From bf8b55fe39106ea75efea1ef29ed96c6a66da597 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Thu, 16 May 2019 15:12:20 -0500 Subject: [PATCH] Update dependencies, 2.0.6 --- .babelrc | 13 +- dist/dist.js | 20195 ++++---------------------------------------- dist/dist.min.js | 4 +- package-lock.json | 7422 +++++++++------- package.json | 22 +- 5 files changed, 6135 insertions(+), 21521 deletions(-) diff --git a/.babelrc b/.babelrc index a67ff18..85e1f1b 100644 --- a/.babelrc +++ b/.babelrc @@ -1,12 +1,3 @@ { - "presets": ["es2015", "stage-0", "react"], - - /* if you want to use babel runtime, uncomment the following line */ - // "plugins": ["transform-runtime"], - - "env": { - "build": { - "optional": ["optimisation", "minification"] - } - } -} + "presets": ["@babel/env", "@babel/react"] +} \ No newline at end of file diff --git a/dist/dist.js b/dist/dist.js index b281839..6f742b4 100644 --- a/dist/dist.js +++ b/dist/dist.js @@ -345,26 +345,19 @@ if (true) { /***/ }), /* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__App__ = __webpack_require__(17); -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _reactDom = __webpack_require__(5); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _App = __webpack_require__(17); - -var _App2 = _interopRequireDefault(_App); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -_reactDom2.default.render(_react2.default.createElement(_App2.default, null), document.body.appendChild(document.createElement('div'))); +__WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.render(__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__App__["a" /* default */], null), document.body.appendChild(document.createElement('div'))); /***/ }), /* 7 */ @@ -1022,55 +1015,59 @@ module.exports = getActiveElement; /***/ }), /* 17 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return App; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_filesafe_embed__ = __webpack_require__(18); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_filesafe_embed___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_filesafe_embed__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_filesafe_js__ = __webpack_require__(19); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_filesafe_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_filesafe_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sn_components_api__ = __webpack_require__(20); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sn_components_api___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_sn_components_api__); +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); +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); } } -var _filesafeEmbed = __webpack_require__(18); +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -var _filesafeEmbed2 = _interopRequireDefault(_filesafeEmbed); +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } -var _filesafeJs = __webpack_require__(19); +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -var _filesafeJs2 = _interopRequireDefault(_filesafeJs); +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -var _snComponentsApi = __webpack_require__(20); +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); } -var _snComponentsApi2 = _interopRequireDefault(_snComponentsApi); +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var BaseHeight = 53; var MessageHavingHeight = 28; var PerMessageHeight = 22; var ExpandedHeight = 305; -var App = function (_React$Component) { +var App = +/*#__PURE__*/ +function (_React$Component) { _inherits(App, _React$Component); function App(props) { - _classCallCheck(this, App); + var _this; - var _this = _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).call(this, props)); + _classCallCheck(this, App); - _this.state = { expanded: false }; + _this = _possibleConstructorReturn(this, _getPrototypeOf(App).call(this, props)); + _this.state = { + expanded: false + }; return _this; } @@ -1079,54 +1076,55 @@ var App = function (_React$Component) { value: function componentDidMount() { var _this2 = this; - this.componentManager = new _snComponentsApi2.default(null, function () { + this.componentManager = new __WEBPACK_IMPORTED_MODULE_3_sn_components_api___default.a(null, function () { // On ready and permissions authorization document.documentElement.classList.add(_this2.componentManager.platform); }); - - this.filesafe = new _filesafeJs2.default({ componentManager: this.componentManager }); + this.filesafe = new __WEBPACK_IMPORTED_MODULE_2_filesafe_js___default.a({ + componentManager: this.componentManager + }); this.fsObserver = this.filesafe.addDataChangeObserver(function () { _this2.recomputeHeight(); }); - this.componentManager.streamContextItem(function (incomingNote) { - var itemClass = _filesafeJs2.default.getSFItemClass(); + var itemClass = __WEBPACK_IMPORTED_MODULE_2_filesafe_js___default.a.getSFItemClass(); var noteModel = new itemClass(incomingNote); + _this2.filesafe.setCurrentNote(noteModel); }); - var delegate = { onSelectFile: function onSelectFile(fileDescriptor) { if (fileDescriptor) { if (!_this2.state.expanded) { _this2.expandedFromSelection = true; + _this2.expandForFileSelection(); } } else { if (_this2.expandedFromSelection) { _this2.collapse(); + _this2.expandedFromSelection = false; } } } }; - var mountPoint = document.getElementById("embed"); - _filesafeEmbed2.default.FilesafeEmbed.renderInElement(mountPoint, this.filesafe, delegate); - + __WEBPACK_IMPORTED_MODULE_1_filesafe_embed___default.a.FilesafeEmbed.renderInElement(mountPoint, this.filesafe, delegate); this.recomputeHeight(); } }, { key: "recomputeHeight", value: function recomputeHeight() { var totalHeight = BaseHeight; - var credentials = this.filesafe.getAllCredentials(); + if (credentials.length == 0) { totalHeight += PerMessageHeight; } var integrations = this.filesafe.getAllIntegrations(); + if (integrations.length == 0) { totalHeight += PerMessageHeight; } @@ -1158,37 +1156,38 @@ var App = function (_React$Component) { }, { key: "expand", value: function expand() { - this.setState({ expanded: true }, this.recomputeHeight); + this.setState({ + expanded: true + }, this.recomputeHeight); } }, { key: "collapse", value: function collapse() { - this.setState({ expanded: false }, this.recomputeHeight); + this.setState({ + expanded: false + }, this.recomputeHeight); } }, { key: "render", value: function render() { - return _react2.default.createElement( - "div", - { id: "root" }, - _react2.default.createElement("div", { id: "embed" }), - _react2.default.createElement( - "div", - { id: "expand-button", className: "sk-button contrast no-border", onClick: this.toggleHeight.bind(this) }, - _react2.default.createElement( - "div", - { className: "sk-label" }, - this.state.expanded ? "▲" : "▼" - ) - ) - ); + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + id: "root" + }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + id: "embed" + }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + id: "expand-button", + className: "sk-button contrast no-border", + onClick: this.toggleHeight.bind(this) + }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + className: "sk-label" + }, this.state.expanded ? "▲" : "▼"))); } }]); return App; -}(_react2.default.Component); +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + -exports.default = App; /***/ }), /* 18 */ @@ -1257,37 +1256,123 @@ module.exports = /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 4); +/******/ return __webpack_require__(__webpack_require__.s = 13); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { -module.exports = __webpack_require__(0); +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +module.exports = _classCallCheck; /***/ }), /* 1 */ +/***/ (function(module, exports) { + +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; +} + +module.exports = _createClass; + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(0); + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +var _typeof = __webpack_require__(15); + +var assertThisInitialized = __webpack_require__(7); + +function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === "object" || typeof call === "function")) { + return call; + } + + return assertThisInitialized(self); +} + +module.exports = _possibleConstructorReturn; + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +function _getPrototypeOf(o) { + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} + +module.exports = _getPrototypeOf; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +var setPrototypeOf = __webpack_require__(16); + +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); +} + +module.exports = _inherits; + +/***/ }), +/* 6 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilesafeManager; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_filesafe_js__ = __webpack_require__(8); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_filesafe_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_filesafe_js__); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_defineProperty__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_defineProperty__); -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 _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; } var FilesafeManager = /*#__PURE__*/ function () { - _createClass(FilesafeManager, null, [{ + __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default()(FilesafeManager, null, [{ key: "get", /* @@ -1303,13 +1388,13 @@ function () { }]); function FilesafeManager() { - _classCallCheck(this, FilesafeManager); + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default()(this, FilesafeManager); this.unloadHandlers = []; this.dataChangeObservers = []; } - _createClass(FilesafeManager, [{ + __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default()(FilesafeManager, [{ key: "setFilesafeInstance", value: function setFilesafeInstance(filesafe) { var _this = this; @@ -1406,48 +1491,135 @@ function () { return FilesafeManager; }(); -_defineProperty(FilesafeManager, "instance", null); +__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_defineProperty___default()(FilesafeManager, "instance", null); /***/ }), -/* 2 */ +/* 7 */ +/***/ (function(module, exports) { + +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; +} + +module.exports = _assertThisInitialized; + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + +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; +} + +module.exports = _defineProperty; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(20); + + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +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); + }); + }; +} + +module.exports = _asyncToGenerator; + +/***/ }), +/* 11 */ /***/ (function(module, exports) { module.exports = __webpack_require__(5); /***/ }), -/* 3 */ +/* 12 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilesView; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__ = __webpack_require__(1); -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator__ = __webpack_require__(10); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_getPrototypeOf__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_getPrototypeOf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_getPrototypeOf__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_inherits__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__ = __webpack_require__(6); -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); }); }; } - -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 _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -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; } @@ -1455,16 +1627,16 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope var FilesView = /*#__PURE__*/ function (_React$Component) { - _inherits(FilesView, _React$Component); + __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_inherits___default()(FilesView, _React$Component); function FilesView(props) { var _this; - _classCallCheck(this, FilesView); + __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck___default()(this, FilesView); - _this = _possibleConstructorReturn(this, _getPrototypeOf(FilesView).call(this, props)); + _this = __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_possibleConstructorReturn___default()(this, __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_getPrototypeOf___default()(FilesView).call(this, props)); - _defineProperty(_assertThisInitialized(_this), "setStatusForFile", function (file, status, hasSpinner) { + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "setStatusForFile", function (file, status, hasSpinner) { _this.setState({ fileStatusFile: file, fileStatus: status, @@ -1472,26 +1644,26 @@ function (_React$Component) { }); }); - _defineProperty(_assertThisInitialized(_this), "decryptFile", + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "decryptFile", /*#__PURE__*/ function () { - var _ref = _asyncToGenerator( + var _ref = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee(fileDescriptor) { + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee(fileDescriptor) { var integration, name; - return regeneratorRuntime.wrap(function _callee$(_context) { + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - integration = __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.integrationForFileDescriptor(fileDescriptor); - name = __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.displayStringForIntegration(integration); + integration = __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.integrationForFileDescriptor(fileDescriptor); + name = __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.displayStringForIntegration(integration); _this.setStatusForFile(fileDescriptor, "Downloading from ".concat(name, "..."), true); - return _context.abrupt("return", __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.downloadFileFromDescriptor(fileDescriptor).then(function (item) { + return _context.abrupt("return", __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.downloadFileFromDescriptor(fileDescriptor).then(function (item) { _this.setStatusForFile(fileDescriptor, "Decrypting...", true); - return __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.decryptFile({ + return __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.decryptFile({ fileDescriptor: fileDescriptor, fileItem: item }).then(function (data) { @@ -1524,14 +1696,14 @@ function (_React$Component) { }; }()); - _defineProperty(_assertThisInitialized(_this), "downloadFile", + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "downloadFile", /*#__PURE__*/ function () { - var _ref2 = _asyncToGenerator( + var _ref2 = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee2(fileDescriptor) { + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee2(fileDescriptor) { var platform, display, fileData; - return regeneratorRuntime.wrap(function _callee2$(_context2) { + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: @@ -1540,7 +1712,7 @@ function (_React$Component) { break; } - platform = __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.getPlatform(); + platform = __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.getPlatform(); display = platform == "ios" ? "iOS" : "Android"; alert("Downloading files is not currently supported on ".concat(display, ".")); return _context2.abrupt("return"); @@ -1551,7 +1723,7 @@ function (_React$Component) { case 7: fileData = _context2.sent; - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.downloadBase64Data(fileData); + __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.downloadBase64Data(fileData); _this.setStatusForFile(fileDescriptor, null); @@ -1568,14 +1740,14 @@ function (_React$Component) { }; }()); - _defineProperty(_assertThisInitialized(_this), "previewFile", + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "previewFile", /*#__PURE__*/ function () { - var _ref3 = _asyncToGenerator( + var _ref3 = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee3(fileDescriptor) { + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee3(fileDescriptor) { var fileData, url; - return regeneratorRuntime.wrap(function _callee3$(_context3) { + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: @@ -1584,7 +1756,7 @@ function (_React$Component) { case 2: fileData = _context3.sent; - url = __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.createTemporaryFileUrl({ + url = __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.createTemporaryFileUrl({ base64Data: fileData.base64Data, dataType: fileData.fileType }); @@ -1609,7 +1781,7 @@ function (_React$Component) { }; }()); - _defineProperty(_assertThisInitialized(_this), "onClickPreview", function () { + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "onClickPreview", function () { // We'll try revoking here in a timeout, but in browsers, since it opens in another tab, this code may not execute. // In that case, we'll revoke again when the current file is collapsed or another is selected. // Actually I've found that with a timeout of 100, it doesn't execute, but if you increase to 250-500, it does. @@ -1618,7 +1790,7 @@ function (_React$Component) { }, 500); }); - _defineProperty(_assertThisInitialized(_this), "selectFile", function (event, metadata) { + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "selectFile", function (event, metadata) { var element = event.target; element.focus(); @@ -1640,13 +1812,13 @@ function (_React$Component) { _this.revokePreview(); }); - _defineProperty(_assertThisInitialized(_this), "deleteFile", function (fileDescriptor) { - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.deleteFileFromDescriptor(fileDescriptor); + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "deleteFile", function (fileDescriptor) { + __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.deleteFileFromDescriptor(fileDescriptor); }); - _defineProperty(_assertThisInitialized(_this), "copyInsertionLink", function (fileDescriptor) { + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "copyInsertionLink", function (fileDescriptor) { var text = "[FileSafe:".concat(fileDescriptor.uuid, ":").concat(fileDescriptor.content.fileName, "]"); - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.copyTextToClipboard(text); + __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.copyTextToClipboard(text); _this.setState({ copiedLink: fileDescriptor @@ -1659,54 +1831,54 @@ function (_React$Component) { }, 1000); }); - _defineProperty(_assertThisInitialized(_this), "isFileSelected", function (metadata) { + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "isFileSelected", function (metadata) { return _this.state.selectedFile == metadata; }); - _defineProperty(_assertThisInitialized(_this), "elementForFile", function (file) { - var integration = __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.integrationForFileDescriptor(file); - var integrationName = __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.displayStringForIntegration(integration); + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "elementForFile", function (file) { + var integration = __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.integrationForFileDescriptor(file); + var integrationName = __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.displayStringForIntegration(integration); var path = file.content.serverMetadata.file_path; var previewReady = _this.state.previewUrl && _this.state.previewingFile == file; // We should make Files their own component and have their own state but for now we're doing it this way. var hasStatus = _this.state.fileStatusFile == file && _this.state.fileStatus; var hasSpinner = _this.state.hasStatusSpinner; - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + return __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "file-item-container " + (_this.isFileSelected(file) ? "expanded" : "") - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { onClick: function onClick(event) { _this.selectFile(event, file); }, className: "file-item-button sk-button info " + (_this.isFileSelected(file) ? "selected" : undefined) - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "sk-label" - }, file.content.fileName), hasStatus && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, file.content.fileName), hasStatus && __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "file-download-status sk-horizontal-group" - }, hasSpinner && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, hasSpinner && __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "sk-spinner x-small" - }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "file-status-label" - }, _this.state.fileStatus)), _this.isFileSelected(file) && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, _this.state.fileStatus)), _this.isFileSelected(file) && __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "file-item-options-wrapper" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { onClick: function onClick(e) { e.stopPropagation(); }, className: "sk-app-bar file-item-options" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "center" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { onClick: function onClick(e) { e.stopPropagation(); _this.downloadFile(file); }, className: "sk-app-bar-item" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "sk-label contrast " + (_this.isMobile ? "disabled" : "") - }, "Download")), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "Download")), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "sk-app-bar-item border" - }), _this.supportsPreviews && previewReady && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", { + }), _this.supportsPreviews && previewReady && __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("a", { className: "sk-app-bar-item", href: _this.state.previewUrl, onClick: function onClick(e) { @@ -1715,54 +1887,54 @@ function (_React$Component) { _this.onClickPreview(); }, target: "_blank" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "sk-label contrast" - }, "Open Preview")), _this.supportsPreviews && !previewReady && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "Open Preview")), _this.supportsPreviews && !previewReady && __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { onClick: function onClick(e) { e.stopPropagation(); _this.previewFile(file); }, className: "sk-app-bar-item" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "sk-label contrast " + (_this.isMobile ? "disabled" : "") - }, "Preview")), _this.supportsPreviews && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "Preview")), _this.supportsPreviews && __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "sk-app-bar-item border" - }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { onClick: function onClick(e) { e.stopPropagation(); _this.copyInsertionLink(file); }, className: "sk-app-bar-item" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "sk-label contrast" - }, _this.state.copiedLink == file ? "Copied" : "Copy Insert Link")), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, _this.state.copiedLink == file ? "Copied" : "Copy Insert Link")), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "sk-app-bar-item border" - }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { onClick: function onClick(e) { e.stopPropagation(); _this.deleteFile(file); }, className: "sk-app-bar-item" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "sk-label contrast" - }, "Delete")))), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "Delete")))), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { className: "file-location" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("strong", null, integrationName), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("span", null, " ", path))))); + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("strong", null, integrationName), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("span", null, " ", path))))); }); _this.state = {}; - _this.delegate = __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().getDelegate(); + _this.delegate = __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().getDelegate(); return _this; } - _createClass(FilesView, [{ + __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass___default()(FilesView, [{ key: "revokePreview", value: function revokePreview() { if (this.state.previewUrl) { - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.revokeTempUrl(this.state.previewUrl); + __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.revokeTempUrl(this.state.previewUrl); } this.setState({ @@ -1796,7 +1968,7 @@ function (_React$Component) { return this._supportsPreview; } - var env = __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.getEnvironment(); // May be undefined if bridge hasn't been established yet. + var env = __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.getEnvironment(); // May be undefined if bridge hasn't been established yet. if (env == undefined) { return false; @@ -1811,26 +1983,26 @@ function (_React$Component) { }, { key: "isMobile", get: function get() { - return __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.isMobile(); + return __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__["a" /* default */].get().filesafe.isMobile(); } }]); return FilesView; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); +}(__WEBPACK_IMPORTED_MODULE_9_react___default.a.Component); /***/ }), -/* 4 */ +/* 13 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__FilesafeEmbed__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__FilesafeEmbed__ = __webpack_require__(14); @@ -1841,34 +2013,31 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); }); /***/ }), -/* 5 */ +/* 14 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilesafeEmbed; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_Root__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__lib_FilesafeManager__ = __webpack_require__(1); -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_getPrototypeOf__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_getPrototypeOf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_getPrototypeOf__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_dom__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__components_Root__ = __webpack_require__(17); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__ = __webpack_require__(6); -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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } @@ -1878,78 +2047,112 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func var FilesafeEmbed = /*#__PURE__*/ function (_React$Component) { - _inherits(FilesafeEmbed, _React$Component); + __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits___default()(FilesafeEmbed, _React$Component); - _createClass(FilesafeEmbed, null, [{ + __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass___default()(FilesafeEmbed, null, [{ key: "renderInElement", // Called by consumer value: function renderInElement(element, filesafe, delegate) { - __WEBPACK_IMPORTED_MODULE_3__lib_FilesafeManager__["a" /* default */].get().setFilesafeInstance(filesafe); - __WEBPACK_IMPORTED_MODULE_3__lib_FilesafeManager__["a" /* default */].get().setDelegate(delegate); - __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.render(__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(FilesafeEmbed), element); + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().setFilesafeInstance(filesafe); + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().setDelegate(delegate); + __WEBPACK_IMPORTED_MODULE_6_react_dom___default.a.render(__WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(FilesafeEmbed), element); } // Called by consumer. Required if embed will appear and disappear multiple times // This function will clean up window observers }, { key: "unload", value: function unload(element) { - __WEBPACK_IMPORTED_MODULE_3__lib_FilesafeManager__["a" /* default */].get().unload(); - __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unmountComponentAtNode(element); + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().unload(); + __WEBPACK_IMPORTED_MODULE_6_react_dom___default.a.unmountComponentAtNode(element); } }]); function FilesafeEmbed(props) { - _classCallCheck(this, FilesafeEmbed); + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default()(this, FilesafeEmbed); - return _possibleConstructorReturn(this, _getPrototypeOf(FilesafeEmbed).call(this, props)); + return __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_possibleConstructorReturn___default()(this, __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_getPrototypeOf___default()(FilesafeEmbed).call(this, props)); } - _createClass(FilesafeEmbed, [{ + __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass___default()(FilesafeEmbed, [{ key: "render", value: function render() { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", { id: "filesafe-embed" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", { className: "sn-component" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__components_Root__["a" /* default */], null))); + }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__components_Root__["a" /* default */], null))); } }]); return FilesafeEmbed; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); +}(__WEBPACK_IMPORTED_MODULE_5_react___default.a.Component); /***/ }), -/* 6 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 15 */ +/***/ (function(module, exports) { -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Root; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__KeysView__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__UploadFilesView_js__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__AllFilesView__ = __webpack_require__(12); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__IntegrationsView__ = __webpack_require__(13); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__lib_FilesafeManager__ = __webpack_require__(1); -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _typeof(obj) { + if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { + module.exports = _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + module.exports = _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); + }; + } -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); } } + return _typeof(obj); +} -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } +module.exports = _typeof; -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +function _setPrototypeOf(o, p) { + module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); +} + +module.exports = _setPrototypeOf; + +/***/ }), +/* 17 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Root; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__KeysView__ = __webpack_require__(18); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__UploadFilesView_js__ = __webpack_require__(19); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__AllFilesView__ = __webpack_require__(23); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__IntegrationsView__ = __webpack_require__(24); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__lib_FilesafeManager__ = __webpack_require__(6); -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } @@ -1961,74 +2164,75 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func var Root = /*#__PURE__*/ function (_React$Component) { - _inherits(Root, _React$Component); + __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits___default()(Root, _React$Component); function Root(props) { var _this; - _classCallCheck(this, Root); + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default()(this, Root); - _this = _possibleConstructorReturn(this, _getPrototypeOf(Root).call(this, props)); + _this = __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn___default()(this, __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf___default()(Root).call(this, props)); _this.state = { messages: [] }; return _this; } - _createClass(Root, [{ + __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default()(Root, [{ key: "render", value: function render() { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", { id: "home", className: "sk-panel static" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", { id: "main-content", className: "sk-panel-content" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", { className: "sk-panel-section" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__UploadFilesView_js__["a" /* default */], null)), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__UploadFilesView_js__["a" /* default */], null)), __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", { className: "sk-panel-section" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__IntegrationsView__["a" /* default */], null)), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__IntegrationsView__["a" /* default */], null)), __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", { className: "sk-panel-section" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1__KeysView__["a" /* default */], null)), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__KeysView__["a" /* default */], null)), __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", { className: "sk-panel-section" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__AllFilesView__["a" /* default */], null)))); + }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__AllFilesView__["a" /* default */], null)))); } }]); return Root; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); +}(__WEBPACK_IMPORTED_MODULE_5_react___default.a.Component); /***/ }), -/* 7 */ +/* 18 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return KeysView; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__ = __webpack_require__(1); -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -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; } +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__ = __webpack_require__(6); -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -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; } @@ -2036,103 +2240,103 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope var KeysView = /*#__PURE__*/ function (_React$Component) { - _inherits(KeysView, _React$Component); + __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits___default()(KeysView, _React$Component); function KeysView(props) { var _this; - _classCallCheck(this, KeysView); + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default()(this, KeysView); - _this = _possibleConstructorReturn(this, _getPrototypeOf(KeysView).call(this, props)); + _this = __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn___default()(this, __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf___default()(KeysView).call(this, props)); - _defineProperty(_assertThisInitialized(_this), "exportCredential", function (credential) { + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "exportCredential", function (credential) { var base64Data = btoa(JSON.stringify(credential, null, 2)); - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.downloadBase64Data({ + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.downloadBase64Data({ base64Data: base64Data, fileName: "sn-filesafe-keys-".concat(credential.created_at.toISOString(), ".json"), fileType: 'text/json' }); }); - _defineProperty(_assertThisInitialized(_this), "deleteCredential", function (credential) { + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "deleteCredential", function (credential) { if (_this.numFilesForCredential(credential) != 0) { alert("This key has files encrypted with it and cannot be deleted. First delete any associated files, then try again."); return; } - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.deleteCredential(credential); + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.deleteCredential(credential); }); - _defineProperty(_assertThisInitialized(_this), "createNewKeys", function () { - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.createNewCredentials(); + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "createNewKeys", function () { + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.createNewCredentials(); }); - _defineProperty(_assertThisInitialized(_this), "labelForCredential", function (credential) { + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "labelForCredential", function (credential) { return credential.created_at.toLocaleString(); }); - _defineProperty(_assertThisInitialized(_this), "numFilesForCredential", function (credential) { - return __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.numberOfFilesEncryptedWithCredential(credential); + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "numFilesForCredential", function (credential) { + return __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.numberOfFilesEncryptedWithCredential(credential); }); - _defineProperty(_assertThisInitialized(_this), "setCredentialAsDefault", function (credential) { - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.setCredentialAsDefault(credential); + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "setCredentialAsDefault", function (credential) { + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.setCredentialAsDefault(credential); }); _this.state = { - credentials: __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllCredentials() || [] + credentials: __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllCredentials() || [] }; - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().addDataChangeObserver(function () { + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().addDataChangeObserver(function () { _this.setState({ - credentials: __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllCredentials() + credentials: __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllCredentials() }); }); return _this; } - _createClass(KeysView, [{ + __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default()(KeysView, [{ key: "render", value: function render() { var _this2 = this; - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", null, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", null, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-panel-row" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-h2 sk-bold" - }, "Keys"), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "Keys"), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-button info no-border", onClick: this.createNewKeys - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-label" - }, "Create New"))), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "Create New"))), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "list-container" }, this.state.credentials.map(function (credential) { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "list-item sk-horizontal-group top" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-circle x-small " + (credential.content.isDefault ? "info" : "sk-secondary-contrast") - }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", null, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", null, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-panel-row condensed sk-bold" - }, _this2.labelForCredential(credential)), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, _this2.labelForCredential(credential)), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { style: { marginTop: 3 }, className: "sk-panel-row condensed" - }, _this2.numFilesForCredential(credential), " encrypted files"), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, _this2.numFilesForCredential(credential), " encrypted files"), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-panel-row condensed" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-horizontal-group" - }, _this2.state.credentials.length > 1 && !credential.content.isDefault && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", { + }, _this2.state.credentials.length > 1 && !credential.content.isDefault && __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("a", { className: "info", onClick: function onClick() { _this2.setCredentialAsDefault(credential); } - }, "Make Default"), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", { + }, "Make Default"), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("a", { className: "info", onClick: function onClick() { _this2.exportCredential(credential); } - }, "Export"), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", { + }, "Export"), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("a", { className: "danger", onClick: function onClick() { _this2.deleteCredential(credential); @@ -2143,18207 +2347,1513 @@ function (_React$Component) { }]); return KeysView; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); +}(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component); /***/ }), -/* 8 */ -/***/ (function(module, exports) { +/* 19 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -module.exports = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // 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 -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // 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, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // 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 = 4); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UploadFilesView; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator__ = __webpack_require__(10); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_getPrototypeOf__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_getPrototypeOf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_getPrototypeOf__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_inherits__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__lib_MessagesManager__ = __webpack_require__(21); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__MessagesView_js__ = __webpack_require__(22); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__FilesView__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__ = __webpack_require__(6); -/* WEBPACK VAR INJECTION */(function(global) {var require;var require;(function (f) { - if (true) { - module.exports = f(); - } else if (typeof define === "function" && define.amd) { - define([], f); - } else { - var g; - if (typeof window !== "undefined") { - g = window; - } else if (typeof global !== "undefined") { - g = global; - } else if (typeof self !== "undefined") { - g = self; - } else { - g = this; - } - g.SF = f(); - } -})(function () { - var define, module, exports; - return function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = "function" == typeof require && require; - if (!f && c) return require(i, !0); - if (u) return u(i, !0); - var a = new Error("Cannot find module '" + i + "'"); - throw a.code = "MODULE_NOT_FOUND", a; - } - var p = n[i] = { - exports: {} - }; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r); - }, p, p.exports, r, e, n, t); - } - return n[i].exports; - } - for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]); - return o; - } - return r; - }()({ - 1: [function (require, module, exports) { - (function (global) { - /* - CryptoJS v3.1.2 - code.google.com/p/crypto-js - (c) 2009-2013 by Jeff Mott. All rights reserved. - code.google.com/p/crypto-js/wiki/License - */ - var CryptoJS = CryptoJS || function (u, p) { - var d = {}, - l = d.lib = {}, - s = function () {}, - t = l.Base = { - extend: function (a) { - s.prototype = this; - var c = new s(); - a && c.mixIn(a); - c.hasOwnProperty("init") || (c.init = function () { - c.$super.init.apply(this, arguments); - }); - c.init.prototype = c; - c.$super = this; - return c; - }, - create: function () { - var a = this.extend(); - a.init.apply(a, arguments); - return a; - }, - init: function () {}, - mixIn: function (a) { - for (var c in a) a.hasOwnProperty(c) && (this[c] = a[c]); - a.hasOwnProperty("toString") && (this.toString = a.toString); - }, - clone: function () { - return this.init.prototype.extend(this); - } - }, - r = l.WordArray = t.extend({ - init: function (a, c) { - a = this.words = a || []; - this.sigBytes = c != p ? c : 4 * a.length; - }, - toString: function (a) { - return (a || v).stringify(this); - }, - concat: function (a) { - var c = this.words, - e = a.words, - j = this.sigBytes; - a = a.sigBytes; - this.clamp(); - if (j % 4) for (var k = 0; k < a; k++) c[j + k >>> 2] |= (e[k >>> 2] >>> 24 - 8 * (k % 4) & 255) << 24 - 8 * ((j + k) % 4);else if (65535 < e.length) for (k = 0; k < a; k += 4) c[j + k >>> 2] = e[k >>> 2];else c.push.apply(c, e); - this.sigBytes += a; - return this; - }, - clamp: function () { - var a = this.words, - c = this.sigBytes; - a[c >>> 2] &= 4294967295 << 32 - 8 * (c % 4); - a.length = u.ceil(c / 4); - }, - clone: function () { - var a = t.clone.call(this); - a.words = this.words.slice(0); - return a; - }, - random: function (a) { - for (var c = [], e = 0; e < a; e += 4) c.push(4294967296 * u.random() | 0); - return new r.init(c, a); - } - }), - w = d.enc = {}, - v = w.Hex = { - stringify: function (a) { - var c = a.words; - a = a.sigBytes; - for (var e = [], j = 0; j < a; j++) { - var k = c[j >>> 2] >>> 24 - 8 * (j % 4) & 255; - e.push((k >>> 4).toString(16)); - e.push((k & 15).toString(16)); - } - return e.join(""); - }, - parse: function (a) { - for (var c = a.length, e = [], j = 0; j < c; j += 2) e[j >>> 3] |= parseInt(a.substr(j, 2), 16) << 24 - 4 * (j % 8); - return new r.init(e, c / 2); - } - }, - b = w.Latin1 = { - stringify: function (a) { - var c = a.words; - a = a.sigBytes; - for (var e = [], j = 0; j < a; j++) e.push(String.fromCharCode(c[j >>> 2] >>> 24 - 8 * (j % 4) & 255)); - return e.join(""); - }, - parse: function (a) { - for (var c = a.length, e = [], j = 0; j < c; j++) e[j >>> 2] |= (a.charCodeAt(j) & 255) << 24 - 8 * (j % 4); - - return new r.init(e, c); - } - }, - x = w.Utf8 = { - stringify: function (a) { - try { - return decodeURIComponent(escape(b.stringify(a))); - } catch (c) { - throw Error("Malformed UTF-8 data"); - } - }, - parse: function (a) { - return b.parse(unescape(encodeURIComponent(a))); - } - }, - q = l.BufferedBlockAlgorithm = t.extend({ - reset: function () { - this._data = new r.init(); - this._nDataBytes = 0; - }, - _append: function (a) { - "string" == typeof a && (a = x.parse(a)); - - this._data.concat(a); - - this._nDataBytes += a.sigBytes; - }, - _process: function (a) { - var c = this._data, - e = c.words, - j = c.sigBytes, - k = this.blockSize, - b = j / (4 * k), - b = a ? u.ceil(b) : u.max((b | 0) - this._minBufferSize, 0); - a = b * k; - j = u.min(4 * a, j); - - if (a) { - for (var q = 0; q < a; q += k) this._doProcessBlock(e, q); - - q = e.splice(0, a); - c.sigBytes -= j; - } - - return new r.init(q, j); - }, - clone: function () { - var a = t.clone.call(this); - a._data = this._data.clone(); - return a; - }, - _minBufferSize: 0 - }); - - l.Hasher = q.extend({ - cfg: t.extend(), - init: function (a) { - this.cfg = this.cfg.extend(a); - this.reset(); - }, - reset: function () { - q.reset.call(this); - - this._doReset(); - }, - update: function (a) { - this._append(a); - - this._process(); - - return this; - }, - finalize: function (a) { - a && this._append(a); - return this._doFinalize(); - }, - blockSize: 16, - _createHelper: function (a) { - return function (b, e) { - return new a.init(e).finalize(b); - }; - }, - _createHmacHelper: function (a) { - return function (b, e) { - return new n.HMAC.init(a, e).finalize(b); - }; - } - }); - var n = d.algo = {}; - return d; - }(Math); - - (function () { - var u = CryptoJS, - p = u.lib.WordArray; - u.enc.Base64 = { - stringify: function (d) { - var l = d.words, - p = d.sigBytes, - t = this._map; - d.clamp(); - d = []; - - for (var r = 0; r < p; r += 3) for (var w = (l[r >>> 2] >>> 24 - 8 * (r % 4) & 255) << 16 | (l[r + 1 >>> 2] >>> 24 - 8 * ((r + 1) % 4) & 255) << 8 | l[r + 2 >>> 2] >>> 24 - 8 * ((r + 2) % 4) & 255, v = 0; 4 > v && r + 0.75 * v < p; v++) d.push(t.charAt(w >>> 6 * (3 - v) & 63)); - - if (l = t.charAt(64)) for (; d.length % 4;) d.push(l); - return d.join(""); - }, - parse: function (d) { - var l = d.length, - s = this._map, - t = s.charAt(64); - t && (t = d.indexOf(t), -1 != t && (l = t)); - - for (var t = [], r = 0, w = 0; w < l; w++) if (w % 4) { - var v = s.indexOf(d.charAt(w - 1)) << 2 * (w % 4), - b = s.indexOf(d.charAt(w)) >>> 6 - 2 * (w % 4); - t[r >>> 2] |= (v | b) << 24 - 8 * (r % 4); - r++; - } - - return p.create(t, r); - }, - _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" - }; - })(); - - (function (u) { - function p(b, n, a, c, e, j, k) { - b = b + (n & a | ~n & c) + e + k; - return (b << j | b >>> 32 - j) + n; - } - - function d(b, n, a, c, e, j, k) { - b = b + (n & c | a & ~c) + e + k; - return (b << j | b >>> 32 - j) + n; - } - - function l(b, n, a, c, e, j, k) { - b = b + (n ^ a ^ c) + e + k; - return (b << j | b >>> 32 - j) + n; - } - - function s(b, n, a, c, e, j, k) { - b = b + (a ^ (n | ~c)) + e + k; - return (b << j | b >>> 32 - j) + n; - } - - for (var t = CryptoJS, r = t.lib, w = r.WordArray, v = r.Hasher, r = t.algo, b = [], x = 0; 64 > x; x++) b[x] = 4294967296 * u.abs(u.sin(x + 1)) | 0; - - r = r.MD5 = v.extend({ - _doReset: function () { - this._hash = new w.init([1732584193, 4023233417, 2562383102, 271733878]); - }, - _doProcessBlock: function (q, n) { - for (var a = 0; 16 > a; a++) { - var c = n + a, - e = q[c]; - q[c] = (e << 8 | e >>> 24) & 16711935 | (e << 24 | e >>> 8) & 4278255360; - } - - var a = this._hash.words, - c = q[n + 0], - e = q[n + 1], - j = q[n + 2], - k = q[n + 3], - z = q[n + 4], - r = q[n + 5], - t = q[n + 6], - w = q[n + 7], - v = q[n + 8], - A = q[n + 9], - B = q[n + 10], - C = q[n + 11], - u = q[n + 12], - D = q[n + 13], - E = q[n + 14], - x = q[n + 15], - f = a[0], - m = a[1], - g = a[2], - h = a[3], - f = p(f, m, g, h, c, 7, b[0]), - h = p(h, f, m, g, e, 12, b[1]), - g = p(g, h, f, m, j, 17, b[2]), - m = p(m, g, h, f, k, 22, b[3]), - f = p(f, m, g, h, z, 7, b[4]), - h = p(h, f, m, g, r, 12, b[5]), - g = p(g, h, f, m, t, 17, b[6]), - m = p(m, g, h, f, w, 22, b[7]), - f = p(f, m, g, h, v, 7, b[8]), - h = p(h, f, m, g, A, 12, b[9]), - g = p(g, h, f, m, B, 17, b[10]), - m = p(m, g, h, f, C, 22, b[11]), - f = p(f, m, g, h, u, 7, b[12]), - h = p(h, f, m, g, D, 12, b[13]), - g = p(g, h, f, m, E, 17, b[14]), - m = p(m, g, h, f, x, 22, b[15]), - f = d(f, m, g, h, e, 5, b[16]), - h = d(h, f, m, g, t, 9, b[17]), - g = d(g, h, f, m, C, 14, b[18]), - m = d(m, g, h, f, c, 20, b[19]), - f = d(f, m, g, h, r, 5, b[20]), - h = d(h, f, m, g, B, 9, b[21]), - g = d(g, h, f, m, x, 14, b[22]), - m = d(m, g, h, f, z, 20, b[23]), - f = d(f, m, g, h, A, 5, b[24]), - h = d(h, f, m, g, E, 9, b[25]), - g = d(g, h, f, m, k, 14, b[26]), - m = d(m, g, h, f, v, 20, b[27]), - f = d(f, m, g, h, D, 5, b[28]), - h = d(h, f, m, g, j, 9, b[29]), - g = d(g, h, f, m, w, 14, b[30]), - m = d(m, g, h, f, u, 20, b[31]), - f = l(f, m, g, h, r, 4, b[32]), - h = l(h, f, m, g, v, 11, b[33]), - g = l(g, h, f, m, C, 16, b[34]), - m = l(m, g, h, f, E, 23, b[35]), - f = l(f, m, g, h, e, 4, b[36]), - h = l(h, f, m, g, z, 11, b[37]), - g = l(g, h, f, m, w, 16, b[38]), - m = l(m, g, h, f, B, 23, b[39]), - f = l(f, m, g, h, D, 4, b[40]), - h = l(h, f, m, g, c, 11, b[41]), - g = l(g, h, f, m, k, 16, b[42]), - m = l(m, g, h, f, t, 23, b[43]), - f = l(f, m, g, h, A, 4, b[44]), - h = l(h, f, m, g, u, 11, b[45]), - g = l(g, h, f, m, x, 16, b[46]), - m = l(m, g, h, f, j, 23, b[47]), - f = s(f, m, g, h, c, 6, b[48]), - h = s(h, f, m, g, w, 10, b[49]), - g = s(g, h, f, m, E, 15, b[50]), - m = s(m, g, h, f, r, 21, b[51]), - f = s(f, m, g, h, u, 6, b[52]), - h = s(h, f, m, g, k, 10, b[53]), - g = s(g, h, f, m, B, 15, b[54]), - m = s(m, g, h, f, e, 21, b[55]), - f = s(f, m, g, h, v, 6, b[56]), - h = s(h, f, m, g, x, 10, b[57]), - g = s(g, h, f, m, t, 15, b[58]), - m = s(m, g, h, f, D, 21, b[59]), - f = s(f, m, g, h, z, 6, b[60]), - h = s(h, f, m, g, C, 10, b[61]), - g = s(g, h, f, m, j, 15, b[62]), - m = s(m, g, h, f, A, 21, b[63]); - a[0] = a[0] + f | 0; - a[1] = a[1] + m | 0; - a[2] = a[2] + g | 0; - a[3] = a[3] + h | 0; - }, - _doFinalize: function () { - var b = this._data, - n = b.words, - a = 8 * this._nDataBytes, - c = 8 * b.sigBytes; - n[c >>> 5] |= 128 << 24 - c % 32; - var e = u.floor(a / 4294967296); - n[(c + 64 >>> 9 << 4) + 15] = (e << 8 | e >>> 24) & 16711935 | (e << 24 | e >>> 8) & 4278255360; - n[(c + 64 >>> 9 << 4) + 14] = (a << 8 | a >>> 24) & 16711935 | (a << 24 | a >>> 8) & 4278255360; - b.sigBytes = 4 * (n.length + 1); - - this._process(); - - b = this._hash; - n = b.words; - - for (a = 0; 4 > a; a++) c = n[a], n[a] = (c << 8 | c >>> 24) & 16711935 | (c << 24 | c >>> 8) & 4278255360; - - return b; - }, - clone: function () { - var b = v.clone.call(this); - b._hash = this._hash.clone(); - return b; - } - }); - t.MD5 = v._createHelper(r); - t.HmacMD5 = v._createHmacHelper(r); - })(Math); - - (function () { - var u = CryptoJS, - p = u.lib, - d = p.Base, - l = p.WordArray, - p = u.algo, - s = p.EvpKDF = d.extend({ - cfg: d.extend({ - keySize: 4, - hasher: p.MD5, - iterations: 1 - }), - init: function (d) { - this.cfg = this.cfg.extend(d); - }, - compute: function (d, r) { - for (var p = this.cfg, s = p.hasher.create(), b = l.create(), u = b.words, q = p.keySize, p = p.iterations; u.length < q;) { - n && s.update(n); - var n = s.update(d).finalize(r); - s.reset(); - - for (var a = 1; a < p; a++) n = s.finalize(n), s.reset(); - - b.concat(n); - } - - b.sigBytes = 4 * q; - return b; - } - }); - - u.EvpKDF = function (d, l, p) { - return s.create(p).compute(d, l); - }; - })(); - - CryptoJS.lib.Cipher || function (u) { - var p = CryptoJS, - d = p.lib, - l = d.Base, - s = d.WordArray, - t = d.BufferedBlockAlgorithm, - r = p.enc.Base64, - w = p.algo.EvpKDF, - v = d.Cipher = t.extend({ - cfg: l.extend(), - createEncryptor: function (e, a) { - return this.create(this._ENC_XFORM_MODE, e, a); - }, - createDecryptor: function (e, a) { - return this.create(this._DEC_XFORM_MODE, e, a); - }, - init: function (e, a, b) { - this.cfg = this.cfg.extend(b); - this._xformMode = e; - this._key = a; - this.reset(); - }, - reset: function () { - t.reset.call(this); - - this._doReset(); - }, - process: function (e) { - this._append(e); - - return this._process(); - }, - finalize: function (e) { - e && this._append(e); - return this._doFinalize(); - }, - keySize: 4, - ivSize: 4, - _ENC_XFORM_MODE: 1, - _DEC_XFORM_MODE: 2, - _createHelper: function (e) { - return { - encrypt: function (b, k, d) { - return ("string" == typeof k ? c : a).encrypt(e, b, k, d); - }, - decrypt: function (b, k, d) { - return ("string" == typeof k ? c : a).decrypt(e, b, k, d); - } - }; - } - }); - d.StreamCipher = v.extend({ - _doFinalize: function () { - return this._process(!0); - }, - blockSize: 1 - }); - - var b = p.mode = {}, - x = function (e, a, b) { - var c = this._iv; - c ? this._iv = u : c = this._prevBlock; - - for (var d = 0; d < b; d++) e[a + d] ^= c[d]; - }, - q = (d.BlockCipherMode = l.extend({ - createEncryptor: function (e, a) { - return this.Encryptor.create(e, a); - }, - createDecryptor: function (e, a) { - return this.Decryptor.create(e, a); - }, - init: function (e, a) { - this._cipher = e; - this._iv = a; - } - })).extend(); - - q.Encryptor = q.extend({ - processBlock: function (e, a) { - var b = this._cipher, - c = b.blockSize; - x.call(this, e, a, c); - b.encryptBlock(e, a); - this._prevBlock = e.slice(a, a + c); - } - }); - q.Decryptor = q.extend({ - processBlock: function (e, a) { - var b = this._cipher, - c = b.blockSize, - d = e.slice(a, a + c); - b.decryptBlock(e, a); - x.call(this, e, a, c); - this._prevBlock = d; - } - }); - b = b.CBC = q; - q = (p.pad = {}).Pkcs7 = { - pad: function (a, b) { - for (var c = 4 * b, c = c - a.sigBytes % c, d = c << 24 | c << 16 | c << 8 | c, l = [], n = 0; n < c; n += 4) l.push(d); - - c = s.create(l, c); - a.concat(c); - }, - unpad: function (a) { - a.sigBytes -= a.words[a.sigBytes - 1 >>> 2] & 255; - } - }; - d.BlockCipher = v.extend({ - cfg: v.cfg.extend({ - mode: b, - padding: q - }), - reset: function () { - v.reset.call(this); - var a = this.cfg, - b = a.iv, - a = a.mode; - if (this._xformMode == this._ENC_XFORM_MODE) var c = a.createEncryptor;else c = a.createDecryptor, this._minBufferSize = 1; - this._mode = c.call(a, this, b && b.words); - }, - _doProcessBlock: function (a, b) { - this._mode.processBlock(a, b); - }, - _doFinalize: function () { - var a = this.cfg.padding; - - if (this._xformMode == this._ENC_XFORM_MODE) { - a.pad(this._data, this.blockSize); - - var b = this._process(!0); - } else b = this._process(!0), a.unpad(b); - - return b; - }, - blockSize: 4 - }); - var n = d.CipherParams = l.extend({ - init: function (a) { - this.mixIn(a); - }, - toString: function (a) { - return (a || this.formatter).stringify(this); - } - }), - b = (p.format = {}).OpenSSL = { - stringify: function (a) { - var b = a.ciphertext; - a = a.salt; - return (a ? s.create([1398893684, 1701076831]).concat(a).concat(b) : b).toString(r); - }, - parse: function (a) { - a = r.parse(a); - var b = a.words; - - if (1398893684 == b[0] && 1701076831 == b[1]) { - var c = s.create(b.slice(2, 4)); - b.splice(0, 4); - a.sigBytes -= 16; - } - - return n.create({ - ciphertext: a, - salt: c - }); - } - }, - a = d.SerializableCipher = l.extend({ - cfg: l.extend({ - format: b - }), - encrypt: function (a, b, c, d) { - d = this.cfg.extend(d); - var l = a.createEncryptor(c, d); - b = l.finalize(b); - l = l.cfg; - return n.create({ - ciphertext: b, - key: c, - iv: l.iv, - algorithm: a, - mode: l.mode, - padding: l.padding, - blockSize: a.blockSize, - formatter: d.format - }); - }, - decrypt: function (a, b, c, d) { - d = this.cfg.extend(d); - b = this._parse(b, d.format); - return a.createDecryptor(c, d).finalize(b.ciphertext); - }, - _parse: function (a, b) { - return "string" == typeof a ? b.parse(a, this) : a; - } - }), - p = (p.kdf = {}).OpenSSL = { - execute: function (a, b, c, d) { - d || (d = s.random(8)); - a = w.create({ - keySize: b + c - }).compute(a, d); - c = s.create(a.words.slice(b), 4 * c); - a.sigBytes = 4 * b; - return n.create({ - key: a, - iv: c, - salt: d - }); - } - }, - c = d.PasswordBasedCipher = a.extend({ - cfg: a.cfg.extend({ - kdf: p - }), - encrypt: function (b, c, d, l) { - l = this.cfg.extend(l); - d = l.kdf.execute(d, b.keySize, b.ivSize); - l.iv = d.iv; - b = a.encrypt.call(this, b, c, d.key, l); - b.mixIn(d); - return b; - }, - decrypt: function (b, c, d, l) { - l = this.cfg.extend(l); - c = this._parse(c, l.format); - d = l.kdf.execute(d, b.keySize, b.ivSize, c.salt); - l.iv = d.iv; - return a.decrypt.call(this, b, c, d.key, l); - } - }); - }(); - - (function () { - for (var u = CryptoJS, p = u.lib.BlockCipher, d = u.algo, l = [], s = [], t = [], r = [], w = [], v = [], b = [], x = [], q = [], n = [], a = [], c = 0; 256 > c; c++) a[c] = 128 > c ? c << 1 : c << 1 ^ 283; - - for (var e = 0, j = 0, c = 0; 256 > c; c++) { - var k = j ^ j << 1 ^ j << 2 ^ j << 3 ^ j << 4, - k = k >>> 8 ^ k & 255 ^ 99; - l[e] = k; - s[k] = e; - var z = a[e], - F = a[z], - G = a[F], - y = 257 * a[k] ^ 16843008 * k; - t[e] = y << 24 | y >>> 8; - r[e] = y << 16 | y >>> 16; - w[e] = y << 8 | y >>> 24; - v[e] = y; - y = 16843009 * G ^ 65537 * F ^ 257 * z ^ 16843008 * e; - b[k] = y << 24 | y >>> 8; - x[k] = y << 16 | y >>> 16; - q[k] = y << 8 | y >>> 24; - n[k] = y; - e ? (e = z ^ a[a[a[G ^ z]]], j ^= a[a[j]]) : e = j = 1; - } - - var H = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], - d = d.AES = p.extend({ - _doReset: function () { - for (var a = this._key, c = a.words, d = a.sigBytes / 4, a = 4 * ((this._nRounds = d + 6) + 1), e = this._keySchedule = [], j = 0; j < a; j++) if (j < d) e[j] = c[j];else { - var k = e[j - 1]; - j % d ? 6 < d && 4 == j % d && (k = l[k >>> 24] << 24 | l[k >>> 16 & 255] << 16 | l[k >>> 8 & 255] << 8 | l[k & 255]) : (k = k << 8 | k >>> 24, k = l[k >>> 24] << 24 | l[k >>> 16 & 255] << 16 | l[k >>> 8 & 255] << 8 | l[k & 255], k ^= H[j / d | 0] << 24); - e[j] = e[j - d] ^ k; - } - - c = this._invKeySchedule = []; - - for (d = 0; d < a; d++) j = a - d, k = d % 4 ? e[j] : e[j - 4], c[d] = 4 > d || 4 >= j ? k : b[l[k >>> 24]] ^ x[l[k >>> 16 & 255]] ^ q[l[k >>> 8 & 255]] ^ n[l[k & 255]]; - }, - encryptBlock: function (a, b) { - this._doCryptBlock(a, b, this._keySchedule, t, r, w, v, l); - }, - decryptBlock: function (a, c) { - var d = a[c + 1]; - a[c + 1] = a[c + 3]; - a[c + 3] = d; - - this._doCryptBlock(a, c, this._invKeySchedule, b, x, q, n, s); - - d = a[c + 1]; - a[c + 1] = a[c + 3]; - a[c + 3] = d; - }, - _doCryptBlock: function (a, b, c, d, e, j, l, f) { - for (var m = this._nRounds, g = a[b] ^ c[0], h = a[b + 1] ^ c[1], k = a[b + 2] ^ c[2], n = a[b + 3] ^ c[3], p = 4, r = 1; r < m; r++) var q = d[g >>> 24] ^ e[h >>> 16 & 255] ^ j[k >>> 8 & 255] ^ l[n & 255] ^ c[p++], s = d[h >>> 24] ^ e[k >>> 16 & 255] ^ j[n >>> 8 & 255] ^ l[g & 255] ^ c[p++], t = d[k >>> 24] ^ e[n >>> 16 & 255] ^ j[g >>> 8 & 255] ^ l[h & 255] ^ c[p++], n = d[n >>> 24] ^ e[g >>> 16 & 255] ^ j[h >>> 8 & 255] ^ l[k & 255] ^ c[p++], g = q, h = s, k = t; - - q = (f[g >>> 24] << 24 | f[h >>> 16 & 255] << 16 | f[k >>> 8 & 255] << 8 | f[n & 255]) ^ c[p++]; - s = (f[h >>> 24] << 24 | f[k >>> 16 & 255] << 16 | f[n >>> 8 & 255] << 8 | f[g & 255]) ^ c[p++]; - t = (f[k >>> 24] << 24 | f[n >>> 16 & 255] << 16 | f[g >>> 8 & 255] << 8 | f[h & 255]) ^ c[p++]; - n = (f[n >>> 24] << 24 | f[g >>> 16 & 255] << 16 | f[h >>> 8 & 255] << 8 | f[k & 255]) ^ c[p++]; - a[b] = q; - a[b + 1] = s; - a[b + 2] = t; - a[b + 3] = n; - }, - keySize: 8 - }); - u.AES = p._createHelper(d); - })(); - - ; - /* - CryptoJS v3.1.2 - code.google.com/p/crypto-js - (c) 2009-2013 by Jeff Mott. All rights reserved. - code.google.com/p/crypto-js/wiki/License - */ - - var CryptoJS = CryptoJS || function (h, s) { - var f = {}, - g = f.lib = {}, - q = function () {}, - m = g.Base = { - extend: function (a) { - q.prototype = this; - var c = new q(); - a && c.mixIn(a); - c.hasOwnProperty("init") || (c.init = function () { - c.$super.init.apply(this, arguments); - }); - c.init.prototype = c; - c.$super = this; - return c; - }, - create: function () { - var a = this.extend(); - a.init.apply(a, arguments); - return a; - }, - init: function () {}, - mixIn: function (a) { - for (var c in a) a.hasOwnProperty(c) && (this[c] = a[c]); - - a.hasOwnProperty("toString") && (this.toString = a.toString); - }, - clone: function () { - return this.init.prototype.extend(this); - } - }, - r = g.WordArray = m.extend({ - init: function (a, c) { - a = this.words = a || []; - this.sigBytes = c != s ? c : 4 * a.length; - }, - toString: function (a) { - return (a || k).stringify(this); - }, - concat: function (a) { - var c = this.words, - d = a.words, - b = this.sigBytes; - a = a.sigBytes; - this.clamp(); - if (b % 4) for (var e = 0; e < a; e++) c[b + e >>> 2] |= (d[e >>> 2] >>> 24 - 8 * (e % 4) & 255) << 24 - 8 * ((b + e) % 4);else if (65535 < d.length) for (e = 0; e < a; e += 4) c[b + e >>> 2] = d[e >>> 2];else c.push.apply(c, d); - this.sigBytes += a; - return this; - }, - clamp: function () { - var a = this.words, - c = this.sigBytes; - a[c >>> 2] &= 4294967295 << 32 - 8 * (c % 4); - a.length = h.ceil(c / 4); - }, - clone: function () { - var a = m.clone.call(this); - a.words = this.words.slice(0); - return a; - }, - random: function (a) { - for (var c = [], d = 0; d < a; d += 4) c.push(4294967296 * h.random() | 0); - - return new r.init(c, a); - } - }), - l = f.enc = {}, - k = l.Hex = { - stringify: function (a) { - var c = a.words; - a = a.sigBytes; - - for (var d = [], b = 0; b < a; b++) { - var e = c[b >>> 2] >>> 24 - 8 * (b % 4) & 255; - d.push((e >>> 4).toString(16)); - d.push((e & 15).toString(16)); - } - - return d.join(""); - }, - parse: function (a) { - for (var c = a.length, d = [], b = 0; b < c; b += 2) d[b >>> 3] |= parseInt(a.substr(b, 2), 16) << 24 - 4 * (b % 8); - - return new r.init(d, c / 2); - } - }, - n = l.Latin1 = { - stringify: function (a) { - var c = a.words; - a = a.sigBytes; - - for (var d = [], b = 0; b < a; b++) d.push(String.fromCharCode(c[b >>> 2] >>> 24 - 8 * (b % 4) & 255)); - - return d.join(""); - }, - parse: function (a) { - for (var c = a.length, d = [], b = 0; b < c; b++) d[b >>> 2] |= (a.charCodeAt(b) & 255) << 24 - 8 * (b % 4); - - return new r.init(d, c); - } - }, - j = l.Utf8 = { - stringify: function (a) { - try { - return decodeURIComponent(escape(n.stringify(a))); - } catch (c) { - throw Error("Malformed UTF-8 data"); - } - }, - parse: function (a) { - return n.parse(unescape(encodeURIComponent(a))); - } - }, - u = g.BufferedBlockAlgorithm = m.extend({ - reset: function () { - this._data = new r.init(); - this._nDataBytes = 0; - }, - _append: function (a) { - "string" == typeof a && (a = j.parse(a)); - - this._data.concat(a); - - this._nDataBytes += a.sigBytes; - }, - _process: function (a) { - var c = this._data, - d = c.words, - b = c.sigBytes, - e = this.blockSize, - f = b / (4 * e), - f = a ? h.ceil(f) : h.max((f | 0) - this._minBufferSize, 0); - a = f * e; - b = h.min(4 * a, b); - - if (a) { - for (var g = 0; g < a; g += e) this._doProcessBlock(d, g); - - g = d.splice(0, a); - c.sigBytes -= b; - } - - return new r.init(g, b); - }, - clone: function () { - var a = m.clone.call(this); - a._data = this._data.clone(); - return a; - }, - _minBufferSize: 0 - }); - - g.Hasher = u.extend({ - cfg: m.extend(), - init: function (a) { - this.cfg = this.cfg.extend(a); - this.reset(); - }, - reset: function () { - u.reset.call(this); - - this._doReset(); - }, - update: function (a) { - this._append(a); - - this._process(); - - return this; - }, - finalize: function (a) { - a && this._append(a); - return this._doFinalize(); - }, - blockSize: 16, - _createHelper: function (a) { - return function (c, d) { - return new a.init(d).finalize(c); - }; - }, - _createHmacHelper: function (a) { - return function (c, d) { - return new t.HMAC.init(a, d).finalize(c); - }; - } - }); - var t = f.algo = {}; - return f; - }(Math); - - (function (h) { - for (var s = CryptoJS, f = s.lib, g = f.WordArray, q = f.Hasher, f = s.algo, m = [], r = [], l = function (a) { - return 4294967296 * (a - (a | 0)) | 0; - }, k = 2, n = 0; 64 > n;) { - var j; - - a: { - j = k; - - for (var u = h.sqrt(j), t = 2; t <= u; t++) if (!(j % t)) { - j = !1; - break a; - } - - j = !0; - } - - j && (8 > n && (m[n] = l(h.pow(k, 0.5))), r[n] = l(h.pow(k, 1 / 3)), n++); - k++; - } - - var a = [], - f = f.SHA256 = q.extend({ - _doReset: function () { - this._hash = new g.init(m.slice(0)); - }, - _doProcessBlock: function (c, d) { - for (var b = this._hash.words, e = b[0], f = b[1], g = b[2], j = b[3], h = b[4], m = b[5], n = b[6], q = b[7], p = 0; 64 > p; p++) { - if (16 > p) a[p] = c[d + p] | 0;else { - var k = a[p - 15], - l = a[p - 2]; - a[p] = ((k << 25 | k >>> 7) ^ (k << 14 | k >>> 18) ^ k >>> 3) + a[p - 7] + ((l << 15 | l >>> 17) ^ (l << 13 | l >>> 19) ^ l >>> 10) + a[p - 16]; - } - k = q + ((h << 26 | h >>> 6) ^ (h << 21 | h >>> 11) ^ (h << 7 | h >>> 25)) + (h & m ^ ~h & n) + r[p] + a[p]; - l = ((e << 30 | e >>> 2) ^ (e << 19 | e >>> 13) ^ (e << 10 | e >>> 22)) + (e & f ^ e & g ^ f & g); - q = n; - n = m; - m = h; - h = j + k | 0; - j = g; - g = f; - f = e; - e = k + l | 0; - } - - b[0] = b[0] + e | 0; - b[1] = b[1] + f | 0; - b[2] = b[2] + g | 0; - b[3] = b[3] + j | 0; - b[4] = b[4] + h | 0; - b[5] = b[5] + m | 0; - b[6] = b[6] + n | 0; - b[7] = b[7] + q | 0; - }, - _doFinalize: function () { - var a = this._data, - d = a.words, - b = 8 * this._nDataBytes, - e = 8 * a.sigBytes; - d[e >>> 5] |= 128 << 24 - e % 32; - d[(e + 64 >>> 9 << 4) + 14] = h.floor(b / 4294967296); - d[(e + 64 >>> 9 << 4) + 15] = b; - a.sigBytes = 4 * d.length; - - this._process(); - - return this._hash; - }, - clone: function () { - var a = q.clone.call(this); - a._hash = this._hash.clone(); - return a; - } - }); - s.SHA256 = q._createHelper(f); - s.HmacSHA256 = q._createHmacHelper(f); - })(Math); - - (function () { - var h = CryptoJS, - s = h.enc.Utf8; - h.algo.HMAC = h.lib.Base.extend({ - init: function (f, g) { - f = this._hasher = new f.init(); - "string" == typeof g && (g = s.parse(g)); - var h = f.blockSize, - m = 4 * h; - g.sigBytes > m && (g = f.finalize(g)); - g.clamp(); - - for (var r = this._oKey = g.clone(), l = this._iKey = g.clone(), k = r.words, n = l.words, j = 0; j < h; j++) k[j] ^= 1549556828, n[j] ^= 909522486; - - r.sigBytes = l.sigBytes = m; - this.reset(); - }, - reset: function () { - var f = this._hasher; - f.reset(); - f.update(this._iKey); - }, - update: function (f) { - this._hasher.update(f); - - return this; - }, - finalize: function (f) { - var g = this._hasher; - f = g.finalize(f); - g.reset(); - return g.finalize(this._oKey.clone().concat(f)); - } - }); - })(); - - ; - /* - CryptoJS v3.1.2 - code.google.com/p/crypto-js - (c) 2009-2013 by Jeff Mott. All rights reserved. - code.google.com/p/crypto-js/wiki/License - */ - - var CryptoJS = CryptoJS || function (a, j) { - var c = {}, - b = c.lib = {}, - f = function () {}, - l = b.Base = { - extend: function (a) { - f.prototype = this; - var d = new f(); - a && d.mixIn(a); - d.hasOwnProperty("init") || (d.init = function () { - d.$super.init.apply(this, arguments); - }); - d.init.prototype = d; - d.$super = this; - return d; - }, - create: function () { - var a = this.extend(); - a.init.apply(a, arguments); - return a; - }, - init: function () {}, - mixIn: function (a) { - for (var d in a) a.hasOwnProperty(d) && (this[d] = a[d]); - - a.hasOwnProperty("toString") && (this.toString = a.toString); - }, - clone: function () { - return this.init.prototype.extend(this); - } - }, - u = b.WordArray = l.extend({ - init: function (a, d) { - a = this.words = a || []; - this.sigBytes = d != j ? d : 4 * a.length; - }, - toString: function (a) { - return (a || m).stringify(this); - }, - concat: function (a) { - var d = this.words, - M = a.words, - e = this.sigBytes; - a = a.sigBytes; - this.clamp(); - if (e % 4) for (var b = 0; b < a; b++) d[e + b >>> 2] |= (M[b >>> 2] >>> 24 - 8 * (b % 4) & 255) << 24 - 8 * ((e + b) % 4);else if (65535 < M.length) for (b = 0; b < a; b += 4) d[e + b >>> 2] = M[b >>> 2];else d.push.apply(d, M); - this.sigBytes += a; - return this; - }, - clamp: function () { - var D = this.words, - d = this.sigBytes; - D[d >>> 2] &= 4294967295 << 32 - 8 * (d % 4); - D.length = a.ceil(d / 4); - }, - clone: function () { - var a = l.clone.call(this); - a.words = this.words.slice(0); - return a; - }, - random: function (D) { - for (var d = [], b = 0; b < D; b += 4) d.push(4294967296 * a.random() | 0); - - return new u.init(d, D); - } - }), - k = c.enc = {}, - m = k.Hex = { - stringify: function (a) { - var d = a.words; - a = a.sigBytes; - - for (var b = [], e = 0; e < a; e++) { - var c = d[e >>> 2] >>> 24 - 8 * (e % 4) & 255; - b.push((c >>> 4).toString(16)); - b.push((c & 15).toString(16)); - } - - return b.join(""); - }, - parse: function (a) { - for (var d = a.length, b = [], e = 0; e < d; e += 2) b[e >>> 3] |= parseInt(a.substr(e, 2), 16) << 24 - 4 * (e % 8); - - return new u.init(b, d / 2); - } - }, - y = k.Latin1 = { - stringify: function (a) { - var b = a.words; - a = a.sigBytes; - - for (var c = [], e = 0; e < a; e++) c.push(String.fromCharCode(b[e >>> 2] >>> 24 - 8 * (e % 4) & 255)); - - return c.join(""); - }, - parse: function (a) { - for (var b = a.length, c = [], e = 0; e < b; e++) c[e >>> 2] |= (a.charCodeAt(e) & 255) << 24 - 8 * (e % 4); - - return new u.init(c, b); - } - }, - z = k.Utf8 = { - stringify: function (a) { - try { - return decodeURIComponent(escape(y.stringify(a))); - } catch (b) { - throw Error("Malformed UTF-8 data"); - } - }, - parse: function (a) { - return y.parse(unescape(encodeURIComponent(a))); - } - }, - x = b.BufferedBlockAlgorithm = l.extend({ - reset: function () { - this._data = new u.init(); - this._nDataBytes = 0; - }, - _append: function (a) { - "string" == typeof a && (a = z.parse(a)); - - this._data.concat(a); - - this._nDataBytes += a.sigBytes; - }, - _process: function (b) { - var d = this._data, - c = d.words, - e = d.sigBytes, - l = this.blockSize, - k = e / (4 * l), - k = b ? a.ceil(k) : a.max((k | 0) - this._minBufferSize, 0); - b = k * l; - e = a.min(4 * b, e); - - if (b) { - for (var x = 0; x < b; x += l) this._doProcessBlock(c, x); - - x = c.splice(0, b); - d.sigBytes -= e; - } - - return new u.init(x, e); - }, - clone: function () { - var a = l.clone.call(this); - a._data = this._data.clone(); - return a; - }, - _minBufferSize: 0 - }); - - b.Hasher = x.extend({ - cfg: l.extend(), - init: function (a) { - this.cfg = this.cfg.extend(a); - this.reset(); - }, - reset: function () { - x.reset.call(this); - - this._doReset(); - }, - update: function (a) { - this._append(a); - - this._process(); - - return this; - }, - finalize: function (a) { - a && this._append(a); - return this._doFinalize(); - }, - blockSize: 16, - _createHelper: function (a) { - return function (b, c) { - return new a.init(c).finalize(b); - }; - }, - _createHmacHelper: function (a) { - return function (b, c) { - return new ja.HMAC.init(a, c).finalize(b); - }; - } - }); - var ja = c.algo = {}; - return c; - }(Math); - - (function (a) { - var j = CryptoJS, - c = j.lib, - b = c.Base, - f = c.WordArray, - j = j.x64 = {}; - j.Word = b.extend({ - init: function (a, b) { - this.high = a; - this.low = b; - } - }); - j.WordArray = b.extend({ - init: function (b, c) { - b = this.words = b || []; - this.sigBytes = c != a ? c : 8 * b.length; - }, - toX32: function () { - for (var a = this.words, b = a.length, c = [], m = 0; m < b; m++) { - var y = a[m]; - c.push(y.high); - c.push(y.low); - } - - return f.create(c, this.sigBytes); - }, - clone: function () { - for (var a = b.clone.call(this), c = a.words = this.words.slice(0), k = c.length, f = 0; f < k; f++) c[f] = c[f].clone(); - - return a; - } - }); - })(); - - (function () { - function a() { - return f.create.apply(f, arguments); - } - - for (var j = CryptoJS, c = j.lib.Hasher, b = j.x64, f = b.Word, l = b.WordArray, b = j.algo, u = [a(1116352408, 3609767458), a(1899447441, 602891725), a(3049323471, 3964484399), a(3921009573, 2173295548), a(961987163, 4081628472), a(1508970993, 3053834265), a(2453635748, 2937671579), a(2870763221, 3664609560), a(3624381080, 2734883394), a(310598401, 1164996542), a(607225278, 1323610764), a(1426881987, 3590304994), a(1925078388, 4068182383), a(2162078206, 991336113), a(2614888103, 633803317), a(3248222580, 3479774868), a(3835390401, 2666613458), a(4022224774, 944711139), a(264347078, 2341262773), a(604807628, 2007800933), a(770255983, 1495990901), a(1249150122, 1856431235), a(1555081692, 3175218132), a(1996064986, 2198950837), a(2554220882, 3999719339), a(2821834349, 766784016), a(2952996808, 2566594879), a(3210313671, 3203337956), a(3336571891, 1034457026), a(3584528711, 2466948901), a(113926993, 3758326383), a(338241895, 168717936), a(666307205, 1188179964), a(773529912, 1546045734), a(1294757372, 1522805485), a(1396182291, 2643833823), a(1695183700, 2343527390), a(1986661051, 1014477480), a(2177026350, 1206759142), a(2456956037, 344077627), a(2730485921, 1290863460), a(2820302411, 3158454273), a(3259730800, 3505952657), a(3345764771, 106217008), a(3516065817, 3606008344), a(3600352804, 1432725776), a(4094571909, 1467031594), a(275423344, 851169720), a(430227734, 3100823752), a(506948616, 1363258195), a(659060556, 3750685593), a(883997877, 3785050280), a(958139571, 3318307427), a(1322822218, 3812723403), a(1537002063, 2003034995), a(1747873779, 3602036899), a(1955562222, 1575990012), a(2024104815, 1125592928), a(2227730452, 2716904306), a(2361852424, 442776044), a(2428436474, 593698344), a(2756734187, 3733110249), a(3204031479, 2999351573), a(3329325298, 3815920427), a(3391569614, 3928383900), a(3515267271, 566280711), a(3940187606, 3454069534), a(4118630271, 4000239992), a(116418474, 1914138554), a(174292421, 2731055270), a(289380356, 3203993006), a(460393269, 320620315), a(685471733, 587496836), a(852142971, 1086792851), a(1017036298, 365543100), a(1126000580, 2618297676), a(1288033470, 3409855158), a(1501505948, 4234509866), a(1607167915, 987167468), a(1816402316, 1246189591)], k = [], m = 0; 80 > m; m++) k[m] = a(); - - b = b.SHA512 = c.extend({ - _doReset: function () { - this._hash = new l.init([new f.init(1779033703, 4089235720), new f.init(3144134277, 2227873595), new f.init(1013904242, 4271175723), new f.init(2773480762, 1595750129), new f.init(1359893119, 2917565137), new f.init(2600822924, 725511199), new f.init(528734635, 4215389547), new f.init(1541459225, 327033209)]); - }, - _doProcessBlock: function (a, b) { - for (var c = this._hash.words, f = c[0], j = c[1], d = c[2], l = c[3], e = c[4], m = c[5], N = c[6], c = c[7], aa = f.high, O = f.low, ba = j.high, P = j.low, ca = d.high, Q = d.low, da = l.high, R = l.low, ea = e.high, S = e.low, fa = m.high, T = m.low, ga = N.high, U = N.low, ha = c.high, V = c.low, r = aa, n = O, G = ba, E = P, H = ca, F = Q, Y = da, I = R, s = ea, p = S, W = fa, J = T, X = ga, K = U, Z = ha, L = V, t = 0; 80 > t; t++) { - var A = k[t]; - if (16 > t) var q = A.high = a[b + 2 * t] | 0, - g = A.low = a[b + 2 * t + 1] | 0;else { - var q = k[t - 15], - g = q.high, - v = q.low, - q = (g >>> 1 | v << 31) ^ (g >>> 8 | v << 24) ^ g >>> 7, - v = (v >>> 1 | g << 31) ^ (v >>> 8 | g << 24) ^ (v >>> 7 | g << 25), - C = k[t - 2], - g = C.high, - h = C.low, - C = (g >>> 19 | h << 13) ^ (g << 3 | h >>> 29) ^ g >>> 6, - h = (h >>> 19 | g << 13) ^ (h << 3 | g >>> 29) ^ (h >>> 6 | g << 26), - g = k[t - 7], - $ = g.high, - B = k[t - 16], - w = B.high, - B = B.low, - g = v + g.low, - q = q + $ + (g >>> 0 < v >>> 0 ? 1 : 0), - g = g + h, - q = q + C + (g >>> 0 < h >>> 0 ? 1 : 0), - g = g + B, - q = q + w + (g >>> 0 < B >>> 0 ? 1 : 0); - A.high = q; - A.low = g; - } - var $ = s & W ^ ~s & X, - B = p & J ^ ~p & K, - A = r & G ^ r & H ^ G & H, - ka = n & E ^ n & F ^ E & F, - v = (r >>> 28 | n << 4) ^ (r << 30 | n >>> 2) ^ (r << 25 | n >>> 7), - C = (n >>> 28 | r << 4) ^ (n << 30 | r >>> 2) ^ (n << 25 | r >>> 7), - h = u[t], - la = h.high, - ia = h.low, - h = L + ((p >>> 14 | s << 18) ^ (p >>> 18 | s << 14) ^ (p << 23 | s >>> 9)), - w = Z + ((s >>> 14 | p << 18) ^ (s >>> 18 | p << 14) ^ (s << 23 | p >>> 9)) + (h >>> 0 < L >>> 0 ? 1 : 0), - h = h + B, - w = w + $ + (h >>> 0 < B >>> 0 ? 1 : 0), - h = h + ia, - w = w + la + (h >>> 0 < ia >>> 0 ? 1 : 0), - h = h + g, - w = w + q + (h >>> 0 < g >>> 0 ? 1 : 0), - g = C + ka, - A = v + A + (g >>> 0 < C >>> 0 ? 1 : 0), - Z = X, - L = K, - X = W, - K = J, - W = s, - J = p, - p = I + h | 0, - s = Y + w + (p >>> 0 < I >>> 0 ? 1 : 0) | 0, - Y = H, - I = F, - H = G, - F = E, - G = r, - E = n, - n = h + g | 0, - r = w + A + (n >>> 0 < h >>> 0 ? 1 : 0) | 0; - } - - O = f.low = O + n; - f.high = aa + r + (O >>> 0 < n >>> 0 ? 1 : 0); - P = j.low = P + E; - j.high = ba + G + (P >>> 0 < E >>> 0 ? 1 : 0); - Q = d.low = Q + F; - d.high = ca + H + (Q >>> 0 < F >>> 0 ? 1 : 0); - R = l.low = R + I; - l.high = da + Y + (R >>> 0 < I >>> 0 ? 1 : 0); - S = e.low = S + p; - e.high = ea + s + (S >>> 0 < p >>> 0 ? 1 : 0); - T = m.low = T + J; - m.high = fa + W + (T >>> 0 < J >>> 0 ? 1 : 0); - U = N.low = U + K; - N.high = ga + X + (U >>> 0 < K >>> 0 ? 1 : 0); - V = c.low = V + L; - c.high = ha + Z + (V >>> 0 < L >>> 0 ? 1 : 0); - }, - _doFinalize: function () { - var a = this._data, - b = a.words, - c = 8 * this._nDataBytes, - f = 8 * a.sigBytes; - b[f >>> 5] |= 128 << 24 - f % 32; - b[(f + 128 >>> 10 << 5) + 30] = Math.floor(c / 4294967296); - b[(f + 128 >>> 10 << 5) + 31] = c; - a.sigBytes = 4 * b.length; - - this._process(); - - return this._hash.toX32(); - }, - clone: function () { - var a = c.clone.call(this); - a._hash = this._hash.clone(); - return a; - }, - blockSize: 32 - }); - j.SHA512 = c._createHelper(b); - j.HmacSHA512 = c._createHmacHelper(b); - })(); - - (function () { - var a = CryptoJS, - j = a.enc.Utf8; - a.algo.HMAC = a.lib.Base.extend({ - init: function (a, b) { - a = this._hasher = new a.init(); - "string" == typeof b && (b = j.parse(b)); - var f = a.blockSize, - l = 4 * f; - b.sigBytes > l && (b = a.finalize(b)); - b.clamp(); - - for (var u = this._oKey = b.clone(), k = this._iKey = b.clone(), m = u.words, y = k.words, z = 0; z < f; z++) m[z] ^= 1549556828, y[z] ^= 909522486; - - u.sigBytes = k.sigBytes = l; - this.reset(); - }, - reset: function () { - var a = this._hasher; - a.reset(); - a.update(this._iKey); - }, - update: function (a) { - this._hasher.update(a); - - return this; - }, - finalize: function (a) { - var b = this._hasher; - a = b.finalize(a); - b.reset(); - return b.finalize(this._oKey.clone().concat(a)); - } - }); - })(); - - ; - /* - CryptoJS v3.1.2 - code.google.com/p/crypto-js - (c) 2009-2013 by Jeff Mott. All rights reserved. - code.google.com/p/crypto-js/wiki/License - */ - - var CryptoJS = CryptoJS || function (g, j) { - var e = {}, - d = e.lib = {}, - m = function () {}, - n = d.Base = { - extend: function (a) { - m.prototype = this; - var c = new m(); - a && c.mixIn(a); - c.hasOwnProperty("init") || (c.init = function () { - c.$super.init.apply(this, arguments); - }); - c.init.prototype = c; - c.$super = this; - return c; - }, - create: function () { - var a = this.extend(); - a.init.apply(a, arguments); - return a; - }, - init: function () {}, - mixIn: function (a) { - for (var c in a) a.hasOwnProperty(c) && (this[c] = a[c]); - - a.hasOwnProperty("toString") && (this.toString = a.toString); - }, - clone: function () { - return this.init.prototype.extend(this); - } - }, - q = d.WordArray = n.extend({ - init: function (a, c) { - a = this.words = a || []; - this.sigBytes = c != j ? c : 4 * a.length; - }, - toString: function (a) { - return (a || l).stringify(this); - }, - concat: function (a) { - var c = this.words, - p = a.words, - f = this.sigBytes; - a = a.sigBytes; - this.clamp(); - if (f % 4) for (var b = 0; b < a; b++) c[f + b >>> 2] |= (p[b >>> 2] >>> 24 - 8 * (b % 4) & 255) << 24 - 8 * ((f + b) % 4);else if (65535 < p.length) for (b = 0; b < a; b += 4) c[f + b >>> 2] = p[b >>> 2];else c.push.apply(c, p); - this.sigBytes += a; - return this; - }, - clamp: function () { - var a = this.words, - c = this.sigBytes; - a[c >>> 2] &= 4294967295 << 32 - 8 * (c % 4); - a.length = g.ceil(c / 4); - }, - clone: function () { - var a = n.clone.call(this); - a.words = this.words.slice(0); - return a; - }, - random: function (a) { - for (var c = [], b = 0; b < a; b += 4) c.push(4294967296 * g.random() | 0); - - return new q.init(c, a); - } - }), - b = e.enc = {}, - l = b.Hex = { - stringify: function (a) { - var c = a.words; - a = a.sigBytes; - - for (var b = [], f = 0; f < a; f++) { - var d = c[f >>> 2] >>> 24 - 8 * (f % 4) & 255; - b.push((d >>> 4).toString(16)); - b.push((d & 15).toString(16)); - } - - return b.join(""); - }, - parse: function (a) { - for (var c = a.length, b = [], f = 0; f < c; f += 2) b[f >>> 3] |= parseInt(a.substr(f, 2), 16) << 24 - 4 * (f % 8); - - return new q.init(b, c / 2); - } - }, - k = b.Latin1 = { - stringify: function (a) { - var c = a.words; - a = a.sigBytes; - - for (var b = [], f = 0; f < a; f++) b.push(String.fromCharCode(c[f >>> 2] >>> 24 - 8 * (f % 4) & 255)); - - return b.join(""); - }, - parse: function (a) { - for (var c = a.length, b = [], f = 0; f < c; f++) b[f >>> 2] |= (a.charCodeAt(f) & 255) << 24 - 8 * (f % 4); - - return new q.init(b, c); - } - }, - h = b.Utf8 = { - stringify: function (a) { - try { - return decodeURIComponent(escape(k.stringify(a))); - } catch (b) { - throw Error("Malformed UTF-8 data"); - } - }, - parse: function (a) { - return k.parse(unescape(encodeURIComponent(a))); - } - }, - u = d.BufferedBlockAlgorithm = n.extend({ - reset: function () { - this._data = new q.init(); - this._nDataBytes = 0; - }, - _append: function (a) { - "string" == typeof a && (a = h.parse(a)); - - this._data.concat(a); - - this._nDataBytes += a.sigBytes; - }, - _process: function (a) { - var b = this._data, - d = b.words, - f = b.sigBytes, - l = this.blockSize, - e = f / (4 * l), - e = a ? g.ceil(e) : g.max((e | 0) - this._minBufferSize, 0); - a = e * l; - f = g.min(4 * a, f); - - if (a) { - for (var h = 0; h < a; h += l) this._doProcessBlock(d, h); - - h = d.splice(0, a); - b.sigBytes -= f; - } - - return new q.init(h, f); - }, - clone: function () { - var a = n.clone.call(this); - a._data = this._data.clone(); - return a; - }, - _minBufferSize: 0 - }); - - d.Hasher = u.extend({ - cfg: n.extend(), - init: function (a) { - this.cfg = this.cfg.extend(a); - this.reset(); - }, - reset: function () { - u.reset.call(this); - - this._doReset(); - }, - update: function (a) { - this._append(a); - - this._process(); - - return this; - }, - finalize: function (a) { - a && this._append(a); - return this._doFinalize(); - }, - blockSize: 16, - _createHelper: function (a) { - return function (b, d) { - return new a.init(d).finalize(b); - }; - }, - _createHmacHelper: function (a) { - return function (b, d) { - return new w.HMAC.init(a, d).finalize(b); - }; - } - }); - var w = e.algo = {}; - return e; - }(Math); - - (function () { - var g = CryptoJS, - j = g.lib, - e = j.WordArray, - d = j.Hasher, - m = [], - j = g.algo.SHA1 = d.extend({ - _doReset: function () { - this._hash = new e.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]); - }, - _doProcessBlock: function (d, e) { - for (var b = this._hash.words, l = b[0], k = b[1], h = b[2], g = b[3], j = b[4], a = 0; 80 > a; a++) { - if (16 > a) m[a] = d[e + a] | 0;else { - var c = m[a - 3] ^ m[a - 8] ^ m[a - 14] ^ m[a - 16]; - m[a] = c << 1 | c >>> 31; - } - c = (l << 5 | l >>> 27) + j + m[a]; - c = 20 > a ? c + ((k & h | ~k & g) + 1518500249) : 40 > a ? c + ((k ^ h ^ g) + 1859775393) : 60 > a ? c + ((k & h | k & g | h & g) - 1894007588) : c + ((k ^ h ^ g) - 899497514); - j = g; - g = h; - h = k << 30 | k >>> 2; - k = l; - l = c; - } - - b[0] = b[0] + l | 0; - b[1] = b[1] + k | 0; - b[2] = b[2] + h | 0; - b[3] = b[3] + g | 0; - b[4] = b[4] + j | 0; - }, - _doFinalize: function () { - var d = this._data, - e = d.words, - b = 8 * this._nDataBytes, - l = 8 * d.sigBytes; - e[l >>> 5] |= 128 << 24 - l % 32; - e[(l + 64 >>> 9 << 4) + 14] = Math.floor(b / 4294967296); - e[(l + 64 >>> 9 << 4) + 15] = b; - d.sigBytes = 4 * e.length; - - this._process(); - - return this._hash; - }, - clone: function () { - var e = d.clone.call(this); - e._hash = this._hash.clone(); - return e; - } - }); - g.SHA1 = d._createHelper(j); - g.HmacSHA1 = d._createHmacHelper(j); - })(); - - (function () { - var g = CryptoJS, - j = g.enc.Utf8; - g.algo.HMAC = g.lib.Base.extend({ - init: function (e, d) { - e = this._hasher = new e.init(); - "string" == typeof d && (d = j.parse(d)); - var g = e.blockSize, - n = 4 * g; - d.sigBytes > n && (d = e.finalize(d)); - d.clamp(); - - for (var q = this._oKey = d.clone(), b = this._iKey = d.clone(), l = q.words, k = b.words, h = 0; h < g; h++) l[h] ^= 1549556828, k[h] ^= 909522486; - - q.sigBytes = b.sigBytes = n; - this.reset(); - }, - reset: function () { - var e = this._hasher; - e.reset(); - e.update(this._iKey); - }, - update: function (e) { - this._hasher.update(e); - - return this; - }, - finalize: function (e) { - var d = this._hasher; - e = d.finalize(e); - d.reset(); - return d.finalize(this._oKey.clone().concat(e)); - } - }); - })(); - - (function () { - var g = CryptoJS, - j = g.lib, - e = j.Base, - d = j.WordArray, - j = g.algo, - m = j.HMAC, - n = j.PBKDF2 = e.extend({ - cfg: e.extend({ - keySize: 4, - hasher: j.SHA1, - iterations: 1 - }), - init: function (d) { - this.cfg = this.cfg.extend(d); - }, - compute: function (e, b) { - for (var g = this.cfg, k = m.create(g.hasher, e), h = d.create(), j = d.create([1]), n = h.words, a = j.words, c = g.keySize, g = g.iterations; n.length < c;) { - var p = k.update(b).finalize(j); - k.reset(); - - for (var f = p.words, v = f.length, s = p, t = 1; t < g; t++) { - s = k.finalize(s); - k.reset(); - - for (var x = s.words, r = 0; r < v; r++) f[r] ^= x[r]; - } - - h.concat(p); - a[0]++; - } - - h.sigBytes = 4 * c; - return h; - } - }); - - g.PBKDF2 = function (d, b, e) { - return n.create(e).compute(d, b); - }; - })(); - - ; - /* - CryptoJS v3.1.2 - code.google.com/p/crypto-js - (c) 2009-2013 by Jeff Mott. All rights reserved. - code.google.com/p/crypto-js/wiki/License - */ - - var CryptoJS = CryptoJS || function (e, m) { - var p = {}, - j = p.lib = {}, - l = function () {}, - f = j.Base = { - extend: function (a) { - l.prototype = this; - var c = new l(); - a && c.mixIn(a); - c.hasOwnProperty("init") || (c.init = function () { - c.$super.init.apply(this, arguments); - }); - c.init.prototype = c; - c.$super = this; - return c; - }, - create: function () { - var a = this.extend(); - a.init.apply(a, arguments); - return a; - }, - init: function () {}, - mixIn: function (a) { - for (var c in a) a.hasOwnProperty(c) && (this[c] = a[c]); - - a.hasOwnProperty("toString") && (this.toString = a.toString); - }, - clone: function () { - return this.init.prototype.extend(this); - } - }, - n = j.WordArray = f.extend({ - init: function (a, c) { - a = this.words = a || []; - this.sigBytes = c != m ? c : 4 * a.length; - }, - toString: function (a) { - return (a || h).stringify(this); - }, - concat: function (a) { - var c = this.words, - q = a.words, - d = this.sigBytes; - a = a.sigBytes; - this.clamp(); - if (d % 4) for (var b = 0; b < a; b++) c[d + b >>> 2] |= (q[b >>> 2] >>> 24 - 8 * (b % 4) & 255) << 24 - 8 * ((d + b) % 4);else if (65535 < q.length) for (b = 0; b < a; b += 4) c[d + b >>> 2] = q[b >>> 2];else c.push.apply(c, q); - this.sigBytes += a; - return this; - }, - clamp: function () { - var a = this.words, - c = this.sigBytes; - a[c >>> 2] &= 4294967295 << 32 - 8 * (c % 4); - a.length = e.ceil(c / 4); - }, - clone: function () { - var a = f.clone.call(this); - a.words = this.words.slice(0); - return a; - }, - random: function (a) { - for (var c = [], b = 0; b < a; b += 4) c.push(4294967296 * e.random() | 0); - - return new n.init(c, a); - } - }), - b = p.enc = {}, - h = b.Hex = { - stringify: function (a) { - var c = a.words; - a = a.sigBytes; - - for (var b = [], d = 0; d < a; d++) { - var f = c[d >>> 2] >>> 24 - 8 * (d % 4) & 255; - b.push((f >>> 4).toString(16)); - b.push((f & 15).toString(16)); - } - - return b.join(""); - }, - parse: function (a) { - for (var c = a.length, b = [], d = 0; d < c; d += 2) b[d >>> 3] |= parseInt(a.substr(d, 2), 16) << 24 - 4 * (d % 8); - - return new n.init(b, c / 2); - } - }, - g = b.Latin1 = { - stringify: function (a) { - var c = a.words; - a = a.sigBytes; - - for (var b = [], d = 0; d < a; d++) b.push(String.fromCharCode(c[d >>> 2] >>> 24 - 8 * (d % 4) & 255)); - - return b.join(""); - }, - parse: function (a) { - for (var c = a.length, b = [], d = 0; d < c; d++) b[d >>> 2] |= (a.charCodeAt(d) & 255) << 24 - 8 * (d % 4); - - return new n.init(b, c); - } - }, - r = b.Utf8 = { - stringify: function (a) { - try { - return decodeURIComponent(escape(g.stringify(a))); - } catch (c) { - throw Error("Malformed UTF-8 data"); - } - }, - parse: function (a) { - return g.parse(unescape(encodeURIComponent(a))); - } - }, - k = j.BufferedBlockAlgorithm = f.extend({ - reset: function () { - this._data = new n.init(); - this._nDataBytes = 0; - }, - _append: function (a) { - "string" == typeof a && (a = r.parse(a)); - - this._data.concat(a); - - this._nDataBytes += a.sigBytes; - }, - _process: function (a) { - var c = this._data, - b = c.words, - d = c.sigBytes, - f = this.blockSize, - h = d / (4 * f), - h = a ? e.ceil(h) : e.max((h | 0) - this._minBufferSize, 0); - a = h * f; - d = e.min(4 * a, d); - - if (a) { - for (var g = 0; g < a; g += f) this._doProcessBlock(b, g); - - g = b.splice(0, a); - c.sigBytes -= d; - } - - return new n.init(g, d); - }, - clone: function () { - var a = f.clone.call(this); - a._data = this._data.clone(); - return a; - }, - _minBufferSize: 0 - }); - - j.Hasher = k.extend({ - cfg: f.extend(), - init: function (a) { - this.cfg = this.cfg.extend(a); - this.reset(); - }, - reset: function () { - k.reset.call(this); - - this._doReset(); - }, - update: function (a) { - this._append(a); - - this._process(); - - return this; - }, - finalize: function (a) { - a && this._append(a); - return this._doFinalize(); - }, - blockSize: 16, - _createHelper: function (a) { - return function (c, b) { - return new a.init(b).finalize(c); - }; - }, - _createHmacHelper: function (a) { - return function (b, f) { - return new s.HMAC.init(a, f).finalize(b); - }; - } - }); - var s = p.algo = {}; - return p; - }(Math); - - (function () { - var e = CryptoJS, - m = e.lib, - p = m.WordArray, - j = m.Hasher, - l = [], - m = e.algo.SHA1 = j.extend({ - _doReset: function () { - this._hash = new p.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]); - }, - _doProcessBlock: function (f, n) { - for (var b = this._hash.words, h = b[0], g = b[1], e = b[2], k = b[3], j = b[4], a = 0; 80 > a; a++) { - if (16 > a) l[a] = f[n + a] | 0;else { - var c = l[a - 3] ^ l[a - 8] ^ l[a - 14] ^ l[a - 16]; - l[a] = c << 1 | c >>> 31; - } - c = (h << 5 | h >>> 27) + j + l[a]; - c = 20 > a ? c + ((g & e | ~g & k) + 1518500249) : 40 > a ? c + ((g ^ e ^ k) + 1859775393) : 60 > a ? c + ((g & e | g & k | e & k) - 1894007588) : c + ((g ^ e ^ k) - 899497514); - j = k; - k = e; - e = g << 30 | g >>> 2; - g = h; - h = c; - } - - b[0] = b[0] + h | 0; - b[1] = b[1] + g | 0; - b[2] = b[2] + e | 0; - b[3] = b[3] + k | 0; - b[4] = b[4] + j | 0; - }, - _doFinalize: function () { - var f = this._data, - e = f.words, - b = 8 * this._nDataBytes, - h = 8 * f.sigBytes; - e[h >>> 5] |= 128 << 24 - h % 32; - e[(h + 64 >>> 9 << 4) + 14] = Math.floor(b / 4294967296); - e[(h + 64 >>> 9 << 4) + 15] = b; - f.sigBytes = 4 * e.length; - - this._process(); - - return this._hash; - }, - clone: function () { - var e = j.clone.call(this); - e._hash = this._hash.clone(); - return e; - } - }); - e.SHA1 = j._createHelper(m); - e.HmacSHA1 = j._createHmacHelper(m); - })(); - - ; - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _slicedToArray = function () { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; - }(); - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - - var _createClass = 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); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - - function _possibleConstructorReturn(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return call && (typeof call === "object" || typeof call === "function") ? call : self; - } - - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; - } - - function _asyncToGenerator(fn) { - return function () { - var gen = fn.apply(this, arguments); - return new Promise(function (resolve, reject) { - function step(key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - return Promise.resolve(value).then(function (value) { - step("next", value); - }, function (err) { - step("throw", err); - }); - } - } - - return step("next"); - }); - }; - } - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - var SFAlertManager = exports.SFAlertManager = function () { - function SFAlertManager() { - _classCallCheck(this, SFAlertManager); - } - - _createClass(SFAlertManager, [{ - key: "alert", - value: function () { - var _ref = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee(params) { - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - return _context.abrupt("return", new Promise(function (resolve, reject) { - window.alert(params.text); - resolve(); - })); - - case 1: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function alert(_x) { - return _ref.apply(this, arguments); - } - - return alert; - }() - }, { - key: "confirm", - value: function () { - var _ref2 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee2(params) { - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - return _context2.abrupt("return", new Promise(function (resolve, reject) { - if (window.confirm(params.text)) { - resolve(); - } else { - reject(); - } - })); - - case 1: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function confirm(_x2) { - return _ref2.apply(this, arguments); - } - - return confirm; - }() - }]); - - return SFAlertManager; - }(); - - ; - - var SFAuthManager = exports.SFAuthManager = function () { - function SFAuthManager(storageManager, httpManager, alertManager, timeout) { - _classCallCheck(this, SFAuthManager); - - SFAuthManager.DidSignOutEvent = "DidSignOutEvent"; - SFAuthManager.WillSignInEvent = "WillSignInEvent"; - SFAuthManager.DidSignInEvent = "DidSignInEvent"; - this.httpManager = httpManager; - this.storageManager = storageManager; - this.alertManager = alertManager || new SFAlertManager(); - this.$timeout = timeout || setTimeout.bind(window); - this.eventHandlers = []; - } - - _createClass(SFAuthManager, [{ - key: "addEventHandler", - value: function addEventHandler(handler) { - this.eventHandlers.push(handler); - return handler; - } - }, { - key: "removeEventHandler", - value: function removeEventHandler(handler) { - _.pull(this.eventHandlers, handler); - } - }, { - key: "notifyEvent", - value: function notifyEvent(event, data) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = this.eventHandlers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var handler = _step.value; - handler(event, data || {}); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - }, { - key: "saveKeys", - value: function () { - var _ref3 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee3(keys) { - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - this._keys = keys; - _context3.next = 3; - return this.storageManager.setItem("mk", keys.mk); - - case 3: - _context3.next = 5; - return this.storageManager.setItem("ak", keys.ak); - - case 5: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function saveKeys(_x3) { - return _ref3.apply(this, arguments); - } - - return saveKeys; - }() - }, { - key: "signout", - value: function () { - var _ref4 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee4(clearAllData) { - var _this = this; - - return regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - this._keys = null; - this._authParams = null; - - if (!clearAllData) { - _context4.next = 6; - break; - } - - return _context4.abrupt("return", this.storageManager.clearAllData().then(function () { - _this.notifyEvent(SFAuthManager.DidSignOutEvent); - })); - - case 6: - this.notifyEvent(SFAuthManager.DidSignOutEvent); - - case 7: - case "end": - return _context4.stop(); - } - } - }, _callee4, this); - })); - - function signout(_x4) { - return _ref4.apply(this, arguments); - } - - return signout; - }() - }, { - key: "keys", - value: function () { - var _ref5 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee5() { - var mk; - return regeneratorRuntime.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - if (this._keys) { - _context5.next = 11; - break; - } - - _context5.next = 3; - return this.storageManager.getItem("mk"); - - case 3: - mk = _context5.sent; - - if (mk) { - _context5.next = 6; - break; - } - - return _context5.abrupt("return", null); - - case 6: - _context5.t0 = mk; - _context5.next = 9; - return this.storageManager.getItem("ak"); - - case 9: - _context5.t1 = _context5.sent; - this._keys = { - mk: _context5.t0, - ak: _context5.t1 - }; - - case 11: - return _context5.abrupt("return", this._keys); - - case 12: - case "end": - return _context5.stop(); - } - } - }, _callee5, this); - })); - - function keys() { - return _ref5.apply(this, arguments); - } - - return keys; - }() - }, { - key: "getAuthParams", - value: function () { - var _ref6 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee6() { - var data; - return regeneratorRuntime.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - if (this._authParams) { - _context6.next = 5; - break; - } - - _context6.next = 3; - return this.storageManager.getItem("auth_params"); - - case 3: - data = _context6.sent; - this._authParams = JSON.parse(data); - - case 5: - if (!(this._authParams && !this._authParams.version)) { - _context6.next = 9; - break; - } - - _context6.next = 8; - return this.defaultProtocolVersion(); - - case 8: - this._authParams.version = _context6.sent; - - case 9: - return _context6.abrupt("return", this._authParams); - - case 10: - case "end": - return _context6.stop(); - } - } - }, _callee6, this); - })); - - function getAuthParams() { - return _ref6.apply(this, arguments); - } - - return getAuthParams; - }() - }, { - key: "defaultProtocolVersion", - value: function () { - var _ref7 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee7() { - var keys; - return regeneratorRuntime.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - _context7.next = 2; - return this.keys(); - - case 2: - keys = _context7.sent; - - if (!(keys && keys.ak)) { - _context7.next = 7; - break; - } - - return _context7.abrupt("return", "002"); - - case 7: - return _context7.abrupt("return", "001"); - - case 8: - case "end": - return _context7.stop(); - } - } - }, _callee7, this); - })); - - function defaultProtocolVersion() { - return _ref7.apply(this, arguments); - } - - return defaultProtocolVersion; - }() - }, { - key: "protocolVersion", - value: function () { - var _ref8 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee8() { - var authParams; - return regeneratorRuntime.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - _context8.next = 2; - return this.getAuthParams(); - - case 2: - authParams = _context8.sent; - - if (!(authParams && authParams.version)) { - _context8.next = 5; - break; - } - - return _context8.abrupt("return", authParams.version); - - case 5: - return _context8.abrupt("return", this.defaultProtocolVersion()); - - case 6: - case "end": - return _context8.stop(); - } - } - }, _callee8, this); - })); - - function protocolVersion() { - return _ref8.apply(this, arguments); - } - - return protocolVersion; - }() - }, { - key: "getAuthParamsForEmail", - value: function () { - var _ref9 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee9(url, email, extraParams) { - var _this2 = this; - - return regeneratorRuntime.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - return _context9.abrupt("return", new Promise(function (resolve, reject) { - var requestUrl = url + "/auth/params"; - - _this2.httpManager.getAbsolute(requestUrl, _.merge({ - email: email - }, extraParams), function (response) { - resolve(response); - }, function (response) { - console.error("Error getting auth params", response); - - if ((typeof response === "undefined" ? "undefined" : _typeof(response)) !== 'object') { - response = { - error: { - message: "A server error occurred while trying to sign in. Please try again." - } - }; - } - - resolve(response); - }); - })); - - case 1: - case "end": - return _context9.stop(); - } - } - }, _callee9, this); - })); - - function getAuthParamsForEmail(_x5, _x6, _x7) { - return _ref9.apply(this, arguments); - } - - return getAuthParamsForEmail; - }() - }, { - key: "lock", - value: function lock() { - this.locked = true; - } - }, { - key: "unlock", - value: function unlock() { - this.locked = false; - } - }, { - key: "isLocked", - value: function isLocked() { - return this.locked == true; - } - }, { - key: "unlockAndResolve", - value: function unlockAndResolve(resolve, param) { - this.unlock(); - resolve(param); - } - }, { - key: "login", - value: function () { - var _ref10 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee12(url, email, password, strictSignin, extraParams) { - var _this3 = this; - - return regeneratorRuntime.wrap(function _callee12$(_context12) { - while (1) { - switch (_context12.prev = _context12.next) { - case 0: - return _context12.abrupt("return", new Promise(function () { - var _ref11 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee11(resolve, reject) { - var existingKeys, authParams, message, _message, abort, _message2, minimum, _message3, latestVersion, _message4, keys, requestUrl, params; - - return regeneratorRuntime.wrap(function _callee11$(_context11) { - while (1) { - switch (_context11.prev = _context11.next) { - case 0: - _context11.next = 2; - return _this3.keys(); - - case 2: - existingKeys = _context11.sent; - - if (!(existingKeys != null)) { - _context11.next = 6; - break; - } - - resolve({ - error: { - message: "Cannot log in because already signed in." - } - }); - return _context11.abrupt("return"); - - case 6: - if (!_this3.isLocked()) { - _context11.next = 9; - break; - } - - resolve({ - error: { - message: "Login already in progress." - } - }); - return _context11.abrupt("return"); - - case 9: - _this3.lock(); - - _this3.notifyEvent(SFAuthManager.WillSignInEvent); - - _context11.next = 13; - return _this3.getAuthParamsForEmail(url, email, extraParams); - - case 13: - authParams = _context11.sent; // SF3 requires a unique identifier in the auth params - - authParams.identifier = email; - - if (!authParams.error) { - _context11.next = 18; - break; - } - - _this3.unlockAndResolve(resolve, authParams); - - return _context11.abrupt("return"); - - case 18: - if (!(!authParams || !authParams.pw_cost)) { - _context11.next = 21; - break; - } - - _this3.unlockAndResolve(resolve, { - error: { - message: "Invalid email or password." - } - }); - - return _context11.abrupt("return"); - - case 21: - if (SFJS.supportedVersions().includes(authParams.version)) { - _context11.next = 25; - break; - } - - if (SFJS.isVersionNewerThanLibraryVersion(authParams.version)) { - // The user has a new account type, but is signing in to an older client. - message = "This version of the application does not support your newer account type. Please upgrade to the latest version of Standard Notes to sign in."; - } else { - // The user has a very old account type, which is no longer supported by this client - message = "The protocol version associated with your account is outdated and no longer supported by this application. Please visit standardnotes.org/help/security for more information."; - } - - _this3.unlockAndResolve(resolve, { - error: { - message: message - } - }); - - return _context11.abrupt("return"); - - case 25: - if (!SFJS.isProtocolVersionOutdated(authParams.version)) { - _context11.next = 32; - break; - } - - _message = "The encryption version for your account, " + authParams.version + ", is outdated and requires upgrade. You may proceed with login, but are advised to perform a security update using the web or desktop application. Please visit standardnotes.org/help/security for more information."; - abort = false; - _context11.next = 30; - return _this3.alertManager.confirm({ - title: "Update Needed", - text: _message, - confirmButtonText: "Sign In" - }).catch(function () { - _this3.unlockAndResolve(resolve, { - error: {} - }); - - abort = true; - }); - - case 30: - if (!abort) { - _context11.next = 32; - break; - } - - return _context11.abrupt("return"); - - case 32: - if (SFJS.supportsPasswordDerivationCost(authParams.pw_cost)) { - _context11.next = 36; - break; - } - - _message2 = "Your account was created on a platform with higher security capabilities than this browser supports. " + "If we attempted to generate your login keys here, it would take hours. " + "Please use a browser with more up to date security capabilities, like Google Chrome or Firefox, to log in."; - - _this3.unlockAndResolve(resolve, { - error: { - message: _message2 - } - }); - - return _context11.abrupt("return"); - - case 36: - minimum = SFJS.costMinimumForVersion(authParams.version); - - if (!(authParams.pw_cost < minimum)) { - _context11.next = 41; - break; - } - - _message3 = "Unable to login due to insecure password parameters. Please visit standardnotes.org/help/security for more information."; - - _this3.unlockAndResolve(resolve, { - error: { - message: _message3 - } - }); - - return _context11.abrupt("return"); - - case 41: - if (!strictSignin) { - _context11.next = 47; - break; - } // Refuse sign in if authParams.version is anything but the latest version - - - latestVersion = SFJS.version(); - - if (!(authParams.version !== latestVersion)) { - _context11.next = 47; - break; - } - - _message4 = "Strict sign in refused server sign in parameters. The latest security version is " + latestVersion + ", but your account is reported to have version " + authParams.version + ". If you'd like to proceed with sign in anyway, please disable strict sign in and try again."; - - _this3.unlockAndResolve(resolve, { - error: { - message: _message4 - } - }); - - return _context11.abrupt("return"); - - case 47: - _context11.next = 49; - return SFJS.crypto.computeEncryptionKeysForUser(password, authParams); - - case 49: - keys = _context11.sent; - requestUrl = url + "/auth/sign_in"; - params = _.merge({ - password: keys.pw, - email: email - }, extraParams); - - _this3.httpManager.postAbsolute(requestUrl, params, function () { - var _ref12 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee10(response) { - return regeneratorRuntime.wrap(function _callee10$(_context10) { - while (1) { - switch (_context10.prev = _context10.next) { - case 0: - _context10.next = 2; - return _this3.handleAuthResponse(response, email, url, authParams, keys); - - case 2: - _this3.notifyEvent(SFAuthManager.DidSignInEvent); - - _this3.$timeout(function () { - return _this3.unlockAndResolve(resolve, response); - }); - - case 4: - case "end": - return _context10.stop(); - } - } - }, _callee10, _this3); - })); - - return function (_x15) { - return _ref12.apply(this, arguments); - }; - }(), function (response) { - console.error("Error logging in", response); - - if ((typeof response === "undefined" ? "undefined" : _typeof(response)) !== 'object') { - response = { - error: { - message: "A server error occurred while trying to sign in. Please try again." - } - }; - } - - _this3.$timeout(function () { - return _this3.unlockAndResolve(resolve, response); - }); - }); - - case 53: - case "end": - return _context11.stop(); - } - } - }, _callee11, _this3); - })); - - return function (_x13, _x14) { - return _ref11.apply(this, arguments); - }; - }())); - - case 1: - case "end": - return _context12.stop(); - } - } - }, _callee12, this); - })); - - function login(_x8, _x9, _x10, _x11, _x12) { - return _ref10.apply(this, arguments); - } - - return login; - }() - }, { - key: "register", - value: function register(url, email, password) { - var _this4 = this; - - return new Promise(function () { - var _ref13 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee14(resolve, reject) { - var results, keys, authParams, requestUrl, params; - return regeneratorRuntime.wrap(function _callee14$(_context14) { - while (1) { - switch (_context14.prev = _context14.next) { - case 0: - if (!_this4.isLocked()) { - _context14.next = 3; - break; - } - - resolve({ - error: { - message: "Register already in progress." - } - }); - return _context14.abrupt("return"); - - case 3: - _this4.lock(); - - _context14.next = 6; - return SFJS.crypto.generateInitialKeysAndAuthParamsForUser(email, password); - - case 6: - results = _context14.sent; - keys = results.keys; - authParams = results.authParams; - requestUrl = url + "/auth"; - params = _.merge({ - password: keys.pw, - email: email - }, authParams); - - _this4.httpManager.postAbsolute(requestUrl, params, function () { - var _ref14 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee13(response) { - return regeneratorRuntime.wrap(function _callee13$(_context13) { - while (1) { - switch (_context13.prev = _context13.next) { - case 0: - _context13.next = 2; - return _this4.handleAuthResponse(response, email, url, authParams, keys); - - case 2: - _this4.unlockAndResolve(resolve, response); - - case 3: - case "end": - return _context13.stop(); - } - } - }, _callee13, _this4); - })); - - return function (_x18) { - return _ref14.apply(this, arguments); - }; - }(), function (response) { - console.error("Registration error", response); - - if ((typeof response === "undefined" ? "undefined" : _typeof(response)) !== 'object') { - response = { - error: { - message: "A server error occurred while trying to register. Please try again." - } - }; - } - - _this4.unlockAndResolve(resolve, response); - }); - - case 12: - case "end": - return _context14.stop(); - } - } - }, _callee14, _this4); - })); - - return function (_x16, _x17) { - return _ref13.apply(this, arguments); - }; - }()); - } - }, { - key: "changePassword", - value: function () { - var _ref15 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee17(url, email, current_server_pw, newKeys, newAuthParams) { - var _this5 = this; - - return regeneratorRuntime.wrap(function _callee17$(_context17) { - while (1) { - switch (_context17.prev = _context17.next) { - case 0: - return _context17.abrupt("return", new Promise(function () { - var _ref16 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee16(resolve, reject) { - var newServerPw, requestUrl, params; - return regeneratorRuntime.wrap(function _callee16$(_context16) { - while (1) { - switch (_context16.prev = _context16.next) { - case 0: - if (!_this5.isLocked()) { - _context16.next = 3; - break; - } - - resolve({ - error: { - message: "Change password already in progress." - } - }); - return _context16.abrupt("return"); - - case 3: - _this5.lock(); - - newServerPw = newKeys.pw; - requestUrl = url + "/auth/change_pw"; - params = _.merge({ - new_password: newServerPw, - current_password: current_server_pw - }, newAuthParams); - - _this5.httpManager.postAbsolute(requestUrl, params, function () { - var _ref17 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee15(response) { - return regeneratorRuntime.wrap(function _callee15$(_context15) { - while (1) { - switch (_context15.prev = _context15.next) { - case 0: - _context15.next = 2; - return _this5.handleAuthResponse(response, email, null, newAuthParams, newKeys); - - case 2: - _this5.unlockAndResolve(resolve, response); - - case 3: - case "end": - return _context15.stop(); - } - } - }, _callee15, _this5); - })); - - return function (_x26) { - return _ref17.apply(this, arguments); - }; - }(), function (response) { - if ((typeof response === "undefined" ? "undefined" : _typeof(response)) !== 'object') { - response = { - error: { - message: "Something went wrong while changing your password. Your password was not changed. Please try again." - } - }; - } - - _this5.unlockAndResolve(resolve, response); - }); - - case 8: - case "end": - return _context16.stop(); - } - } - }, _callee16, _this5); - })); - - return function (_x24, _x25) { - return _ref16.apply(this, arguments); - }; - }())); - - case 1: - case "end": - return _context17.stop(); - } - } - }, _callee17, this); - })); - - function changePassword(_x19, _x20, _x21, _x22, _x23) { - return _ref15.apply(this, arguments); - } - - return changePassword; - }() - }, { - key: "handleAuthResponse", - value: function () { - var _ref18 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee18(response, email, url, authParams, keys) { - return regeneratorRuntime.wrap(function _callee18$(_context18) { - while (1) { - switch (_context18.prev = _context18.next) { - case 0: - if (!url) { - _context18.next = 3; - break; - } - - _context18.next = 3; - return this.storageManager.setItem("server", url); - - case 3: - this._authParams = authParams; - _context18.next = 6; - return this.storageManager.setItem("auth_params", JSON.stringify(authParams)); - - case 6: - _context18.next = 8; - return this.storageManager.setItem("jwt", response.token); - - case 8: - return _context18.abrupt("return", this.saveKeys(keys)); - - case 9: - case "end": - return _context18.stop(); - } - } - }, _callee18, this); - })); - - function handleAuthResponse(_x27, _x28, _x29, _x30, _x31) { - return _ref18.apply(this, arguments); - } - - return handleAuthResponse; - }() - }]); - - return SFAuthManager; - }(); - - ; - var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : null; - - var SFHttpManager = exports.SFHttpManager = function () { - function SFHttpManager(timeout) { - _classCallCheck(this, SFHttpManager); // calling callbacks in a $timeout allows UI to update - - - this.$timeout = timeout || setTimeout.bind(globalScope); - } - - _createClass(SFHttpManager, [{ - key: "setJWTRequestHandler", - value: function setJWTRequestHandler(handler) { - this.jwtRequestHandler = handler; - } - }, { - key: "setAuthHeadersForRequest", - value: function () { - var _ref19 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee19(request) { - var token; - return regeneratorRuntime.wrap(function _callee19$(_context19) { - while (1) { - switch (_context19.prev = _context19.next) { - case 0: - _context19.next = 2; - return this.jwtRequestHandler(); - - case 2: - token = _context19.sent; - - if (token) { - request.setRequestHeader('Authorization', 'Bearer ' + token); - } - - case 4: - case "end": - return _context19.stop(); - } - } - }, _callee19, this); - })); - - function setAuthHeadersForRequest(_x32) { - return _ref19.apply(this, arguments); - } - - return setAuthHeadersForRequest; - }() - }, { - key: "postAbsolute", - value: function () { - var _ref20 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee20(url, params, onsuccess, onerror) { - return regeneratorRuntime.wrap(function _callee20$(_context20) { - while (1) { - switch (_context20.prev = _context20.next) { - case 0: - return _context20.abrupt("return", this.httpRequest("post", url, params, onsuccess, onerror)); - - case 1: - case "end": - return _context20.stop(); - } - } - }, _callee20, this); - })); - - function postAbsolute(_x33, _x34, _x35, _x36) { - return _ref20.apply(this, arguments); - } - - return postAbsolute; - }() - }, { - key: "patchAbsolute", - value: function () { - var _ref21 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee21(url, params, onsuccess, onerror) { - return regeneratorRuntime.wrap(function _callee21$(_context21) { - while (1) { - switch (_context21.prev = _context21.next) { - case 0: - return _context21.abrupt("return", this.httpRequest("patch", url, params, onsuccess, onerror)); - - case 1: - case "end": - return _context21.stop(); - } - } - }, _callee21, this); - })); - - function patchAbsolute(_x37, _x38, _x39, _x40) { - return _ref21.apply(this, arguments); - } - - return patchAbsolute; - }() - }, { - key: "getAbsolute", - value: function () { - var _ref22 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee22(url, params, onsuccess, onerror) { - return regeneratorRuntime.wrap(function _callee22$(_context22) { - while (1) { - switch (_context22.prev = _context22.next) { - case 0: - return _context22.abrupt("return", this.httpRequest("get", url, params, onsuccess, onerror)); - - case 1: - case "end": - return _context22.stop(); - } - } - }, _callee22, this); - })); - - function getAbsolute(_x41, _x42, _x43, _x44) { - return _ref22.apply(this, arguments); - } - - return getAbsolute; - }() - }, { - key: "httpRequest", - value: function () { - var _ref23 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee24(verb, url, params, onsuccess, onerror) { - var _this6 = this; - - return regeneratorRuntime.wrap(function _callee24$(_context24) { - while (1) { - switch (_context24.prev = _context24.next) { - case 0: - return _context24.abrupt("return", new Promise(function () { - var _ref24 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee23(resolve, reject) { - var xmlhttp; - return regeneratorRuntime.wrap(function _callee23$(_context23) { - while (1) { - switch (_context23.prev = _context23.next) { - case 0: - xmlhttp = new XMLHttpRequest(); - - xmlhttp.onreadystatechange = function () { - if (xmlhttp.readyState == 4) { - var response = xmlhttp.responseText; - - if (response) { - try { - response = JSON.parse(response); - } catch (e) {} - } - - if (xmlhttp.status >= 200 && xmlhttp.status <= 299) { - _this6.$timeout(function () { - onsuccess(response); - resolve(response); - }); - } else { - console.error("Request error:", response); - - _this6.$timeout(function () { - onerror(response, xmlhttp.status); - reject(response); - }); - } - } - }; - - if (verb == "get" && Object.keys(params).length > 0) { - url = url + _this6.formatParams(params); - } - - xmlhttp.open(verb, url, true); - _context23.next = 6; - return _this6.setAuthHeadersForRequest(xmlhttp); - - case 6: - xmlhttp.setRequestHeader('Content-type', 'application/json'); - - if (verb == "post" || verb == "patch") { - xmlhttp.send(JSON.stringify(params)); - } else { - xmlhttp.send(); - } - - case 8: - case "end": - return _context23.stop(); - } - } - }, _callee23, _this6); - })); - - return function (_x50, _x51) { - return _ref24.apply(this, arguments); - }; - }())); - - case 1: - case "end": - return _context24.stop(); - } - } - }, _callee24, this); - })); - - function httpRequest(_x45, _x46, _x47, _x48, _x49) { - return _ref23.apply(this, arguments); - } - - return httpRequest; - }() - }, { - key: "formatParams", - value: function formatParams(params) { - return "?" + Object.keys(params).map(function (key) { - return key + "=" + encodeURIComponent(params[key]); - }).join("&"); - } - }]); - - return SFHttpManager; - }(); - - ; - - var SFMigrationManager = exports.SFMigrationManager = function () { - function SFMigrationManager(modelManager, syncManager, storageManager, authManager) { - var _this7 = this; - - _classCallCheck(this, SFMigrationManager); - - this.modelManager = modelManager; - this.syncManager = syncManager; - this.storageManager = storageManager; - this.completionHandlers = []; - this.loadMigrations(); // The syncManager used to dispatch a param called 'initialSync' in the 'sync:completed' event - // to let us know of the first sync completion after login. - // however it was removed as it was deemed to be unreliable (returned wrong value when a single sync request repeats on completion for pagination) - // We'll now use authManager's events instead - - var didReceiveSignInEvent = false; - var signInHandler = authManager.addEventHandler(function (event) { - if (event == SFAuthManager.DidSignInEvent) { - didReceiveSignInEvent = true; - } - }); - this.syncManager.addEventHandler(function () { - var _ref25 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee25(event, data) { - var dataLoadedEvent, syncCompleteEvent, completedList, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, migrationName, migration; - - return regeneratorRuntime.wrap(function _callee25$(_context25) { - while (1) { - switch (_context25.prev = _context25.next) { - case 0: - dataLoadedEvent = event == "local-data-loaded"; - syncCompleteEvent = event == "sync:completed"; - - if (!(dataLoadedEvent || syncCompleteEvent)) { - _context25.next = 40; - break; - } - - if (dataLoadedEvent) { - _this7.receivedLocalDataEvent = true; - } else if (syncCompleteEvent) { - _this7.receivedSyncCompletedEvent = true; - } // We want to run pending migrations only after local data has been loaded, and a sync has been completed. - - - if (!(_this7.receivedLocalDataEvent && _this7.receivedSyncCompletedEvent)) { - _context25.next = 40; - break; - } - - if (!didReceiveSignInEvent) { - _context25.next = 39; - break; - } // Reset our collected state about sign in - - - didReceiveSignInEvent = false; - authManager.removeEventHandler(signInHandler); // If initial online sync, clear any completed migrations that occurred while offline, - // so they can run again now that we have updated user items. Only clear migrations that - // don't have `runOnlyOnce` set - - _context25.next = 10; - return _this7.getCompletedMigrations(); - - case 10: - completedList = _context25.sent.slice(); - _iteratorNormalCompletion2 = true; - _didIteratorError2 = false; - _iteratorError2 = undefined; - _context25.prev = 14; - _iterator2 = completedList[Symbol.iterator](); - - case 16: - if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { - _context25.next = 25; - break; - } - - migrationName = _step2.value; - _context25.next = 20; - return _this7.migrationForEncodedName(migrationName); - - case 20: - migration = _context25.sent; - - if (!migration.runOnlyOnce) { - _.pull(_this7._completed, migrationName); - } - - case 22: - _iteratorNormalCompletion2 = true; - _context25.next = 16; - break; - - case 25: - _context25.next = 31; - break; - - case 27: - _context25.prev = 27; - _context25.t0 = _context25["catch"](14); - _didIteratorError2 = true; - _iteratorError2 = _context25.t0; - - case 31: - _context25.prev = 31; - _context25.prev = 32; - - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - - case 34: - _context25.prev = 34; - - if (!_didIteratorError2) { - _context25.next = 37; - break; - } - - throw _iteratorError2; - - case 37: - return _context25.finish(34); - - case 38: - return _context25.finish(31); - - case 39: - _this7.runPendingMigrations(); - - case 40: - case "end": - return _context25.stop(); - } - } - }, _callee25, _this7, [[14, 27, 31, 39], [32,, 34, 38]]); - })); - - return function (_x52, _x53) { - return _ref25.apply(this, arguments); - }; - }()); - } - - _createClass(SFMigrationManager, [{ - key: "addCompletionHandler", - value: function addCompletionHandler(handler) { - this.completionHandlers.push(handler); - } - }, { - key: "removeCompletionHandler", - value: function removeCompletionHandler(handler) { - _.pull(this.completionHandlers, handler); - } - }, { - key: "migrationForEncodedName", - value: function () { - var _ref26 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee26(name) { - var decoded; - return regeneratorRuntime.wrap(function _callee26$(_context26) { - while (1) { - switch (_context26.prev = _context26.next) { - case 0: - _context26.next = 2; - return this.decode(name); - - case 2: - decoded = _context26.sent; - return _context26.abrupt("return", this.migrations.find(function (migration) { - return migration.name == decoded; - })); - - case 4: - case "end": - return _context26.stop(); - } - } - }, _callee26, this); - })); - - function migrationForEncodedName(_x54) { - return _ref26.apply(this, arguments); - } - - return migrationForEncodedName; - }() - }, { - key: "loadMigrations", - value: function loadMigrations() { - this.migrations = this.registeredMigrations(); - } - }, { - key: "registeredMigrations", - value: function registeredMigrations() {// Subclasses should return an array of migrations here. - // Migrations should have a unique `name`, `content_type`, - // and `handler`, which is a function that accepts an array of matching items to migration. - } - }, { - key: "runPendingMigrations", - value: function () { - var _ref27 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee27() { - var pending, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, migration, _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, item, _iteratorNormalCompletion7, _didIteratorError7, _iteratorError7, _iterator7, _step7, _iteratorNormalCompletion5, _didIteratorError5, _iteratorError5, _iterator5, _step5, _iteratorNormalCompletion6, _didIteratorError6, _iteratorError6, _iterator6, _step6, handler; - - return regeneratorRuntime.wrap(function _callee27$(_context27) { - while (1) { - switch (_context27.prev = _context27.next) { - case 0: - _context27.next = 2; - return this.getPendingMigrations(); - - case 2: - pending = _context27.sent; // run in pre loop, keeping in mind that a migration may be run twice: when offline then again when signing in. - // we need to reset the items to a new array. - - _iteratorNormalCompletion3 = true; - _didIteratorError3 = false; - _iteratorError3 = undefined; - _context27.prev = 6; - - for (_iterator3 = pending[Symbol.iterator](); !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - migration = _step3.value; - migration.items = []; - } - - _context27.next = 14; - break; - - case 10: - _context27.prev = 10; - _context27.t0 = _context27["catch"](6); - _didIteratorError3 = true; - _iteratorError3 = _context27.t0; - - case 14: - _context27.prev = 14; - _context27.prev = 15; - - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - - case 17: - _context27.prev = 17; - - if (!_didIteratorError3) { - _context27.next = 20; - break; - } - - throw _iteratorError3; - - case 20: - return _context27.finish(17); - - case 21: - return _context27.finish(14); - - case 22: - _iteratorNormalCompletion4 = true; - _didIteratorError4 = false; - _iteratorError4 = undefined; - _context27.prev = 25; - _iterator4 = this.modelManager.allNondummyItems[Symbol.iterator](); - - case 27: - if (_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done) { - _context27.next = 51; - break; - } - - item = _step4.value; - _iteratorNormalCompletion7 = true; - _didIteratorError7 = false; - _iteratorError7 = undefined; - _context27.prev = 32; - - for (_iterator7 = pending[Symbol.iterator](); !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { - migration = _step7.value; - - if (item.content_type == migration.content_type) { - migration.items.push(item); - } - } - - _context27.next = 40; - break; - - case 36: - _context27.prev = 36; - _context27.t1 = _context27["catch"](32); - _didIteratorError7 = true; - _iteratorError7 = _context27.t1; - - case 40: - _context27.prev = 40; - _context27.prev = 41; - - if (!_iteratorNormalCompletion7 && _iterator7.return) { - _iterator7.return(); - } - - case 43: - _context27.prev = 43; - - if (!_didIteratorError7) { - _context27.next = 46; - break; - } - - throw _iteratorError7; - - case 46: - return _context27.finish(43); - - case 47: - return _context27.finish(40); - - case 48: - _iteratorNormalCompletion4 = true; - _context27.next = 27; - break; - - case 51: - _context27.next = 57; - break; - - case 53: - _context27.prev = 53; - _context27.t2 = _context27["catch"](25); - _didIteratorError4 = true; - _iteratorError4 = _context27.t2; - - case 57: - _context27.prev = 57; - _context27.prev = 58; - - if (!_iteratorNormalCompletion4 && _iterator4.return) { - _iterator4.return(); - } - - case 60: - _context27.prev = 60; - - if (!_didIteratorError4) { - _context27.next = 63; - break; - } - - throw _iteratorError4; - - case 63: - return _context27.finish(60); - - case 64: - return _context27.finish(57); - - case 65: - _iteratorNormalCompletion5 = true; - _didIteratorError5 = false; - _iteratorError5 = undefined; - _context27.prev = 68; - _iterator5 = pending[Symbol.iterator](); - - case 70: - if (_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done) { - _context27.next = 81; - break; - } - - migration = _step5.value; - - if (!(migration.items && migration.items.length > 0 || migration.customHandler)) { - _context27.next = 77; - break; - } - - _context27.next = 75; - return this.runMigration(migration, migration.items); - - case 75: - _context27.next = 78; - break; - - case 77: - this.markMigrationCompleted(migration); - - case 78: - _iteratorNormalCompletion5 = true; - _context27.next = 70; - break; - - case 81: - _context27.next = 87; - break; - - case 83: - _context27.prev = 83; - _context27.t3 = _context27["catch"](68); - _didIteratorError5 = true; - _iteratorError5 = _context27.t3; - - case 87: - _context27.prev = 87; - _context27.prev = 88; - - if (!_iteratorNormalCompletion5 && _iterator5.return) { - _iterator5.return(); - } - - case 90: - _context27.prev = 90; - - if (!_didIteratorError5) { - _context27.next = 93; - break; - } - - throw _iteratorError5; - - case 93: - return _context27.finish(90); - - case 94: - return _context27.finish(87); - - case 95: - _iteratorNormalCompletion6 = true; - _didIteratorError6 = false; - _iteratorError6 = undefined; - _context27.prev = 98; - - for (_iterator6 = this.completionHandlers[Symbol.iterator](); !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { - handler = _step6.value; - handler(); - } - - _context27.next = 106; - break; - - case 102: - _context27.prev = 102; - _context27.t4 = _context27["catch"](98); - _didIteratorError6 = true; - _iteratorError6 = _context27.t4; - - case 106: - _context27.prev = 106; - _context27.prev = 107; - - if (!_iteratorNormalCompletion6 && _iterator6.return) { - _iterator6.return(); - } - - case 109: - _context27.prev = 109; - - if (!_didIteratorError6) { - _context27.next = 112; - break; - } - - throw _iteratorError6; - - case 112: - return _context27.finish(109); - - case 113: - return _context27.finish(106); - - case 114: - case "end": - return _context27.stop(); - } - } - }, _callee27, this, [[6, 10, 14, 22], [15,, 17, 21], [25, 53, 57, 65], [32, 36, 40, 48], [41,, 43, 47], [58,, 60, 64], [68, 83, 87, 95], [88,, 90, 94], [98, 102, 106, 114], [107,, 109, 113]]); - })); - - function runPendingMigrations() { - return _ref27.apply(this, arguments); - } - - return runPendingMigrations; - }() - }, { - key: "encode", - value: function () { - var _ref28 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee28(text) { - return regeneratorRuntime.wrap(function _callee28$(_context28) { - while (1) { - switch (_context28.prev = _context28.next) { - case 0: - return _context28.abrupt("return", window.btoa(text)); - - case 1: - case "end": - return _context28.stop(); - } - } - }, _callee28, this); - })); - - function encode(_x55) { - return _ref28.apply(this, arguments); - } - - return encode; - }() - }, { - key: "decode", - value: function () { - var _ref29 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee29(text) { - return regeneratorRuntime.wrap(function _callee29$(_context29) { - while (1) { - switch (_context29.prev = _context29.next) { - case 0: - return _context29.abrupt("return", window.atob(text)); - - case 1: - case "end": - return _context29.stop(); - } - } - }, _callee29, this); - })); - - function decode(_x56) { - return _ref29.apply(this, arguments); - } - - return decode; - }() - }, { - key: "getCompletedMigrations", - value: function () { - var _ref30 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee30() { - var rawCompleted; - return regeneratorRuntime.wrap(function _callee30$(_context30) { - while (1) { - switch (_context30.prev = _context30.next) { - case 0: - if (this._completed) { - _context30.next = 5; - break; - } - - _context30.next = 3; - return this.storageManager.getItem("migrations"); - - case 3: - rawCompleted = _context30.sent; - - if (rawCompleted) { - this._completed = JSON.parse(rawCompleted); - } else { - this._completed = []; - } - - case 5: - return _context30.abrupt("return", this._completed); - - case 6: - case "end": - return _context30.stop(); - } - } - }, _callee30, this); - })); - - function getCompletedMigrations() { - return _ref30.apply(this, arguments); - } - - return getCompletedMigrations; - }() - }, { - key: "getPendingMigrations", - value: function () { - var _ref31 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee31() { - var completed, pending, _iteratorNormalCompletion8, _didIteratorError8, _iteratorError8, _iterator8, _step8, migration; - - return regeneratorRuntime.wrap(function _callee31$(_context31) { - while (1) { - switch (_context31.prev = _context31.next) { - case 0: - _context31.next = 2; - return this.getCompletedMigrations(); - - case 2: - completed = _context31.sent; - pending = []; - _iteratorNormalCompletion8 = true; - _didIteratorError8 = false; - _iteratorError8 = undefined; - _context31.prev = 7; - _iterator8 = this.migrations[Symbol.iterator](); - - case 9: - if (_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done) { - _context31.next = 22; - break; - } - - migration = _step8.value; - _context31.t0 = completed; - _context31.next = 14; - return this.encode(migration.name); - - case 14: - _context31.t1 = _context31.sent; - _context31.t2 = _context31.t0.indexOf.call(_context31.t0, _context31.t1); - _context31.t3 = -1; - - if (!(_context31.t2 == _context31.t3)) { - _context31.next = 19; - break; - } - - pending.push(migration); - - case 19: - _iteratorNormalCompletion8 = true; - _context31.next = 9; - break; - - case 22: - _context31.next = 28; - break; - - case 24: - _context31.prev = 24; - _context31.t4 = _context31["catch"](7); - _didIteratorError8 = true; - _iteratorError8 = _context31.t4; - - case 28: - _context31.prev = 28; - _context31.prev = 29; - - if (!_iteratorNormalCompletion8 && _iterator8.return) { - _iterator8.return(); - } - - case 31: - _context31.prev = 31; - - if (!_didIteratorError8) { - _context31.next = 34; - break; - } - - throw _iteratorError8; - - case 34: - return _context31.finish(31); - - case 35: - return _context31.finish(28); - - case 36: - return _context31.abrupt("return", pending); - - case 37: - case "end": - return _context31.stop(); - } - } - }, _callee31, this, [[7, 24, 28, 36], [29,, 31, 35]]); - })); - - function getPendingMigrations() { - return _ref31.apply(this, arguments); - } - - return getPendingMigrations; - }() - }, { - key: "markMigrationCompleted", - value: function () { - var _ref32 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee32(migration) { - var completed; - return regeneratorRuntime.wrap(function _callee32$(_context32) { - while (1) { - switch (_context32.prev = _context32.next) { - case 0: - _context32.next = 2; - return this.getCompletedMigrations(); - - case 2: - completed = _context32.sent; - _context32.t0 = completed; - _context32.next = 6; - return this.encode(migration.name); - - case 6: - _context32.t1 = _context32.sent; - - _context32.t0.push.call(_context32.t0, _context32.t1); - - this.storageManager.setItem("migrations", JSON.stringify(completed)); - migration.running = false; - - case 10: - case "end": - return _context32.stop(); - } - } - }, _callee32, this); - })); - - function markMigrationCompleted(_x57) { - return _ref32.apply(this, arguments); - } - - return markMigrationCompleted; - }() - }, { - key: "runMigration", - value: function () { - var _ref33 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee33(migration, items) { - var _this8 = this; - - return regeneratorRuntime.wrap(function _callee33$(_context33) { - while (1) { - switch (_context33.prev = _context33.next) { - case 0: - if (!migration.running) { - _context33.next = 2; - break; - } - - return _context33.abrupt("return"); - - case 2: - console.log("Running migration:", migration.name); - migration.running = true; - - if (!migration.customHandler) { - _context33.next = 8; - break; - } - - return _context33.abrupt("return", migration.customHandler().then(function () { - _this8.markMigrationCompleted(migration); - })); - - case 8: - return _context33.abrupt("return", migration.handler(items).then(function () { - _this8.markMigrationCompleted(migration); - })); - - case 9: - case "end": - return _context33.stop(); - } - } - }, _callee33, this); - })); - - function runMigration(_x58, _x59) { - return _ref33.apply(this, arguments); - } - - return runMigration; - }() - }]); - - return SFMigrationManager; - }(); - - ; - - var SFModelManager = exports.SFModelManager = function () { - function SFModelManager(timeout) { - _classCallCheck(this, SFModelManager); - - SFModelManager.MappingSourceRemoteRetrieved = "MappingSourceRemoteRetrieved"; - SFModelManager.MappingSourceRemoteSaved = "MappingSourceRemoteSaved"; - SFModelManager.MappingSourceLocalSaved = "MappingSourceLocalSaved"; - SFModelManager.MappingSourceLocalRetrieved = "MappingSourceLocalRetrieved"; - SFModelManager.MappingSourceComponentRetrieved = "MappingSourceComponentRetrieved"; - SFModelManager.MappingSourceDesktopInstalled = "MappingSourceDesktopInstalled"; // When a component is installed by the desktop and some of its values change - - SFModelManager.MappingSourceRemoteActionRetrieved = "MappingSourceRemoteActionRetrieved"; - /* aciton-based Extensions like note history */ - - SFModelManager.MappingSourceFileImport = "MappingSourceFileImport"; - - SFModelManager.isMappingSourceRetrieved = function (source) { - return [SFModelManager.MappingSourceRemoteRetrieved, SFModelManager.MappingSourceComponentRetrieved, SFModelManager.MappingSourceRemoteActionRetrieved].includes(source); - }; - - this.$timeout = timeout || setTimeout.bind(window); - this.itemSyncObservers = []; - this.itemsPendingRemoval = []; - this.items = []; - this.itemsHash = {}; - this.missedReferences = {}; - this.uuidChangeObservers = []; - } - - _createClass(SFModelManager, [{ - key: "handleSignout", - value: function handleSignout() { - this.items.length = 0; - this.itemsHash = {}; - this.itemsPendingRemoval.length = 0; - this.missedReferences = {}; - } - }, { - key: "addModelUuidChangeObserver", - value: function addModelUuidChangeObserver(id, callback) { - this.uuidChangeObservers.push({ - id: id, - callback: callback - }); - } - }, { - key: "notifyObserversOfUuidChange", - value: function notifyObserversOfUuidChange(oldItem, newItem) { - var _iteratorNormalCompletion9 = true; - var _didIteratorError9 = false; - var _iteratorError9 = undefined; - - try { - for (var _iterator9 = this.uuidChangeObservers[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) { - var observer = _step9.value; - observer.callback(oldItem, newItem); - } - } catch (err) { - _didIteratorError9 = true; - _iteratorError9 = err; - } finally { - try { - if (!_iteratorNormalCompletion9 && _iterator9.return) { - _iterator9.return(); - } - } finally { - if (_didIteratorError9) { - throw _iteratorError9; - } - } - } - } - }, { - key: "alternateUUIDForItem", - value: function () { - var _ref34 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee34(item) { - var newItem, _iteratorNormalCompletion10, _didIteratorError10, _iteratorError10, _iterator10, _step10, referencingObject; - - return regeneratorRuntime.wrap(function _callee34$(_context34) { - while (1) { - switch (_context34.prev = _context34.next) { - case 0: - // We need to clone this item and give it a new uuid, then delete item with old uuid from db (you can't modify uuid's in our indexeddb setup) - newItem = this.createItem(item, true); - _context34.next = 3; - return SFJS.crypto.generateUUID(); - - case 3: - newItem.uuid = _context34.sent; // Update uuids of relationships - - newItem.informReferencesOfUUIDChange(item.uuid, newItem.uuid); - this.informModelsOfUUIDChangeForItem(newItem, item.uuid, newItem.uuid); // the new item should inherit the original's relationships - - _iteratorNormalCompletion10 = true; - _didIteratorError10 = false; - _iteratorError10 = undefined; - _context34.prev = 9; - - for (_iterator10 = item.referencingObjects[Symbol.iterator](); !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) { - referencingObject = _step10.value; - referencingObject.setIsNoLongerBeingReferencedBy(item); - item.setIsNoLongerBeingReferencedBy(referencingObject); - referencingObject.addItemAsRelationship(newItem); - referencingObject.setDirty(true); - } // Used to set up referencingObjects for new item (so that other items can now properly reference this new item) - - - _context34.next = 17; - break; - - case 13: - _context34.prev = 13; - _context34.t0 = _context34["catch"](9); - _didIteratorError10 = true; - _iteratorError10 = _context34.t0; - - case 17: - _context34.prev = 17; - _context34.prev = 18; - - if (!_iteratorNormalCompletion10 && _iterator10.return) { - _iterator10.return(); - } - - case 20: - _context34.prev = 20; - - if (!_didIteratorError10) { - _context34.next = 23; - break; - } - - throw _iteratorError10; - - case 23: - return _context34.finish(20); - - case 24: - return _context34.finish(17); - - case 25: - this.resolveReferencesForItem(newItem); - console.log(item.uuid, "-->", newItem.uuid); // Set to deleted, then run through mapping function so that observers can be notified - - item.deleted = true; - item.content.references = []; // Don't set dirty, because we don't need to sync old item. alternating uuid only occurs in two cases: - // signing in and merging offline data, or when a uuid-conflict occurs. In both cases, the original item never - // saves to a server, so doesn't need to be synced. - // informModelsOfUUIDChangeForItem may set this object to dirty, but we want to undo that here, so that the item gets deleted - // right away through the mapping function. - - item.setDirty(false); - this.mapResponseItemsToLocalModels([item], SFModelManager.MappingSourceLocalSaved); // add new item - - this.addItem(newItem); - newItem.setDirty(true); - this.notifyObserversOfUuidChange(item, newItem); - return _context34.abrupt("return", newItem); - - case 35: - case "end": - return _context34.stop(); - } - } - }, _callee34, this, [[9, 13, 17, 25], [18,, 20, 24]]); - })); - - function alternateUUIDForItem(_x60) { - return _ref34.apply(this, arguments); - } - - return alternateUUIDForItem; - }() - }, { - key: "informModelsOfUUIDChangeForItem", - value: function informModelsOfUUIDChangeForItem(newItem, oldUUID, newUUID) { - // some models that only have one-way relationships might be interested to hear that an item has changed its uuid - // for example, editors have a one way relationship with notes. When a note changes its UUID, it has no way to inform the editor - // to update its relationships - var _iteratorNormalCompletion11 = true; - var _didIteratorError11 = false; - var _iteratorError11 = undefined; - - try { - for (var _iterator11 = this.items[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) { - var model = _step11.value; - model.potentialItemOfInterestHasChangedItsUUID(newItem, oldUUID, newUUID); - } - } catch (err) { - _didIteratorError11 = true; - _iteratorError11 = err; - } finally { - try { - if (!_iteratorNormalCompletion11 && _iterator11.return) { - _iterator11.return(); - } - } finally { - if (_didIteratorError11) { - throw _iteratorError11; - } - } - } - } - }, { - key: "didSyncModelsOffline", - value: function didSyncModelsOffline(items) { - this.notifySyncObserversOfModels(items, SFModelManager.MappingSourceLocalSaved); - } - }, { - key: "mapResponseItemsToLocalModels", - value: function mapResponseItemsToLocalModels(items, source, sourceKey) { - return this.mapResponseItemsToLocalModelsWithOptions({ - items: items, - source: source, - sourceKey: sourceKey - }); - } - }, { - key: "mapResponseItemsToLocalModelsOmittingFields", - value: function mapResponseItemsToLocalModelsOmittingFields(items, omitFields, source, sourceKey) { - return this.mapResponseItemsToLocalModelsWithOptions({ - items: items, - omitFields: omitFields, - source: source, - sourceKey: sourceKey - }); - } - }, { - key: "mapResponseItemsToLocalModelsWithOptions", - value: function mapResponseItemsToLocalModelsWithOptions(_ref35) { - var items = _ref35.items, - omitFields = _ref35.omitFields, - source = _ref35.source, - sourceKey = _ref35.sourceKey, - options = _ref35.options; - var models = [], - processedObjects = [], - modelsToNotifyObserversOf = []; // first loop should add and process items - - var _iteratorNormalCompletion12 = true; - var _didIteratorError12 = false; - var _iteratorError12 = undefined; - - try { - for (var _iterator12 = items[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) { - var json_obj = _step12.value; - - if (!json_obj) { - continue; - } // content is missing if it has been sucessfullly decrypted but no content - - - var isMissingContent = !json_obj.content && !json_obj.errorDecrypting; - var isCorrupt = !json_obj.content_type || !json_obj.uuid; - - if ((isCorrupt || isMissingContent) && !json_obj.deleted) { - // An item that is not deleted should never have empty content - console.error("Server response item is corrupt:", json_obj); - continue; - } // Lodash's _.omit, which was previously used, seems to cause unexpected behavior - // when json_obj is an ES6 item class. So we instead manually omit each key. - - - if (Array.isArray(omitFields)) { - var _iteratorNormalCompletion15 = true; - var _didIteratorError15 = false; - var _iteratorError15 = undefined; - - try { - for (var _iterator15 = omitFields[Symbol.iterator](), _step15; !(_iteratorNormalCompletion15 = (_step15 = _iterator15.next()).done); _iteratorNormalCompletion15 = true) { - var key = _step15.value; - delete json_obj[key]; - } - } catch (err) { - _didIteratorError15 = true; - _iteratorError15 = err; - } finally { - try { - if (!_iteratorNormalCompletion15 && _iterator15.return) { - _iterator15.return(); - } - } finally { - if (_didIteratorError15) { - throw _iteratorError15; - } - } - } - } - - var item = this.findItem(json_obj.uuid); - - if (item) { - item.updateFromJSON(json_obj); // If an item goes through mapping, it can no longer be a dummy. - - item.dummy = false; - } - - if (this.itemsPendingRemoval.includes(json_obj.uuid)) { - _.pull(this.itemsPendingRemoval, json_obj.uuid); - - continue; - } - - var contentType = json_obj["content_type"] || item && item.content_type; - var unknownContentType = this.acceptableContentTypes && !this.acceptableContentTypes.includes(contentType); - - if (unknownContentType) { - continue; - } - - var isDirtyItemPendingDelete = false; - - if (json_obj.deleted == true) { - if (json_obj.dirty) { - // Item was marked as deleted but not yet synced - // We need to create this item as usual, but just not add it to individual arrays - // i.e add to this.items but not this.notes (so that it can be retrieved with getDirtyItems) - isDirtyItemPendingDelete = true; - } else { - if (item) { - modelsToNotifyObserversOf.push(item); - this.removeItemLocally(item); - } - - continue; - } - } - - if (!item) { - item = this.createItem(json_obj, true); - } - - this.addItem(item, isDirtyItemPendingDelete); // Observers do not need to handle items that errored while decrypting. - - if (!item.errorDecrypting) { - modelsToNotifyObserversOf.push(item); - } - - models.push(item); - processedObjects.push(json_obj); - } // second loop should process references - - } catch (err) { - _didIteratorError12 = true; - _iteratorError12 = err; - } finally { - try { - if (!_iteratorNormalCompletion12 && _iterator12.return) { - _iterator12.return(); - } - } finally { - if (_didIteratorError12) { - throw _iteratorError12; - } - } - } - - var _iteratorNormalCompletion13 = true; - var _didIteratorError13 = false; - var _iteratorError13 = undefined; - - try { - for (var _iterator13 = processedObjects.entries()[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) { - var _ref36 = _step13.value; - - var _ref37 = _slicedToArray(_ref36, 2); - - var index = _ref37[0]; - var _json_obj = _ref37[1]; - var model = models[index]; - - if (_json_obj.content) { - this.resolveReferencesForItem(model); - } - - model.didFinishSyncing(); - } - } catch (err) { - _didIteratorError13 = true; - _iteratorError13 = err; - } finally { - try { - if (!_iteratorNormalCompletion13 && _iterator13.return) { - _iterator13.return(); - } - } finally { - if (_didIteratorError13) { - throw _iteratorError13; - } - } - } - - var missedRefs = this.popMissedReferenceStructsForObjects(processedObjects); - - var _loop = function _loop(ref) { - var model = models.find(function (candidate) { - return candidate.uuid == ref.reference_uuid; - }); // Model should 100% be defined here, but let's not be too overconfident - - if (model) { - var itemWaitingForTheValueInThisCurrentLoop = ref.for_item; - itemWaitingForTheValueInThisCurrentLoop.addItemAsRelationship(model); - } - }; - - var _iteratorNormalCompletion14 = true; - var _didIteratorError14 = false; - var _iteratorError14 = undefined; - - try { - for (var _iterator14 = missedRefs[Symbol.iterator](), _step14; !(_iteratorNormalCompletion14 = (_step14 = _iterator14.next()).done); _iteratorNormalCompletion14 = true) { - var ref = _step14.value; - - _loop(ref); - } - } catch (err) { - _didIteratorError14 = true; - _iteratorError14 = err; - } finally { - try { - if (!_iteratorNormalCompletion14 && _iterator14.return) { - _iterator14.return(); - } - } finally { - if (_didIteratorError14) { - throw _iteratorError14; - } - } - } - - this.notifySyncObserversOfModels(modelsToNotifyObserversOf, source, sourceKey); - return models; - } - }, { - key: "missedReferenceBuildKey", - value: function missedReferenceBuildKey(referenceId, objectId) { - return referenceId + ":" + objectId; - } - }, { - key: "popMissedReferenceStructsForObjects", - value: function popMissedReferenceStructsForObjects(objects) { - if (!objects || objects.length == 0) { - return []; - } - - var results = []; - var toDelete = []; - var uuids = objects.map(function (item) { - return item.uuid; - }); - var genericUuidLength = uuids[0].length; - var keys = Object.keys(this.missedReferences); - var _iteratorNormalCompletion16 = true; - var _didIteratorError16 = false; - var _iteratorError16 = undefined; - - try { - for (var _iterator16 = keys[Symbol.iterator](), _step16; !(_iteratorNormalCompletion16 = (_step16 = _iterator16.next()).done); _iteratorNormalCompletion16 = true) { - var candidateKey = _step16.value; - /* - We used to do string.split to get at the UUID, but surprisingly, - the performance of this was about 20x worse then just getting the substring. - let matches = candidateKey.split(":")[0] == object.uuid; - */ - - var matches = uuids.includes(candidateKey.substring(0, genericUuidLength)); - - if (matches) { - results.push(this.missedReferences[candidateKey]); - toDelete.push(candidateKey); - } - } // remove from hash - - } catch (err) { - _didIteratorError16 = true; - _iteratorError16 = err; - } finally { - try { - if (!_iteratorNormalCompletion16 && _iterator16.return) { - _iterator16.return(); - } - } finally { - if (_didIteratorError16) { - throw _iteratorError16; - } - } - } - - var _iteratorNormalCompletion17 = true; - var _didIteratorError17 = false; - var _iteratorError17 = undefined; - - try { - for (var _iterator17 = toDelete[Symbol.iterator](), _step17; !(_iteratorNormalCompletion17 = (_step17 = _iterator17.next()).done); _iteratorNormalCompletion17 = true) { - var key = _step17.value; - delete this.missedReferences[key]; - } - } catch (err) { - _didIteratorError17 = true; - _iteratorError17 = err; - } finally { - try { - if (!_iteratorNormalCompletion17 && _iterator17.return) { - _iterator17.return(); - } - } finally { - if (_didIteratorError17) { - throw _iteratorError17; - } - } - } - - return results; - } - }, { - key: "resolveReferencesForItem", - value: function resolveReferencesForItem(item) { - var markReferencesDirty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (item.errorDecrypting) { - return; - } // console.log("resolveReferencesForItem", item, "references", item.contentObject.references); - - - var contentObject = item.contentObject; // If another client removes an item's references, this client won't pick up the removal unless - // we remove everything not present in the current list of references - - item.updateLocalRelationships(); - - if (!contentObject.references) { - return; - } - - var references = contentObject.references.slice(); // make copy, references will be modified in array - - var referencesIds = references.map(function (ref) { - return ref.uuid; - }); - var includeBlanks = true; - var referencesObjectResults = this.findItems(referencesIds, includeBlanks); - var _iteratorNormalCompletion18 = true; - var _didIteratorError18 = false; - var _iteratorError18 = undefined; - - try { - for (var _iterator18 = referencesObjectResults.entries()[Symbol.iterator](), _step18; !(_iteratorNormalCompletion18 = (_step18 = _iterator18.next()).done); _iteratorNormalCompletion18 = true) { - var _ref38 = _step18.value; - - var _ref39 = _slicedToArray(_ref38, 2); - - var index = _ref39[0]; - var referencedItem = _ref39[1]; - - if (referencedItem) { - item.addItemAsRelationship(referencedItem); - - if (markReferencesDirty) { - referencedItem.setDirty(true); - } - } else { - var missingRefId = referencesIds[index]; // Allows mapper to check when missing reference makes it through the loop, - // and then runs resolveReferencesForItem again for the original item. - - var mappingKey = this.missedReferenceBuildKey(missingRefId, item.uuid); - - if (!this.missedReferences[mappingKey]) { - var missedRef = { - reference_uuid: missingRefId, - for_item: item - }; - this.missedReferences[mappingKey] = missedRef; - } - } - } - } catch (err) { - _didIteratorError18 = true; - _iteratorError18 = err; - } finally { - try { - if (!_iteratorNormalCompletion18 && _iterator18.return) { - _iterator18.return(); - } - } finally { - if (_didIteratorError18) { - throw _iteratorError18; - } - } - } - } - /* Note that this function is public, and can also be called manually (desktopManager uses it) */ - - }, { - key: "notifySyncObserversOfModels", - value: function notifySyncObserversOfModels(models, source, sourceKey) { - var _this9 = this; // Make sure `let` is used in the for loops instead of `var`, as we will be using a timeout below. - - - var observers = this.itemSyncObservers.sort(function (a, b) { - // sort by priority - return a.priority < b.priority ? -1 : 1; - }); - - var _loop2 = function _loop2(observer) { - var allRelevantItems = observer.types.includes("*") ? models : models.filter(function (item) { - return observer.types.includes(item.content_type); - }); - var validItems = [], - deletedItems = []; - var _iteratorNormalCompletion20 = true; - var _didIteratorError20 = false; - var _iteratorError20 = undefined; - - try { - for (var _iterator20 = allRelevantItems[Symbol.iterator](), _step20; !(_iteratorNormalCompletion20 = (_step20 = _iterator20.next()).done); _iteratorNormalCompletion20 = true) { - var item = _step20.value; - - if (item.deleted) { - deletedItems.push(item); - } else { - validItems.push(item); - } - } - } catch (err) { - _didIteratorError20 = true; - _iteratorError20 = err; - } finally { - try { - if (!_iteratorNormalCompletion20 && _iterator20.return) { - _iterator20.return(); - } - } finally { - if (_didIteratorError20) { - throw _iteratorError20; - } - } - } - - if (allRelevantItems.length > 0) { - _this9._callSyncObserverCallbackWithTimeout(observer, allRelevantItems, validItems, deletedItems, source, sourceKey); - } - }; - - var _iteratorNormalCompletion19 = true; - var _didIteratorError19 = false; - var _iteratorError19 = undefined; - - try { - for (var _iterator19 = observers[Symbol.iterator](), _step19; !(_iteratorNormalCompletion19 = (_step19 = _iterator19.next()).done); _iteratorNormalCompletion19 = true) { - var observer = _step19.value; - - _loop2(observer); - } - } catch (err) { - _didIteratorError19 = true; - _iteratorError19 = err; - } finally { - try { - if (!_iteratorNormalCompletion19 && _iterator19.return) { - _iterator19.return(); - } - } finally { - if (_didIteratorError19) { - throw _iteratorError19; - } - } - } - } - /* - Rather than running this inline in a for loop, which causes problems and requires all variables to be declared with `let`, - we'll do it here so it's more explicit and less confusing. - */ - - }, { - key: "_callSyncObserverCallbackWithTimeout", - value: function _callSyncObserverCallbackWithTimeout(observer, allRelevantItems, validItems, deletedItems, source, sourceKey) { - this.$timeout(function () { - observer.callback(allRelevantItems, validItems, deletedItems, source, sourceKey); - }); - } - }, { - key: "createItem", - value: function createItem(json_obj, dontNotifyObservers) { - var itemClass = SFModelManager.ContentTypeClassMapping && SFModelManager.ContentTypeClassMapping[json_obj.content_type]; - - if (!itemClass) { - itemClass = SFItem; - } - - var item = new itemClass(json_obj); // Some observers would be interested to know when an an item is locally created - // If we don't send this out, these observers would have to wait until MappingSourceRemoteSaved - // to hear about it, but sometimes, RemoveSaved is explicitly ignored by the observer to avoid - // recursive callbacks. See componentManager's syncObserver callback. - // dontNotifyObservers is currently only set true by modelManagers mapResponseItemsToLocalModels - - if (!dontNotifyObservers) { - this.notifySyncObserversOfModels([item], SFModelManager.MappingSourceLocalSaved); - } - - return item; - } - /* - Be sure itemResponse is a generic Javascript object, and not an Item. - An Item needs to collapse its properties into its content object before it can be duplicated. - Note: the reason we need this function is specificallty for the call to resolveReferencesForItem. - This method creates but does not add the item to the global inventory. It's used by syncManager - to check if this prospective duplicate item is identical to another item, including the references. - */ - - }, { - key: "createConflictedItem", - value: function () { - var _ref40 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee35(itemResponse) { - var uuid, dup; - return regeneratorRuntime.wrap(function _callee35$(_context35) { - while (1) { - switch (_context35.prev = _context35.next) { - case 0: - _context35.next = 2; - return SFJS.crypto.generateUUID(); - - case 2: - uuid = _context35.sent; - itemResponse = _.merge(itemResponse, { - uuid: uuid - }); - dup = this.createItem(itemResponse, true); - return _context35.abrupt("return", dup); - - case 6: - case "end": - return _context35.stop(); - } - } - }, _callee35, this); - })); - - function createConflictedItem(_x62) { - return _ref40.apply(this, arguments); - } - - return createConflictedItem; - }() - }, { - key: "addConflictedItem", - value: function addConflictedItem(dup, original) { - this.addItem(dup); // the duplicate should inherit the original's relationships - - var _iteratorNormalCompletion21 = true; - var _didIteratorError21 = false; - var _iteratorError21 = undefined; - - try { - for (var _iterator21 = original.referencingObjects[Symbol.iterator](), _step21; !(_iteratorNormalCompletion21 = (_step21 = _iterator21.next()).done); _iteratorNormalCompletion21 = true) { - var referencingObject = _step21.value; - referencingObject.addItemAsRelationship(dup); - referencingObject.setDirty(true); - } - } catch (err) { - _didIteratorError21 = true; - _iteratorError21 = err; - } finally { - try { - if (!_iteratorNormalCompletion21 && _iterator21.return) { - _iterator21.return(); - } - } finally { - if (_didIteratorError21) { - throw _iteratorError21; - } - } - } - - this.resolveReferencesForItem(dup); - dup.content.conflict_of = original.uuid; - dup.setDirty(true); - } - }, { - key: "duplicateItem", - value: function duplicateItem(item) { - var copy = new item.constructor({ - content: item.content - }); - copy.created_at = item.created_at; - copy.content_type = item.content_type; - this.addItem(copy); // the duplicate should inherit the original's relationships - - var _iteratorNormalCompletion22 = true; - var _didIteratorError22 = false; - var _iteratorError22 = undefined; - - try { - for (var _iterator22 = item.referencingObjects[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) { - var referencingObject = _step22.value; - referencingObject.addItemAsRelationship(copy); - referencingObject.setDirty(true); - } - } catch (err) { - _didIteratorError22 = true; - _iteratorError22 = err; - } finally { - try { - if (!_iteratorNormalCompletion22 && _iterator22.return) { - _iterator22.return(); - } - } finally { - if (_didIteratorError22) { - throw _iteratorError22; - } - } - } - - this.resolveReferencesForItem(copy); - copy.setDirty(true); - return copy; - } - }, { - key: "addItem", - value: function addItem(item) { - var globalOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - this.addItems([item], globalOnly); - } - }, { - key: "addItems", - value: function addItems(items) { - var _this10 = this; - - var globalOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - items.forEach(function (item) { - if (!_this10.itemsHash[item.uuid]) { - _this10.itemsHash[item.uuid] = item; - - _this10.items.push(item); - } - }); - } - /* Notifies observers when an item has been synced or mapped from a remote response */ - - }, { - key: "addItemSyncObserver", - value: function addItemSyncObserver(id, types, callback) { - this.addItemSyncObserverWithPriority({ - id: id, - types: types, - callback: callback, - priority: 1 - }); - } - }, { - key: "addItemSyncObserverWithPriority", - value: function addItemSyncObserverWithPriority(_ref41) { - var id = _ref41.id, - priority = _ref41.priority, - types = _ref41.types, - callback = _ref41.callback; - - if (!Array.isArray(types)) { - types = [types]; - } - - this.itemSyncObservers.push({ - id: id, - types: types, - priority: priority, - callback: callback - }); - } - }, { - key: "removeItemSyncObserver", - value: function removeItemSyncObserver(id) { - _.remove(this.itemSyncObservers, _.find(this.itemSyncObservers, { - id: id - })); - } - }, { - key: "getDirtyItems", - value: function getDirtyItems() { - return this.items.filter(function (item) { - // An item that has an error decrypting can be synced only if it is being deleted. - // Otherwise, we don't want to send corrupt content up to the server. - return item.dirty == true && !item.dummy && (!item.errorDecrypting || item.deleted); - }); - } - }, { - key: "clearDirtyItems", - value: function clearDirtyItems(items) { - var _iteratorNormalCompletion23 = true; - var _didIteratorError23 = false; - var _iteratorError23 = undefined; - - try { - for (var _iterator23 = items[Symbol.iterator](), _step23; !(_iteratorNormalCompletion23 = (_step23 = _iterator23.next()).done); _iteratorNormalCompletion23 = true) { - var item = _step23.value; - item.setDirty(false); - } - } catch (err) { - _didIteratorError23 = true; - _iteratorError23 = err; - } finally { - try { - if (!_iteratorNormalCompletion23 && _iterator23.return) { - _iterator23.return(); - } - } finally { - if (_didIteratorError23) { - throw _iteratorError23; - } - } - } - } - }, { - key: "setItemToBeDeleted", - value: function setItemToBeDeleted(item) { - item.deleted = true; - - if (!item.dummy) { - item.setDirty(true); - } - - this.removeAndDirtyAllRelationshipsForItem(item); - } - }, { - key: "removeAndDirtyAllRelationshipsForItem", - value: function removeAndDirtyAllRelationshipsForItem(item) { - // Handle direct relationships - // An item with errorDecrypting will not have valid content field - if (!item.errorDecrypting) { - var _iteratorNormalCompletion24 = true; - var _didIteratorError24 = false; - var _iteratorError24 = undefined; - - try { - for (var _iterator24 = item.content.references[Symbol.iterator](), _step24; !(_iteratorNormalCompletion24 = (_step24 = _iterator24.next()).done); _iteratorNormalCompletion24 = true) { - var reference = _step24.value; - var relationship = this.findItem(reference.uuid); - - if (relationship) { - item.removeItemAsRelationship(relationship); - - if (relationship.hasRelationshipWithItem(item)) { - relationship.removeItemAsRelationship(item); - relationship.setDirty(true); - } - } - } - } catch (err) { - _didIteratorError24 = true; - _iteratorError24 = err; - } finally { - try { - if (!_iteratorNormalCompletion24 && _iterator24.return) { - _iterator24.return(); - } - } finally { - if (_didIteratorError24) { - throw _iteratorError24; - } - } - } - } // Handle indirect relationships - - - var _iteratorNormalCompletion25 = true; - var _didIteratorError25 = false; - var _iteratorError25 = undefined; - - try { - for (var _iterator25 = item.referencingObjects[Symbol.iterator](), _step25; !(_iteratorNormalCompletion25 = (_step25 = _iterator25.next()).done); _iteratorNormalCompletion25 = true) { - var object = _step25.value; - object.removeItemAsRelationship(item); - object.setDirty(true); - } - } catch (err) { - _didIteratorError25 = true; - _iteratorError25 = err; - } finally { - try { - if (!_iteratorNormalCompletion25 && _iterator25.return) { - _iterator25.return(); - } - } finally { - if (_didIteratorError25) { - throw _iteratorError25; - } - } - } - - item.referencingObjects = []; - } - /* Used when changing encryption key */ - - }, { - key: "setAllItemsDirty", - value: function setAllItemsDirty() { - var dontUpdateClientDates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - var relevantItems = this.allItems; - var _iteratorNormalCompletion26 = true; - var _didIteratorError26 = false; - var _iteratorError26 = undefined; - - try { - for (var _iterator26 = relevantItems[Symbol.iterator](), _step26; !(_iteratorNormalCompletion26 = (_step26 = _iterator26.next()).done); _iteratorNormalCompletion26 = true) { - var item = _step26.value; - item.setDirty(true, dontUpdateClientDates); - } - } catch (err) { - _didIteratorError26 = true; - _iteratorError26 = err; - } finally { - try { - if (!_iteratorNormalCompletion26 && _iterator26.return) { - _iterator26.return(); - } - } finally { - if (_didIteratorError26) { - throw _iteratorError26; - } - } - } - } - }, { - key: "removeItemLocally", - value: function () { - var _ref42 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee36(item) { - return regeneratorRuntime.wrap(function _callee36$(_context36) { - while (1) { - switch (_context36.prev = _context36.next) { - case 0: - _.remove(this.items, { - uuid: item.uuid - }); - - delete this.itemsHash[item.uuid]; - item.isBeingRemovedLocally(); - this.itemsPendingRemoval.push(item.uuid); - - case 4: - case "end": - return _context36.stop(); - } - } - }, _callee36, this); - })); - - function removeItemLocally(_x66) { - return _ref42.apply(this, arguments); - } - - return removeItemLocally; - }() - /* Searching */ - - }, { - key: "allItemsMatchingTypes", - value: function allItemsMatchingTypes(contentTypes) { - return this.allItems.filter(function (item) { - return (_.includes(contentTypes, item.content_type) || _.includes(contentTypes, "*")) && !item.dummy; - }); - } - }, { - key: "invalidItems", - value: function invalidItems() { - return this.allItems.filter(function (item) { - return item.errorDecrypting; - }); - } - }, { - key: "validItemsForContentType", - value: function validItemsForContentType(contentType) { - return this.allItems.filter(function (item) { - return item.content_type == contentType && !item.errorDecrypting; - }); - } - }, { - key: "findItem", - value: function findItem(itemId) { - return this.itemsHash[itemId]; - } - }, { - key: "findItems", - value: function findItems(ids) { - var includeBlanks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var results = []; - var _iteratorNormalCompletion27 = true; - var _didIteratorError27 = false; - var _iteratorError27 = undefined; - - try { - for (var _iterator27 = ids[Symbol.iterator](), _step27; !(_iteratorNormalCompletion27 = (_step27 = _iterator27.next()).done); _iteratorNormalCompletion27 = true) { - var id = _step27.value; - var item = this.itemsHash[id]; - - if (item || includeBlanks) { - results.push(item); - } - } - } catch (err) { - _didIteratorError27 = true; - _iteratorError27 = err; - } finally { - try { - if (!_iteratorNormalCompletion27 && _iterator27.return) { - _iterator27.return(); - } - } finally { - if (_didIteratorError27) { - throw _iteratorError27; - } - } - } - - return results; - } - }, { - key: "itemsMatchingPredicate", - value: function itemsMatchingPredicate(predicate) { - return this.itemsMatchingPredicates([predicate]); - } - }, { - key: "itemsMatchingPredicates", - value: function itemsMatchingPredicates(predicates) { - return this.filterItemsWithPredicates(this.allItems, predicates); - } - }, { - key: "filterItemsWithPredicates", - value: function filterItemsWithPredicates(items, predicates) { - var results = items.filter(function (item) { - var _iteratorNormalCompletion28 = true; - var _didIteratorError28 = false; - var _iteratorError28 = undefined; - - try { - for (var _iterator28 = predicates[Symbol.iterator](), _step28; !(_iteratorNormalCompletion28 = (_step28 = _iterator28.next()).done); _iteratorNormalCompletion28 = true) { - var predicate = _step28.value; - - if (!item.satisfiesPredicate(predicate)) { - return false; - } - } - } catch (err) { - _didIteratorError28 = true; - _iteratorError28 = err; - } finally { - try { - if (!_iteratorNormalCompletion28 && _iterator28.return) { - _iterator28.return(); - } - } finally { - if (_didIteratorError28) { - throw _iteratorError28; - } - } - } - - return true; - }); - return results; - } - /* - Archives - */ - - }, { - key: "importItems", - value: function () { - var _ref43 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee37(externalItems) { - var itemsToBeMapped, _iteratorNormalCompletion29, _didIteratorError29, _iteratorError29, _iterator29, _step29, itemData, existing, dup, items, _iteratorNormalCompletion30, _didIteratorError30, _iteratorError30, _iterator30, _step30, item; - - return regeneratorRuntime.wrap(function _callee37$(_context37) { - while (1) { - switch (_context37.prev = _context37.next) { - case 0: - itemsToBeMapped = []; - _iteratorNormalCompletion29 = true; - _didIteratorError29 = false; - _iteratorError29 = undefined; - _context37.prev = 4; - _iterator29 = externalItems[Symbol.iterator](); - - case 6: - if (_iteratorNormalCompletion29 = (_step29 = _iterator29.next()).done) { - _context37.next = 21; - break; - } - - itemData = _step29.value; - existing = this.findItem(itemData.uuid); - - if (!(existing && !existing.errorDecrypting)) { - _context37.next = 16; - break; - } - - _context37.next = 12; - return this.createConflictedItem(itemData); - - case 12: - dup = _context37.sent; - - if (!itemData.deleted && !existing.isItemContentEqualWith(dup)) { - // Data differs - this.addConflictedItem(dup, existing); - itemsToBeMapped.push(dup); - } - - _context37.next = 18; - break; - - case 16: - // it doesn't exist, push it into items to be mapped - itemsToBeMapped.push(itemData); - - if (existing && existing.errorDecrypting) { - existing.errorDecrypting = false; - } - - case 18: - _iteratorNormalCompletion29 = true; - _context37.next = 6; - break; - - case 21: - _context37.next = 27; - break; - - case 23: - _context37.prev = 23; - _context37.t0 = _context37["catch"](4); - _didIteratorError29 = true; - _iteratorError29 = _context37.t0; - - case 27: - _context37.prev = 27; - _context37.prev = 28; - - if (!_iteratorNormalCompletion29 && _iterator29.return) { - _iterator29.return(); - } - - case 30: - _context37.prev = 30; - - if (!_didIteratorError29) { - _context37.next = 33; - break; - } - - throw _iteratorError29; - - case 33: - return _context37.finish(30); - - case 34: - return _context37.finish(27); - - case 35: - items = this.mapResponseItemsToLocalModels(itemsToBeMapped, SFModelManager.MappingSourceFileImport); - _iteratorNormalCompletion30 = true; - _didIteratorError30 = false; - _iteratorError30 = undefined; - _context37.prev = 39; - - for (_iterator30 = items[Symbol.iterator](); !(_iteratorNormalCompletion30 = (_step30 = _iterator30.next()).done); _iteratorNormalCompletion30 = true) { - item = _step30.value; - item.setDirty(true, true); - item.deleted = false; - } - - _context37.next = 47; - break; - - case 43: - _context37.prev = 43; - _context37.t1 = _context37["catch"](39); - _didIteratorError30 = true; - _iteratorError30 = _context37.t1; - - case 47: - _context37.prev = 47; - _context37.prev = 48; - - if (!_iteratorNormalCompletion30 && _iterator30.return) { - _iterator30.return(); - } - - case 50: - _context37.prev = 50; - - if (!_didIteratorError30) { - _context37.next = 53; - break; - } - - throw _iteratorError30; - - case 53: - return _context37.finish(50); - - case 54: - return _context37.finish(47); - - case 55: - return _context37.abrupt("return", items); - - case 56: - case "end": - return _context37.stop(); - } - } - }, _callee37, this, [[4, 23, 27, 35], [28,, 30, 34], [39, 43, 47, 55], [48,, 50, 54]]); - })); - - function importItems(_x68) { - return _ref43.apply(this, arguments); - } - - return importItems; - }() - }, { - key: "getAllItemsJSONData", - value: function () { - var _ref44 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee38(keys, authParams, returnNullIfEmpty) { - return regeneratorRuntime.wrap(function _callee38$(_context38) { - while (1) { - switch (_context38.prev = _context38.next) { - case 0: - return _context38.abrupt("return", this.getJSONDataForItems(this.allItems, keys, authParams, returnNullIfEmpty)); - - case 1: - case "end": - return _context38.stop(); - } - } - }, _callee38, this); - })); - - function getAllItemsJSONData(_x69, _x70, _x71) { - return _ref44.apply(this, arguments); - } - - return getAllItemsJSONData; - }() - }, { - key: "getJSONDataForItems", - value: function () { - var _ref45 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee39(items, keys, authParams, returnNullIfEmpty) { - return regeneratorRuntime.wrap(function _callee39$(_context39) { - while (1) { - switch (_context39.prev = _context39.next) { - case 0: - return _context39.abrupt("return", Promise.all(items.map(function (item) { - var itemParams = new SFItemParams(item, keys, authParams); - return itemParams.paramsForExportFile(); - })).then(function (items) { - if (returnNullIfEmpty && items.length == 0) { - return null; - } - - var data = { - items: items - }; - - if (keys) { - // auth params are only needed when encrypted with a standard file key - data["auth_params"] = authParams; - } - - return JSON.stringify(data, null, 2 - /* pretty print */ - ); - })); - - case 1: - case "end": - return _context39.stop(); - } - } - }, _callee39, this); - })); - - function getJSONDataForItems(_x72, _x73, _x74, _x75) { - return _ref45.apply(this, arguments); - } - - return getJSONDataForItems; - }() - }, { - key: "computeDataIntegrityHash", - value: function () { - var _ref46 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee40() { - var items, dates, string, hash; - return regeneratorRuntime.wrap(function _callee40$(_context40) { - while (1) { - switch (_context40.prev = _context40.next) { - case 0: - _context40.prev = 0; - items = this.allNondummyItems.sort(function (a, b) { - return b.updated_at - a.updated_at; - }); - dates = items.map(function (item) { - return item.updatedAtTimestamp(); - }); - string = dates.join(","); - _context40.next = 6; - return SFJS.crypto.sha256(string); - - case 6: - hash = _context40.sent; - return _context40.abrupt("return", hash); - - case 10: - _context40.prev = 10; - _context40.t0 = _context40["catch"](0); - console.error("Error computing data integrity hash", _context40.t0); - return _context40.abrupt("return", null); - - case 14: - case "end": - return _context40.stop(); - } - } - }, _callee40, this, [[0, 10]]); - })); - - function computeDataIntegrityHash() { - return _ref46.apply(this, arguments); - } - - return computeDataIntegrityHash; - }() - }, { - key: "allItems", - get: function get() { - return this.items.slice(); - } - }, { - key: "allNondummyItems", - get: function get() { - return this.items.filter(function (item) { - return !item.dummy; - }); - } - }]); - - return SFModelManager; - }(); - - ; - - var SFPrivilegesManager = exports.SFPrivilegesManager = function () { - function SFPrivilegesManager(modelManager, syncManager, singletonManager) { - _classCallCheck(this, SFPrivilegesManager); - - this.modelManager = modelManager; - this.syncManager = syncManager; - this.singletonManager = singletonManager; - this.loadPrivileges(); - SFPrivilegesManager.CredentialAccountPassword = "CredentialAccountPassword"; - SFPrivilegesManager.CredentialLocalPasscode = "CredentialLocalPasscode"; - SFPrivilegesManager.ActionManageExtensions = "ActionManageExtensions"; - SFPrivilegesManager.ActionManageBackups = "ActionManageBackups"; - SFPrivilegesManager.ActionViewProtectedNotes = "ActionViewProtectedNotes"; - SFPrivilegesManager.ActionManagePrivileges = "ActionManagePrivileges"; - SFPrivilegesManager.ActionManagePasscode = "ActionManagePasscode"; - SFPrivilegesManager.ActionDeleteNote = "ActionDeleteNote"; - SFPrivilegesManager.SessionExpiresAtKey = "SessionExpiresAtKey"; - SFPrivilegesManager.SessionLengthKey = "SessionLengthKey"; - SFPrivilegesManager.SessionLengthNone = 0; - SFPrivilegesManager.SessionLengthFiveMinutes = 300; - SFPrivilegesManager.SessionLengthOneHour = 3600; - SFPrivilegesManager.SessionLengthOneWeek = 604800; - this.availableActions = [SFPrivilegesManager.ActionViewProtectedNotes, SFPrivilegesManager.ActionDeleteNote, SFPrivilegesManager.ActionManagePasscode, SFPrivilegesManager.ActionManageBackups, SFPrivilegesManager.ActionManageExtensions, SFPrivilegesManager.ActionManagePrivileges]; - this.availableCredentials = [SFPrivilegesManager.CredentialAccountPassword, SFPrivilegesManager.CredentialLocalPasscode]; - this.sessionLengths = [SFPrivilegesManager.SessionLengthNone, SFPrivilegesManager.SessionLengthFiveMinutes, SFPrivilegesManager.SessionLengthOneHour, SFPrivilegesManager.SessionLengthOneWeek, SFPrivilegesManager.SessionLengthIndefinite]; - } - /* - async delegate.isOffline() - async delegate.hasLocalPasscode() - async delegate.saveToStorage(key, value) - async delegate.getFromStorage(key) - async delegate.verifyAccountPassword - async delegate.verifyLocalPasscode - */ - - - _createClass(SFPrivilegesManager, [{ - key: "setDelegate", - value: function setDelegate(delegate) { - this.delegate = delegate; - } - }, { - key: "getAvailableActions", - value: function getAvailableActions() { - return this.availableActions; - } - }, { - key: "getAvailableCredentials", - value: function getAvailableCredentials() { - return this.availableCredentials; - } - }, { - key: "netCredentialsForAction", - value: function () { - var _ref47 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee41(action) { - var credentials, netCredentials, _iteratorNormalCompletion31, _didIteratorError31, _iteratorError31, _iterator31, _step31, cred, isOffline, hasLocalPasscode; - - return regeneratorRuntime.wrap(function _callee41$(_context41) { - while (1) { - switch (_context41.prev = _context41.next) { - case 0: - _context41.next = 2; - return this.getPrivileges(); - - case 2: - _context41.t0 = action; - credentials = _context41.sent.getCredentialsForAction(_context41.t0); - netCredentials = []; - _iteratorNormalCompletion31 = true; - _didIteratorError31 = false; - _iteratorError31 = undefined; - _context41.prev = 8; - _iterator31 = credentials[Symbol.iterator](); - - case 10: - if (_iteratorNormalCompletion31 = (_step31 = _iterator31.next()).done) { - _context41.next = 27; - break; - } - - cred = _step31.value; - - if (!(cred == SFPrivilegesManager.CredentialAccountPassword)) { - _context41.next = 19; - break; - } - - _context41.next = 15; - return this.delegate.isOffline(); - - case 15: - isOffline = _context41.sent; - - if (!isOffline) { - netCredentials.push(cred); - } - - _context41.next = 24; - break; - - case 19: - if (!(cred == SFPrivilegesManager.CredentialLocalPasscode)) { - _context41.next = 24; - break; - } - - _context41.next = 22; - return this.delegate.hasLocalPasscode(); - - case 22: - hasLocalPasscode = _context41.sent; - - if (hasLocalPasscode) { - netCredentials.push(cred); - } - - case 24: - _iteratorNormalCompletion31 = true; - _context41.next = 10; - break; - - case 27: - _context41.next = 33; - break; - - case 29: - _context41.prev = 29; - _context41.t1 = _context41["catch"](8); - _didIteratorError31 = true; - _iteratorError31 = _context41.t1; - - case 33: - _context41.prev = 33; - _context41.prev = 34; - - if (!_iteratorNormalCompletion31 && _iterator31.return) { - _iterator31.return(); - } - - case 36: - _context41.prev = 36; - - if (!_didIteratorError31) { - _context41.next = 39; - break; - } - - throw _iteratorError31; - - case 39: - return _context41.finish(36); - - case 40: - return _context41.finish(33); - - case 41: - return _context41.abrupt("return", netCredentials); - - case 42: - case "end": - return _context41.stop(); - } - } - }, _callee41, this, [[8, 29, 33, 41], [34,, 36, 40]]); - })); - - function netCredentialsForAction(_x76) { - return _ref47.apply(this, arguments); - } - - return netCredentialsForAction; - }() - }, { - key: "loadPrivileges", - value: function () { - var _ref48 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee43() { - var _this11 = this; - - return regeneratorRuntime.wrap(function _callee43$(_context43) { - while (1) { - switch (_context43.prev = _context43.next) { - case 0: - if (!this.loadPromise) { - _context43.next = 2; - break; - } - - return _context43.abrupt("return", this.loadPromise); - - case 2: - this.loadPromise = new Promise(function (resolve, reject) { - var privsContentType = SFPrivileges.contentType(); - var contentTypePredicate = new SFPredicate("content_type", "=", privsContentType); - - _this11.singletonManager.registerSingleton([contentTypePredicate], function (resolvedSingleton) { - _this11.privileges = resolvedSingleton; - resolve(resolvedSingleton); - }, function () { - var _ref49 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee42(valueCallback) { - var privs; - return regeneratorRuntime.wrap(function _callee42$(_context42) { - while (1) { - switch (_context42.prev = _context42.next) { - case 0: - // Safe to create. Create and return object. - privs = new SFPrivileges({ - content_type: privsContentType - }); - - if (SFJS.crypto.generateUUIDSync) { - _context42.next = 4; - break; - } - - _context42.next = 4; - return privs.initUUID(); - - case 4: - _this11.modelManager.addItem(privs); - - privs.setDirty(true); - - _this11.syncManager.sync(); - - valueCallback(privs); - resolve(privs); - - case 9: - case "end": - return _context42.stop(); - } - } - }, _callee42, _this11); - })); - - return function (_x77) { - return _ref49.apply(this, arguments); - }; - }()); - }); - return _context43.abrupt("return", this.loadPromise); - - case 4: - case "end": - return _context43.stop(); - } - } - }, _callee43, this); - })); - - function loadPrivileges() { - return _ref48.apply(this, arguments); - } - - return loadPrivileges; - }() - }, { - key: "getPrivileges", - value: function () { - var _ref50 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee44() { - return regeneratorRuntime.wrap(function _callee44$(_context44) { - while (1) { - switch (_context44.prev = _context44.next) { - case 0: - if (!this.privileges) { - _context44.next = 4; - break; - } - - return _context44.abrupt("return", this.privileges); - - case 4: - return _context44.abrupt("return", this.loadPrivileges()); - - case 5: - case "end": - return _context44.stop(); - } - } - }, _callee44, this); - })); - - function getPrivileges() { - return _ref50.apply(this, arguments); - } - - return getPrivileges; - }() - }, { - key: "displayInfoForCredential", - value: function displayInfoForCredential(credential) { - var metadata = {}; - metadata[SFPrivilegesManager.CredentialAccountPassword] = { - label: "Account Password", - prompt: "Please enter your account password." - }; - metadata[SFPrivilegesManager.CredentialLocalPasscode] = { - label: "Local Passcode", - prompt: "Please enter your local passcode." - }; - return metadata[credential]; - } - }, { - key: "displayInfoForAction", - value: function displayInfoForAction(action) { - var metadata = {}; - metadata[SFPrivilegesManager.ActionManageExtensions] = { - label: "Manage Extensions" - }; - metadata[SFPrivilegesManager.ActionManageBackups] = { - label: "Download/Import Backups" - }; - metadata[SFPrivilegesManager.ActionViewProtectedNotes] = { - label: "View Protected Notes" - }; - metadata[SFPrivilegesManager.ActionManagePrivileges] = { - label: "Manage Privileges" - }; - metadata[SFPrivilegesManager.ActionManagePasscode] = { - label: "Manage Passcode" - }; - metadata[SFPrivilegesManager.ActionDeleteNote] = { - label: "Delete Notes" - }; - return metadata[action]; - } - }, { - key: "getSessionLengthOptions", - value: function getSessionLengthOptions() { - return [{ - value: SFPrivilegesManager.SessionLengthNone, - label: "Don't Remember" - }, { - value: SFPrivilegesManager.SessionLengthFiveMinutes, - label: "5 Minutes" - }, { - value: SFPrivilegesManager.SessionLengthOneHour, - label: "1 Hour" - }, { - value: SFPrivilegesManager.SessionLengthOneWeek, - label: "1 Week" - }]; - } - }, { - key: "setSessionLength", - value: function () { - var _ref51 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee45(length) { - var addToNow, expiresAt; - return regeneratorRuntime.wrap(function _callee45$(_context45) { - while (1) { - switch (_context45.prev = _context45.next) { - case 0: - addToNow = function addToNow(seconds) { - var date = new Date(); - date.setSeconds(date.getSeconds() + seconds); - return date; - }; - - expiresAt = addToNow(length); - return _context45.abrupt("return", Promise.all([this.delegate.saveToStorage(SFPrivilegesManager.SessionExpiresAtKey, JSON.stringify(expiresAt)), this.delegate.saveToStorage(SFPrivilegesManager.SessionLengthKey, JSON.stringify(length))])); - - case 3: - case "end": - return _context45.stop(); - } - } - }, _callee45, this); - })); - - function setSessionLength(_x78) { - return _ref51.apply(this, arguments); - } - - return setSessionLength; - }() - }, { - key: "clearSession", - value: function () { - var _ref52 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee46() { - return regeneratorRuntime.wrap(function _callee46$(_context46) { - while (1) { - switch (_context46.prev = _context46.next) { - case 0: - return _context46.abrupt("return", this.setSessionLength(SFPrivilegesManager.SessionLengthNone)); - - case 1: - case "end": - return _context46.stop(); - } - } - }, _callee46, this); - })); - - function clearSession() { - return _ref52.apply(this, arguments); - } - - return clearSession; - }() - }, { - key: "getSelectedSessionLength", - value: function () { - var _ref53 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee47() { - var length; - return regeneratorRuntime.wrap(function _callee47$(_context47) { - while (1) { - switch (_context47.prev = _context47.next) { - case 0: - _context47.next = 2; - return this.delegate.getFromStorage(SFPrivilegesManager.SessionLengthKey); - - case 2: - length = _context47.sent; - - if (!length) { - _context47.next = 7; - break; - } - - return _context47.abrupt("return", JSON.parse(length)); - - case 7: - return _context47.abrupt("return", SFPrivilegesManager.SessionLengthNone); - - case 8: - case "end": - return _context47.stop(); - } - } - }, _callee47, this); - })); - - function getSelectedSessionLength() { - return _ref53.apply(this, arguments); - } - - return getSelectedSessionLength; - }() - }, { - key: "getSessionExpirey", - value: function () { - var _ref54 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee48() { - var expiresAt; - return regeneratorRuntime.wrap(function _callee48$(_context48) { - while (1) { - switch (_context48.prev = _context48.next) { - case 0: - _context48.next = 2; - return this.delegate.getFromStorage(SFPrivilegesManager.SessionExpiresAtKey); - - case 2: - expiresAt = _context48.sent; - - if (!expiresAt) { - _context48.next = 7; - break; - } - - return _context48.abrupt("return", new Date(JSON.parse(expiresAt))); - - case 7: - return _context48.abrupt("return", new Date()); - - case 8: - case "end": - return _context48.stop(); - } - } - }, _callee48, this); - })); - - function getSessionExpirey() { - return _ref54.apply(this, arguments); - } - - return getSessionExpirey; - }() - }, { - key: "actionHasPrivilegesConfigured", - value: function () { - var _ref55 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee49(action) { - return regeneratorRuntime.wrap(function _callee49$(_context49) { - while (1) { - switch (_context49.prev = _context49.next) { - case 0: - _context49.next = 2; - return this.netCredentialsForAction(action); - - case 2: - _context49.t0 = _context49.sent.length; - return _context49.abrupt("return", _context49.t0 > 0); - - case 4: - case "end": - return _context49.stop(); - } - } - }, _callee49, this); - })); - - function actionHasPrivilegesConfigured(_x79) { - return _ref55.apply(this, arguments); - } - - return actionHasPrivilegesConfigured; - }() - }, { - key: "actionRequiresPrivilege", - value: function () { - var _ref56 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee50(action) { - var expiresAt, netCredentials; - return regeneratorRuntime.wrap(function _callee50$(_context50) { - while (1) { - switch (_context50.prev = _context50.next) { - case 0: - _context50.next = 2; - return this.getSessionExpirey(); - - case 2: - expiresAt = _context50.sent; - - if (!(expiresAt > new Date())) { - _context50.next = 5; - break; - } - - return _context50.abrupt("return", false); - - case 5: - _context50.next = 7; - return this.netCredentialsForAction(action); - - case 7: - netCredentials = _context50.sent; - return _context50.abrupt("return", netCredentials.length > 0); - - case 9: - case "end": - return _context50.stop(); - } - } - }, _callee50, this); - })); - - function actionRequiresPrivilege(_x80) { - return _ref56.apply(this, arguments); - } - - return actionRequiresPrivilege; - }() - }, { - key: "savePrivileges", - value: function () { - var _ref57 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee51() { - var privs; - return regeneratorRuntime.wrap(function _callee51$(_context51) { - while (1) { - switch (_context51.prev = _context51.next) { - case 0: - _context51.next = 2; - return this.getPrivileges(); - - case 2: - privs = _context51.sent; - privs.setDirty(true); - this.syncManager.sync(); - - case 5: - case "end": - return _context51.stop(); - } - } - }, _callee51, this); - })); - - function savePrivileges() { - return _ref57.apply(this, arguments); - } - - return savePrivileges; - }() - }, { - key: "authenticateAction", - value: function () { - var _ref58 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee52(action, credentialAuthMapping) { - var requiredCredentials, successfulCredentials, failedCredentials, _iteratorNormalCompletion32, _didIteratorError32, _iteratorError32, _iterator32, _step32, requiredCredential, passesAuth; - - return regeneratorRuntime.wrap(function _callee52$(_context52) { - while (1) { - switch (_context52.prev = _context52.next) { - case 0: - _context52.next = 2; - return this.netCredentialsForAction(action); - - case 2: - requiredCredentials = _context52.sent; - successfulCredentials = [], failedCredentials = []; - _iteratorNormalCompletion32 = true; - _didIteratorError32 = false; - _iteratorError32 = undefined; - _context52.prev = 7; - _iterator32 = requiredCredentials[Symbol.iterator](); - - case 9: - if (_iteratorNormalCompletion32 = (_step32 = _iterator32.next()).done) { - _context52.next = 18; - break; - } - - requiredCredential = _step32.value; - _context52.next = 13; - return this._verifyAuthenticationParameters(requiredCredential, credentialAuthMapping[requiredCredential]); - - case 13: - passesAuth = _context52.sent; - - if (passesAuth) { - successfulCredentials.push(requiredCredential); - } else { - failedCredentials.push(requiredCredential); - } - - case 15: - _iteratorNormalCompletion32 = true; - _context52.next = 9; - break; - - case 18: - _context52.next = 24; - break; - - case 20: - _context52.prev = 20; - _context52.t0 = _context52["catch"](7); - _didIteratorError32 = true; - _iteratorError32 = _context52.t0; - - case 24: - _context52.prev = 24; - _context52.prev = 25; - - if (!_iteratorNormalCompletion32 && _iterator32.return) { - _iterator32.return(); - } - - case 27: - _context52.prev = 27; - - if (!_didIteratorError32) { - _context52.next = 30; - break; - } - - throw _iteratorError32; - - case 30: - return _context52.finish(27); - - case 31: - return _context52.finish(24); - - case 32: - return _context52.abrupt("return", { - success: failedCredentials.length == 0, - successfulCredentials: successfulCredentials, - failedCredentials: failedCredentials - }); - - case 33: - case "end": - return _context52.stop(); - } - } - }, _callee52, this, [[7, 20, 24, 32], [25,, 27, 31]]); - })); - - function authenticateAction(_x81, _x82) { - return _ref58.apply(this, arguments); - } - - return authenticateAction; - }() - }, { - key: "_verifyAuthenticationParameters", - value: function () { - var _ref59 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee55(credential, value) { - var _this12 = this; - - var verifyAccountPassword, verifyLocalPasscode; - return regeneratorRuntime.wrap(function _callee55$(_context55) { - while (1) { - switch (_context55.prev = _context55.next) { - case 0: - verifyAccountPassword = function () { - var _ref60 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee53(password) { - return regeneratorRuntime.wrap(function _callee53$(_context53) { - while (1) { - switch (_context53.prev = _context53.next) { - case 0: - return _context53.abrupt("return", _this12.delegate.verifyAccountPassword(password)); - - case 1: - case "end": - return _context53.stop(); - } - } - }, _callee53, _this12); - })); - - return function verifyAccountPassword(_x85) { - return _ref60.apply(this, arguments); - }; - }(); - - verifyLocalPasscode = function () { - var _ref61 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee54(passcode) { - return regeneratorRuntime.wrap(function _callee54$(_context54) { - while (1) { - switch (_context54.prev = _context54.next) { - case 0: - return _context54.abrupt("return", _this12.delegate.verifyLocalPasscode(passcode)); - - case 1: - case "end": - return _context54.stop(); - } - } - }, _callee54, _this12); - })); - - return function verifyLocalPasscode(_x86) { - return _ref61.apply(this, arguments); - }; - }(); - - if (!(credential == SFPrivilegesManager.CredentialAccountPassword)) { - _context55.next = 6; - break; - } - - return _context55.abrupt("return", verifyAccountPassword(value)); - - case 6: - if (!(credential == SFPrivilegesManager.CredentialLocalPasscode)) { - _context55.next = 8; - break; - } - - return _context55.abrupt("return", verifyLocalPasscode(value)); - - case 8: - case "end": - return _context55.stop(); - } - } - }, _callee55, this); - })); - - function _verifyAuthenticationParameters(_x83, _x84) { - return _ref59.apply(this, arguments); - } - - return _verifyAuthenticationParameters; - }() - }]); - - return SFPrivilegesManager; - }(); - - ; - var SessionHistoryPersistKey = "sessionHistory_persist"; - var SessionHistoryRevisionsKey = "sessionHistory_revisions"; - var SessionHistoryAutoOptimizeKey = "sessionHistory_autoOptimize"; - - var SFSessionHistoryManager = exports.SFSessionHistoryManager = function () { - function SFSessionHistoryManager(modelManager, storageManager, keyRequestHandler, contentTypes, timeout) { - var _this13 = this; - - _classCallCheck(this, SFSessionHistoryManager); - - this.modelManager = modelManager; - this.storageManager = storageManager; - this.$timeout = timeout || setTimeout.bind(window); // Required to persist the encrypted form of SFHistorySession - - this.keyRequestHandler = keyRequestHandler; - this.loadFromDisk().then(function () { - _this13.modelManager.addItemSyncObserver("session-history", contentTypes, function (allItems, validItems, deletedItems, source, sourceKey) { - var _iteratorNormalCompletion33 = true; - var _didIteratorError33 = false; - var _iteratorError33 = undefined; - - try { - for (var _iterator33 = allItems[Symbol.iterator](), _step33; !(_iteratorNormalCompletion33 = (_step33 = _iterator33.next()).done); _iteratorNormalCompletion33 = true) { - var item = _step33.value; - - try { - _this13.addHistoryEntryForItem(item); - } catch (e) { - console.log("Caught exception while trying to add item history entry", e); - } - } - } catch (err) { - _didIteratorError33 = true; - _iteratorError33 = err; - } finally { - try { - if (!_iteratorNormalCompletion33 && _iterator33.return) { - _iterator33.return(); - } - } finally { - if (_didIteratorError33) { - throw _iteratorError33; - } - } - } - }); - }); - } - - _createClass(SFSessionHistoryManager, [{ - key: "encryptionParams", - value: function () { - var _ref62 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee56() { - return regeneratorRuntime.wrap(function _callee56$(_context56) { - while (1) { - switch (_context56.prev = _context56.next) { - case 0: - return _context56.abrupt("return", this.keyRequestHandler()); - - case 1: - case "end": - return _context56.stop(); - } - } - }, _callee56, this); - })); - - function encryptionParams() { - return _ref62.apply(this, arguments); - } - - return encryptionParams; - }() - }, { - key: "addHistoryEntryForItem", - value: function addHistoryEntryForItem(item) { - var _this14 = this; - - var persistableItemParams = { - uuid: item.uuid, - content_type: item.content_type, - updated_at: item.updated_at, - content: item.content - }; - var entry = this.historySession.addEntryForItem(persistableItemParams); - - if (this.autoOptimize) { - this.historySession.optimizeHistoryForItem(item); - } - - if (entry && this.diskEnabled) { - // Debounce, clear existing timeout - if (this.diskTimeout) { - if (this.$timeout.hasOwnProperty("cancel")) { - this.$timeout.cancel(this.diskTimeout); - } else { - clearTimeout(this.diskTimeout); - } - } - - ; - this.diskTimeout = this.$timeout(function () { - _this14.saveToDisk(); - }, 2000); - } - } - }, { - key: "historyForItem", - value: function historyForItem(item) { - return this.historySession.historyForItem(item); - } - }, { - key: "clearHistoryForItem", - value: function () { - var _ref63 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee57(item) { - return regeneratorRuntime.wrap(function _callee57$(_context57) { - while (1) { - switch (_context57.prev = _context57.next) { - case 0: - this.historySession.clearItemHistory(item); - return _context57.abrupt("return", this.saveToDisk()); - - case 2: - case "end": - return _context57.stop(); - } - } - }, _callee57, this); - })); - - function clearHistoryForItem(_x87) { - return _ref63.apply(this, arguments); - } - - return clearHistoryForItem; - }() - }, { - key: "clearAllHistory", - value: function () { - var _ref64 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee58() { - return regeneratorRuntime.wrap(function _callee58$(_context58) { - while (1) { - switch (_context58.prev = _context58.next) { - case 0: - this.historySession.clearAllHistory(); - return _context58.abrupt("return", this.storageManager.removeItem(SessionHistoryRevisionsKey)); - - case 2: - case "end": - return _context58.stop(); - } - } - }, _callee58, this); - })); - - function clearAllHistory() { - return _ref64.apply(this, arguments); - } - - return clearAllHistory; - }() - }, { - key: "toggleDiskSaving", - value: function () { - var _ref65 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee59() { - return regeneratorRuntime.wrap(function _callee59$(_context59) { - while (1) { - switch (_context59.prev = _context59.next) { - case 0: - this.diskEnabled = !this.diskEnabled; - - if (!this.diskEnabled) { - _context59.next = 6; - break; - } - - this.storageManager.setItem(SessionHistoryPersistKey, JSON.stringify(true)); - this.saveToDisk(); - _context59.next = 8; - break; - - case 6: - this.storageManager.setItem(SessionHistoryPersistKey, JSON.stringify(false)); - return _context59.abrupt("return", this.storageManager.removeItem(SessionHistoryRevisionsKey)); - - case 8: - case "end": - return _context59.stop(); - } - } - }, _callee59, this); - })); - - function toggleDiskSaving() { - return _ref65.apply(this, arguments); - } - - return toggleDiskSaving; - }() - }, { - key: "saveToDisk", - value: function () { - var _ref66 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee60() { - var _this15 = this; - - var encryptionParams, itemParams; - return regeneratorRuntime.wrap(function _callee60$(_context60) { - while (1) { - switch (_context60.prev = _context60.next) { - case 0: - if (this.diskEnabled) { - _context60.next = 2; - break; - } - - return _context60.abrupt("return"); - - case 2: - _context60.next = 4; - return this.encryptionParams(); - - case 4: - encryptionParams = _context60.sent; - itemParams = new SFItemParams(this.historySession, encryptionParams.keys, encryptionParams.auth_params); - itemParams.paramsForSync().then(function (syncParams) { - // console.log("Saving to disk", syncParams); - _this15.storageManager.setItem(SessionHistoryRevisionsKey, JSON.stringify(syncParams)); - }); - - case 7: - case "end": - return _context60.stop(); - } - } - }, _callee60, this); - })); - - function saveToDisk() { - return _ref66.apply(this, arguments); - } - - return saveToDisk; - }() - }, { - key: "loadFromDisk", - value: function () { - var _ref67 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee61() { - var diskValue, historyValue, encryptionParams, historySession, autoOptimizeValue; - return regeneratorRuntime.wrap(function _callee61$(_context61) { - while (1) { - switch (_context61.prev = _context61.next) { - case 0: - _context61.next = 2; - return this.storageManager.getItem(SessionHistoryPersistKey); - - case 2: - diskValue = _context61.sent; - - if (diskValue) { - this.diskEnabled = JSON.parse(diskValue); - } - - _context61.next = 6; - return this.storageManager.getItem(SessionHistoryRevisionsKey); - - case 6: - historyValue = _context61.sent; - - if (!historyValue) { - _context61.next = 18; - break; - } - - historyValue = JSON.parse(historyValue); - _context61.next = 11; - return this.encryptionParams(); - - case 11: - encryptionParams = _context61.sent; - _context61.next = 14; - return SFJS.itemTransformer.decryptItem(historyValue, encryptionParams.keys); - - case 14: - historySession = new SFHistorySession(historyValue); - this.historySession = historySession; - _context61.next = 19; - break; - - case 18: - this.historySession = new SFHistorySession(); - - case 19: - _context61.next = 21; - return this.storageManager.getItem(SessionHistoryAutoOptimizeKey); - - case 21: - autoOptimizeValue = _context61.sent; - - if (autoOptimizeValue) { - this.autoOptimize = JSON.parse(autoOptimizeValue); - } else { - // default value is true - this.autoOptimize = true; - } - - case 23: - case "end": - return _context61.stop(); - } - } - }, _callee61, this); - })); - - function loadFromDisk() { - return _ref67.apply(this, arguments); - } - - return loadFromDisk; - }() - }, { - key: "toggleAutoOptimize", - value: function () { - var _ref68 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee62() { - return regeneratorRuntime.wrap(function _callee62$(_context62) { - while (1) { - switch (_context62.prev = _context62.next) { - case 0: - this.autoOptimize = !this.autoOptimize; - - if (this.autoOptimize) { - this.storageManager.setItem(SessionHistoryAutoOptimizeKey, JSON.stringify(true)); - } else { - this.storageManager.setItem(SessionHistoryAutoOptimizeKey, JSON.stringify(false)); - } - - case 2: - case "end": - return _context62.stop(); - } - } - }, _callee62, this); - })); - - function toggleAutoOptimize() { - return _ref68.apply(this, arguments); - } - - return toggleAutoOptimize; - }() - }]); - - return SFSessionHistoryManager; - }(); - - ; - /* - The SingletonManager allows controllers to register an item as a singleton, which means only one instance of that model - should exist, both on the server and on the client. When the SingletonManager detects multiple items matching the singleton predicate, - the oldest ones will be deleted, leaving the newest ones. (See 4/28/18 update. We now choose the earliest created one as the winner.). - (This no longer fully applies, See 4/28/18 update.) We will treat the model most recently arrived from the server as the most recent one. The reason for this is, - if you're offline, a singleton can be created, as in the case of UserPreferneces. Then when you sign in, you'll retrieve your actual user preferences. - In that case, even though the offline singleton has a more recent updated_at, the server retreived value is the one we care more about. - 4/28/18: I'm seeing this issue: if you have the app open in one window, then in another window sign in, and during sign in, - click Refresh (or autorefresh occurs) in the original signed in window, then you will happen to receive from the server the newly created - Extensions singleton, and it will be mistaken (it just looks like a regular retrieved item, since nothing is in saved) for a fresh, latest copy, and replace the current instance. - This has happened to me and many users. - A puzzling issue, but what if instead of resolving singletons by choosing the one most recently modified, we choose the one with the earliest create date? - This way, we don't care when it was modified, but we always, always choose the item that was created first. This way, we always deal with the same item. - */ - - var SFSingletonManager = exports.SFSingletonManager = function () { - function SFSingletonManager(modelManager, syncManager) { - var _this16 = this; - - _classCallCheck(this, SFSingletonManager); - - this.syncManager = syncManager; - this.modelManager = modelManager; - this.singletonHandlers = []; // We use sync observer instead of syncEvent `local-data-incremental-load`, because we want singletons - // to resolve with the first priority, because they generally dictate app state. - // If we used local-data-incremental-load, and 1 item was important singleton and 99 were heavy components, - // then given the random nature of notifiying observers, the heavy components would spend a lot of time loading first, - // here, we priortize ours loading as most important - - modelManager.addItemSyncObserverWithPriority({ - id: "sf-singleton-manager", - types: "*", - priority: -1, - callback: function callback() { - _this16.resolveSingletons(modelManager.allNondummyItems, null, true); - } - }); - syncManager.addEventHandler(function (syncEvent, data) { - if (syncEvent == "local-data-loaded") { - _this16.resolveSingletons(modelManager.allNondummyItems, null, true); - - _this16.initialDataLoaded = true; - } else if (syncEvent == "sync:completed") { - // Wait for initial data load before handling any sync. If we don't want for initial data load, - // then the singleton resolver won't have the proper items to work with to determine whether to resolve or create. - if (!_this16.initialDataLoaded) { - return; - } // The reason we also need to consider savedItems in consolidating singletons is in case of sync conflicts, - // a new item can be created, but is never processed through "retrievedItems" since it is only created locally then saved. - // HOWEVER, by considering savedItems, we are now ruining everything, especially during sign in. A singleton can be created - // offline, and upon sign in, will sync all items to the server, and by combining retrievedItems & savedItems, and only choosing - // the latest, you are now resolving to the most recent one, which is in the savedItems list and not retrieved items, defeating - // the whole purpose of this thing. - // Updated solution: resolveSingletons will now evaluate both of these arrays separately. - - - _this16.resolveSingletons(data.retrievedItems, data.savedItems); - } - }); - /* - If an item alternates its uuid on registration, singletonHandlers might need to update - their local reference to the object, since the object reference will change on uuid alternation - */ - - modelManager.addModelUuidChangeObserver("singleton-manager", function (oldModel, newModel) { - var _iteratorNormalCompletion34 = true; - var _didIteratorError34 = false; - var _iteratorError34 = undefined; - - try { - for (var _iterator34 = _this16.singletonHandlers[Symbol.iterator](), _step34; !(_iteratorNormalCompletion34 = (_step34 = _iterator34.next()).done); _iteratorNormalCompletion34 = true) { - var handler = _step34.value; - - if (handler.singleton && SFPredicate.ItemSatisfiesPredicates(newModel, handler.predicates)) { - // Reference is now invalid, calling resolveSingleton should update it - handler.singleton = null; - - _this16.resolveSingletons([newModel]); - } - } - } catch (err) { - _didIteratorError34 = true; - _iteratorError34 = err; - } finally { - try { - if (!_iteratorNormalCompletion34 && _iterator34.return) { - _iterator34.return(); - } - } finally { - if (_didIteratorError34) { - throw _iteratorError34; - } - } - } - }); - } - - _createClass(SFSingletonManager, [{ - key: "registerSingleton", - value: function registerSingleton(predicates, resolveCallback, createBlock) { - /* - predicate: a key/value pair that specifies properties that should match in order for an item to be considered a predicate - resolveCallback: called when one or more items are deleted and a new item becomes the reigning singleton - createBlock: called when a sync is complete and no items are found. The createBlock should create the item and return it. - */ - this.singletonHandlers.push({ - predicates: predicates, - resolutionCallback: resolveCallback, - createBlock: createBlock - }); - } - }, { - key: "resolveSingletons", - value: function resolveSingletons(retrievedItems, savedItems, initialLoad) { - var _this17 = this; - - retrievedItems = retrievedItems || []; - savedItems = savedItems || []; - - var _loop3 = function _loop3(singletonHandler) { - var predicates = singletonHandler.predicates.slice(); - - var retrievedSingletonItems = _this17.modelManager.filterItemsWithPredicates(retrievedItems, predicates); - - var handleCreation = function handleCreation() { - if (singletonHandler.createBlock) { - singletonHandler.pendingCreateBlockCallback = true; - singletonHandler.createBlock(function (created) { - singletonHandler.singleton = created; - singletonHandler.pendingCreateBlockCallback = false; - singletonHandler.resolutionCallback && singletonHandler.resolutionCallback(created); - }); - } - }; // We only want to consider saved items count to see if it's more than 0, and do nothing else with it. - // This way we know there was some action and things need to be resolved. The saved items will come up - // in filterItemsWithPredicate(this.modelManager.allNondummyItems) and be deleted anyway - - - var savedSingletonItemsCount = _this17.modelManager.filterItemsWithPredicates(savedItems, predicates).length; - - if (retrievedSingletonItems.length > 0 || savedSingletonItemsCount > 0) { - /* - Check local inventory and make sure only 1 similar item exists. If more than 1, delete newest - Note that this local inventory will also contain whatever is in retrievedItems. - */ - var allExtantItemsMatchingPredicate = _this17.modelManager.itemsMatchingPredicates(predicates); - /* - Delete all but the earliest created - */ - - - if (allExtantItemsMatchingPredicate.length >= 2) { - var sorted = allExtantItemsMatchingPredicate.sort(function (a, b) { - /* - If compareFunction(a, b) is less than 0, sort a to an index lower than b, i.e. a comes first. - If compareFunction(a, b) is greater than 0, sort b to an index lower than a, i.e. b comes first. - */ - if (a.errorDecrypting) { - return 1; - } - - if (b.errorDecrypting) { - return -1; - } - - return a.created_at < b.created_at ? -1 : 1; - }); // The item that will be chosen to be kept - - var winningItem = sorted[0]; // Items that will be deleted - // Delete everything but the first one - - var toDelete = sorted.slice(1, sorted.length); - var _iteratorNormalCompletion36 = true; - var _didIteratorError36 = false; - var _iteratorError36 = undefined; - - try { - for (var _iterator36 = toDelete[Symbol.iterator](), _step36; !(_iteratorNormalCompletion36 = (_step36 = _iterator36.next()).done); _iteratorNormalCompletion36 = true) { - var d = _step36.value; - - _this17.modelManager.setItemToBeDeleted(d); - } - } catch (err) { - _didIteratorError36 = true; - _iteratorError36 = err; - } finally { - try { - if (!_iteratorNormalCompletion36 && _iterator36.return) { - _iterator36.return(); - } - } finally { - if (_didIteratorError36) { - throw _iteratorError36; - } - } - } - - _this17.syncManager.sync(); // Send remaining item to callback - - - singletonHandler.singleton = winningItem; - singletonHandler.resolutionCallback && singletonHandler.resolutionCallback(winningItem); - } else if (allExtantItemsMatchingPredicate.length == 1) { - var singleton = allExtantItemsMatchingPredicate[0]; - - if (singleton.errorDecrypting) { - // Delete the current singleton and create a new one - _this17.modelManager.setItemToBeDeleted(singleton); - - handleCreation(); - } else if (!singletonHandler.singleton || singletonHandler.singleton !== singleton) { - // Not yet notified interested parties of object - singletonHandler.singleton = singleton; - singletonHandler.resolutionCallback && singletonHandler.resolutionCallback(singleton); - } - } - } else { - // Retrieved items does not include any items of interest. If we don't have a singleton registered to this handler, - // we need to create one. Only do this on actual sync completetions and not on initial data load. Because we want - // to get the latest from the server before making the decision to create a new item - if (!singletonHandler.singleton && !initialLoad && !singletonHandler.pendingCreateBlockCallback) { - handleCreation(); - } - } - }; - - var _iteratorNormalCompletion35 = true; - var _didIteratorError35 = false; - var _iteratorError35 = undefined; - - try { - for (var _iterator35 = this.singletonHandlers[Symbol.iterator](), _step35; !(_iteratorNormalCompletion35 = (_step35 = _iterator35.next()).done); _iteratorNormalCompletion35 = true) { - var singletonHandler = _step35.value; - - _loop3(singletonHandler); - } - } catch (err) { - _didIteratorError35 = true; - _iteratorError35 = err; - } finally { - try { - if (!_iteratorNormalCompletion35 && _iterator35.return) { - _iterator35.return(); - } - } finally { - if (_didIteratorError35) { - throw _iteratorError35; - } - } - } - } - }]); - - return SFSingletonManager; - }(); - - ; // SFStorageManager should be subclassed, and all the methods below overwritten. - - var SFStorageManager = exports.SFStorageManager = function () { - function SFStorageManager() { - _classCallCheck(this, SFStorageManager); - } - - _createClass(SFStorageManager, [{ - key: "setItem", - - /* Simple Key/Value Storage */ - value: function () { - var _ref69 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee63(key, value) { - return regeneratorRuntime.wrap(function _callee63$(_context63) { - while (1) { - switch (_context63.prev = _context63.next) { - case 0: - case "end": - return _context63.stop(); - } - } - }, _callee63, this); - })); - - function setItem(_x88, _x89) { - return _ref69.apply(this, arguments); - } - - return setItem; - }() - }, { - key: "getItem", - value: function () { - var _ref70 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee64(key) { - return regeneratorRuntime.wrap(function _callee64$(_context64) { - while (1) { - switch (_context64.prev = _context64.next) { - case 0: - case "end": - return _context64.stop(); - } - } - }, _callee64, this); - })); - - function getItem(_x90) { - return _ref70.apply(this, arguments); - } - - return getItem; - }() - }, { - key: "removeItem", - value: function () { - var _ref71 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee65(key) { - return regeneratorRuntime.wrap(function _callee65$(_context65) { - while (1) { - switch (_context65.prev = _context65.next) { - case 0: - case "end": - return _context65.stop(); - } - } - }, _callee65, this); - })); - - function removeItem(_x91) { - return _ref71.apply(this, arguments); - } - - return removeItem; - }() - }, { - key: "clear", - value: function () { - var _ref72 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee66() { - return regeneratorRuntime.wrap(function _callee66$(_context66) { - while (1) { - switch (_context66.prev = _context66.next) { - case 0: - case "end": - return _context66.stop(); - } - } - }, _callee66, this); - })); - - function clear() { - return _ref72.apply(this, arguments); - } - - return clear; - }() - }, { - key: "getAllModels", - - /* - Model Storage - */ - value: function () { - var _ref73 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee67() { - return regeneratorRuntime.wrap(function _callee67$(_context67) { - while (1) { - switch (_context67.prev = _context67.next) { - case 0: - case "end": - return _context67.stop(); - } - } - }, _callee67, this); - })); - - function getAllModels() { - return _ref73.apply(this, arguments); - } - - return getAllModels; - }() - }, { - key: "saveModel", - value: function () { - var _ref74 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee68(item) { - return regeneratorRuntime.wrap(function _callee68$(_context68) { - while (1) { - switch (_context68.prev = _context68.next) { - case 0: - return _context68.abrupt("return", this.saveModels([item])); - - case 1: - case "end": - return _context68.stop(); - } - } - }, _callee68, this); - })); - - function saveModel(_x92) { - return _ref74.apply(this, arguments); - } - - return saveModel; - }() - }, { - key: "saveModels", - value: function () { - var _ref75 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee69(items) { - return regeneratorRuntime.wrap(function _callee69$(_context69) { - while (1) { - switch (_context69.prev = _context69.next) { - case 0: - case "end": - return _context69.stop(); - } - } - }, _callee69, this); - })); - - function saveModels(_x93) { - return _ref75.apply(this, arguments); - } - - return saveModels; - }() - }, { - key: "deleteModel", - value: function () { - var _ref76 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee70(item) { - return regeneratorRuntime.wrap(function _callee70$(_context70) { - while (1) { - switch (_context70.prev = _context70.next) { - case 0: - case "end": - return _context70.stop(); - } - } - }, _callee70, this); - })); - - function deleteModel(_x94) { - return _ref76.apply(this, arguments); - } - - return deleteModel; - }() - }, { - key: "clearAllModels", - value: function () { - var _ref77 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee71() { - return regeneratorRuntime.wrap(function _callee71$(_context71) { - while (1) { - switch (_context71.prev = _context71.next) { - case 0: - case "end": - return _context71.stop(); - } - } - }, _callee71, this); - })); - - function clearAllModels() { - return _ref77.apply(this, arguments); - } - - return clearAllModels; - }() - }, { - key: "clearAllData", - - /* General */ - value: function () { - var _ref78 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee72() { - return regeneratorRuntime.wrap(function _callee72$(_context72) { - while (1) { - switch (_context72.prev = _context72.next) { - case 0: - return _context72.abrupt("return", Promise.all([this.clear(), this.clearAllModels()])); - - case 1: - case "end": - return _context72.stop(); - } - } - }, _callee72, this); - })); - - function clearAllData() { - return _ref78.apply(this, arguments); - } - - return clearAllData; - }() - }]); - - return SFStorageManager; - }(); - - ; - - var SFSyncManager = exports.SFSyncManager = function () { - function SFSyncManager(modelManager, storageManager, httpManager, timeout, interval) { - _classCallCheck(this, SFSyncManager); - - SFSyncManager.KeyRequestLoadLocal = "KeyRequestLoadLocal"; - SFSyncManager.KeyRequestSaveLocal = "KeyRequestSaveLocal"; - SFSyncManager.KeyRequestLoadSaveAccount = "KeyRequestLoadSaveAccount"; - this.httpManager = httpManager; - this.modelManager = modelManager; - this.storageManager = storageManager; // Allows you to et your own interval/timeout function (i.e if you're using angular and want to use $timeout) - - this.$interval = interval || setInterval.bind(window); - this.$timeout = timeout || setTimeout.bind(window); - this.syncStatus = {}; - this.syncStatusObservers = []; - this.eventHandlers = []; - this.PerSyncItemUploadLimit = 100; // The number of changed items that constitute a major change - // This is used by the desktop app to create backups - - this.MajorDataChangeThreshold = 15; // Sync integrity checking - // If X consective sync requests return mismatching hashes, then we officially enter out-of-sync. - - this.MaxDiscordanceBeforeOutOfSync = 5; // How many consective sync results have had mismatching hashes. This value can never exceed this.MaxDiscordanceBeforeOutOfSync. - - this.syncDiscordance = 0; - this.outOfSync = false; - } - - _createClass(SFSyncManager, [{ - key: "handleServerIntegrityHash", - value: function () { - var _ref79 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee73(serverHash) { - var localHash; - return regeneratorRuntime.wrap(function _callee73$(_context73) { - while (1) { - switch (_context73.prev = _context73.next) { - case 0: - if (!(!serverHash || serverHash.length == 0)) { - _context73.next = 2; - break; - } - - return _context73.abrupt("return", true); - - case 2: - _context73.next = 4; - return this.modelManager.computeDataIntegrityHash(); - - case 4: - localHash = _context73.sent; - - if (localHash) { - _context73.next = 7; - break; - } - - return _context73.abrupt("return", true); - - case 7: - if (!(localHash !== serverHash)) { - _context73.next = 13; - break; - } - - this.syncDiscordance++; - - if (this.syncDiscordance >= this.MaxDiscordanceBeforeOutOfSync) { - if (!this.outOfSync) { - this.outOfSync = true; - this.notifyEvent("enter-out-of-sync"); - } - } - - return _context73.abrupt("return", false); - - case 13: - // Integrity matches - if (this.outOfSync) { - this.outOfSync = false; - this.notifyEvent("exit-out-of-sync"); - } - - this.syncDiscordance = 0; - return _context73.abrupt("return", true); - - case 16: - case "end": - return _context73.stop(); - } - } - }, _callee73, this); - })); - - function handleServerIntegrityHash(_x95) { - return _ref79.apply(this, arguments); - } - - return handleServerIntegrityHash; - }() - }, { - key: "isOutOfSync", - value: function isOutOfSync() { - // Once we are outOfSync, it's up to the client to display UI to the user to instruct them - // to take action. The client should present a reconciliation wizard. - return this.outOfSync; - } - }, { - key: "getServerURL", - value: function () { - var _ref80 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee74() { - return regeneratorRuntime.wrap(function _callee74$(_context74) { - while (1) { - switch (_context74.prev = _context74.next) { - case 0: - _context74.next = 2; - return this.storageManager.getItem("server"); - - case 2: - _context74.t0 = _context74.sent; - - if (_context74.t0) { - _context74.next = 5; - break; - } - - _context74.t0 = window._default_sf_server; - - case 5: - return _context74.abrupt("return", _context74.t0); - - case 6: - case "end": - return _context74.stop(); - } - } - }, _callee74, this); - })); - - function getServerURL() { - return _ref80.apply(this, arguments); - } - - return getServerURL; - }() - }, { - key: "getSyncURL", - value: function () { - var _ref81 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee75() { - return regeneratorRuntime.wrap(function _callee75$(_context75) { - while (1) { - switch (_context75.prev = _context75.next) { - case 0: - _context75.next = 2; - return this.getServerURL(); - - case 2: - _context75.t0 = _context75.sent; - return _context75.abrupt("return", _context75.t0 + "/items/sync"); - - case 4: - case "end": - return _context75.stop(); - } - } - }, _callee75, this); - })); - - function getSyncURL() { - return _ref81.apply(this, arguments); - } - - return getSyncURL; - }() - }, { - key: "registerSyncStatusObserver", - value: function registerSyncStatusObserver(callback) { - var observer = { - key: new Date(), - callback: callback - }; - this.syncStatusObservers.push(observer); - return observer; - } - }, { - key: "removeSyncStatusObserver", - value: function removeSyncStatusObserver(observer) { - _.pull(this.syncStatusObservers, observer); - } - }, { - key: "syncStatusDidChange", - value: function syncStatusDidChange() { - var _this18 = this; - - this.syncStatusObservers.forEach(function (observer) { - observer.callback(_this18.syncStatus); - }); - } - }, { - key: "addEventHandler", - value: function addEventHandler(handler) { - /* - Possible Events: - sync:completed - sync:taking-too-long - sync:updated_token - sync:error - major-data-change - local-data-loaded - sync-session-invalid - sync-exception - */ - this.eventHandlers.push(handler); - return handler; - } - }, { - key: "removeEventHandler", - value: function removeEventHandler(handler) { - _.pull(this.eventHandlers, handler); - } - }, { - key: "notifyEvent", - value: function notifyEvent(syncEvent, data) { - var _iteratorNormalCompletion37 = true; - var _didIteratorError37 = false; - var _iteratorError37 = undefined; - - try { - for (var _iterator37 = this.eventHandlers[Symbol.iterator](), _step37; !(_iteratorNormalCompletion37 = (_step37 = _iterator37.next()).done); _iteratorNormalCompletion37 = true) { - var handler = _step37.value; - handler(syncEvent, data || {}); - } - } catch (err) { - _didIteratorError37 = true; - _iteratorError37 = err; - } finally { - try { - if (!_iteratorNormalCompletion37 && _iterator37.return) { - _iterator37.return(); - } - } finally { - if (_didIteratorError37) { - throw _iteratorError37; - } - } - } - } - }, { - key: "setKeyRequestHandler", - value: function setKeyRequestHandler(handler) { - this.keyRequestHandler = handler; - } - }, { - key: "getActiveKeyInfo", - value: function () { - var _ref82 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee76(request) { - return regeneratorRuntime.wrap(function _callee76$(_context76) { - while (1) { - switch (_context76.prev = _context76.next) { - case 0: - return _context76.abrupt("return", this.keyRequestHandler(request)); - - case 1: - case "end": - return _context76.stop(); - } - } - }, _callee76, this); - })); - - function getActiveKeyInfo(_x96) { - return _ref82.apply(this, arguments); - } - - return getActiveKeyInfo; - }() - }, { - key: "initialDataLoaded", - value: function initialDataLoaded() { - return this._initialDataLoaded; - } - }, { - key: "loadLocalItems", - value: function () { - var _ref83 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee78(incrementalCallback) { - var _this19 = this; - - var batchSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100; - return regeneratorRuntime.wrap(function _callee78$(_context78) { - while (1) { - switch (_context78.prev = _context78.next) { - case 0: - return _context78.abrupt("return", this.storageManager.getAllModels().then(function (items) { - // put most recently updated at beginning, sorted by priority - items = items.sort(function (a, b) { - var dateResult = new Date(b.updated_at) - new Date(a.updated_at); - var priorityList = _this19.contentTypeLoadPriority; - var aPriority = 0, - bPriority = 0; - - if (priorityList) { - aPriority = priorityList.indexOf(a.content_type); - bPriority = priorityList.indexOf(b.content_type); - - if (aPriority == -1) { - // Not found in list, not prioritized. Set it to max value - aPriority = priorityList.length; - } - - if (bPriority == -1) { - // Not found in list, not prioritized. Set it to max value - bPriority = priorityList.length; - } - } - - if (aPriority == bPriority) { - return dateResult; - } - - if (aPriority < bPriority) { - return -1; - } else { - return 1; - } // aPriority < bPriority means a should come first - - - return aPriority < bPriority ? -1 : 1; - }); // break it up into chunks to make interface more responsive for large item counts - - var total = items.length; - var current = 0; - var processed = []; - - var decryptNext = function () { - var _ref84 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee77() { - var subitems, processedSubitems; - return regeneratorRuntime.wrap(function _callee77$(_context77) { - while (1) { - switch (_context77.prev = _context77.next) { - case 0: - subitems = items.slice(current, current + batchSize); - _context77.next = 3; - return _this19.handleItemsResponse(subitems, null, SFModelManager.MappingSourceLocalRetrieved, SFSyncManager.KeyRequestLoadLocal); - - case 3: - processedSubitems = _context77.sent; - processed.push(processedSubitems); - current += subitems.length; - - if (!(current < total)) { - _context77.next = 10; - break; - } - - return _context77.abrupt("return", new Promise(function (innerResolve, innerReject) { - _this19.$timeout(function () { - _this19.notifyEvent("local-data-incremental-load"); - - incrementalCallback && incrementalCallback(current, total); - decryptNext().then(innerResolve); - }); - })); - - case 10: - // Completed - _this19.notifyEvent("local-data-loaded"); - - _this19._initialDataLoaded = true; - - case 12: - case "end": - return _context77.stop(); - } - } - }, _callee77, _this19); - })); - - return function decryptNext() { - return _ref84.apply(this, arguments); - }; - }(); - - return decryptNext(); - })); - - case 1: - case "end": - return _context78.stop(); - } - } - }, _callee78, this); - })); - - function loadLocalItems(_x98) { - return _ref83.apply(this, arguments); - } - - return loadLocalItems; - }() - }, { - key: "writeItemsToLocalStorage", - value: function () { - var _ref85 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee81(items, offlineOnly) { - var _this20 = this; - - return regeneratorRuntime.wrap(function _callee81$(_context81) { - while (1) { - switch (_context81.prev = _context81.next) { - case 0: - return _context81.abrupt("return", new Promise(function () { - var _ref86 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee80(resolve, reject) { - var info; - return regeneratorRuntime.wrap(function _callee80$(_context80) { - while (1) { - switch (_context80.prev = _context80.next) { - case 0: - if (!(items.length == 0)) { - _context80.next = 3; - break; - } - - resolve(); - return _context80.abrupt("return"); - - case 3: - _context80.next = 5; - return _this20.getActiveKeyInfo(SFSyncManager.KeyRequestSaveLocal); - - case 5: - info = _context80.sent; - Promise.all(items.map(function () { - var _ref87 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee79(item) { - var itemParams; - return regeneratorRuntime.wrap(function _callee79$(_context79) { - while (1) { - switch (_context79.prev = _context79.next) { - case 0: - itemParams = new SFItemParams(item, info.keys, info.auth_params); - _context79.next = 3; - return itemParams.paramsForLocalStorage(); - - case 3: - itemParams = _context79.sent; - - if (offlineOnly) { - delete itemParams.dirty; - } - - return _context79.abrupt("return", itemParams); - - case 6: - case "end": - return _context79.stop(); - } - } - }, _callee79, _this20); - })); - - return function (_x103) { - return _ref87.apply(this, arguments); - }; - }())).then(function (params) { - _this20.storageManager.saveModels(params).then(function () { - // on success - if (_this20.syncStatus.localError) { - _this20.syncStatus.localError = null; - - _this20.syncStatusDidChange(); - } - - resolve(); - }).catch(function (error) { - // on error - console.error("Error writing items", error); - _this20.syncStatus.localError = error; - - _this20.syncStatusDidChange(); - - reject(); - }); - }).catch(function (e) { - reject(e); - }); - - case 7: - case "end": - return _context80.stop(); - } - } - }, _callee80, _this20); - })); - - return function (_x101, _x102) { - return _ref86.apply(this, arguments); - }; - }())); - - case 1: - case "end": - return _context81.stop(); - } - } - }, _callee81, this); - })); - - function writeItemsToLocalStorage(_x99, _x100) { - return _ref85.apply(this, arguments); - } - - return writeItemsToLocalStorage; - }() - }, { - key: "syncOffline", - value: function () { - var _ref88 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee82(items) { - var _this21 = this; - - var _iteratorNormalCompletion38, _didIteratorError38, _iteratorError38, _iterator38, _step38, item; - - return regeneratorRuntime.wrap(function _callee82$(_context82) { - while (1) { - switch (_context82.prev = _context82.next) { - case 0: - // Update all items updated_at to now - _iteratorNormalCompletion38 = true; - _didIteratorError38 = false; - _iteratorError38 = undefined; - _context82.prev = 3; - - for (_iterator38 = items[Symbol.iterator](); !(_iteratorNormalCompletion38 = (_step38 = _iterator38.next()).done); _iteratorNormalCompletion38 = true) { - item = _step38.value; - item.updated_at = new Date(); - } - - _context82.next = 11; - break; - - case 7: - _context82.prev = 7; - _context82.t0 = _context82["catch"](3); - _didIteratorError38 = true; - _iteratorError38 = _context82.t0; - - case 11: - _context82.prev = 11; - _context82.prev = 12; - - if (!_iteratorNormalCompletion38 && _iterator38.return) { - _iterator38.return(); - } - - case 14: - _context82.prev = 14; - - if (!_didIteratorError38) { - _context82.next = 17; - break; - } - - throw _iteratorError38; - - case 17: - return _context82.finish(14); - - case 18: - return _context82.finish(11); - - case 19: - return _context82.abrupt("return", this.writeItemsToLocalStorage(items, true).then(function (responseItems) { - // delete anything needing to be deleted - var _iteratorNormalCompletion39 = true; - var _didIteratorError39 = false; - var _iteratorError39 = undefined; - - try { - for (var _iterator39 = items[Symbol.iterator](), _step39; !(_iteratorNormalCompletion39 = (_step39 = _iterator39.next()).done); _iteratorNormalCompletion39 = true) { - var _item = _step39.value; - - if (_item.deleted) { - _this21.modelManager.removeItemLocally(_item); - } - } - } catch (err) { - _didIteratorError39 = true; - _iteratorError39 = err; - } finally { - try { - if (!_iteratorNormalCompletion39 && _iterator39.return) { - _iterator39.return(); - } - } finally { - if (_didIteratorError39) { - throw _iteratorError39; - } - } - } - - _this21.notifyEvent("sync:completed", { - savedItems: items - }); // Required in order for modelManager to notify sync observers - - - _this21.modelManager.didSyncModelsOffline(items); - - return { - saved_items: items - }; - })); - - case 20: - case "end": - return _context82.stop(); - } - } - }, _callee82, this, [[3, 7, 11, 19], [12,, 14, 18]]); - })); - - function syncOffline(_x104) { - return _ref88.apply(this, arguments); - } - - return syncOffline; - }() - /* - In the case of signing in and merging local data, we alternative UUIDs - to avoid overwriting data a user may retrieve that has the same UUID. - Alternating here forces us to to create duplicates of the items instead. - */ - - }, { - key: "markAllItemsDirtyAndSaveOffline", - value: function () { - var _ref89 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee83(alternateUUIDs) { - var originalItems, _iteratorNormalCompletion40, _didIteratorError40, _iteratorError40, _iterator40, _step40, item, allItems, _iteratorNormalCompletion41, _didIteratorError41, _iteratorError41, _iterator41, _step41, _item2; - - return regeneratorRuntime.wrap(function _callee83$(_context83) { - while (1) { - switch (_context83.prev = _context83.next) { - case 0: - // use a copy, as alternating uuid will affect array - originalItems = this.modelManager.allNondummyItems.filter(function (item) { - return !item.errorDecrypting; - }).slice(); - - if (!alternateUUIDs) { - _context83.next = 28; - break; - } - - _iteratorNormalCompletion40 = true; - _didIteratorError40 = false; - _iteratorError40 = undefined; - _context83.prev = 5; - _iterator40 = originalItems[Symbol.iterator](); - - case 7: - if (_iteratorNormalCompletion40 = (_step40 = _iterator40.next()).done) { - _context83.next = 14; - break; - } - - item = _step40.value; - _context83.next = 11; - return this.modelManager.alternateUUIDForItem(item); - - case 11: - _iteratorNormalCompletion40 = true; - _context83.next = 7; - break; - - case 14: - _context83.next = 20; - break; - - case 16: - _context83.prev = 16; - _context83.t0 = _context83["catch"](5); - _didIteratorError40 = true; - _iteratorError40 = _context83.t0; - - case 20: - _context83.prev = 20; - _context83.prev = 21; - - if (!_iteratorNormalCompletion40 && _iterator40.return) { - _iterator40.return(); - } - - case 23: - _context83.prev = 23; - - if (!_didIteratorError40) { - _context83.next = 26; - break; - } - - throw _iteratorError40; - - case 26: - return _context83.finish(23); - - case 27: - return _context83.finish(20); - - case 28: - allItems = this.modelManager.allNondummyItems; - _iteratorNormalCompletion41 = true; - _didIteratorError41 = false; - _iteratorError41 = undefined; - _context83.prev = 32; - - for (_iterator41 = allItems[Symbol.iterator](); !(_iteratorNormalCompletion41 = (_step41 = _iterator41.next()).done); _iteratorNormalCompletion41 = true) { - _item2 = _step41.value; - - _item2.setDirty(true); - } - - _context83.next = 40; - break; - - case 36: - _context83.prev = 36; - _context83.t1 = _context83["catch"](32); - _didIteratorError41 = true; - _iteratorError41 = _context83.t1; - - case 40: - _context83.prev = 40; - _context83.prev = 41; - - if (!_iteratorNormalCompletion41 && _iterator41.return) { - _iterator41.return(); - } - - case 43: - _context83.prev = 43; - - if (!_didIteratorError41) { - _context83.next = 46; - break; - } - - throw _iteratorError41; - - case 46: - return _context83.finish(43); - - case 47: - return _context83.finish(40); - - case 48: - return _context83.abrupt("return", this.writeItemsToLocalStorage(allItems, false)); - - case 49: - case "end": - return _context83.stop(); - } - } - }, _callee83, this, [[5, 16, 20, 28], [21,, 23, 27], [32, 36, 40, 48], [41,, 43, 47]]); - })); - - function markAllItemsDirtyAndSaveOffline(_x105) { - return _ref89.apply(this, arguments); - } - - return markAllItemsDirtyAndSaveOffline; - }() - }, { - key: "setSyncToken", - value: function () { - var _ref90 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee84(token) { - return regeneratorRuntime.wrap(function _callee84$(_context84) { - while (1) { - switch (_context84.prev = _context84.next) { - case 0: - this._syncToken = token; - _context84.next = 3; - return this.storageManager.setItem("syncToken", token); - - case 3: - case "end": - return _context84.stop(); - } - } - }, _callee84, this); - })); - - function setSyncToken(_x106) { - return _ref90.apply(this, arguments); - } - - return setSyncToken; - }() - }, { - key: "getSyncToken", - value: function () { - var _ref91 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee85() { - return regeneratorRuntime.wrap(function _callee85$(_context85) { - while (1) { - switch (_context85.prev = _context85.next) { - case 0: - if (this._syncToken) { - _context85.next = 4; - break; - } - - _context85.next = 3; - return this.storageManager.getItem("syncToken"); - - case 3: - this._syncToken = _context85.sent; - - case 4: - return _context85.abrupt("return", this._syncToken); - - case 5: - case "end": - return _context85.stop(); - } - } - }, _callee85, this); - })); - - function getSyncToken() { - return _ref91.apply(this, arguments); - } - - return getSyncToken; - }() - }, { - key: "setCursorToken", - value: function () { - var _ref92 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee86(token) { - return regeneratorRuntime.wrap(function _callee86$(_context86) { - while (1) { - switch (_context86.prev = _context86.next) { - case 0: - this._cursorToken = token; - - if (!token) { - _context86.next = 6; - break; - } - - _context86.next = 4; - return this.storageManager.setItem("cursorToken", token); - - case 4: - _context86.next = 8; - break; - - case 6: - _context86.next = 8; - return this.storageManager.removeItem("cursorToken"); - - case 8: - case "end": - return _context86.stop(); - } - } - }, _callee86, this); - })); - - function setCursorToken(_x107) { - return _ref92.apply(this, arguments); - } - - return setCursorToken; - }() - }, { - key: "getCursorToken", - value: function () { - var _ref93 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee87() { - return regeneratorRuntime.wrap(function _callee87$(_context87) { - while (1) { - switch (_context87.prev = _context87.next) { - case 0: - if (this._cursorToken) { - _context87.next = 4; - break; - } - - _context87.next = 3; - return this.storageManager.getItem("cursorToken"); - - case 3: - this._cursorToken = _context87.sent; - - case 4: - return _context87.abrupt("return", this._cursorToken); - - case 5: - case "end": - return _context87.stop(); - } - } - }, _callee87, this); - })); - - function getCursorToken() { - return _ref93.apply(this, arguments); - } - - return getCursorToken; - }() - }, { - key: "clearQueuedCallbacks", - value: function clearQueuedCallbacks() { - this._queuedCallbacks = []; - } - }, { - key: "callQueuedCallbacks", - value: function callQueuedCallbacks(response) { - var allCallbacks = this.queuedCallbacks; - - if (allCallbacks.length) { - var _iteratorNormalCompletion42 = true; - var _didIteratorError42 = false; - var _iteratorError42 = undefined; - - try { - for (var _iterator42 = allCallbacks[Symbol.iterator](), _step42; !(_iteratorNormalCompletion42 = (_step42 = _iterator42.next()).done); _iteratorNormalCompletion42 = true) { - var eachCallback = _step42.value; - eachCallback(response); - } - } catch (err) { - _didIteratorError42 = true; - _iteratorError42 = err; - } finally { - try { - if (!_iteratorNormalCompletion42 && _iterator42.return) { - _iterator42.return(); - } - } finally { - if (_didIteratorError42) { - throw _iteratorError42; - } - } - } - - this.clearQueuedCallbacks(); - } - } - }, { - key: "beginCheckingIfSyncIsTakingTooLong", - value: function beginCheckingIfSyncIsTakingTooLong() { - if (this.syncStatus.checker) { - this.stopCheckingIfSyncIsTakingTooLong(); - } - - this.syncStatus.checker = this.$interval(function () { - // check to see if the ongoing sync is taking too long, alert the user - var secondsPassed = (new Date() - this.syncStatus.syncStart) / 1000; - var warningThreshold = 5.0; // seconds - - if (secondsPassed > warningThreshold) { - this.notifyEvent("sync:taking-too-long"); - this.stopCheckingIfSyncIsTakingTooLong(); - } - }.bind(this), 500); - } - }, { - key: "stopCheckingIfSyncIsTakingTooLong", - value: function stopCheckingIfSyncIsTakingTooLong() { - if (this.$interval.hasOwnProperty("cancel")) { - this.$interval.cancel(this.syncStatus.checker); - } else { - clearInterval(this.syncStatus.checker); - } - - this.syncStatus.checker = null; - } - }, { - key: "lockSyncing", - value: function lockSyncing() { - this.syncLocked = true; - } - }, { - key: "unlockSyncing", - value: function unlockSyncing() { - this.syncLocked = false; - } - }, { - key: "sync", - value: function () { - var _ref94 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee89() { - var _this22 = this; - - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return regeneratorRuntime.wrap(function _callee89$(_context89) { - while (1) { - switch (_context89.prev = _context89.next) { - case 0: - return _context89.abrupt("return", new Promise(function () { - var _ref95 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee88(resolve, reject) { - var allDirtyItems, dirtyItemsNotYetSaved, info, isContinuationSync, submitLimit, subItems, params, _iteratorNormalCompletion43, _didIteratorError43, _iteratorError43, _iterator43, _step43, item; - - return regeneratorRuntime.wrap(function _callee88$(_context88) { - while (1) { - switch (_context88.prev = _context88.next) { - case 0: - if (!_this22.syncLocked) { - _context88.next = 4; - break; - } - - console.log("Sync Locked, Returning;"); - resolve(); - return _context88.abrupt("return"); - - case 4: - if (!options) options = {}; - allDirtyItems = _this22.modelManager.getDirtyItems(); - /* - When it comes to saving to disk before the sync request (both in syncOpInProgress and preSyncSave), - you only want to save items that have a dirty count > 0. That's because, if for example, you're syncing - 2000 items, and every sync request handles only 150 items at a time, then every sync request will - be writing the same thousand items to storage every time. Writing a thousand items to storage can take 10s. - So, save to local storage only items with dirtyCount > 0, then, after saving, set dirtyCount to 0. - This way, if an item changes again, it will be saved next sync. - */ - - dirtyItemsNotYetSaved = allDirtyItems.filter(function (candidate) { - if (candidate.dirtyCount > 0) { - candidate.dirtyCount = 0; - return true; - } else { - return false; - } - }); // When a user hits the physical refresh button, we want to force refresh, in case - // the sync engine is stuck in some inProgress loop. - - if (!(_this22.syncStatus.syncOpInProgress && !options.force)) { - _context88.next = 14; - break; - } - - _this22.repeatOnCompletion = true; - - _this22.queuedCallbacks.push(resolve); - - _context88.next = 12; - return _this22.writeItemsToLocalStorage(dirtyItemsNotYetSaved, false); - - case 12: - console.log("Sync op in progress; returning."); - return _context88.abrupt("return"); - - case 14: - _context88.next = 16; - return _this22.getActiveKeyInfo(SFSyncManager.KeyRequestLoadSaveAccount); - - case 16: - info = _context88.sent; - - if (!info.offline) { - _context88.next = 20; - break; - } - - _this22.syncOffline(allDirtyItems).then(function (response) { - _this22.modelManager.clearDirtyItems(allDirtyItems); - - resolve(response); - }).catch(function (e) { - _this22.notifyEvent("sync-exception", e); - }); - - return _context88.abrupt("return"); - - case 20: - isContinuationSync = _this22.syncStatus.needsMoreSync; - _this22.syncStatus.syncOpInProgress = true; - _this22.syncStatus.syncStart = new Date(); - - _this22.beginCheckingIfSyncIsTakingTooLong(); - - submitLimit = _this22.PerSyncItemUploadLimit; - subItems = allDirtyItems.slice(0, submitLimit); - - if (subItems.length < allDirtyItems.length) { - // more items left to be synced, repeat - _this22.syncStatus.needsMoreSync = true; - } else { - _this22.syncStatus.needsMoreSync = false; - } - - if (!isContinuationSync) { - _this22.syncStatus.total = allDirtyItems.length; - _this22.syncStatus.current = 0; - } // If items are marked as dirty during a long running sync request, total isn't updated - // This happens mostly in the case of large imports and sync conflicts where duplicated items are created - - - if (_this22.syncStatus.current > _this22.syncStatus.total) { - _this22.syncStatus.total = _this22.syncStatus.current; - } - - _this22.syncStatusDidChange(); // Perform save after you've updated all status signals above. Presync save can take several seconds in some cases. - // Write to local storage before beginning sync. - // This way, if they close the browser before the sync request completes, local changes will not be lost - - - _context88.next = 32; - return _this22.writeItemsToLocalStorage(dirtyItemsNotYetSaved, false); - - case 32: - if (options.onPreSyncSave) { - options.onPreSyncSave(); - } // when doing a sync request that returns items greater than the limit, and thus subsequent syncs are required, - // we want to keep track of all retreived items, then save to local storage only once all items have been retrieved, - // so that relationships remain intact - // Update 12/18: I don't think we need to do this anymore, since relationships will now retroactively resolve their relationships, - // if an item they were looking for hasn't been pulled in yet. - - - if (!_this22.allRetreivedItems) { - _this22.allRetreivedItems = []; - } // We also want to do this for savedItems - - - if (!_this22.allSavedItems) { - _this22.allSavedItems = []; - } - - params = {}; - params.limit = 150; - - if (options.performIntegrityCheck) { - params.compute_integrity = true; - } - - _context88.prev = 38; - _context88.next = 41; - return Promise.all(subItems.map(function (item) { - var itemParams = new SFItemParams(item, info.keys, info.auth_params); - itemParams.additionalFields = options.additionalFields; - return itemParams.paramsForSync(); - })).then(function (itemsParams) { - params.items = itemsParams; - }); - - case 41: - _context88.next = 46; - break; - - case 43: - _context88.prev = 43; - _context88.t0 = _context88["catch"](38); - - _this22.notifyEvent("sync-exception", _context88.t0); - - case 46: - _iteratorNormalCompletion43 = true; - _didIteratorError43 = false; - _iteratorError43 = undefined; - _context88.prev = 49; - - for (_iterator43 = subItems[Symbol.iterator](); !(_iteratorNormalCompletion43 = (_step43 = _iterator43.next()).done); _iteratorNormalCompletion43 = true) { - item = _step43.value; // Reset dirty counter to 0, since we're about to sync it. - // This means anyone marking the item as dirty after this will cause it so sync again and not be cleared on sync completion. - - item.dirtyCount = 0; - } - - _context88.next = 57; - break; - - case 53: - _context88.prev = 53; - _context88.t1 = _context88["catch"](49); - _didIteratorError43 = true; - _iteratorError43 = _context88.t1; - - case 57: - _context88.prev = 57; - _context88.prev = 58; - - if (!_iteratorNormalCompletion43 && _iterator43.return) { - _iterator43.return(); - } - - case 60: - _context88.prev = 60; - - if (!_didIteratorError43) { - _context88.next = 63; - break; - } - - throw _iteratorError43; - - case 63: - return _context88.finish(60); - - case 64: - return _context88.finish(57); - - case 65: - _context88.next = 67; - return _this22.getSyncToken(); - - case 67: - params.sync_token = _context88.sent; - _context88.next = 70; - return _this22.getCursorToken(); - - case 70: - params.cursor_token = _context88.sent; - _context88.prev = 71; - _context88.t2 = _this22.httpManager; - _context88.next = 75; - return _this22.getSyncURL(); - - case 75: - _context88.t3 = _context88.sent; - _context88.t4 = params; - - _context88.t5 = function (response) { - _this22.handleSyncSuccess(subItems, response, options).then(function () { - resolve(response); - }).catch(function (e) { - console.log("Caught sync success exception:", e); - - _this22.handleSyncError(null, null, allDirtyItems).then(function (errorResponse) { - resolve(errorResponse); - }); - }); - }; - - _context88.t6 = function (response, statusCode) { - _this22.handleSyncError(response, statusCode, allDirtyItems).then(function (errorResponse) { - resolve(errorResponse); - }); - }; - - _context88.t2.postAbsolute.call(_context88.t2, _context88.t3, _context88.t4, _context88.t5, _context88.t6); - - _context88.next = 85; - break; - - case 82: - _context88.prev = 82; - _context88.t7 = _context88["catch"](71); - console.log("Sync exception caught:", _context88.t7); - - case 85: - case "end": - return _context88.stop(); - } - } - }, _callee88, _this22, [[38, 43], [49, 53, 57, 65], [58,, 60, 64], [71, 82]]); - })); - - return function (_x109, _x110) { - return _ref95.apply(this, arguments); - }; - }())); - - case 1: - case "end": - return _context89.stop(); - } - } - }, _callee89, this); - })); - - function sync() { - return _ref94.apply(this, arguments); - } - - return sync; - }() - }, { - key: "handleSyncSuccess", - value: function () { - var _ref96 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee90(syncedItems, response, options) { - var _this23 = this; - - var itemsToClearAsDirty, _iteratorNormalCompletion44, _didIteratorError44, _iteratorError44, _iterator44, _step44, item, allSavedUUIDs, retrieved, omitFields, saved, unsaved, matches, cursorToken; - - return regeneratorRuntime.wrap(function _callee90$(_context90) { - while (1) { - switch (_context90.prev = _context90.next) { - case 0: - // Check to make sure any subItem hasn't been marked as dirty again while a sync was ongoing - itemsToClearAsDirty = []; - _iteratorNormalCompletion44 = true; - _didIteratorError44 = false; - _iteratorError44 = undefined; - _context90.prev = 4; - - for (_iterator44 = syncedItems[Symbol.iterator](); !(_iteratorNormalCompletion44 = (_step44 = _iterator44.next()).done); _iteratorNormalCompletion44 = true) { - item = _step44.value; - - if (item.dirtyCount == 0) { - // Safe to clear as dirty - itemsToClearAsDirty.push(item); - } - } - - _context90.next = 12; - break; - - case 8: - _context90.prev = 8; - _context90.t0 = _context90["catch"](4); - _didIteratorError44 = true; - _iteratorError44 = _context90.t0; - - case 12: - _context90.prev = 12; - _context90.prev = 13; - - if (!_iteratorNormalCompletion44 && _iterator44.return) { - _iterator44.return(); - } - - case 15: - _context90.prev = 15; - - if (!_didIteratorError44) { - _context90.next = 18; - break; - } - - throw _iteratorError44; - - case 18: - return _context90.finish(15); - - case 19: - return _context90.finish(12); - - case 20: - this.modelManager.clearDirtyItems(itemsToClearAsDirty); - this.syncStatus.error = null; // Filter retrieved_items to remove any items that may be in saved_items for this complete sync operation - // When signing in, and a user requires many round trips to complete entire retrieval of data, an item may be saved - // on the first trip, then on subsequent trips using cursor_token, this same item may be returned, since it's date is - // greater than cursor_token. We keep track of all saved items in whole sync operation with this.allSavedItems - // We need this because singletonManager looks at retrievedItems as higher precendence than savedItems, but if it comes in both - // then that's problematic. - - allSavedUUIDs = this.allSavedItems.map(function (item) { - return item.uuid; - }); - response.retrieved_items = response.retrieved_items.filter(function (candidate) { - return !allSavedUUIDs.includes(candidate.uuid); - }); // Map retrieved items to local data - // Note that deleted items will not be returned - - _context90.next = 26; - return this.handleItemsResponse(response.retrieved_items, null, SFModelManager.MappingSourceRemoteRetrieved, SFSyncManager.KeyRequestLoadSaveAccount); - - case 26: - retrieved = _context90.sent; // Append items to master list of retrieved items for this ongoing sync operation - - this.allRetreivedItems = this.allRetreivedItems.concat(retrieved); - this.syncStatus.retrievedCount = this.allRetreivedItems.length; // Merge only metadata for saved items - // we write saved items to disk now because it clears their dirty status then saves - // if we saved items before completion, we had have to save them as dirty and save them again on success as clean - - omitFields = ["content", "auth_hash"]; // Map saved items to local data - - _context90.next = 32; - return this.handleItemsResponse(response.saved_items, omitFields, SFModelManager.MappingSourceRemoteSaved, SFSyncManager.KeyRequestLoadSaveAccount); - - case 32: - saved = _context90.sent; // Append items to master list of saved items for this ongoing sync operation - - this.allSavedItems = this.allSavedItems.concat(saved); // Create copies of items or alternate their uuids if neccessary - - unsaved = response.unsaved; // don't `await`. This function calls sync, so if you wait, it will call sync without having completed the sync we're in. - // On second thought, calling await will only await the local conflict resolution and not await the sync call. - // We do need to wait here for sync duplication to finish. If we don't, there seems to be an issue where if you import a large - // backup with uuid-conflcits (from another account), you'll see very confused duplication. - - _context90.next = 37; - return this.handleUnsavedItemsResponse(unsaved); - - case 37: - _context90.next = 39; - return this.writeItemsToLocalStorage(saved, false); - - case 39: - _context90.next = 41; - return this.writeItemsToLocalStorage(retrieved, false); - - case 41: - this.syncStatus.syncOpInProgress = false; - this.syncStatus.current += syncedItems.length; - this.syncStatusDidChange(); // set the sync token at the end, so that if any errors happen above, you can resync - - this.setSyncToken(response.sync_token); - this.setCursorToken(response.cursor_token); - this.stopCheckingIfSyncIsTakingTooLong(); // if a cursor token is available, dont perform integrity calculation, - // as content is still on the server waiting to be downloaded - - if (!(response.integrity_hash && !response.cursor_token)) { - _context90.next = 52; - break; - } - - _context90.next = 50; - return this.handleServerIntegrityHash(response.integrity_hash); - - case 50: - matches = _context90.sent; - - if (!matches) { - // If the server hash doesn't match our local hash, we want to continue syncing until we reach - // the max discordance threshold - if (this.syncDiscordance < this.MaxDiscordanceBeforeOutOfSync) { - this.repeatOnCompletion = true; - } - } - - case 52: - _context90.next = 54; - return this.getCursorToken(); - - case 54: - cursorToken = _context90.sent; - - if (!(cursorToken || this.syncStatus.needsMoreSync)) { - _context90.next = 59; - break; - } - - return _context90.abrupt("return", new Promise(function (resolve, reject) { - setTimeout(function () { - this.sync(options).then(resolve); - }.bind(_this23), 10); // wait 10ms to allow UI to update - })); - - case 59: - if (!this.repeatOnCompletion) { - _context90.next = 64; - break; - } - - this.repeatOnCompletion = false; - return _context90.abrupt("return", new Promise(function (resolve, reject) { - setTimeout(function () { - this.sync(options).then(resolve); - }.bind(_this23), 10); // wait 10ms to allow UI to update - })); - - case 64: - /* - // await this.writeItemsToLocalStorage(this.allRetreivedItems, false); - We used to do this, but the problem is, if you're saving 2000 items at the end of a sign in, - then refresh or close the page, the items will not be saved, and the sync token will be the lastest. - So the data won't be downloaded again. Instead, we'll save retrieved as they come. - */ - this.syncStatus.retrievedCount = 0; - this.syncStatusDidChange(); - - if (this.allRetreivedItems.length >= this.majorDataChangeThreshold || saved.length >= this.majorDataChangeThreshold || unsaved.length >= this.majorDataChangeThreshold) { - this.notifyEvent("major-data-change"); - } - - this.callQueuedCallbacks(response); - this.notifyEvent("sync:completed", { - retrievedItems: this.allRetreivedItems, - savedItems: this.allSavedItems, - unsavedItems: unsaved - }); - this.allRetreivedItems = []; - this.allSavedItems = []; - return _context90.abrupt("return", response); - - case 72: - case "end": - return _context90.stop(); - } - } - }, _callee90, this, [[4, 8, 12, 20], [13,, 15, 19]]); - })); - - function handleSyncSuccess(_x111, _x112, _x113) { - return _ref96.apply(this, arguments); - } - - return handleSyncSuccess; - }() - }, { - key: "handleSyncError", - value: function () { - var _ref97 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee91(response, statusCode, allDirtyItems) { - return regeneratorRuntime.wrap(function _callee91$(_context91) { - while (1) { - switch (_context91.prev = _context91.next) { - case 0: - console.log("Sync error: ", response); - - if (statusCode == 401) { - this.notifyEvent("sync-session-invalid"); - } - - if (!response) { - response = { - error: { - message: "Could not connect to server." - } - }; - } else if (typeof response == 'string') { - response = { - error: { - message: response - } - }; - } - - this.syncStatus.syncOpInProgress = false; - this.syncStatus.error = response.error; - this.syncStatusDidChange(); - this.writeItemsToLocalStorage(allDirtyItems, false); - this.modelManager.didSyncModelsOffline(allDirtyItems); - this.stopCheckingIfSyncIsTakingTooLong(); - this.notifyEvent("sync:error", response.error); - this.callQueuedCallbacks({ - error: "Sync error" - }); - return _context91.abrupt("return", response); - - case 12: - case "end": - return _context91.stop(); - } - } - }, _callee91, this); - })); - - function handleSyncError(_x114, _x115, _x116) { - return _ref97.apply(this, arguments); - } - - return handleSyncError; - }() - }, { - key: "handleItemsResponse", - value: function () { - var _ref98 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee92(responseItems, omitFields, source, keyRequest) { - var keys, items, itemsWithErrorStatusChange; - return regeneratorRuntime.wrap(function _callee92$(_context92) { - while (1) { - switch (_context92.prev = _context92.next) { - case 0: - _context92.next = 2; - return this.getActiveKeyInfo(keyRequest); - - case 2: - keys = _context92.sent.keys; - _context92.next = 5; - return SFJS.itemTransformer.decryptMultipleItems(responseItems, keys); - - case 5: - items = this.modelManager.mapResponseItemsToLocalModelsOmittingFields(responseItems, omitFields, source); // During the decryption process, items may be marked as "errorDecrypting". If so, we want to be sure - // to persist this new state by writing these items back to local storage. When an item's "errorDecrypting" - // flag is changed, its "errorDecryptingValueChanged" flag will be set, so we can find these items by filtering (then unsetting) below: - - itemsWithErrorStatusChange = items.filter(function (item) { - var valueChanged = item.errorDecryptingValueChanged; // unset after consuming value - - item.errorDecryptingValueChanged = false; - return valueChanged; - }); - - if (itemsWithErrorStatusChange.length > 0) { - this.writeItemsToLocalStorage(itemsWithErrorStatusChange, false); - } - - return _context92.abrupt("return", items); - - case 9: - case "end": - return _context92.stop(); - } - } - }, _callee92, this); - })); - - function handleItemsResponse(_x117, _x118, _x119, _x120) { - return _ref98.apply(this, arguments); - } - - return handleItemsResponse; - }() - }, { - key: "refreshErroredItems", - value: function () { - var _ref99 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee93() { - var erroredItems; - return regeneratorRuntime.wrap(function _callee93$(_context93) { - while (1) { - switch (_context93.prev = _context93.next) { - case 0: - erroredItems = this.modelManager.allNondummyItems.filter(function (item) { - return item.errorDecrypting == true; - }); - - if (!(erroredItems.length > 0)) { - _context93.next = 3; - break; - } - - return _context93.abrupt("return", this.handleItemsResponse(erroredItems, null, SFModelManager.MappingSourceLocalRetrieved, SFSyncManager.KeyRequestLoadSaveAccount)); - - case 3: - case "end": - return _context93.stop(); - } - } - }, _callee93, this); - })); - - function refreshErroredItems() { - return _ref99.apply(this, arguments); - } - - return refreshErroredItems; - }() - }, { - key: "handleUnsavedItemsResponse", - value: function () { - var _ref100 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee94(unsaved) { - var _iteratorNormalCompletion45, _didIteratorError45, _iteratorError45, _iterator45, _step45, mapping, itemResponse, item, error, dup; - - return regeneratorRuntime.wrap(function _callee94$(_context94) { - while (1) { - switch (_context94.prev = _context94.next) { - case 0: - if (!(unsaved.length == 0)) { - _context94.next = 2; - break; - } - - return _context94.abrupt("return"); - - case 2: - console.log("Handle Conflicted Items:", unsaved); - _iteratorNormalCompletion45 = true; - _didIteratorError45 = false; - _iteratorError45 = undefined; - _context94.prev = 6; - _iterator45 = unsaved[Symbol.iterator](); - - case 8: - if (_iteratorNormalCompletion45 = (_step45 = _iterator45.next()).done) { - _context94.next = 35; - break; - } - - mapping = _step45.value; - itemResponse = mapping.item; - _context94.t0 = SFJS.itemTransformer; - _context94.t1 = [itemResponse]; - _context94.next = 15; - return this.getActiveKeyInfo(SFSyncManager.KeyRequestLoadSaveAccount); - - case 15: - _context94.t2 = _context94.sent.keys; - _context94.next = 18; - return _context94.t0.decryptMultipleItems.call(_context94.t0, _context94.t1, _context94.t2); - - case 18: - item = this.modelManager.findItem(itemResponse.uuid); // Could be deleted - - if (item) { - _context94.next = 21; - break; - } - - return _context94.abrupt("continue", 32); - - case 21: - error = mapping.error; - - if (!(error.tag === "uuid_conflict")) { - _context94.next = 27; - break; - } - - _context94.next = 25; - return this.modelManager.alternateUUIDForItem(item); - - case 25: - _context94.next = 32; - break; - - case 27: - if (!(error.tag === "sync_conflict")) { - _context94.next = 32; - break; - } - - _context94.next = 30; - return this.modelManager.createConflictedItem(itemResponse); - - case 30: - dup = _context94.sent; - - if (!itemResponse.deleted && !item.isItemContentEqualWith(dup)) { - this.modelManager.addConflictedItem(dup, item); - } - - case 32: - _iteratorNormalCompletion45 = true; - _context94.next = 8; - break; - - case 35: - _context94.next = 41; - break; - - case 37: - _context94.prev = 37; - _context94.t3 = _context94["catch"](6); - _didIteratorError45 = true; - _iteratorError45 = _context94.t3; - - case 41: - _context94.prev = 41; - _context94.prev = 42; - - if (!_iteratorNormalCompletion45 && _iterator45.return) { - _iterator45.return(); - } - - case 44: - _context94.prev = 44; - - if (!_didIteratorError45) { - _context94.next = 47; - break; - } - - throw _iteratorError45; - - case 47: - return _context94.finish(44); - - case 48: - return _context94.finish(41); - - case 49: - // This will immediately result in "Sync op in progress" and sync will be queued. - // That's ok. You actually want a sync op in progress so that the new items are saved to disk right away. - // If you add a timeout here of 100ms, you'll avoid sync op in progress, but it will be a few ms before the items - // are saved to disk, meaning that the user may see All changes saved a few ms before changes are saved to disk. - // You could also just write to disk manually here, but syncing here is 100% sure to trigger sync op in progress as that's - // where it's being called from. - this.sync(null, { - additionalFields: ["created_at", "updated_at"] - }); - - case 50: - case "end": - return _context94.stop(); - } - } - }, _callee94, this, [[6, 37, 41, 49], [42,, 44, 48]]); - })); - - function handleUnsavedItemsResponse(_x121) { - return _ref100.apply(this, arguments); - } - - return handleUnsavedItemsResponse; - }() - /* - Executes a sync request with a blank sync token and high download limit. It will download all items, - but won't do anything with them other than decrypting, creating respective objects, and returning them to caller. (it does not map them nor establish their relationships) - The use case came primarly for clients who had ignored a certain content_type in sync, but later issued an update - indicated they actually did want to start handling that content type. In that case, they would need to download all items - freshly from the server. - */ - - }, { - key: "stateless_downloadAllItems", - value: function stateless_downloadAllItems() { - var _this24 = this; - - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return new Promise(function () { - var _ref101 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee96(resolve, reject) { - var params; - return regeneratorRuntime.wrap(function _callee96$(_context96) { - while (1) { - switch (_context96.prev = _context96.next) { - case 0: - params = { - limit: options.limit || 500, - sync_token: options.syncToken, - cursor_token: options.cursorToken, - content_type: options.contentType, - event: options.event - }; - _context96.prev = 1; - _context96.t0 = _this24.httpManager; - _context96.next = 5; - return _this24.getSyncURL(); - - case 5: - _context96.t1 = _context96.sent; - _context96.t2 = params; - - _context96.t3 = function () { - var _ref102 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee95(response) { - var incomingItems, keys; - return regeneratorRuntime.wrap(function _callee95$(_context95) { - while (1) { - switch (_context95.prev = _context95.next) { - case 0: - if (!options.retrievedItems) { - options.retrievedItems = []; - } - - incomingItems = response.retrieved_items; - _context95.next = 4; - return _this24.getActiveKeyInfo(SFSyncManager.KeyRequestLoadSaveAccount); - - case 4: - keys = _context95.sent.keys; - _context95.next = 7; - return SFJS.itemTransformer.decryptMultipleItems(incomingItems, keys); - - case 7: - options.retrievedItems = options.retrievedItems.concat(incomingItems.map(function (incomingItem) { - // Create model classes - return _this24.modelManager.createItem(incomingItem, true - /* dontNotifyObservers */ - ); - })); - options.syncToken = response.sync_token; - options.cursorToken = response.cursor_token; - - if (options.cursorToken) { - _this24.stateless_downloadAllItems(options).then(resolve); - } else { - resolve(options.retrievedItems); - } - - case 11: - case "end": - return _context95.stop(); - } - } - }, _callee95, _this24); - })); - - return function (_x125) { - return _ref102.apply(this, arguments); - }; - }(); - - _context96.t4 = function (response, statusCode) { - reject(response); - }; - - _context96.t0.postAbsolute.call(_context96.t0, _context96.t1, _context96.t2, _context96.t3, _context96.t4); - - _context96.next = 16; - break; - - case 12: - _context96.prev = 12; - _context96.t5 = _context96["catch"](1); - console.log("Download all items exception caught:", _context96.t5); - reject(_context96.t5); - - case 16: - case "end": - return _context96.stop(); - } - } - }, _callee96, _this24, [[1, 12]]); - })); - - return function (_x123, _x124) { - return _ref101.apply(this, arguments); - }; - }()); - } - }, { - key: "resolveOutOfSync", - value: function () { - var _ref103 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee98() { - var _this25 = this; - - return regeneratorRuntime.wrap(function _callee98$(_context98) { - while (1) { - switch (_context98.prev = _context98.next) { - case 0: - return _context98.abrupt("return", this.stateless_downloadAllItems({ - event: "resolve-out-of-sync" - }).then(function () { - var _ref104 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee97(downloadedItems) { - var itemsToMap, _iteratorNormalCompletion46, _didIteratorError46, _iteratorError46, _iterator46, _step46, downloadedItem, existingItem, contentDoesntMatch, duplicate; - - return regeneratorRuntime.wrap(function _callee97$(_context97) { - while (1) { - switch (_context97.prev = _context97.next) { - case 0: - itemsToMap = []; - _iteratorNormalCompletion46 = true; - _didIteratorError46 = false; - _iteratorError46 = undefined; - _context97.prev = 4; - _iterator46 = downloadedItems[Symbol.iterator](); - - case 6: - if (_iteratorNormalCompletion46 = (_step46 = _iterator46.next()).done) { - _context97.next = 20; - break; - } - - downloadedItem = _step46.value; // Note that deleted items will not be sent back by the server. - - existingItem = _this25.modelManager.findItem(downloadedItem.uuid); - - if (!existingItem) { - _context97.next = 16; - break; - } // Check if the content differs. If it does, create a new item, and do not map downloadedItem. - - - contentDoesntMatch = !downloadedItem.isItemContentEqualWith(existingItem); - - if (!contentDoesntMatch) { - _context97.next = 16; - break; - } - - _context97.next = 14; - return _this25.modelManager.createConflictedItem(existingItem, existingItem); - - case 14: - duplicate = _context97.sent; - - _this25.modelManager.addConflictedItem(duplicate, existingItem); - - case 16: - // Map the downloadedItem as authoritive content. If client copy at all differed, we would have created a duplicate of it above and synced it. - // This is also neccessary to map the updated_at value from the server - itemsToMap.push(downloadedItem); - - case 17: - _iteratorNormalCompletion46 = true; - _context97.next = 6; - break; - - case 20: - _context97.next = 26; - break; - - case 22: - _context97.prev = 22; - _context97.t0 = _context97["catch"](4); - _didIteratorError46 = true; - _iteratorError46 = _context97.t0; - - case 26: - _context97.prev = 26; - _context97.prev = 27; - - if (!_iteratorNormalCompletion46 && _iterator46.return) { - _iterator46.return(); - } - - case 29: - _context97.prev = 29; - - if (!_didIteratorError46) { - _context97.next = 32; - break; - } - - throw _iteratorError46; - - case 32: - return _context97.finish(29); - - case 33: - return _context97.finish(26); - - case 34: - _this25.modelManager.mapResponseItemsToLocalModelsWithOptions({ - items: itemsToMap, - source: SFModelManager.MappingSourceRemoteRetrieved - }); // Save all items locally. Usually sync() would save downloaded items locally, but we're using stateless_sync here, so we have to do it manually - - - _context97.next = 37; - return _this25.writeItemsToLocalStorage(_this25.modelManager.allNondummyItems); - - case 37: - return _context97.abrupt("return", _this25.sync({ - performIntegrityCheck: true - })); - - case 38: - case "end": - return _context97.stop(); - } - } - }, _callee97, _this25, [[4, 22, 26, 34], [27,, 29, 33]]); - })); - - return function (_x126) { - return _ref104.apply(this, arguments); - }; - }())); - - case 1: - case "end": - return _context98.stop(); - } - } - }, _callee98, this); - })); - - function resolveOutOfSync() { - return _ref103.apply(this, arguments); - } - - return resolveOutOfSync; - }() - }, { - key: "handleSignout", - value: function () { - var _ref105 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee99() { - return regeneratorRuntime.wrap(function _callee99$(_context99) { - while (1) { - switch (_context99.prev = _context99.next) { - case 0: - this._syncToken = null; - this._cursorToken = null; - this._queuedCallbacks = []; - this.syncStatus = {}; - - case 4: - case "end": - return _context99.stop(); - } - } - }, _callee99, this); - })); - - function handleSignout() { - return _ref105.apply(this, arguments); - } - - return handleSignout; - }() - }, { - key: "clearSyncToken", - value: function () { - var _ref106 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee100() { - return regeneratorRuntime.wrap(function _callee100$(_context100) { - while (1) { - switch (_context100.prev = _context100.next) { - case 0: - this._syncToken = null; - this._cursorToken = null; - return _context100.abrupt("return", this.storageManager.removeItem("syncToken")); - - case 3: - case "end": - return _context100.stop(); - } - } - }, _callee100, this); - })); - - function clearSyncToken() { - return _ref106.apply(this, arguments); - } - - return clearSyncToken; - }() - }, { - key: "queuedCallbacks", - get: function get() { - if (!this._queuedCallbacks) { - this._queuedCallbacks = []; - } - - return this._queuedCallbacks; - } - }]); - - return SFSyncManager; - }(); - - ; - var dateFormatter; - - var SFItem = exports.SFItem = function () { - function SFItem() { - var json_obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _classCallCheck(this, SFItem); - - this.content = {}; - this.referencingObjects = []; - this.updateFromJSON(json_obj); - - if (!this.uuid) { - // on React Native, this method will not exist. UUID gen will be handled manually via async methods. - if (typeof SFJS !== "undefined" && SFJS.crypto.generateUUIDSync) { - this.uuid = SFJS.crypto.generateUUIDSync(); - } - } - - if (_typeof(this.content) === 'object' && !this.content.references) { - this.content.references = []; - } - } // On some platforms, syncrounous uuid generation is not available. - // Those platforms (mobile) must call this function manually. - - - _createClass(SFItem, [{ - key: "initUUID", - value: function () { - var _ref107 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee101() { - return regeneratorRuntime.wrap(function _callee101$(_context101) { - while (1) { - switch (_context101.prev = _context101.next) { - case 0: - if (this.uuid) { - _context101.next = 4; - break; - } - - _context101.next = 3; - return SFJS.crypto.generateUUID(); - - case 3: - this.uuid = _context101.sent; - - case 4: - case "end": - return _context101.stop(); - } - } - }, _callee101, this); - })); - - function initUUID() { - return _ref107.apply(this, arguments); - } - - return initUUID; - }() - }, { - key: "updateFromJSON", - value: function updateFromJSON(json) { - // Don't expect this to ever be the case but we're having a crash with Android and this is the only suspect. - if (!json) { - return; - } // Manually merge top level data instead of wholesale merge - - - this.created_at = json.created_at; - this.updated_at = json.updated_at; - this.deleted = json.deleted; - this.uuid = json.uuid; - this.enc_item_key = json.enc_item_key; - this.auth_hash = json.auth_hash; - this.auth_params = json.auth_params; // When updating from server response (as opposed to local json response), these keys will be missing. - // So we only want to update these values if they are explicitly present. - - var clientKeys = ["errorDecrypting", "dirty", "dirtyCount", "dummy"]; - var _iteratorNormalCompletion47 = true; - var _didIteratorError47 = false; - var _iteratorError47 = undefined; - - try { - for (var _iterator47 = clientKeys[Symbol.iterator](), _step47; !(_iteratorNormalCompletion47 = (_step47 = _iterator47.next()).done); _iteratorNormalCompletion47 = true) { - var key = _step47.value; - - if (json[key] !== undefined) { - this[key] = json[key]; - } - } // Check if object has getter for content_type, and if so, skip - - } catch (err) { - _didIteratorError47 = true; - _iteratorError47 = err; - } finally { - try { - if (!_iteratorNormalCompletion47 && _iterator47.return) { - _iterator47.return(); - } - } finally { - if (_didIteratorError47) { - throw _iteratorError47; - } - } - } - - if (!this.content_type) { - this.content_type = json.content_type; - } // this.content = json.content will copy it by reference rather than value. So we need to do a deep merge after. - // json.content can still be a string here. We copy it to this.content, then do a deep merge to transfer over all values. - - - if (json.errorDecrypting) { - this.content = json.content; - } else { - try { - var parsedContent = typeof json.content === 'string' ? JSON.parse(json.content) : json.content; - SFItem.deepMerge(this.contentObject, parsedContent); - } catch (e) { - console.log("Error while updating item from json", e); - } - } - - if (this.created_at) { - this.created_at = new Date(this.created_at); - this.updated_at = new Date(this.updated_at); - } else { - this.created_at = new Date(); - this.updated_at = new Date(); - } // Allows the getter to be re-invoked - - - this._client_updated_at = null; - - if (json.content) { - this.mapContentToLocalProperties(this.contentObject); - } else if (json.deleted == true) { - this.handleDeletedContent(); - } - } - }, { - key: "mapContentToLocalProperties", - value: function mapContentToLocalProperties(contentObj) {} - }, { - key: "createContentJSONFromProperties", - value: function createContentJSONFromProperties() { - /* - NOTE: This function does have side effects and WILL modify our content. - Subclasses will override structureParams, and add their own custom content and properties to the object returned from structureParams - These are properties that this superclass will not be aware of, like 'title' or 'text' - When we call createContentJSONFromProperties, we want to update our own inherit 'content' field with the values returned from structureParams, - so that our content field is up to date. - Each subclass will call super.structureParams and merge it with its own custom result object. - Since our own structureParams gets a real-time copy of our content, it should be safe to merge the aggregate value back into our own content field. - */ - var content = this.structureParams(); - SFItem.deepMerge(this.contentObject, content); // Return the content item copy and not our actual value, as we don't want it to be mutated outside our control. - - return content; - } - }, { - key: "structureParams", - value: function structureParams() { - return this.getContentCopy(); - } - /* Allows the item to handle the case where the item is deleted and the content is null */ - - }, { - key: "handleDeletedContent", - value: function handleDeletedContent() {// Subclasses can override - } - }, { - key: "setDirty", - value: function setDirty(dirty, dontUpdateClientDate) { - this.dirty = dirty; // Allows the syncManager to check if an item has been marked dirty after a sync has been started - // This prevents it from clearing it as a dirty item after sync completion, if someone else has marked it dirty - // again after an ongoing sync. - - if (!this.dirtyCount) { - this.dirtyCount = 0; - } - - if (dirty) { - this.dirtyCount++; - } else { - this.dirtyCount = 0; - } - - if (dirty && !dontUpdateClientDate) { - // Set the client modified date to now if marking the item as dirty - this.client_updated_at = new Date(); - } else if (!this.hasRawClientUpdatedAtValue()) { - // copy updated_at - this.client_updated_at = new Date(this.updated_at); - } - } - }, { - key: "updateLocalRelationships", - value: function updateLocalRelationships() {// optional override - } - }, { - key: "addItemAsRelationship", - value: function addItemAsRelationship(item) { - item.setIsBeingReferencedBy(this); - - if (this.hasRelationshipWithItem(item)) { - return; - } - - var references = this.content.references || []; - references.push({ - uuid: item.uuid, - content_type: item.content_type - }); - this.content.references = references; - } - }, { - key: "removeItemAsRelationship", - value: function removeItemAsRelationship(item) { - item.setIsNoLongerBeingReferencedBy(this); - this.removeReferenceWithUuid(item.uuid); - } // When another object has a relationship with us, we push that object into memory here. - // We use this so that when `this` is deleted, we're able to update the references of those other objects. - - }, { - key: "setIsBeingReferencedBy", - value: function setIsBeingReferencedBy(item) { - if (!_.find(this.referencingObjects, { - uuid: item.uuid - })) { - this.referencingObjects.push(item); - } - } - }, { - key: "setIsNoLongerBeingReferencedBy", - value: function setIsNoLongerBeingReferencedBy(item) { - _.remove(this.referencingObjects, { - uuid: item.uuid - }); // Legacy two-way relationships should be handled here - - - if (this.hasRelationshipWithItem(item)) { - this.removeReferenceWithUuid(item.uuid); // We really shouldn't have the authority to set this item as dirty, but it's the only way to save this change. - - this.setDirty(true); - } - } - }, { - key: "removeReferenceWithUuid", - value: function removeReferenceWithUuid(uuid) { - var references = this.content.references || []; - references = references.filter(function (r) { - return r.uuid != uuid; - }); - this.content.references = references; - } - }, { - key: "hasRelationshipWithItem", - value: function hasRelationshipWithItem(item) { - var target = this.content.references.find(function (r) { - return r.uuid == item.uuid; - }); - return target != null; - } - }, { - key: "isBeingRemovedLocally", - value: function isBeingRemovedLocally() {} - }, { - key: "didFinishSyncing", - value: function didFinishSyncing() {} - }, { - key: "informReferencesOfUUIDChange", - value: function informReferencesOfUUIDChange(oldUUID, newUUID) {// optional override - } - }, { - key: "potentialItemOfInterestHasChangedItsUUID", - value: function potentialItemOfInterestHasChangedItsUUID(newItem, oldUUID, newUUID) { - // optional override - var _iteratorNormalCompletion48 = true; - var _didIteratorError48 = false; - var _iteratorError48 = undefined; - - try { - for (var _iterator48 = this.content.references[Symbol.iterator](), _step48; !(_iteratorNormalCompletion48 = (_step48 = _iterator48.next()).done); _iteratorNormalCompletion48 = true) { - var reference = _step48.value; - - if (reference.uuid == oldUUID) { - reference.uuid = newUUID; - this.setDirty(true); - } - } - } catch (err) { - _didIteratorError48 = true; - _iteratorError48 = err; - } finally { - try { - if (!_iteratorNormalCompletion48 && _iterator48.return) { - _iterator48.return(); - } - } finally { - if (_didIteratorError48) { - throw _iteratorError48; - } - } - } - } - }, { - key: "doNotEncrypt", - value: function doNotEncrypt() { - return false; - } - /* - App Data - */ - - }, { - key: "setDomainDataItem", - value: function setDomainDataItem(key, value, domain) { - if (!domain) { - console.error("SFItem.AppDomain needs to be set."); - return; - } - - if (this.errorDecrypting) { - return; - } - - if (!this.content.appData) { - this.content.appData = {}; - } - - var data = this.content.appData[domain]; - - if (!data) { - data = {}; - } - - data[key] = value; - this.content.appData[domain] = data; - } - }, { - key: "getDomainDataItem", - value: function getDomainDataItem(key, domain) { - if (!domain) { - console.error("SFItem.AppDomain needs to be set."); - return; - } - - if (this.errorDecrypting) { - return; - } - - if (!this.content.appData) { - this.content.appData = {}; - } - - var data = this.content.appData[domain]; - - if (data) { - return data[key]; - } else { - return null; - } - } - }, { - key: "setAppDataItem", - value: function setAppDataItem(key, value) { - this.setDomainDataItem(key, value, SFItem.AppDomain); - } - }, { - key: "getAppDataItem", - value: function getAppDataItem(key) { - return this.getDomainDataItem(key, SFItem.AppDomain); - } - }, { - key: "hasRawClientUpdatedAtValue", - value: function hasRawClientUpdatedAtValue() { - return this.getAppDataItem("client_updated_at") != null; - } - }, { - key: "keysToIgnoreWhenCheckingContentEquality", - - /* - During sync conflicts, when determing whether to create a duplicate for an item, we can omit keys that have no - meaningful weight and can be ignored. For example, if one component has active = true and another component has active = false, - it would be silly to duplicate them, so instead we ignore this. - */ - value: function keysToIgnoreWhenCheckingContentEquality() { - return []; - } // Same as above, but keys inside appData[Item.AppDomain] - - }, { - key: "appDataKeysToIgnoreWhenCheckingContentEquality", - value: function appDataKeysToIgnoreWhenCheckingContentEquality() { - return ["client_updated_at"]; - } - }, { - key: "getContentCopy", - value: function getContentCopy() { - var contentCopy = JSON.parse(JSON.stringify(this.content)); - return contentCopy; - } - }, { - key: "isItemContentEqualWith", - value: function isItemContentEqualWith(otherItem) { - var omit = function omit(obj, keys) { - if (!obj) { - return obj; - } - - var _iteratorNormalCompletion49 = true; - var _didIteratorError49 = false; - var _iteratorError49 = undefined; - - try { - for (var _iterator49 = keys[Symbol.iterator](), _step49; !(_iteratorNormalCompletion49 = (_step49 = _iterator49.next()).done); _iteratorNormalCompletion49 = true) { - var key = _step49.value; - delete obj[key]; - } - } catch (err) { - _didIteratorError49 = true; - _iteratorError49 = err; - } finally { - try { - if (!_iteratorNormalCompletion49 && _iterator49.return) { - _iterator49.return(); - } - } finally { - if (_didIteratorError49) { - throw _iteratorError49; - } - } - } - - return obj; - }; // Create copies of objects before running omit as not to modify source values directly. - - - var leftContent = this.getContentCopy(); - - if (leftContent.appData) { - omit(leftContent.appData[SFItem.AppDomain], this.appDataKeysToIgnoreWhenCheckingContentEquality()); - } - - leftContent = omit(leftContent, this.keysToIgnoreWhenCheckingContentEquality()); - var rightContent = otherItem.getContentCopy(); - - if (rightContent.appData) { - omit(rightContent.appData[SFItem.AppDomain], otherItem.appDataKeysToIgnoreWhenCheckingContentEquality()); - } - - rightContent = omit(rightContent, otherItem.keysToIgnoreWhenCheckingContentEquality()); - return JSON.stringify(leftContent) === JSON.stringify(rightContent); - } - }, { - key: "satisfiesPredicate", - value: function satisfiesPredicate(predicate) { - /* - Predicate is an SFPredicate having properties: - { - keypath: String, - operator: String, - value: object - } - */ - return SFPredicate.ItemSatisfiesPredicate(this, predicate); - } - /* - Dates - */ - - }, { - key: "createdAtString", - value: function createdAtString() { - return this.dateToLocalizedString(this.created_at); - } - }, { - key: "updatedAtString", - value: function updatedAtString() { - return this.dateToLocalizedString(this.client_updated_at); - } - }, { - key: "updatedAtTimestamp", - value: function updatedAtTimestamp() { - return this.updated_at.getTime(); - } - }, { - key: "dateToLocalizedString", - value: function dateToLocalizedString(date) { - if (typeof Intl !== 'undefined' && Intl.DateTimeFormat) { - if (!dateFormatter) { - var locale = navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language; - dateFormatter = new Intl.DateTimeFormat(locale, { - year: 'numeric', - month: 'short', - day: '2-digit', - weekday: 'long', - hour: '2-digit', - minute: '2-digit' - }); - } - - return dateFormatter.format(date); - } else { - // IE < 11, Safari <= 9.0. - // In English, this generates the string most similar to - // the toLocaleDateString() result above. - return date.toDateString() + ' ' + date.toLocaleTimeString(); - } - } - }, { - key: "contentObject", - get: function get() { - if (this.errorDecrypting) { - return this.content; - } - - if (!this.content) { - this.content = {}; - return this.content; - } - - if (this.content !== null && _typeof(this.content) === 'object') { - // this is the case when mapping localStorage content, in which case the content is already parsed - return this.content; - } - - try { - var content = JSON.parse(this.content); - this.content = content; - return this.content; - } catch (e) { - console.log("Error parsing json", e, this); - this.content = {}; - return this.content; - } - } - }, { - key: "pinned", - get: function get() { - return this.getAppDataItem("pinned"); - } - }, { - key: "archived", - get: function get() { - return this.getAppDataItem("archived"); - } - }, { - key: "locked", - get: function get() { - return this.getAppDataItem("locked"); - } // May be used by clients to display the human readable type for this item. Should be overriden by subclasses. - - }, { - key: "displayName", - get: function get() { - return "Item"; - } - }, { - key: "client_updated_at", - get: function get() { - if (!this._client_updated_at) { - var saved = this.getAppDataItem("client_updated_at"); - - if (saved) { - this._client_updated_at = new Date(saved); - } else { - this._client_updated_at = new Date(this.updated_at); - } - } - - return this._client_updated_at; - }, - set: function set(date) { - this._client_updated_at = date; - this.setAppDataItem("client_updated_at", date); - } - }], [{ - key: "deepMerge", - value: function deepMerge(a, b) { - // By default _.merge will not merge a full array with an empty one. - // We want to replace arrays wholesale - function mergeCopyArrays(objValue, srcValue) { - if (_.isArray(objValue)) { - return srcValue; - } - } - - _.mergeWith(a, b, mergeCopyArrays); - - return a; - } - }]); - - return SFItem; - }(); - - ; - - var SFItemParams = exports.SFItemParams = function () { - function SFItemParams(item, keys, auth_params) { - _classCallCheck(this, SFItemParams); - - this.item = item; - this.keys = keys; - this.auth_params = auth_params; - - if (this.keys && !this.auth_params) { - throw "SFItemParams.auth_params must be supplied if supplying keys."; - } - - if (this.auth_params && !this.auth_params.version) { - throw "SFItemParams.auth_params is missing version"; - } - } - - _createClass(SFItemParams, [{ - key: "paramsForExportFile", - value: function () { - var _ref108 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee102(includeDeleted) { - var result; - return regeneratorRuntime.wrap(function _callee102$(_context102) { - while (1) { - switch (_context102.prev = _context102.next) { - case 0: - this.additionalFields = ["updated_at"]; - this.forExportFile = true; - - if (!includeDeleted) { - _context102.next = 6; - break; - } - - return _context102.abrupt("return", this.__params()); - - case 6: - _context102.next = 8; - return this.__params(); - - case 8: - result = _context102.sent; - return _context102.abrupt("return", _.omit(result, ["deleted"])); - - case 10: - case "end": - return _context102.stop(); - } - } - }, _callee102, this); - })); - - function paramsForExportFile(_x128) { - return _ref108.apply(this, arguments); - } - - return paramsForExportFile; - }() - }, { - key: "paramsForExtension", - value: function () { - var _ref109 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee103() { - return regeneratorRuntime.wrap(function _callee103$(_context103) { - while (1) { - switch (_context103.prev = _context103.next) { - case 0: - return _context103.abrupt("return", this.paramsForExportFile()); - - case 1: - case "end": - return _context103.stop(); - } - } - }, _callee103, this); - })); - - function paramsForExtension() { - return _ref109.apply(this, arguments); - } - - return paramsForExtension; - }() - }, { - key: "paramsForLocalStorage", - value: function () { - var _ref110 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee104() { - return regeneratorRuntime.wrap(function _callee104$(_context104) { - while (1) { - switch (_context104.prev = _context104.next) { - case 0: - this.additionalFields = ["updated_at", "dirty", "errorDecrypting"]; - this.forExportFile = true; - return _context104.abrupt("return", this.__params()); - - case 3: - case "end": - return _context104.stop(); - } - } - }, _callee104, this); - })); - - function paramsForLocalStorage() { - return _ref110.apply(this, arguments); - } - - return paramsForLocalStorage; - }() - }, { - key: "paramsForSync", - value: function () { - var _ref111 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee105() { - return regeneratorRuntime.wrap(function _callee105$(_context105) { - while (1) { - switch (_context105.prev = _context105.next) { - case 0: - return _context105.abrupt("return", this.__params()); - - case 1: - case "end": - return _context105.stop(); - } - } - }, _callee105, this); - })); - - function paramsForSync() { - return _ref111.apply(this, arguments); - } - - return paramsForSync; - }() - }, { - key: "__params", - value: function () { - var _ref112 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee106() { - var params, doNotEncrypt, encryptedParams; - return regeneratorRuntime.wrap(function _callee106$(_context106) { - while (1) { - switch (_context106.prev = _context106.next) { - case 0: - params = { - uuid: this.item.uuid, - content_type: this.item.content_type, - deleted: this.item.deleted, - created_at: this.item.created_at - }; - - if (this.item.errorDecrypting) { - _context106.next = 23; - break; - } // Items should always be encrypted for export files. Only respect item.doNotEncrypt for remote sync params. - - - doNotEncrypt = this.item.doNotEncrypt() && !this.forExportFile; - - if (!(this.keys && !doNotEncrypt)) { - _context106.next = 11; - break; - } - - _context106.next = 6; - return SFJS.itemTransformer.encryptItem(this.item, this.keys, this.auth_params); - - case 6: - encryptedParams = _context106.sent; - - _.merge(params, encryptedParams); - - if (this.auth_params.version !== "001") { - params.auth_hash = null; - } - - _context106.next = 21; - break; - - case 11: - if (!this.forExportFile) { - _context106.next = 15; - break; - } - - _context106.t0 = this.item.createContentJSONFromProperties(); - _context106.next = 19; - break; - - case 15: - _context106.next = 17; - return SFJS.crypto.base64(JSON.stringify(this.item.createContentJSONFromProperties())); - - case 17: - _context106.t1 = _context106.sent; - _context106.t0 = "000" + _context106.t1; - - case 19: - params.content = _context106.t0; - - if (!this.forExportFile) { - params.enc_item_key = null; - params.auth_hash = null; - } - - case 21: - _context106.next = 26; - break; - - case 23: - // Error decrypting, keep "content" and related fields as is (and do not try to encrypt, otherwise that would be undefined behavior) - params.content = this.item.content; - params.enc_item_key = this.item.enc_item_key; - params.auth_hash = this.item.auth_hash; - - case 26: - if (this.additionalFields) { - _.merge(params, _.pick(this.item, this.additionalFields)); - } - - return _context106.abrupt("return", params); - - case 28: - case "end": - return _context106.stop(); - } - } - }, _callee106, this); - })); - - function __params() { - return _ref112.apply(this, arguments); - } - - return __params; - }() - }]); - - return SFItemParams; - }(); - - ; - - var SFPredicate = exports.SFPredicate = function () { - function SFPredicate(keypath, operator, value) { - _classCallCheck(this, SFPredicate); - - this.keypath = keypath; - this.operator = operator; - this.value = value; // Preprocessing to make predicate evaluation faster. - // Won't recurse forever, but with arbitrarily large input could get stuck. Hope there are input size limits - // somewhere else. - - if (SFPredicate.IsRecursiveOperator(this.operator)) { - this.value = this.value.map(SFPredicate.fromArray); - } - } - - _createClass(SFPredicate, null, [{ - key: "fromArray", - value: function fromArray(array) { - return new SFPredicate(array[0], array[1], array[2]); - } - }, { - key: "ObjectSatisfiesPredicate", - value: function ObjectSatisfiesPredicate(object, predicate) { - // Predicates may not always be created using the official constructor - // so if it's still an array here, convert to object - if (Array.isArray(predicate)) { - predicate = this.fromArray(predicate); - } - - if (SFPredicate.IsRecursiveOperator(predicate.operator)) { - if (predicate.operator === "and") { - var _iteratorNormalCompletion50 = true; - var _didIteratorError50 = false; - var _iteratorError50 = undefined; - - try { - for (var _iterator50 = predicate.value[Symbol.iterator](), _step50; !(_iteratorNormalCompletion50 = (_step50 = _iterator50.next()).done); _iteratorNormalCompletion50 = true) { - var subPredicate = _step50.value; - - if (!this.ObjectSatisfiesPredicate(object, subPredicate)) { - return false; - } - } - } catch (err) { - _didIteratorError50 = true; - _iteratorError50 = err; - } finally { - try { - if (!_iteratorNormalCompletion50 && _iterator50.return) { - _iterator50.return(); - } - } finally { - if (_didIteratorError50) { - throw _iteratorError50; - } - } - } - - return true; - } - - if (predicate.operator === "or") { - var _iteratorNormalCompletion51 = true; - var _didIteratorError51 = false; - var _iteratorError51 = undefined; - - try { - for (var _iterator51 = predicate.value[Symbol.iterator](), _step51; !(_iteratorNormalCompletion51 = (_step51 = _iterator51.next()).done); _iteratorNormalCompletion51 = true) { - var subPredicate = _step51.value; - - if (this.ObjectSatisfiesPredicate(object, subPredicate)) { - return true; - } - } - } catch (err) { - _didIteratorError51 = true; - _iteratorError51 = err; - } finally { - try { - if (!_iteratorNormalCompletion51 && _iterator51.return) { - _iterator51.return(); - } - } finally { - if (_didIteratorError51) { - throw _iteratorError51; - } - } - } - - return false; - } - } - - var predicateValue = predicate.value; - - if (typeof predicateValue == 'string' && predicateValue.includes(".ago")) { - predicateValue = this.DateFromString(predicateValue); - } - - var valueAtKeyPath = predicate.keypath.split('.').reduce(function (previous, current) { - return previous && previous[current]; - }, object); - var falseyValues = [false, "", null, undefined, NaN]; // If the value at keyPath is undefined, either because the property is nonexistent or the value is null. - - if (valueAtKeyPath == undefined) { - if (predicate.operator == "!=") { - return !falseyValues.includes(predicate.value); - } else { - return falseyValues.includes(predicate.value); - } - } - - if (predicate.operator == "=") { - // Use array comparison - if (Array.isArray(valueAtKeyPath)) { - return JSON.stringify(valueAtKeyPath) == JSON.stringify(predicateValue); - } else { - return valueAtKeyPath == predicateValue; - } - } else if (predicate.operator == "!=") { - // Use array comparison - if (Array.isArray(valueAtKeyPath)) { - return JSON.stringify(valueAtKeyPath) != JSON.stringify(predicateValue); - } else { - return valueAtKeyPath !== predicateValue; - } - } else if (predicate.operator == "<") { - return valueAtKeyPath < predicateValue; - } else if (predicate.operator == ">") { - return valueAtKeyPath > predicateValue; - } else if (predicate.operator == "<=") { - return valueAtKeyPath <= predicateValue; - } else if (predicate.operator == ">=") { - return valueAtKeyPath >= predicateValue; - } else if (predicate.operator == "startsWith") { - return valueAtKeyPath.startsWith(predicateValue); - } else if (predicate.operator == "in") { - return predicateValue.indexOf(valueAtKeyPath) != -1; - } else if (predicate.operator == "includes") { - return this.resolveIncludesPredicate(valueAtKeyPath, predicateValue); - } else if (predicate.operator == "matches") { - var regex = new RegExp(predicateValue); - return regex.test(valueAtKeyPath); - } - - return false; - } - }, { - key: "resolveIncludesPredicate", - value: function resolveIncludesPredicate(valueAtKeyPath, predicateValue) { - // includes can be a string or a predicate (in array form) - if (typeof predicateValue == 'string') { - // if string, simply check if the valueAtKeyPath includes the predicate value - return valueAtKeyPath.includes(predicateValue); - } else { - // is a predicate array or predicate object - var innerPredicate; - - if (Array.isArray(predicateValue)) { - innerPredicate = SFPredicate.fromArray(predicateValue); - } else { - innerPredicate = predicateValue; - } - - var _iteratorNormalCompletion52 = true; - var _didIteratorError52 = false; - var _iteratorError52 = undefined; - - try { - for (var _iterator52 = valueAtKeyPath[Symbol.iterator](), _step52; !(_iteratorNormalCompletion52 = (_step52 = _iterator52.next()).done); _iteratorNormalCompletion52 = true) { - var obj = _step52.value; - - if (this.ObjectSatisfiesPredicate(obj, innerPredicate)) { - return true; - } - } - } catch (err) { - _didIteratorError52 = true; - _iteratorError52 = err; - } finally { - try { - if (!_iteratorNormalCompletion52 && _iterator52.return) { - _iterator52.return(); - } - } finally { - if (_didIteratorError52) { - throw _iteratorError52; - } - } - } - - return false; - } - } - }, { - key: "ItemSatisfiesPredicate", - value: function ItemSatisfiesPredicate(item, predicate) { - if (Array.isArray(predicate)) { - predicate = SFPredicate.fromArray(predicate); - } - - return this.ObjectSatisfiesPredicate(item, predicate); - } - }, { - key: "ItemSatisfiesPredicates", - value: function ItemSatisfiesPredicates(item, predicates) { - var _iteratorNormalCompletion53 = true; - var _didIteratorError53 = false; - var _iteratorError53 = undefined; - - try { - for (var _iterator53 = predicates[Symbol.iterator](), _step53; !(_iteratorNormalCompletion53 = (_step53 = _iterator53.next()).done); _iteratorNormalCompletion53 = true) { - var predicate = _step53.value; - - if (!this.ItemSatisfiesPredicate(item, predicate)) { - return false; - } - } - } catch (err) { - _didIteratorError53 = true; - _iteratorError53 = err; - } finally { - try { - if (!_iteratorNormalCompletion53 && _iterator53.return) { - _iterator53.return(); - } - } finally { - if (_didIteratorError53) { - throw _iteratorError53; - } - } - } - - return true; - } - }, { - key: "DateFromString", - value: function DateFromString(string) { - // x.days.ago, x.hours.ago - var comps = string.split("."); - var unit = comps[1]; - var date = new Date(); - var offset = parseInt(comps[0]); - - if (unit == "days") { - date.setDate(date.getDate() - offset); - } else if (unit == "hours") { - date.setHours(date.getHours() - offset); - } - - return date; - } - }, { - key: "IsRecursiveOperator", - value: function IsRecursiveOperator(operator) { - return ["and", "or"].includes(operator); - } - }]); - - return SFPredicate; - }(); - - ; - - var SFPrivileges = exports.SFPrivileges = function (_SFItem) { - _inherits(SFPrivileges, _SFItem); - - _createClass(SFPrivileges, null, [{ - key: "contentType", - value: function contentType() { - // It has prefix SN since it was originally imported from SN codebase - return "SN|Privileges"; - } - }]); - - function SFPrivileges(json_obj) { - _classCallCheck(this, SFPrivileges); - - var _this26 = _possibleConstructorReturn(this, (SFPrivileges.__proto__ || Object.getPrototypeOf(SFPrivileges)).call(this, json_obj)); - - if (!_this26.content.desktopPrivileges) { - _this26.content.desktopPrivileges = {}; - } - - return _this26; - } - - _createClass(SFPrivileges, [{ - key: "setCredentialsForAction", - value: function setCredentialsForAction(action, credentials) { - this.content.desktopPrivileges[action] = credentials; - } - }, { - key: "getCredentialsForAction", - value: function getCredentialsForAction(action) { - return this.content.desktopPrivileges[action] || []; - } - }, { - key: "toggleCredentialForAction", - value: function toggleCredentialForAction(action, credential) { - if (this.isCredentialRequiredForAction(action, credential)) { - this.removeCredentialForAction(action, credential); - } else { - this.addCredentialForAction(action, credential); - } - } - }, { - key: "removeCredentialForAction", - value: function removeCredentialForAction(action, credential) { - _.pull(this.content.desktopPrivileges[action], credential); - } - }, { - key: "addCredentialForAction", - value: function addCredentialForAction(action, credential) { - var credentials = this.getCredentialsForAction(action); - credentials.push(credential); - this.setCredentialsForAction(action, credentials); - } - }, { - key: "isCredentialRequiredForAction", - value: function isCredentialRequiredForAction(action, credential) { - var credentialsRequired = this.getCredentialsForAction(action); - return credentialsRequired.includes(credential); - } - }]); - - return SFPrivileges; - }(SFItem); - - ; - /* - Important: This is the only object in the session history domain that is persistable. - A history session contains one main content object: - the itemUUIDToItemHistoryMapping. This is a dictionary whose keys are item uuids, - and each value is an SFItemHistory object. - Each SFItemHistory object contains an array called `entires` which contain `SFItemHistory` entries (or subclasses, if the - `SFItemHistory.HistoryEntryClassMapping` class property value is set.) - */ - // See default class values at bottom of this file, including `SFHistorySession.LargeItemEntryAmountThreshold`. - - var SFHistorySession = exports.SFHistorySession = function (_SFItem2) { - _inherits(SFHistorySession, _SFItem2); - - function SFHistorySession(json_obj) { - _classCallCheck(this, SFHistorySession); - /* - Our .content params: - { - itemUUIDToItemHistoryMapping - } - */ - - - var _this27 = _possibleConstructorReturn(this, (SFHistorySession.__proto__ || Object.getPrototypeOf(SFHistorySession)).call(this, json_obj)); - - if (!_this27.content.itemUUIDToItemHistoryMapping) { - _this27.content.itemUUIDToItemHistoryMapping = {}; - } // When initializing from a json_obj, we want to deserialize the item history JSON into SFItemHistory objects. - - - var uuids = Object.keys(_this27.content.itemUUIDToItemHistoryMapping); - uuids.forEach(function (itemUUID) { - var itemHistory = _this27.content.itemUUIDToItemHistoryMapping[itemUUID]; - _this27.content.itemUUIDToItemHistoryMapping[itemUUID] = new SFItemHistory(itemHistory); - }); - return _this27; - } - - _createClass(SFHistorySession, [{ - key: "addEntryForItem", - value: function addEntryForItem(item) { - var itemHistory = this.historyForItem(item); - var entry = itemHistory.addHistoryEntryForItem(item); - return entry; - } - }, { - key: "historyForItem", - value: function historyForItem(item) { - var history = this.content.itemUUIDToItemHistoryMapping[item.uuid]; - - if (!history) { - history = this.content.itemUUIDToItemHistoryMapping[item.uuid] = new SFItemHistory(); - } - - return history; - } - }, { - key: "clearItemHistory", - value: function clearItemHistory(item) { - this.historyForItem(item).clear(); - } - }, { - key: "clearAllHistory", - value: function clearAllHistory() { - this.content.itemUUIDToItemHistoryMapping = {}; - } - }, { - key: "optimizeHistoryForItem", - value: function optimizeHistoryForItem(item) { - // Clean up if there are too many revisions. Note SFHistorySession.LargeItemEntryAmountThreshold is the amount of revisions which above, call - // for an optimization. An optimization may not remove entries above this threshold. It will determine what it should keep and what it shouldn't. - // So, it is possible to have a threshold of 60 but have 600 entries, if the item history deems those worth keeping. - var itemHistory = this.historyForItem(item); - - if (itemHistory.entries.length > SFHistorySession.LargeItemEntryAmountThreshold) { - itemHistory.optimize(); - } - } - }]); - - return SFHistorySession; - }(SFItem); // See comment in `this.optimizeHistoryForItem` - - - SFHistorySession.LargeItemEntryAmountThreshold = 60; - ; // See default class values at bottom of this file, including `SFItemHistory.LargeEntryDeltaThreshold`. - - var SFItemHistory = exports.SFItemHistory = function () { - function SFItemHistory() { - var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _classCallCheck(this, SFItemHistory); - - if (!this.entries) { - this.entries = []; - } // Deserialize the entries into entry objects. - - - if (params.entries) { - var _iteratorNormalCompletion54 = true; - var _didIteratorError54 = false; - var _iteratorError54 = undefined; - - try { - for (var _iterator54 = params.entries[Symbol.iterator](), _step54; !(_iteratorNormalCompletion54 = (_step54 = _iterator54.next()).done); _iteratorNormalCompletion54 = true) { - var entryParams = _step54.value; - var entry = this.createEntryForItem(entryParams.item); - entry.setPreviousEntry(this.getLastEntry()); - this.entries.push(entry); - } - } catch (err) { - _didIteratorError54 = true; - _iteratorError54 = err; - } finally { - try { - if (!_iteratorNormalCompletion54 && _iterator54.return) { - _iterator54.return(); - } - } finally { - if (_didIteratorError54) { - throw _iteratorError54; - } - } - } - } - } - - _createClass(SFItemHistory, [{ - key: "createEntryForItem", - value: function createEntryForItem(item) { - var historyItemClass = SFItemHistory.HistoryEntryClassMapping && SFItemHistory.HistoryEntryClassMapping[item.content_type]; - - if (!historyItemClass) { - historyItemClass = SFItemHistoryEntry; - } - - var entry = new historyItemClass(item); - return entry; - } - }, { - key: "getLastEntry", - value: function getLastEntry() { - return this.entries[this.entries.length - 1]; - } - }, { - key: "addHistoryEntryForItem", - value: function addHistoryEntryForItem(item) { - var prospectiveEntry = this.createEntryForItem(item); - var previousEntry = this.getLastEntry(); - prospectiveEntry.setPreviousEntry(previousEntry); // Don't add first revision if text length is 0, as this means it's a new note. - // Actually, nevermind. If we do this, the first character added to a new note - // will be displayed as "1 characters loaded". - // if(!previousRevision && prospectiveRevision.textCharDiffLength == 0) { - // return; - // } - // Don't add if text is the same - - if (prospectiveEntry.isSameAsEntry(previousEntry)) { - return; - } - - this.entries.push(prospectiveEntry); - return prospectiveEntry; - } - }, { - key: "clear", - value: function clear() { - this.entries.length = 0; - } - }, { - key: "optimize", - value: function optimize() { - var _this28 = this; - - var keepEntries = []; - - var isEntrySignificant = function isEntrySignificant(entry) { - return entry.deltaSize() > SFItemHistory.LargeEntryDeltaThreshold; - }; - - var processEntry = function processEntry(entry, index, keep) { - // Entries may be processed retrospectively, meaning it can be decided to be deleted, then an upcoming processing can change that. - if (keep) { - keepEntries.push(entry); - } else { - // Remove if in keep - var index = keepEntries.indexOf(entry); - - if (index !== -1) { - keepEntries.splice(index, 1); - } - } - - if (keep && isEntrySignificant(entry) && entry.operationVector() == -1) { - // This is a large negative change. Hang on to the previous entry. - var previousEntry = _this28.entries[index - 1]; - - if (previousEntry) { - keepEntries.push(previousEntry); - } - } - }; - - this.entries.forEach(function (entry, index) { - if (index == 0 || index == _this28.entries.length - 1) { - // Keep the first and last - processEntry(entry, index, true); - } else { - var significant = isEntrySignificant(entry); - processEntry(entry, index, significant); - } - }); - this.entries = this.entries.filter(function (entry, index) { - return keepEntries.indexOf(entry) !== -1; - }); - } - }]); - - return SFItemHistory; - }(); // The amount of characters added or removed that constitute a keepable entry after optimization. - - - SFItemHistory.LargeEntryDeltaThreshold = 15; - ; - - var SFItemHistoryEntry = exports.SFItemHistoryEntry = function () { - function SFItemHistoryEntry(item) { - _classCallCheck(this, SFItemHistoryEntry); // Whatever values `item` has will be persisted, so be sure that the values are picked beforehand. - - - this.item = SFItem.deepMerge({}, item); // We'll assume a `text` content value to diff on. If it doesn't exist, no problem. - - this.defaultContentKeyToDiffOn = "text"; // Default value - - this.textCharDiffLength = 0; - - if (typeof this.item.updated_at == 'string') { - this.item.updated_at = new Date(this.item.updated_at); - } - } - - _createClass(SFItemHistoryEntry, [{ - key: "setPreviousEntry", - value: function setPreviousEntry(previousEntry) { - this.hasPreviousEntry = previousEntry != null; // we'll try to compute the delta based on an assumed content property of `text`, if it exists. - - if (this.item.content[this.defaultContentKeyToDiffOn]) { - if (previousEntry) { - this.textCharDiffLength = this.item.content[this.defaultContentKeyToDiffOn].length - previousEntry.item.content[this.defaultContentKeyToDiffOn].length; - } else { - this.textCharDiffLength = this.item.content[this.defaultContentKeyToDiffOn].length; - } - } - } - }, { - key: "operationVector", - value: function operationVector() { - // We'll try to use the value of `textCharDiffLength` to help determine this, if it's set - if (this.textCharDiffLength != undefined) { - if (!this.hasPreviousEntry || this.textCharDiffLength == 0) { - return 0; - } else if (this.textCharDiffLength < 0) { - return -1; - } else { - return 1; - } - } // Otherwise use a default value of 1 - - - return 1; - } - }, { - key: "deltaSize", - value: function deltaSize() { - // Up to the subclass to determine how large the delta was, i.e number of characters changed. - // But this general class won't be able to determine which property it should diff on, or even its format. - // We can return the `textCharDiffLength` if it's set, otherwise, just return 1; - if (this.textCharDiffLength != undefined) { - return Math.abs(this.textCharDiffLength); - } // Otherwise return 1 here to constitute a basic positive delta. - // The value returned should always be positive. override `operationVector` to return the direction of the delta. - - - return 1; - } - }, { - key: "isSameAsEntry", - value: function isSameAsEntry(entry) { - if (!entry) { - return false; - } - - var lhs = new SFItem(this.item); - var rhs = new SFItem(entry.item); - return lhs.isItemContentEqualWith(rhs); - } - }]); - - return SFItemHistoryEntry; - }(); - - ; - /* Abstract class. Instantiate an instance of either SFCryptoJS (uses cryptojs) or SFCryptoWeb (uses web crypto) */ - - var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : null; - - var SFAbstractCrypto = exports.SFAbstractCrypto = function () { - function SFAbstractCrypto() { - _classCallCheck(this, SFAbstractCrypto); - - this.DefaultPBKDF2Length = 768; - } - /* - Our WebCrypto implementation only offers PBKDf2, so any other encryption - and key generation functions must use CryptoJS in this abstract implementation. - */ - - - _createClass(SFAbstractCrypto, [{ - key: "generateUUIDSync", - value: function generateUUIDSync() { - var crypto = globalScope.crypto || globalScope.msCrypto; - - if (crypto) { - var buf = new Uint32Array(4); - crypto.getRandomValues(buf); - var idx = -1; - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - idx++; - var r = buf[idx >> 3] >> idx % 8 * 4 & 15; - var v = c == 'x' ? r : r & 0x3 | 0x8; - return v.toString(16); - }); - } else { - var d = new Date().getTime(); - - if (globalScope.performance && typeof globalScope.performance.now === "function") { - d += performance.now(); //use high-precision timer if available - } - - var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = (d + Math.random() * 16) % 16 | 0; - d = Math.floor(d / 16); - return (c == 'x' ? r : r & 0x3 | 0x8).toString(16); - }); - return uuid; - } - } - }, { - key: "generateUUID", - value: function () { - var _ref113 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee107() { - return regeneratorRuntime.wrap(function _callee107$(_context107) { - while (1) { - switch (_context107.prev = _context107.next) { - case 0: - return _context107.abrupt("return", this.generateUUIDSync()); - - case 1: - case "end": - return _context107.stop(); - } - } - }, _callee107, this); - })); - - function generateUUID() { - return _ref113.apply(this, arguments); - } - - return generateUUID; - }() - }, { - key: "decryptText", - value: function () { - var _ref114 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee108() { - var _ref115 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - ciphertextToAuth = _ref115.ciphertextToAuth, - contentCiphertext = _ref115.contentCiphertext, - encryptionKey = _ref115.encryptionKey, - iv = _ref115.iv, - authHash = _ref115.authHash, - authKey = _ref115.authKey; - - var requiresAuth = arguments[1]; - var localAuthHash, keyData, ivData, decrypted; - return regeneratorRuntime.wrap(function _callee108$(_context108) { - while (1) { - switch (_context108.prev = _context108.next) { - case 0: - if (!(requiresAuth && !authHash)) { - _context108.next = 3; - break; - } - - console.error("Auth hash is required."); - return _context108.abrupt("return"); - - case 3: - if (!authHash) { - _context108.next = 10; - break; - } - - _context108.next = 6; - return this.hmac256(ciphertextToAuth, authKey); - - case 6: - localAuthHash = _context108.sent; - - if (!(authHash !== localAuthHash)) { - _context108.next = 10; - break; - } - - console.error("Auth hash does not match, returning null."); - return _context108.abrupt("return", null); - - case 10: - keyData = CryptoJS.enc.Hex.parse(encryptionKey); - ivData = CryptoJS.enc.Hex.parse(iv || ""); - decrypted = CryptoJS.AES.decrypt(contentCiphertext, keyData, { - iv: ivData, - mode: CryptoJS.mode.CBC, - padding: CryptoJS.pad.Pkcs7 - }); - return _context108.abrupt("return", decrypted.toString(CryptoJS.enc.Utf8)); - - case 14: - case "end": - return _context108.stop(); - } - } - }, _callee108, this); - })); - - function decryptText() { - return _ref114.apply(this, arguments); - } - - return decryptText; - }() - }, { - key: "encryptText", - value: function () { - var _ref116 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee109(text, key, iv) { - var keyData, ivData, encrypted; - return regeneratorRuntime.wrap(function _callee109$(_context109) { - while (1) { - switch (_context109.prev = _context109.next) { - case 0: - keyData = CryptoJS.enc.Hex.parse(key); - ivData = CryptoJS.enc.Hex.parse(iv || ""); - encrypted = CryptoJS.AES.encrypt(text, keyData, { - iv: ivData, - mode: CryptoJS.mode.CBC, - padding: CryptoJS.pad.Pkcs7 - }); - return _context109.abrupt("return", encrypted.toString()); - - case 4: - case "end": - return _context109.stop(); - } - } - }, _callee109, this); - })); - - function encryptText(_x131, _x132, _x133) { - return _ref116.apply(this, arguments); - } - - return encryptText; - }() - }, { - key: "generateRandomKey", - value: function () { - var _ref117 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee110(bits) { - return regeneratorRuntime.wrap(function _callee110$(_context110) { - while (1) { - switch (_context110.prev = _context110.next) { - case 0: - return _context110.abrupt("return", CryptoJS.lib.WordArray.random(bits / 8).toString()); - - case 1: - case "end": - return _context110.stop(); - } - } - }, _callee110, this); - })); - - function generateRandomKey(_x134) { - return _ref117.apply(this, arguments); - } - - return generateRandomKey; - }() - }, { - key: "generateItemEncryptionKey", - value: function () { - var _ref118 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee111() { - var length, cost, salt, passphrase; - return regeneratorRuntime.wrap(function _callee111$(_context111) { - while (1) { - switch (_context111.prev = _context111.next) { - case 0: - // Generates a key that will be split in half, each being 256 bits. So total length will need to be 512. - length = 512; - cost = 1; - _context111.next = 4; - return this.generateRandomKey(length); - - case 4: - salt = _context111.sent; - _context111.next = 7; - return this.generateRandomKey(length); - - case 7: - passphrase = _context111.sent; - return _context111.abrupt("return", this.pbkdf2(passphrase, salt, cost, length)); - - case 9: - case "end": - return _context111.stop(); - } - } - }, _callee111, this); - })); - - function generateItemEncryptionKey() { - return _ref118.apply(this, arguments); - } - - return generateItemEncryptionKey; - }() - }, { - key: "firstHalfOfKey", - value: function () { - var _ref119 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee112(key) { - return regeneratorRuntime.wrap(function _callee112$(_context112) { - while (1) { - switch (_context112.prev = _context112.next) { - case 0: - return _context112.abrupt("return", key.substring(0, key.length / 2)); - - case 1: - case "end": - return _context112.stop(); - } - } - }, _callee112, this); - })); - - function firstHalfOfKey(_x135) { - return _ref119.apply(this, arguments); - } - - return firstHalfOfKey; - }() - }, { - key: "secondHalfOfKey", - value: function () { - var _ref120 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee113(key) { - return regeneratorRuntime.wrap(function _callee113$(_context113) { - while (1) { - switch (_context113.prev = _context113.next) { - case 0: - return _context113.abrupt("return", key.substring(key.length / 2, key.length)); - - case 1: - case "end": - return _context113.stop(); - } - } - }, _callee113, this); - })); - - function secondHalfOfKey(_x136) { - return _ref120.apply(this, arguments); - } - - return secondHalfOfKey; - }() - }, { - key: "base64", - value: function () { - var _ref121 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee114(text) { - return regeneratorRuntime.wrap(function _callee114$(_context114) { - while (1) { - switch (_context114.prev = _context114.next) { - case 0: - return _context114.abrupt("return", globalScope.btoa(encodeURIComponent(text).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) { - return String.fromCharCode('0x' + p1); - }))); - - case 1: - case "end": - return _context114.stop(); - } - } - }, _callee114, this); - })); - - function base64(_x137) { - return _ref121.apply(this, arguments); - } - - return base64; - }() - }, { - key: "base64Decode", - value: function () { - var _ref122 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee115(base64String) { - return regeneratorRuntime.wrap(function _callee115$(_context115) { - while (1) { - switch (_context115.prev = _context115.next) { - case 0: - return _context115.abrupt("return", globalScope.atob(base64String)); - - case 1: - case "end": - return _context115.stop(); - } - } - }, _callee115, this); - })); - - function base64Decode(_x138) { - return _ref122.apply(this, arguments); - } - - return base64Decode; - }() - }, { - key: "sha256", - value: function () { - var _ref123 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee116(text) { - return regeneratorRuntime.wrap(function _callee116$(_context116) { - while (1) { - switch (_context116.prev = _context116.next) { - case 0: - return _context116.abrupt("return", CryptoJS.SHA256(text).toString()); - - case 1: - case "end": - return _context116.stop(); - } - } - }, _callee116, this); - })); - - function sha256(_x139) { - return _ref123.apply(this, arguments); - } - - return sha256; - }() - }, { - key: "hmac256", - value: function () { - var _ref124 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee117(message, key) { - var keyData, messageData, result; - return regeneratorRuntime.wrap(function _callee117$(_context117) { - while (1) { - switch (_context117.prev = _context117.next) { - case 0: - keyData = CryptoJS.enc.Hex.parse(key); - messageData = CryptoJS.enc.Utf8.parse(message); - result = CryptoJS.HmacSHA256(messageData, keyData).toString(); - return _context117.abrupt("return", result); - - case 4: - case "end": - return _context117.stop(); - } - } - }, _callee117, this); - })); - - function hmac256(_x140, _x141) { - return _ref124.apply(this, arguments); - } - - return hmac256; - }() - }, { - key: "generateSalt", - value: function () { - var _ref125 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee118(identifier, version, cost, nonce) { - var result; - return regeneratorRuntime.wrap(function _callee118$(_context118) { - while (1) { - switch (_context118.prev = _context118.next) { - case 0: - _context118.next = 2; - return this.sha256([identifier, "SF", version, cost, nonce].join(":")); - - case 2: - result = _context118.sent; - return _context118.abrupt("return", result); - - case 4: - case "end": - return _context118.stop(); - } - } - }, _callee118, this); - })); - - function generateSalt(_x142, _x143, _x144, _x145) { - return _ref125.apply(this, arguments); - } - - return generateSalt; - }() - /** Generates two deterministic keys based on one input */ - - }, { - key: "generateSymmetricKeyPair", - value: function () { - var _ref126 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee119() { - var _ref127 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - password = _ref127.password, - pw_salt = _ref127.pw_salt, - pw_cost = _ref127.pw_cost; - - var output, outputLength, splitLength, firstThird, secondThird, thirdThird; - return regeneratorRuntime.wrap(function _callee119$(_context119) { - while (1) { - switch (_context119.prev = _context119.next) { - case 0: - _context119.next = 2; - return this.pbkdf2(password, pw_salt, pw_cost, this.DefaultPBKDF2Length); - - case 2: - output = _context119.sent; - outputLength = output.length; - splitLength = outputLength / 3; - firstThird = output.slice(0, splitLength); - secondThird = output.slice(splitLength, splitLength * 2); - thirdThird = output.slice(splitLength * 2, splitLength * 3); - return _context119.abrupt("return", [firstThird, secondThird, thirdThird]); - - case 9: - case "end": - return _context119.stop(); - } - } - }, _callee119, this); - })); - - function generateSymmetricKeyPair() { - return _ref126.apply(this, arguments); - } - - return generateSymmetricKeyPair; - }() - }, { - key: "computeEncryptionKeysForUser", - value: function () { - var _ref128 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee120(password, authParams) { - var pw_salt; - return regeneratorRuntime.wrap(function _callee120$(_context120) { - while (1) { - switch (_context120.prev = _context120.next) { - case 0: - if (!(authParams.version == "003")) { - _context120.next = 9; - break; - } - - if (authParams.identifier) { - _context120.next = 4; - break; - } - - console.error("authParams is missing identifier."); - return _context120.abrupt("return"); - - case 4: - _context120.next = 6; - return this.generateSalt(authParams.identifier, authParams.version, authParams.pw_cost, authParams.pw_nonce); - - case 6: - pw_salt = _context120.sent; - _context120.next = 10; - break; - - case 9: - // Salt is returned from server - pw_salt = authParams.pw_salt; - - case 10: - return _context120.abrupt("return", this.generateSymmetricKeyPair({ - password: password, - pw_salt: pw_salt, - pw_cost: authParams.pw_cost - }).then(function (keys) { - var userKeys = { - pw: keys[0], - mk: keys[1], - ak: keys[2] - }; - return userKeys; - })); - - case 11: - case "end": - return _context120.stop(); - } - } - }, _callee120, this); - })); - - function computeEncryptionKeysForUser(_x147, _x148) { - return _ref128.apply(this, arguments); - } - - return computeEncryptionKeysForUser; - }() // Unlike computeEncryptionKeysForUser, this method always uses the latest SF Version - - }, { - key: "generateInitialKeysAndAuthParamsForUser", - value: function () { - var _ref129 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee121(identifier, password) { - var version, pw_cost, pw_nonce, pw_salt; - return regeneratorRuntime.wrap(function _callee121$(_context121) { - while (1) { - switch (_context121.prev = _context121.next) { - case 0: - version = this.SFJS.version; - pw_cost = this.SFJS.defaultPasswordGenerationCost; - _context121.next = 4; - return this.generateRandomKey(256); - - case 4: - pw_nonce = _context121.sent; - _context121.next = 7; - return this.generateSalt(identifier, version, pw_cost, pw_nonce); - - case 7: - pw_salt = _context121.sent; - return _context121.abrupt("return", this.generateSymmetricKeyPair({ - password: password, - pw_salt: pw_salt, - pw_cost: pw_cost - }).then(function (keys) { - var authParams = { - pw_nonce: pw_nonce, - pw_cost: pw_cost, - identifier: identifier, - version: version - }; - var userKeys = { - pw: keys[0], - mk: keys[1], - ak: keys[2] - }; - return { - keys: userKeys, - authParams: authParams - }; - })); - - case 9: - case "end": - return _context121.stop(); - } - } - }, _callee121, this); - })); - - function generateInitialKeysAndAuthParamsForUser(_x149, _x150) { - return _ref129.apply(this, arguments); - } - - return generateInitialKeysAndAuthParamsForUser; - }() - }]); - - return SFAbstractCrypto; - }(); - - ; - - var SFCryptoJS = exports.SFCryptoJS = function (_SFAbstractCrypto) { - _inherits(SFCryptoJS, _SFAbstractCrypto); - - function SFCryptoJS() { - _classCallCheck(this, SFCryptoJS); - - return _possibleConstructorReturn(this, (SFCryptoJS.__proto__ || Object.getPrototypeOf(SFCryptoJS)).apply(this, arguments)); - } - - _createClass(SFCryptoJS, [{ - key: "pbkdf2", - value: function () { - var _ref130 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee122(password, pw_salt, pw_cost, length) { - var params; - return regeneratorRuntime.wrap(function _callee122$(_context122) { - while (1) { - switch (_context122.prev = _context122.next) { - case 0: - params = { - keySize: length / 32, - hasher: CryptoJS.algo.SHA512, - iterations: pw_cost - }; - return _context122.abrupt("return", CryptoJS.PBKDF2(password, pw_salt, params).toString()); - - case 2: - case "end": - return _context122.stop(); - } - } - }, _callee122, this); - })); - - function pbkdf2(_x151, _x152, _x153, _x154) { - return _ref130.apply(this, arguments); - } - - return pbkdf2; - }() - }]); - - return SFCryptoJS; - }(SFAbstractCrypto); - - ; - var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : null; - var subtleCrypto = globalScope.crypto ? globalScope.crypto.subtle : null; - - var SFCryptoWeb = exports.SFCryptoWeb = function (_SFAbstractCrypto2) { - _inherits(SFCryptoWeb, _SFAbstractCrypto2); - - function SFCryptoWeb() { - _classCallCheck(this, SFCryptoWeb); - - return _possibleConstructorReturn(this, (SFCryptoWeb.__proto__ || Object.getPrototypeOf(SFCryptoWeb)).apply(this, arguments)); - } - - _createClass(SFCryptoWeb, [{ - key: "pbkdf2", - - /** - Public - */ - value: function () { - var _ref131 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee123(password, pw_salt, pw_cost, length) { - var key; - return regeneratorRuntime.wrap(function _callee123$(_context123) { - while (1) { - switch (_context123.prev = _context123.next) { - case 0: - _context123.next = 2; - return this.webCryptoImportKey(password, "PBKDF2", ["deriveBits"]); - - case 2: - key = _context123.sent; - - if (key) { - _context123.next = 6; - break; - } - - console.log("Key is null, unable to continue"); - return _context123.abrupt("return", null); - - case 6: - return _context123.abrupt("return", this.webCryptoDeriveBits(key, pw_salt, pw_cost, length)); - - case 7: - case "end": - return _context123.stop(); - } - } - }, _callee123, this); - })); - - function pbkdf2(_x155, _x156, _x157, _x158) { - return _ref131.apply(this, arguments); - } - - return pbkdf2; - }() - }, { - key: "generateRandomKey", - value: function () { - var _ref132 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee125(bits) { - var _this31 = this; - - var extractable; - return regeneratorRuntime.wrap(function _callee125$(_context125) { - while (1) { - switch (_context125.prev = _context125.next) { - case 0: - extractable = true; - return _context125.abrupt("return", subtleCrypto.generateKey({ - name: "AES-CBC", - length: bits - }, extractable, ["encrypt", "decrypt"]).then(function (keyObject) { - return subtleCrypto.exportKey("raw", keyObject).then(function () { - var _ref133 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee124(keyData) { - var key; - return regeneratorRuntime.wrap(function _callee124$(_context124) { - while (1) { - switch (_context124.prev = _context124.next) { - case 0: - _context124.next = 2; - return _this31.arrayBufferToHexString(new Uint8Array(keyData)); - - case 2: - key = _context124.sent; - return _context124.abrupt("return", key); - - case 4: - case "end": - return _context124.stop(); - } - } - }, _callee124, _this31); - })); - - return function (_x160) { - return _ref133.apply(this, arguments); - }; - }()).catch(function (err) { - console.error("Error exporting key", err); - }); - }).catch(function (err) { - console.error("Error generating key", err); - })); - - case 2: - case "end": - return _context125.stop(); - } - } - }, _callee125, this); - })); - - function generateRandomKey(_x159) { - return _ref132.apply(this, arguments); - } - - return generateRandomKey; - }() - }, { - key: "generateItemEncryptionKey", - value: function () { - var _ref134 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee126() { - var length; - return regeneratorRuntime.wrap(function _callee126$(_context126) { - while (1) { - switch (_context126.prev = _context126.next) { - case 0: - // Generates a key that will be split in half, each being 256 bits. So total length will need to be 512. - length = 256; - return _context126.abrupt("return", Promise.all([this.generateRandomKey(length), this.generateRandomKey(length)]).then(function (values) { - return values.join(""); - })); - - case 2: - case "end": - return _context126.stop(); - } - } - }, _callee126, this); - })); - - function generateItemEncryptionKey() { - return _ref134.apply(this, arguments); - } - - return generateItemEncryptionKey; - }() - /* This is a functioning implementation of WebCrypto's encrypt, however, in basic testing, CrpytoJS performs about 30-40% faster, surprisingly. */ - - }, { - key: "encryptText", - value: function () { - var _ref135 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee128(text, key, iv) { - var _this32 = this; - - var ivData, alg, keyBuffer, keyData, textData; - return regeneratorRuntime.wrap(function _callee128$(_context128) { - while (1) { - switch (_context128.prev = _context128.next) { - case 0: - if (!iv) { - _context128.next = 6; - break; - } - - _context128.next = 3; - return this.hexStringToArrayBuffer(iv); - - case 3: - _context128.t0 = _context128.sent; - _context128.next = 7; - break; - - case 6: - _context128.t0 = new ArrayBuffer(16); - - case 7: - ivData = _context128.t0; - alg = { - name: 'AES-CBC', - iv: ivData - }; - _context128.next = 11; - return this.hexStringToArrayBuffer(key); - - case 11: - keyBuffer = _context128.sent; - _context128.next = 14; - return this.webCryptoImportKey(keyBuffer, alg.name, ["encrypt"]); - - case 14: - keyData = _context128.sent; - _context128.next = 17; - return this.stringToArrayBuffer(text); - - case 17: - textData = _context128.sent; - return _context128.abrupt("return", crypto.subtle.encrypt(alg, keyData, textData).then(function () { - var _ref136 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee127(result) { - var cipher; - return regeneratorRuntime.wrap(function _callee127$(_context127) { - while (1) { - switch (_context127.prev = _context127.next) { - case 0: - _context127.next = 2; - return _this32.arrayBufferToBase64(result); - - case 2: - cipher = _context127.sent; - return _context127.abrupt("return", cipher); - - case 4: - case "end": - return _context127.stop(); - } - } - }, _callee127, _this32); - })); - - return function (_x164) { - return _ref136.apply(this, arguments); - }; - }())); - - case 19: - case "end": - return _context128.stop(); - } - } - }, _callee128, this); - })); - - function encryptText(_x161, _x162, _x163) { - return _ref135.apply(this, arguments); - } - - return encryptText; - }() - }, { - key: "decryptText", - value: function () { - var _ref137 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee130() { - var _this33 = this; - - var _ref138 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - ciphertextToAuth = _ref138.ciphertextToAuth, - contentCiphertext = _ref138.contentCiphertext, - encryptionKey = _ref138.encryptionKey, - iv = _ref138.iv, - authHash = _ref138.authHash, - authKey = _ref138.authKey; - - var requiresAuth = arguments[1]; - var localAuthHash, ivData, alg, keyBuffer, keyData, textData; - return regeneratorRuntime.wrap(function _callee130$(_context130) { - while (1) { - switch (_context130.prev = _context130.next) { - case 0: - if (!(requiresAuth && !authHash)) { - _context130.next = 3; - break; - } - - console.error("Auth hash is required."); - return _context130.abrupt("return"); - - case 3: - if (!authHash) { - _context130.next = 10; - break; - } - - _context130.next = 6; - return this.hmac256(ciphertextToAuth, authKey); - - case 6: - localAuthHash = _context130.sent; - - if (!(authHash !== localAuthHash)) { - _context130.next = 10; - break; - } - - console.error("Auth hash does not match, returning null. " + authHash + " != " + localAuthHash); - return _context130.abrupt("return", null); - - case 10: - if (!iv) { - _context130.next = 16; - break; - } - - _context130.next = 13; - return this.hexStringToArrayBuffer(iv); - - case 13: - _context130.t0 = _context130.sent; - _context130.next = 17; - break; - - case 16: - _context130.t0 = new ArrayBuffer(16); - - case 17: - ivData = _context130.t0; - alg = { - name: 'AES-CBC', - iv: ivData - }; - _context130.next = 21; - return this.hexStringToArrayBuffer(encryptionKey); - - case 21: - keyBuffer = _context130.sent; - _context130.next = 24; - return this.webCryptoImportKey(keyBuffer, alg.name, ["decrypt"]); - - case 24: - keyData = _context130.sent; - _context130.next = 27; - return this.base64ToArrayBuffer(contentCiphertext); - - case 27: - textData = _context130.sent; - return _context130.abrupt("return", crypto.subtle.decrypt(alg, keyData, textData).then(function () { - var _ref139 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee129(result) { - var decoded; - return regeneratorRuntime.wrap(function _callee129$(_context129) { - while (1) { - switch (_context129.prev = _context129.next) { - case 0: - _context129.next = 2; - return _this33.arrayBufferToString(result); - - case 2: - decoded = _context129.sent; - return _context129.abrupt("return", decoded); - - case 4: - case "end": - return _context129.stop(); - } - } - }, _callee129, _this33); - })); - - return function (_x166) { - return _ref139.apply(this, arguments); - }; - }()).catch(function (error) { - console.error("Error decrypting:", error); - })); - - case 29: - case "end": - return _context130.stop(); - } - } - }, _callee130, this); - })); - - function decryptText() { - return _ref137.apply(this, arguments); - } - - return decryptText; - }() - /** - Internal - */ - - }, { - key: "webCryptoImportKey", - value: function () { - var _ref140 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee131(input, alg, actions, hash) { - var text; - return regeneratorRuntime.wrap(function _callee131$(_context131) { - while (1) { - switch (_context131.prev = _context131.next) { - case 0: - if (!(typeof input === "string")) { - _context131.next = 6; - break; - } - - _context131.next = 3; - return this.stringToArrayBuffer(input); - - case 3: - _context131.t0 = _context131.sent; - _context131.next = 7; - break; - - case 6: - _context131.t0 = input; - - case 7: - text = _context131.t0; - return _context131.abrupt("return", subtleCrypto.importKey("raw", text, { - name: alg, - hash: hash - }, false, actions).then(function (key) { - return key; - }).catch(function (err) { - console.error(err); - return null; - })); - - case 9: - case "end": - return _context131.stop(); - } - } - }, _callee131, this); - })); - - function webCryptoImportKey(_x167, _x168, _x169, _x170) { - return _ref140.apply(this, arguments); - } - - return webCryptoImportKey; - }() // - - }, { - key: "webCryptoDeriveBits", - value: function () { - var _ref141 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee133(key, pw_salt, pw_cost, length) { - var _this34 = this; - - var params; - return regeneratorRuntime.wrap(function _callee133$(_context133) { - while (1) { - switch (_context133.prev = _context133.next) { - case 0: - _context133.next = 2; - return this.stringToArrayBuffer(pw_salt); - - case 2: - _context133.t0 = _context133.sent; - _context133.t1 = pw_cost; - _context133.t2 = { - name: "SHA-512" - }; - params = { - "name": "PBKDF2", - salt: _context133.t0, - iterations: _context133.t1, - hash: _context133.t2 - }; - return _context133.abrupt("return", subtleCrypto.deriveBits(params, key, length).then(function () { - var _ref142 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee132(bits) { - var key; - return regeneratorRuntime.wrap(function _callee132$(_context132) { - while (1) { - switch (_context132.prev = _context132.next) { - case 0: - _context132.next = 2; - return _this34.arrayBufferToHexString(new Uint8Array(bits)); - - case 2: - key = _context132.sent; - return _context132.abrupt("return", key); - - case 4: - case "end": - return _context132.stop(); - } - } - }, _callee132, _this34); - })); - - return function (_x175) { - return _ref142.apply(this, arguments); - }; - }()).catch(function (err) { - console.error(err); - return null; - })); - - case 7: - case "end": - return _context133.stop(); - } - } - }, _callee133, this); - })); - - function webCryptoDeriveBits(_x171, _x172, _x173, _x174) { - return _ref141.apply(this, arguments); - } - - return webCryptoDeriveBits; - }() - }, { - key: "stringToArrayBuffer", - value: function () { - var _ref143 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee134(string) { - return regeneratorRuntime.wrap(function _callee134$(_context134) { - while (1) { - switch (_context134.prev = _context134.next) { - case 0: - return _context134.abrupt("return", new Promise(function (resolve, reject) { - var blob = new Blob([string]); - var f = new FileReader(); - - f.onload = function (e) { - resolve(e.target.result); - }; - - f.readAsArrayBuffer(blob); - })); - - case 1: - case "end": - return _context134.stop(); - } - } - }, _callee134, this); - })); - - function stringToArrayBuffer(_x176) { - return _ref143.apply(this, arguments); - } - - return stringToArrayBuffer; - }() - }, { - key: "arrayBufferToString", - value: function () { - var _ref144 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee135(arrayBuffer) { - return regeneratorRuntime.wrap(function _callee135$(_context135) { - while (1) { - switch (_context135.prev = _context135.next) { - case 0: - return _context135.abrupt("return", new Promise(function (resolve, reject) { - var blob = new Blob([arrayBuffer]); - var f = new FileReader(); - - f.onload = function (e) { - resolve(e.target.result); - }; - - f.readAsText(blob); - })); - - case 1: - case "end": - return _context135.stop(); - } - } - }, _callee135, this); - })); - - function arrayBufferToString(_x177) { - return _ref144.apply(this, arguments); - } - - return arrayBufferToString; - }() - }, { - key: "arrayBufferToHexString", - value: function () { - var _ref145 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee136(arrayBuffer) { - var byteArray, hexString, nextHexByte, i; - return regeneratorRuntime.wrap(function _callee136$(_context136) { - while (1) { - switch (_context136.prev = _context136.next) { - case 0: - byteArray = new Uint8Array(arrayBuffer); - hexString = ""; - - for (i = 0; i < byteArray.byteLength; i++) { - nextHexByte = byteArray[i].toString(16); - - if (nextHexByte.length < 2) { - nextHexByte = "0" + nextHexByte; - } - - hexString += nextHexByte; - } - - return _context136.abrupt("return", hexString); - - case 4: - case "end": - return _context136.stop(); - } - } - }, _callee136, this); - })); - - function arrayBufferToHexString(_x178) { - return _ref145.apply(this, arguments); - } - - return arrayBufferToHexString; - }() - }, { - key: "hexStringToArrayBuffer", - value: function () { - var _ref146 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee137(hex) { - var bytes, c; - return regeneratorRuntime.wrap(function _callee137$(_context137) { - while (1) { - switch (_context137.prev = _context137.next) { - case 0: - for (bytes = [], c = 0; c < hex.length; c += 2) { - bytes.push(parseInt(hex.substr(c, 2), 16)); - } - - return _context137.abrupt("return", new Uint8Array(bytes)); - - case 2: - case "end": - return _context137.stop(); - } - } - }, _callee137, this); - })); - - function hexStringToArrayBuffer(_x179) { - return _ref146.apply(this, arguments); - } - - return hexStringToArrayBuffer; - }() - }, { - key: "base64ToArrayBuffer", - value: function () { - var _ref147 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee138(base64) { - var binary_string, len, bytes, i; - return regeneratorRuntime.wrap(function _callee138$(_context138) { - while (1) { - switch (_context138.prev = _context138.next) { - case 0: - _context138.next = 2; - return this.base64Decode(base64); - - case 2: - binary_string = _context138.sent; - len = binary_string.length; - bytes = new Uint8Array(len); - - for (i = 0; i < len; i++) { - bytes[i] = binary_string.charCodeAt(i); - } - - return _context138.abrupt("return", bytes.buffer); - - case 7: - case "end": - return _context138.stop(); - } - } - }, _callee138, this); - })); - - function base64ToArrayBuffer(_x180) { - return _ref147.apply(this, arguments); - } - - return base64ToArrayBuffer; - }() - }, { - key: "arrayBufferToBase64", - value: function () { - var _ref148 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee139(buffer) { - return regeneratorRuntime.wrap(function _callee139$(_context139) { - while (1) { - switch (_context139.prev = _context139.next) { - case 0: - return _context139.abrupt("return", new Promise(function (resolve, reject) { - var blob = new Blob([buffer], { - type: 'application/octet-binary' - }); - var reader = new FileReader(); - - reader.onload = function (evt) { - var dataurl = evt.target.result; - resolve(dataurl.substr(dataurl.indexOf(',') + 1)); - }; - - reader.readAsDataURL(blob); - })); - - case 1: - case "end": - return _context139.stop(); - } - } - }, _callee139, this); - })); - - function arrayBufferToBase64(_x181) { - return _ref148.apply(this, arguments); - } - - return arrayBufferToBase64; - }() - }, { - key: "hmac256", - value: function () { - var _ref149 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee141(message, key) { - var _this35 = this; - - var keyHexData, keyData, messageData; - return regeneratorRuntime.wrap(function _callee141$(_context141) { - while (1) { - switch (_context141.prev = _context141.next) { - case 0: - _context141.next = 2; - return this.hexStringToArrayBuffer(key); - - case 2: - keyHexData = _context141.sent; - _context141.next = 5; - return this.webCryptoImportKey(keyHexData, "HMAC", ["sign"], { - name: "SHA-256" - }); - - case 5: - keyData = _context141.sent; - _context141.next = 8; - return this.stringToArrayBuffer(message); - - case 8: - messageData = _context141.sent; - return _context141.abrupt("return", crypto.subtle.sign({ - name: "HMAC" - }, keyData, messageData).then(function () { - var _ref150 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee140(signature) { - var hash; - return regeneratorRuntime.wrap(function _callee140$(_context140) { - while (1) { - switch (_context140.prev = _context140.next) { - case 0: - _context140.next = 2; - return _this35.arrayBufferToHexString(signature); - - case 2: - hash = _context140.sent; - return _context140.abrupt("return", hash); - - case 4: - case "end": - return _context140.stop(); - } - } - }, _callee140, _this35); - })); - - return function (_x184) { - return _ref150.apply(this, arguments); - }; - }()).catch(function (err) { - console.error("Error computing hmac", err); - })); - - case 10: - case "end": - return _context141.stop(); - } - } - }, _callee141, this); - })); - - function hmac256(_x182, _x183) { - return _ref149.apply(this, arguments); - } - - return hmac256; - }() - }]); - - return SFCryptoWeb; - }(SFAbstractCrypto); - - ; - - var SFItemTransformer = exports.SFItemTransformer = function () { - function SFItemTransformer(crypto) { - _classCallCheck(this, SFItemTransformer); - - this.crypto = crypto; - } - - _createClass(SFItemTransformer, [{ - key: "_private_encryptString", - value: function () { - var _ref151 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee142(string, encryptionKey, authKey, uuid, auth_params) { - var fullCiphertext, contentCiphertext, iv, ciphertextToAuth, authHash, authParamsString; - return regeneratorRuntime.wrap(function _callee142$(_context142) { - while (1) { - switch (_context142.prev = _context142.next) { - case 0: - if (!(auth_params.version === "001")) { - _context142.next = 7; - break; - } - - _context142.next = 3; - return this.crypto.encryptText(string, encryptionKey, null); - - case 3: - contentCiphertext = _context142.sent; - fullCiphertext = auth_params.version + contentCiphertext; - _context142.next = 21; - break; - - case 7: - _context142.next = 9; - return this.crypto.generateRandomKey(128); - - case 9: - iv = _context142.sent; - _context142.next = 12; - return this.crypto.encryptText(string, encryptionKey, iv); - - case 12: - contentCiphertext = _context142.sent; - ciphertextToAuth = [auth_params.version, uuid, iv, contentCiphertext].join(":"); - _context142.next = 16; - return this.crypto.hmac256(ciphertextToAuth, authKey); - - case 16: - authHash = _context142.sent; - _context142.next = 19; - return this.crypto.base64(JSON.stringify(auth_params)); - - case 19: - authParamsString = _context142.sent; - fullCiphertext = [auth_params.version, authHash, uuid, iv, contentCiphertext, authParamsString].join(":"); - - case 21: - return _context142.abrupt("return", fullCiphertext); - - case 22: - case "end": - return _context142.stop(); - } - } - }, _callee142, this); - })); - - function _private_encryptString(_x185, _x186, _x187, _x188, _x189) { - return _ref151.apply(this, arguments); - } - - return _private_encryptString; - }() - }, { - key: "encryptItem", - value: function () { - var _ref152 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee143(item, keys, auth_params) { - var params, item_key, ek, ak, ciphertext, authHash; - return regeneratorRuntime.wrap(function _callee143$(_context143) { - while (1) { - switch (_context143.prev = _context143.next) { - case 0: - params = {}; // encrypt item key - - _context143.next = 3; - return this.crypto.generateItemEncryptionKey(); - - case 3: - item_key = _context143.sent; - - if (!(auth_params.version === "001")) { - _context143.next = 10; - break; - } - - _context143.next = 7; - return this.crypto.encryptText(item_key, keys.mk, null); - - case 7: - params.enc_item_key = _context143.sent; - _context143.next = 13; - break; - - case 10: - _context143.next = 12; - return this._private_encryptString(item_key, keys.mk, keys.ak, item.uuid, auth_params); - - case 12: - params.enc_item_key = _context143.sent; - - case 13: - _context143.next = 15; - return this.crypto.firstHalfOfKey(item_key); - - case 15: - ek = _context143.sent; - _context143.next = 18; - return this.crypto.secondHalfOfKey(item_key); - - case 18: - ak = _context143.sent; - _context143.next = 21; - return this._private_encryptString(JSON.stringify(item.createContentJSONFromProperties()), ek, ak, item.uuid, auth_params); - - case 21: - ciphertext = _context143.sent; - - if (!(auth_params.version === "001")) { - _context143.next = 27; - break; - } - - _context143.next = 25; - return this.crypto.hmac256(ciphertext, ak); - - case 25: - authHash = _context143.sent; - params.auth_hash = authHash; - - case 27: - params.content = ciphertext; - return _context143.abrupt("return", params); - - case 29: - case "end": - return _context143.stop(); - } - } - }, _callee143, this); - })); - - function encryptItem(_x190, _x191, _x192) { - return _ref152.apply(this, arguments); - } - - return encryptItem; - }() - }, { - key: "encryptionComponentsFromString", - value: function encryptionComponentsFromString(string, encryptionKey, authKey) { - var encryptionVersion = string.substring(0, 3); - - if (encryptionVersion === "001") { - return { - contentCiphertext: string.substring(3, string.length), - encryptionVersion: encryptionVersion, - ciphertextToAuth: string, - iv: null, - authHash: null, - encryptionKey: encryptionKey, - authKey: authKey - }; - } else { - var components = string.split(":"); - return { - encryptionVersion: components[0], - authHash: components[1], - uuid: components[2], - iv: components[3], - contentCiphertext: components[4], - authParams: components[5], - ciphertextToAuth: [components[0], components[2], components[3], components[4]].join(":"), - encryptionKey: encryptionKey, - authKey: authKey - }; - } - } - }, { - key: "decryptItem", - value: function () { - var _ref153 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee144(item, keys) { - var encryptedItemKey, requiresAuth, keyParams, item_key, ek, ak, itemParams, content; - return regeneratorRuntime.wrap(function _callee144$(_context144) { - while (1) { - switch (_context144.prev = _context144.next) { - case 0: - if (!(typeof item.content != "string")) { - _context144.next = 2; - break; - } - - return _context144.abrupt("return"); - - case 2: - if (!item.content.startsWith("000")) { - _context144.next = 14; - break; - } - - _context144.prev = 3; - _context144.t0 = JSON; - _context144.next = 7; - return this.crypto.base64Decode(item.content.substring(3, item.content.length)); - - case 7: - _context144.t1 = _context144.sent; - item.content = _context144.t0.parse.call(_context144.t0, _context144.t1); - _context144.next = 13; - break; - - case 11: - _context144.prev = 11; - _context144.t2 = _context144["catch"](3); - - case 13: - return _context144.abrupt("return"); - - case 14: - if (item.enc_item_key) { - _context144.next = 17; - break; - } // This needs to be here to continue, return otherwise - - - console.log("Missing item encryption key, skipping decryption."); - return _context144.abrupt("return"); - - case 17: - // decrypt encrypted key - encryptedItemKey = item.enc_item_key; - requiresAuth = true; - - if (!encryptedItemKey.startsWith("002") && !encryptedItemKey.startsWith("003")) { - // legacy encryption type, has no prefix - encryptedItemKey = "001" + encryptedItemKey; - requiresAuth = false; - } - - keyParams = this.encryptionComponentsFromString(encryptedItemKey, keys.mk, keys.ak); // return if uuid in auth hash does not match item uuid. Signs of tampering. - - if (!(keyParams.uuid && keyParams.uuid !== item.uuid)) { - _context144.next = 26; - break; - } - - console.error("Item key params UUID does not match item UUID"); - - if (!item.errorDecrypting) { - item.errorDecryptingValueChanged = true; - } - - item.errorDecrypting = true; - return _context144.abrupt("return"); - - case 26: - _context144.next = 28; - return this.crypto.decryptText(keyParams, requiresAuth); - - case 28: - item_key = _context144.sent; - - if (item_key) { - _context144.next = 34; - break; - } - - console.log("Error decrypting item", item); - - if (!item.errorDecrypting) { - item.errorDecryptingValueChanged = true; - } - - item.errorDecrypting = true; - return _context144.abrupt("return"); - - case 34: - _context144.next = 36; - return this.crypto.firstHalfOfKey(item_key); - - case 36: - ek = _context144.sent; - _context144.next = 39; - return this.crypto.secondHalfOfKey(item_key); - - case 39: - ak = _context144.sent; - itemParams = this.encryptionComponentsFromString(item.content, ek, ak); - _context144.prev = 41; - _context144.t3 = JSON; - _context144.next = 45; - return this.crypto.base64Decode(itemParams.authParams); - - case 45: - _context144.t4 = _context144.sent; - item.auth_params = _context144.t3.parse.call(_context144.t3, _context144.t4); - _context144.next = 51; - break; - - case 49: - _context144.prev = 49; - _context144.t5 = _context144["catch"](41); - - case 51: - if (!(itemParams.uuid && itemParams.uuid !== item.uuid)) { - _context144.next = 55; - break; - } - - if (!item.errorDecrypting) { - item.errorDecryptingValueChanged = true; - } - - item.errorDecrypting = true; - return _context144.abrupt("return"); - - case 55: - if (!itemParams.authHash) { - // legacy 001 - itemParams.authHash = item.auth_hash; - } - - _context144.next = 58; - return this.crypto.decryptText(itemParams, true); - - case 58: - content = _context144.sent; - - if (!content) { - if (!item.errorDecrypting) { - item.errorDecryptingValueChanged = true; - } - - item.errorDecrypting = true; - } else { - if (item.errorDecrypting == true) { - item.errorDecryptingValueChanged = true; - } // Content should only be set if it was successfully decrypted, and should otherwise remain unchanged. - - - item.errorDecrypting = false; - item.content = content; - } - - case 60: - case "end": - return _context144.stop(); - } - } - }, _callee144, this, [[3, 11], [41, 49]]); - })); - - function decryptItem(_x193, _x194) { - return _ref153.apply(this, arguments); - } - - return decryptItem; - }() - }, { - key: "decryptMultipleItems", - value: function () { - var _ref154 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee146(items, keys, throws) { - var _this36 = this; - - var decrypt; - return regeneratorRuntime.wrap(function _callee146$(_context146) { - while (1) { - switch (_context146.prev = _context146.next) { - case 0: - decrypt = function () { - var _ref155 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee145(item) { - var isString; - return regeneratorRuntime.wrap(function _callee145$(_context145) { - while (1) { - switch (_context145.prev = _context145.next) { - case 0: - if (item) { - _context145.next = 2; - break; - } - - return _context145.abrupt("return"); - - case 2: - if (!(item.deleted == true && item.content == null)) { - _context145.next = 4; - break; - } - - return _context145.abrupt("return"); - - case 4: - isString = typeof item.content === 'string' || item.content instanceof String; - - if (!isString) { - _context145.next = 19; - break; - } - - _context145.prev = 6; - _context145.next = 9; - return _this36.decryptItem(item, keys); - - case 9: - _context145.next = 19; - break; - - case 11: - _context145.prev = 11; - _context145.t0 = _context145["catch"](6); - - if (!item.errorDecrypting) { - item.errorDecryptingValueChanged = true; - } - - item.errorDecrypting = true; - - if (!throws) { - _context145.next = 17; - break; - } - - throw _context145.t0; - - case 17: - console.error("Error decrypting item", item, _context145.t0); - return _context145.abrupt("return"); - - case 19: - case "end": - return _context145.stop(); - } - } - }, _callee145, _this36, [[6, 11]]); - })); - - return function decrypt(_x198) { - return _ref155.apply(this, arguments); - }; - }(); - - return _context146.abrupt("return", Promise.all(items.map(function (item) { - return decrypt(item); - }))); - - case 2: - case "end": - return _context146.stop(); - } - } - }, _callee146, this); - })); - - function decryptMultipleItems(_x195, _x196, _x197) { - return _ref154.apply(this, arguments); - } - - return decryptMultipleItems; - }() - }]); - - return SFItemTransformer; - }(); - - ; - var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : null; - - var StandardFile = exports.StandardFile = function () { - function StandardFile(cryptoInstance) { - _classCallCheck(this, StandardFile); // This library runs in native environments as well (react native) - - - if (globalScope) { - // detect IE8 and above, and edge. - // IE and Edge do not support pbkdf2 in WebCrypto, therefore we need to use CryptoJS - var IEOrEdge = typeof document !== 'undefined' && document.documentMode || /Edge/.test(navigator.userAgent); - - if (!IEOrEdge && globalScope.crypto && globalScope.crypto.subtle) { - this.crypto = new SFCryptoWeb(); - } else { - this.crypto = new SFCryptoJS(); - } - } // This must be placed outside window check, as it's used in native. - - - if (cryptoInstance) { - this.crypto = cryptoInstance; - } - - this.itemTransformer = new SFItemTransformer(this.crypto); - this.crypto.SFJS = { - version: this.version(), - defaultPasswordGenerationCost: this.defaultPasswordGenerationCost() - }; - } - - _createClass(StandardFile, [{ - key: "version", - value: function version() { - return "003"; - } - }, { - key: "supportsPasswordDerivationCost", - value: function supportsPasswordDerivationCost(cost) { - // some passwords are created on platforms with stronger pbkdf2 capabilities, like iOS, - // which CryptoJS can't handle here (WebCrypto can however). - // if user has high password cost and is using browser that doesn't support WebCrypto, - // we want to tell them that they can't login with this browser. - if (cost > 5000) { - return this.crypto instanceof SFCryptoWeb; - } else { - return true; - } - } // Returns the versions that this library supports technically. - - }, { - key: "supportedVersions", - value: function supportedVersions() { - return ["001", "002", "003"]; - } - }, { - key: "isVersionNewerThanLibraryVersion", - value: function isVersionNewerThanLibraryVersion(version) { - var libraryVersion = this.version(); - return parseInt(version) > parseInt(libraryVersion); - } - }, { - key: "isProtocolVersionOutdated", - value: function isProtocolVersionOutdated(version) { - // YYYY-MM-DD - var expirationDates = { - "001": Date.parse("2018-01-01"), - "002": Date.parse("2020-01-01") - }; - var date = expirationDates[version]; - - if (!date) { - // No expiration date, is active version - return false; - } - - var expired = new Date() > date; - return expired; - } - }, { - key: "costMinimumForVersion", - value: function costMinimumForVersion(version) { - return { - "001": 3000, - "002": 3000, - "003": 110000 - }[version]; - } - }, { - key: "defaultPasswordGenerationCost", - value: function defaultPasswordGenerationCost() { - return this.costMinimumForVersion(this.version()); - } - }]); - - return StandardFile; - }(); - - if (globalScope) { - // window is for some reason defined in React Native, but throws an exception when you try to set to it - try { - globalScope.StandardFile = StandardFile; - globalScope.SFJS = new StandardFile(); - globalScope.SFCryptoWeb = SFCryptoWeb; - globalScope.SFCryptoJS = SFCryptoJS; - globalScope.SFItemTransformer = SFItemTransformer; - globalScope.SFModelManager = SFModelManager; - globalScope.SFItem = SFItem; - globalScope.SFItemParams = SFItemParams; - globalScope.SFHttpManager = SFHttpManager; - globalScope.SFStorageManager = SFStorageManager; - globalScope.SFSyncManager = SFSyncManager; - globalScope.SFAuthManager = SFAuthManager; - globalScope.SFMigrationManager = SFMigrationManager; - globalScope.SFAlertManager = SFAlertManager; - globalScope.SFPredicate = SFPredicate; - globalScope.SFHistorySession = SFHistorySession; - globalScope.SFSessionHistoryManager = SFSessionHistoryManager; - globalScope.SFItemHistory = SFItemHistory; - globalScope.SFItemHistoryEntry = SFItemHistoryEntry; - globalScope.SFPrivilegesManager = SFPrivilegesManager; - globalScope.SFPrivileges = SFPrivileges; - globalScope.SFSingletonManager = SFSingletonManager; - } catch (e) { - console.log("Exception while exporting window variables", e); - } - } - }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); - }, {}] - }, {}, [1])(1); -}); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) - -/***/ }), -/* 1 */ -/***/ (function(module, exports) { - -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -!function (global) { - "use strict"; - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined; // More compressible than void 0. - - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - var inModule = typeof module === "object"; - var runtime = global.regeneratorRuntime; - - if (runtime) { - if (inModule) { - // If regeneratorRuntime is defined globally and we're in a module, - // make the exports object identical to regeneratorRuntime. - module.exports = runtime; - } // Don't bother evaluating the rest of this file if the runtime was - // already defined globally. - - - return; - } // Define the runtime globally (as expected by generated code) as either - // module.exports (if we're in a module) or a new, empty object. - - - runtime = global.regeneratorRuntime = inModule ? module.exports : {}; - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - - generator._invoke = makeInvokeMethod(innerFn, self, context); - return generator; - } - - runtime.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - - function tryCatch(fn, obj, arg) { - try { - return { - type: "normal", - arg: fn.call(obj, arg) - }; - } catch (err) { - return { - type: "throw", - arg: err - }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - - var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - - function Generator() {} - - function GeneratorFunction() {} - - function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - - - var IteratorPrototype = {}; - - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - - if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function (method) { - prototype[method] = function (arg) { - return this._invoke(method, arg); - }; - }); - } - - runtime.isGeneratorFunction = function (genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" : false; - }; - - runtime.mark = function (genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = "GeneratorFunction"; - } - } - - genFun.prototype = Object.create(Gp); - return genFun; - }; // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - - - runtime.awrap = function (arg) { - return { - __await: arg - }; - }; - - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - - if (value && typeof value === "object" && hasOwn.call(value, "__await")) { - return Promise.resolve(value.__await).then(function (value) { - invoke("next", value, resolve, reject); - }, function (err) { - invoke("throw", err, resolve, reject); - }); - } - - return Promise.resolve(value).then(function (unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. If the Promise is rejected, however, the - // result for this iteration will be rejected with the same - // reason. Note that rejections of yielded Promises are not - // thrown back into the generator function, as is the case - // when an awaited Promise is rejected. This difference in - // behavior between yield and await is important, because it - // allows the consumer to decide what to do with the yielded - // rejection (swallow it and continue, manually .throw it back - // into the generator, abandon iteration, whatever). With - // await, by contrast, there is no opportunity to examine the - // rejection reason outside the generator function, so the - // only option is to throw it from the await expression, and - // let the generator function handle the exception. - result.value = unwrapped; - resolve(result); - }, reject); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function (resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); - } // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - - - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - - runtime.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - - runtime.async = function (innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList)); - return runtime.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function (result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - - - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - var record = tryCatch(innerFn, self, context); - - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done ? GenStateCompleted : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - } else if (record.type === "throw") { - state = GenStateCompleted; // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - - - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - - if (context.method === "throw") { - if (delegate.iterator.return) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - - context.method = "throw"; - context.arg = new TypeError("The iterator does not provide a 'throw' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (!info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). - - context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - } else { - // Re-yield the result returned by the delegate method. - return info; - } // The delegate iterator is finished, so forget it and continue with - // the outer generator. - - - context.delegate = null; - return ContinueSentinel; - } // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - - - defineIteratorMethods(Gp); - Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - - Gp[iteratorSymbol] = function () { - return this; - }; - - Gp.toString = function () { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { - tryLoc: locs[0] - }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ - tryLoc: "root" - }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - runtime.keys = function (object) { - var keys = []; - - for (var key in object) { - keys.push(key); - } - - keys.reverse(); // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - - return function next() { - while (keys.length) { - var key = keys.pop(); - - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - - - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, - next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined; - next.done = true; - return next; - }; - - return next.next = next; - } - } // Return an iterator with no values. - - - return { - next: doneResult - }; - } - - runtime.values = values; - - function doneResult() { - return { - value: undefined, - done: true - }; - } - - Context.prototype = { - constructor: Context, - reset: function (skipTempReset) { - this.prev = 0; - this.next = 0; // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - this.method = "next"; - this.arg = undefined; - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } - } - }, - stop: function () { - this.done = true; - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - dispatchException: function (exception) { - if (this.done) { - throw exception; - } - - var context = this; - - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined; - } - - return !!caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - abrupt: function (type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - - if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - complete: function (record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - finish: function (finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - "catch": function (tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - - return thrown; - } - } // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - - - throw new Error("illegal catch attempt"); - }, - delegateYield: function (iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - - return ContinueSentinel; - } - }; -}( // In sloppy mode, unbound `this` refers to the global object, fallback to -// Function constructor if we're in global strict mode. That is sadly a form -// of indirect eval which violates Content Security Policy. -function () { - return this; -}() || Function("return this")()); - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ExtensionBridge; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_standard_file_js_dist_lodash_min_js__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_standard_file_js_dist_lodash_min_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_standard_file_js_dist_lodash_min_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_standard_file_js__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_standard_file_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_standard_file_js__); -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); }); }; } - -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 _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; } - - - - - -var ExtensionBridge = -/*#__PURE__*/ -function () { - function ExtensionBridge(componentManager) { - _classCallCheck(this, ExtensionBridge); - - this.componentManager = componentManager; - this.updateObservers = []; - this.items = []; - } - - _createClass(ExtensionBridge, [{ - key: "getPlatform", - value: function getPlatform() { - return this.componentManager.platform; - } - }, { - key: "getEnvironment", - value: function getEnvironment() { - return this.componentManager.environment; - } - }, { - key: "isMobile", - value: function isMobile() { - return this.getEnvironment() == "mobile"; - } - }, { - key: "addEventHandler", - value: function addEventHandler(callback) { - var observer = { - id: Math.random, - callback: callback - }; - this.updateObservers.push(observer); - return observer; - } - }, { - key: "removeUpdateObserver", - value: function removeUpdateObserver(observer) { - this.updateObservers.splice(this.updateObservers.indexOf(observer), 1); - } - }, { - key: "notifyObserversOfEvent", - value: function notifyObserversOfEvent(event) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = this.updateObservers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var observer = _step.value; - observer.callback(event); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator["return"] != null) { - _iterator["return"](); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - }, { - key: "filterItems", - value: function filterItems(contentType) { - return this.items.filter(function (item) { - return item.content_type == contentType; - }); - } - }, { - key: "getFileDescriptors", - value: function getFileDescriptors() { - return this.filterItems(ExtensionBridge.FileDescriptorContentTypeKey); - } - }, { - key: "beginStreamingFiles", - value: function beginStreamingFiles() { - var _this = this; - - var contentTypes = [ExtensionBridge.FileDescriptorContentTypeKey, ExtensionBridge.FileSafeCredentialsContentType, ExtensionBridge.FileSafeIntegrationContentTypeKey]; - this.componentManager.streamItems(contentTypes, function (items) { - _this.handleStreamItemsMessage(items); - }); - } - }, { - key: "handleStreamItemsMessage", - value: function () { - var _handleStreamItemsMessage = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee(items) { - var _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, item, index; - - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _iteratorNormalCompletion2 = true; - _didIteratorError2 = false; - _iteratorError2 = undefined; - _context.prev = 3; - _iterator2 = items[Symbol.iterator](); - - case 5: - if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { - _context.next = 18; - break; - } - - item = _step2.value; - item = new __WEBPACK_IMPORTED_MODULE_2_standard_file_js__["SFItem"](item); - - if (!item.deleted) { - _context.next = 11; - break; - } - - this.removeItemFromItems(item); - return _context.abrupt("continue", 15); - - case 11: - if (!item.isMetadataUpdate) { - _context.next = 13; - break; - } - - return _context.abrupt("continue", 15); - - case 13: - index = this.indexOfItem(item); - - if (index >= 0) { - this.items[index] = item; - } else { - this.items.push(item); - } - - case 15: - _iteratorNormalCompletion2 = true; - _context.next = 5; - break; - - case 18: - _context.next = 24; - break; - - case 20: - _context.prev = 20; - _context.t0 = _context["catch"](3); - _didIteratorError2 = true; - _iteratorError2 = _context.t0; - - case 24: - _context.prev = 24; - _context.prev = 25; - - if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { - _iterator2["return"](); - } - - case 27: - _context.prev = 27; - - if (!_didIteratorError2) { - _context.next = 30; - break; - } - - throw _iteratorError2; - - case 30: - return _context.finish(27); - - case 31: - return _context.finish(24); - - case 32: - this.notifyObserversOfEvent(ExtensionBridge.BridgeEventReceivedItems); - - case 33: - case "end": - return _context.stop(); - } - } - }, _callee, this, [[3, 20, 24, 32], [25,, 27, 31]]); - })); - - function handleStreamItemsMessage(_x) { - return _handleStreamItemsMessage.apply(this, arguments); - } - - return handleStreamItemsMessage; - }() - }, { - key: "indexOfItem", - value: function indexOfItem(item) { - for (var index in this.items) { - if (this.items[index].uuid == item.uuid) { - return index; - } - } - - return -1; - } - }, { - key: "removeItemFromItems", - value: function removeItemFromItems(item) { - this.items = this.items.filter(function (candidate) { - return candidate.uuid !== item.uuid; - }); - } - }, { - key: "createItem", - value: function createItem(item, callback) { - this.createItems([item], callback); - } - }, { - key: "createItems", - value: function createItems(items, callback) { - // Not sure why we're nulling UUIDs here. If this was neccessary, componentManager should be the one to do it. - // for(var item of items) { item.uuid = null; } - this.componentManager.createItems(items, function (createdItems) { - callback && callback(createdItems.map(function (item) { - return new __WEBPACK_IMPORTED_MODULE_2_standard_file_js__["SFItem"](item); - })); - }); - } - }, { - key: "saveItem", - value: function () { - var _saveItem = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee2(item) { - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - return _context2.abrupt("return", this.saveItems([item])); - - case 1: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function saveItem(_x2) { - return _saveItem.apply(this, arguments); - } - - return saveItem; - }() - }, { - key: "saveItems", - value: function () { - var _saveItems = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee3(items) { - var _this2 = this; - - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - return _context3.abrupt("return", new Promise(function (resolve, reject) { - _this2.componentManager.saveItems(items, function (response) { - resolve(response); - - _this2.notifyObserversOfEvent(ExtensionBridge.BridgeEventSavedItem); - }); - })); - - case 1: - case "end": - return _context3.stop(); - } - } - }, _callee3); - })); - - function saveItems(_x3) { - return _saveItems.apply(this, arguments); - } - - return saveItems; - }() - }, { - key: "indexOfItem", - value: function indexOfItem(item) { - for (var index in this.items) { - if (this.items[index].uuid == item.uuid) { - return index; - } - } - - return -1; - } - }, { - key: "deleteItem", - value: function deleteItem(item, callback) { - this.deleteItems([item], callback); - } - }, { - key: "deleteItems", - value: function deleteItems(items, callback) { - this.componentManager.deleteItems(items, callback); - } - }, { - key: "removeItemFromItems", - value: function removeItemFromItems(item) { - this.items = this.items.filter(function (candidate) { - return candidate.uuid !== item.uuid; - }); - } - }]); - - return ExtensionBridge; -}(); - -_defineProperty(ExtensionBridge, "FileItemContentTypeKey", "SN|FileSafe|File"); - -_defineProperty(ExtensionBridge, "FileSafeCredentialsContentType", "SN|FileSafe|Credentials"); - -_defineProperty(ExtensionBridge, "FileDescriptorContentTypeKey", "SN|FileSafe|FileMetadata"); - -_defineProperty(ExtensionBridge, "FileSafeIntegrationContentTypeKey", "SN|FileSafe|Integration"); - -_defineProperty(ExtensionBridge, "BridgeEventLoadedCredentials", "BridgeEventLoadedCredentials"); - -_defineProperty(ExtensionBridge, "BridgeEventReceivedItems", "BridgeEventReceivedItems"); - -_defineProperty(ExtensionBridge, "BridgeEventSavedItem", "BridgeEventSavedItem"); - - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -var g; // This works in non-strict mode - -g = function () { - return this; -}(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1, eval)("this"); -} catch (e) { - // This works if the window reference is available - if (typeof window === "object") g = window; -} // g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - - -module.exports = g; - -/***/ }), -/* 4 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Filesafe; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_ExtensionBridge__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__lib_RelayManager__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__lib_IntegrationManager__ = __webpack_require__(8); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__lib_CredentialManager__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__lib_FileManager__ = __webpack_require__(10); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__lib_util_Utils__ = __webpack_require__(12); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_standard_file_js__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_standard_file_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_standard_file_js__); -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); }); }; } - -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; } - - - - - - - - - -var Filesafe = -/*#__PURE__*/ -function () { - _createClass(Filesafe, null, [{ - key: "getSFItemClass", - // Allow consumers to construct these objects without including entire standard-file-js lib - value: function getSFItemClass() { - return __WEBPACK_IMPORTED_MODULE_6_standard_file_js__["SFItem"]; - } - }]); - - function Filesafe(_ref) { - var _this = this; - - var componentManager = _ref.componentManager; - - _classCallCheck(this, Filesafe); - - this.dataChangeObservers = []; - this.newFileDescriptorHandlers = []; - this.extensionBridge = new __WEBPACK_IMPORTED_MODULE_0__lib_ExtensionBridge__["a" /* default */](componentManager); - this.extensionBridge.addEventHandler(function (eventName) { - _this.notifyObservers(); - }); - this.relayManager = new __WEBPACK_IMPORTED_MODULE_1__lib_RelayManager__["a" /* default */](); - this.integrationManager = new __WEBPACK_IMPORTED_MODULE_2__lib_IntegrationManager__["a" /* default */](this.extensionBridge); - this.credentialManager = new __WEBPACK_IMPORTED_MODULE_3__lib_CredentialManager__["a" /* default */]({ - extensionBridge: this.extensionBridge, - onCredentialLoad: function onCredentialLoad() { - _this.relayManager.setCredentials(_this.credentialManager.getDefaultCredentials()); - } - }); - this.fileManager = new __WEBPACK_IMPORTED_MODULE_4__lib_FileManager__["a" /* default */](this.extensionBridge, this.relayManager, this.integrationManager, this.credentialManager); - this.extensionBridge.beginStreamingFiles(); - } - /* - Observe changes - */ - - - _createClass(Filesafe, [{ - key: "addNewFileDescriptorHandler", - value: function addNewFileDescriptorHandler(handler) { - this.newFileDescriptorHandlers.push(handler); - } - }, { - key: "notifyObservers", - value: function notifyObservers() { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = this.dataChangeObservers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var observer = _step.value; - observer(); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator["return"] != null) { - _iterator["return"](); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - }, { - key: "addDataChangeObserver", - value: function addDataChangeObserver(observer) { - this.dataChangeObservers.push(observer); - return observer; - } - }, { - key: "removeDataChangeObserver", - value: function removeDataChangeObserver(observer) { - this.dataChangeObservers = this.dataChangeObservers.filter(function (candidate) { - return candidate != observer; - }); - } - /* Set current note. Used by filesafe-embed to show files for current note. */ - - }, { - key: "setCurrentNote", - value: function setCurrentNote(note) { - this.currentNote = note; - this.notifyObservers(); - } - /* Files */ - - }, { - key: "getAllFileDescriptors", - value: function getAllFileDescriptors() { - return this.fileManager.getAllFileDescriptors(); - } - }, { - key: "findFileDescriptor", - value: function findFileDescriptor(uuid) { - return this.fileManager.findFileDescriptor(uuid); - } - }, { - key: "fileDescriptorsForCurrentNote", - value: function fileDescriptorsForCurrentNote() { - return this.fileManager.fileDescriptorsForNote(this.currentNote); - } - }, { - key: "fileDescriptorsForNote", - value: function fileDescriptorsForNote(note) { - return this.fileManager.fileDescriptorsForNote(note); - } - }, { - key: "fileDescriptorsEncryptedWithCredential", - value: function fileDescriptorsEncryptedWithCredential(credential) { - return this.fileManager.fileDescriptorsEncryptedWithCredential(credential); - } - }, { - key: "deleteFileFromDescriptor", - value: function () { - var _deleteFileFromDescriptor = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee(fileDescriptor) { - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - return _context.abrupt("return", this.fileManager.deleteFileFromDescriptor(fileDescriptor)); - - case 1: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function deleteFileFromDescriptor(_x) { - return _deleteFileFromDescriptor.apply(this, arguments); - } - - return deleteFileFromDescriptor; - }() - }, { - key: "uploadFile", - value: function () { - var _uploadFile = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee2(_ref2) { - var fileItem, inputFileName, fileType, credential, note, descriptor, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, observer; - - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - fileItem = _ref2.fileItem, inputFileName = _ref2.inputFileName, fileType = _ref2.fileType, credential = _ref2.credential, note = _ref2.note; - - if (!note) { - note = this.currentNote; - } - - _context2.next = 4; - return this.fileManager.uploadFile({ - fileItem: fileItem, - inputFileName: inputFileName, - fileType: fileType, - credential: credential, - note: note - }); - - case 4: - descriptor = _context2.sent; - - if (!descriptor) { - _context2.next = 25; - break; - } - - _iteratorNormalCompletion2 = true; - _didIteratorError2 = false; - _iteratorError2 = undefined; - _context2.prev = 9; - - for (_iterator2 = this.newFileDescriptorHandlers[Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - observer = _step2.value; - observer(descriptor); - } - - _context2.next = 17; - break; - - case 13: - _context2.prev = 13; - _context2.t0 = _context2["catch"](9); - _didIteratorError2 = true; - _iteratorError2 = _context2.t0; - - case 17: - _context2.prev = 17; - _context2.prev = 18; - - if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { - _iterator2["return"](); - } - - case 20: - _context2.prev = 20; - - if (!_didIteratorError2) { - _context2.next = 23; - break; - } - - throw _iteratorError2; - - case 23: - return _context2.finish(20); - - case 24: - return _context2.finish(17); - - case 25: - return _context2.abrupt("return", descriptor); - - case 26: - case "end": - return _context2.stop(); - } - } - }, _callee2, this, [[9, 13, 17, 25], [18,, 20, 24]]); - })); - - function uploadFile(_x2) { - return _uploadFile.apply(this, arguments); - } - - return uploadFile; - }() - }, { - key: "encryptAndUploadJavaScriptFileObject", - value: function () { - var _encryptAndUploadJavaScriptFileObject = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee4(jsFile) { - var _this2 = this; - - return regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - return _context4.abrupt("return", new Promise(function (resolve, reject) { - var reader = new FileReader(); - - reader.onload = - /*#__PURE__*/ - function () { - var _ref3 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee3(e) { - var data, arrayBuffer, base64Data, result; - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - data = e.target.result; - arrayBuffer = data; - _context3.next = 4; - return SFJS.crypto.arrayBufferToBase64(arrayBuffer); - - case 4: - base64Data = _context3.sent; - _context3.next = 7; - return _this2.encryptAndUploadData({ - base64Data: base64Data, - inputFileName: jsFile.name, - fileType: jsFile.type - }); - - case 7: - result = _context3.sent; - resolve(result); - - case 9: - case "end": - return _context3.stop(); - } - } - }, _callee3); - })); - - return function (_x4) { - return _ref3.apply(this, arguments); - }; - }(); - - reader.readAsArrayBuffer(jsFile); - })); - - case 1: - case "end": - return _context4.stop(); - } - } - }, _callee4); - })); - - function encryptAndUploadJavaScriptFileObject(_x3) { - return _encryptAndUploadJavaScriptFileObject.apply(this, arguments); - } - - return encryptAndUploadJavaScriptFileObject; - }() - }, { - key: "encryptAndUploadData", - value: function () { - var _encryptAndUploadData = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee6(_ref4) { - var _this3 = this; - - var base64Data, inputFileName, fileType, credential; - return regeneratorRuntime.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - base64Data = _ref4.base64Data, inputFileName = _ref4.inputFileName, fileType = _ref4.fileType; - credential = this.getDefaultCredentials(); - return _context6.abrupt("return", this.encryptFile({ - data: base64Data, - inputFileName: inputFileName, - fileType: fileType, - credential: credential - }).then( - /*#__PURE__*/ - function () { - var _ref5 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee5(fileItem) { - return regeneratorRuntime.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - return _context5.abrupt("return", _this3.uploadFile({ - fileItem: fileItem, - inputFileName: inputFileName, - fileType: fileType, - credential: credential - })["catch"](function (uploadError) { - console.error("filesafe-js | error uploading file:", uploadError); - })); - - case 1: - case "end": - return _context5.stop(); - } - } - }, _callee5); - })); - - return function (_x6) { - return _ref5.apply(this, arguments); - }; - }())); - - case 3: - case "end": - return _context6.stop(); - } - } - }, _callee6, this); - })); - - function encryptAndUploadData(_x5) { - return _encryptAndUploadData.apply(this, arguments); - } - - return encryptAndUploadData; - }() - }, { - key: "downloadFileFromDescriptor", - value: function () { - var _downloadFileFromDescriptor = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee7(fileDescriptor) { - return regeneratorRuntime.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - return _context7.abrupt("return", this.fileManager.downloadFileFromDescriptor(fileDescriptor)); - - case 1: - case "end": - return _context7.stop(); - } - } - }, _callee7, this); - })); - - function downloadFileFromDescriptor(_x7) { - return _downloadFileFromDescriptor.apply(this, arguments); - } - - return downloadFileFromDescriptor; - }() - }, { - key: "encryptFile", - value: function () { - var _encryptFile = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee8(_ref6) { - var data, inputFileName, fileType, credential; - return regeneratorRuntime.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - data = _ref6.data, inputFileName = _ref6.inputFileName, fileType = _ref6.fileType, credential = _ref6.credential; - return _context8.abrupt("return", this.fileManager.encryptFile({ - data: data, - inputFileName: inputFileName, - fileType: fileType, - credential: credential - })); - - case 2: - case "end": - return _context8.stop(); - } - } - }, _callee8, this); - })); - - function encryptFile(_x8) { - return _encryptFile.apply(this, arguments); - } - - return encryptFile; - }() - /* - if fileDescriptor is available, we'll use that to determine credentials - otherwise, passed in credential will be used - */ - - }, { - key: "decryptFile", - value: function () { - var _decryptFile = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee9(_ref7) { - var fileDescriptor, fileItem, credential; - return regeneratorRuntime.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - fileDescriptor = _ref7.fileDescriptor, fileItem = _ref7.fileItem, credential = _ref7.credential; - return _context9.abrupt("return", this.fileManager.decryptFile({ - fileDescriptor: fileDescriptor, - fileItem: fileItem, - credential: credential - })); - - case 2: - case "end": - return _context9.stop(); - } - } - }, _callee9, this); - })); - - function decryptFile(_x9) { - return _decryptFile.apply(this, arguments); - } - - return decryptFile; - }() - }, { - key: "downloadBase64Data", - value: function downloadBase64Data(_ref8) { - var base64Data = _ref8.base64Data, - fileName = _ref8.fileName, - fileType = _ref8.fileType; - __WEBPACK_IMPORTED_MODULE_5__lib_util_Utils__["a" /* default */].downloadData(__WEBPACK_IMPORTED_MODULE_5__lib_util_Utils__["a" /* default */].base64toBinary(base64Data), fileName, fileType); - } - }, { - key: "createTemporaryFileUrl", - value: function createTemporaryFileUrl(_ref9) { - var base64Data = _ref9.base64Data, - dataType = _ref9.dataType; - return __WEBPACK_IMPORTED_MODULE_5__lib_util_Utils__["a" /* default */].tempUrlForData(__WEBPACK_IMPORTED_MODULE_5__lib_util_Utils__["a" /* default */].base64toBinary(base64Data), dataType); - } - }, { - key: "revokeTempUrl", - value: function revokeTempUrl(url) { - __WEBPACK_IMPORTED_MODULE_5__lib_util_Utils__["a" /* default */].revokeTempUrl(url); - } - /* Credentials */ - - }, { - key: "createNewCredentials", - value: function () { - var _createNewCredentials = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee10() { - return regeneratorRuntime.wrap(function _callee10$(_context10) { - while (1) { - switch (_context10.prev = _context10.next) { - case 0: - return _context10.abrupt("return", this.credentialManager.createNewCredentials()); - - case 1: - case "end": - return _context10.stop(); - } - } - }, _callee10, this); - })); - - function createNewCredentials() { - return _createNewCredentials.apply(this, arguments); - } - - return createNewCredentials; - }() - }, { - key: "numberOfFilesEncryptedWithCredential", - value: function numberOfFilesEncryptedWithCredential(credential) { - return this.fileManager.fileDescriptorsEncryptedWithCredential(credential).length; - } - }, { - key: "credentialForFileDescriptor", - value: function credentialForFileDescriptor(fileDescriptor) { - return this.credentialManager.credentialForFileDescriptor(fileDescriptor); - } - }, { - key: "getAllCredentials", - value: function getAllCredentials() { - return this.credentialManager.getAllCredentials(); - } - }, { - key: "getDefaultCredentials", - value: function getDefaultCredentials() { - return this.credentialManager.getDefaultCredentials(); - } - }, { - key: "setCredentialAsDefault", - value: function setCredentialAsDefault(credential) { - return this.credentialManager.setCredentialAsDefault(credential); - } - }, { - key: "deleteCredential", - value: function deleteCredential(credential) { - return this.credentialManager.deleteCredential(credential); - } - }, { - key: "saveCredential", - value: function saveCredential(credential) { - return this.credentialManager.saveCredential(credential); - } - /* Integrations */ - - }, { - key: "getAllIntegrations", - value: function getAllIntegrations() { - return this.integrationManager.integrations; - } - }, { - key: "integrationForFileDescriptor", - value: function integrationForFileDescriptor(fileDescriptor) { - return this.integrationManager.integrationForFileDescriptor(fileDescriptor); - } - }, { - key: "saveIntegrationFromCode", - value: function saveIntegrationFromCode(code) { - return this.integrationManager.saveIntegrationFromCode(code); - } - }, { - key: "getDefaultIntegration", - value: function getDefaultIntegration() { - return this.integrationManager.getDefaultIntegration(); - } - }, { - key: "setIntegrationAsDefault", - value: function setIntegrationAsDefault(integration) { - return this.integrationManager.setIntegrationAsDefault(integration); - } - }, { - key: "deleteIntegration", - value: function deleteIntegration(integration) { - return this.integrationManager.deleteIntegration(integration); - } - }, { - key: "displayStringForIntegration", - value: function displayStringForIntegration(integration) { - return this.integrationManager.displayStringForIntegration(integration); - } - /* - Misc - */ - - }, { - key: "base64toBinary", - value: function base64toBinary(base64String) { - return __WEBPACK_IMPORTED_MODULE_5__lib_util_Utils__["a" /* default */].base64toBinary(base64String); - } - }, { - key: "isMobile", - value: function isMobile() { - return this.extensionBridge.isMobile(); - } - /* desktop, web, mobile */ - - }, { - key: "getEnvironment", - value: function getEnvironment() { - return this.extensionBridge.getEnvironment(); - } - /* desktop-{os}, web-{os}, ios, android */ - - }, { - key: "getPlatform", - value: function getPlatform() { - return this.extensionBridge.getPlatform(); - } - }, { - key: "copyTextToClipboard", - value: function copyTextToClipboard(text) { - return __WEBPACK_IMPORTED_MODULE_5__lib_util_Utils__["a" /* default */].copyTextToClipboard(text); - } - }]); - - return Filesafe; -}(); - - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** - * @license - * Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE - * Build: `lodash include="includes,merge,filter,map,remove,find,omit,pull,cloneDeep,pick,uniq,sortedIndexBy,mergeWith"` - */ -; -(function () { - function t(t, e) { - return t.set(e[0], e[1]), t; - } - - function e(t, e) { - return t.add(e), t; - } - - function n(t, e, n) { - switch (n.length) { - case 0: - return t.call(e); - - case 1: - return t.call(e, n[0]); - - case 2: - return t.call(e, n[0], n[1]); - - case 3: - return t.call(e, n[0], n[1], n[2]); - } - - return t.apply(e, n); - } - - function r(t, e) { - for (var n = -1, r = null == t ? 0 : t.length; ++n < r && false !== e(t[n], n, t);); - } - - function o(t, e) { - for (var n = -1, r = null == t ? 0 : t.length, o = 0, u = []; ++n < r;) { - var c = t[n]; - e(c, n, t) && (u[o++] = c); - } - - return u; - } - - function u(t, e) { - return !(null == t || !t.length) && -1 < s(t, e, 0); - } - - function c(t, e) { - for (var n = -1, r = null == t ? 0 : t.length, o = Array(r); ++n < r;) o[n] = e(t[n], n, t); - - return o; - } - - function i(t, e) { - for (var n = -1, r = e.length, o = t.length; ++n < r;) t[o + n] = e[n]; - - return t; - } - - function a(t, e, n) { - for (var r = -1, o = null == t ? 0 : t.length; ++r < o;) n = e(n, t[r], r, t); - - return n; - } - - function f(t, e) { - for (var n = -1, r = null == t ? 0 : t.length; ++n < r;) if (e(t[n], n, t)) return true; - - return false; - } - - function l(t, e, n) { - var r = t.length; - - for (n += -1; ++n < r;) if (e(t[n], n, t)) return n; - - return -1; - } - - function s(t, e, n) { - if (e === e) t: { - --n; - - for (var r = t.length; ++n < r;) if (t[n] === e) { - t = n; - break t; - } - - t = -1; - } else t = l(t, b, n); - return t; - } - - function b(t) { - return t !== t; - } - - function h(t) { - return function (e) { - return null == e ? ae : e[t]; - }; - } - - function p(t) { - return function (e) { - return t(e); - }; - } - - function y(t, e) { - return c(e, function (e) { - return t[e]; - }); - } - - function j(t, e) { - return t.has(e); - } - - function v(t) { - var e = -1, - n = Array(t.size); - return t.forEach(function (t, r) { - n[++e] = [r, t]; - }), n; - } - - function g(t) { - var e = Object; - return function (n) { - return t(e(n)); - }; - } - - function _(t) { - var e = -1, - n = Array(t.size); - return t.forEach(function (t) { - n[++e] = t; - }), n; - } - - function d() {} - - function A(t) { - var e = -1, - n = null == t ? 0 : t.length; - - for (this.clear(); ++e < n;) { - var r = t[e]; - this.set(r[0], r[1]); - } - } - - function w(t) { - var e = -1, - n = null == t ? 0 : t.length; - - for (this.clear(); ++e < n;) { - var r = t[e]; - this.set(r[0], r[1]); - } - } - - function m(t) { - var e = -1, - n = null == t ? 0 : t.length; - - for (this.clear(); ++e < n;) { - var r = t[e]; - this.set(r[0], r[1]); - } - } - - function O(t) { - var e = -1, - n = null == t ? 0 : t.length; - - for (this.__data__ = new m(); ++e < n;) this.add(t[e]); - } - - function S(t) { - this.size = (this.__data__ = new w(t)).size; - } - - function k(t, e) { - var n = Dn(t), - r = !n && Bn(t), - o = !n && !r && Pn(t), - u = !n && !r && !o && Ln(t); - - if (n = n || r || o || u) { - for (var r = t.length, c = String, i = -1, a = Array(r); ++i < r;) a[i] = c(i); - - r = a; - } else r = []; - - var f, - c = r.length; - - for (f in t) !e && !Ne.call(t, f) || n && ("length" == f || o && ("offset" == f || "parent" == f) || u && ("buffer" == f || "byteLength" == f || "byteOffset" == f) || mt(f, c)) || r.push(f); - - return r; - } - - function z(t, e, n) { - (n === ae || Bt(t[e], n)) && (n !== ae || e in t) || M(t, e, n); - } - - function x(t, e, n) { - var r = t[e]; - Ne.call(t, e) && Bt(r, n) && (n !== ae || e in t) || M(t, e, n); - } - - function I(t, e) { - for (var n = t.length; n--;) if (Bt(t[n][0], e)) return n; - - return -1; - } - - function F(t, e) { - return t && ut(e, Yt(e), t); - } - - function E(t, e) { - return t && ut(e, Zt(e), t); - } - - function M(t, e, n) { - "__proto__" == e && tn ? tn(t, e, { - configurable: true, - enumerable: true, - value: n, - writable: true - }) : t[e] = n; - } - - function $(t, e, n, o, u, c) { - var i, - a = 1 & e, - f = 2 & e, - l = 4 & e; - if (n && (i = u ? n(t, o, u, c) : n(t)), i !== ae) return i; - if (!Vt(t)) return t; - - if (o = Dn(t)) { - if (i = _t(t), !a) return ot(t, i); - } else { - var s = Fn(t), - b = "[object Function]" == s || "[object GeneratorFunction]" == s; - if (Pn(t)) return et(t, a); - - if ("[object Object]" == s || "[object Arguments]" == s || b && !u) { - if (i = f || b ? {} : dt(t), !a) return f ? it(t, E(i, t)) : ct(t, F(i, t)); - } else { - if (!Oe[s]) return u ? t : {}; - i = At(t, s, $, a); - } - } - - if (c || (c = new S()), u = c.get(t)) return u; - c.set(t, i); - var f = l ? f ? pt : ht : f ? Zt : Yt, - h = o ? ae : f(t); - return r(h || t, function (r, o) { - h && (o = r, r = t[o]), x(i, o, $(r, e, n, o, t, c)); - }), i; - } - - function U(t, e) { - var n = []; - return On(t, function (t, r, o) { - e(t, r, o) && n.push(t); - }), n; - } - - function B(t, e, n, r, o) { - var u = -1, - c = t.length; - - for (n || (n = wt), o || (o = []); ++u < c;) { - var a = t[u]; - 0 < e && n(a) ? 1 < e ? B(a, e - 1, n, r, o) : i(o, a) : r || (o[o.length] = a); - } - - return o; - } - - function D(t, e) { - e = tt(e, t); - - for (var n = 0, r = e.length; null != t && n < r;) t = t[xt(e[n++])]; - - return n && n == r ? t : ae; - } - - function P(t, e, n) { - return e = e(t), Dn(t) ? e : i(e, n(t)); - } - - function L(t) { - if (null == t) t = t === ae ? "[object Undefined]" : "[object Null]";else if (Ze && Ze in Object(t)) { - var e = Ne.call(t, Ze), - n = t[Ze]; - - try { - t[Ze] = ae; - var r = true; - } catch (t) {} - - var o = Ce.call(t); - r && (e ? t[Ze] = n : delete t[Ze]), t = o; - } else t = Ce.call(t); - return t; - } - - function N(t) { - return Ct(t) && "[object Arguments]" == L(t); - } - - function V(t, e, n, r, o) { - if (t === e) e = true;else if (null == t || null == e || !Ct(t) && !Ct(e)) e = t !== t && e !== e;else t: { - var u = Dn(t), - c = Dn(e), - i = u ? "[object Array]" : Fn(t), - a = c ? "[object Array]" : Fn(e), - i = "[object Arguments]" == i ? "[object Object]" : i, - a = "[object Arguments]" == a ? "[object Object]" : a, - f = "[object Object]" == i, - c = "[object Object]" == a; - - if ((a = i == a) && Pn(t)) { - if (!Pn(e)) { - e = false; - break t; - } - - u = true, f = false; - } - - if (a && !f) o || (o = new S()), e = u || Ln(t) ? lt(t, e, n, r, V, o) : st(t, e, i, n, r, V, o);else { - if (!(1 & n) && (u = f && Ne.call(t, "__wrapped__"), i = c && Ne.call(e, "__wrapped__"), u || i)) { - t = u ? t.value() : t, e = i ? e.value() : e, o || (o = new S()), e = V(t, e, n, r, o); - break t; - } - - if (a) { - e: if (o || (o = new S()), u = 1 & n, i = ht(t), c = i.length, a = ht(e).length, c == a || u) { - for (f = c; f--;) { - var l = i[f]; - - if (!(u ? l in e : Ne.call(e, l))) { - e = false; - break e; - } - } - - if ((a = o.get(t)) && o.get(e)) e = a == e;else { - a = true, o.set(t, e), o.set(e, t); - - for (var s = u; ++f < c;) { - var l = i[f], - b = t[l], - h = e[l]; - if (r) var p = u ? r(h, b, l, e, t, o) : r(b, h, l, t, e, o); - - if (p === ae ? b !== h && !V(b, h, n, r, o) : !p) { - a = false; - break; - } - - s || (s = "constructor" == l); - } - - a && !s && (n = t.constructor, r = e.constructor, n != r && "constructor" in t && "constructor" in e && !(typeof n == "function" && n instanceof n && typeof r == "function" && r instanceof r) && (a = false)), o.delete(t), o.delete(e), e = a; - } - } else e = false; - } else e = false; - } - } - return e; - } - - function C(t, e) { - var n = e.length, - r = n; - if (null == t) return !r; - - for (t = Object(t); n--;) { - var o = e[n]; - if (o[2] ? o[1] !== t[o[0]] : !(o[0] in t)) return false; - } - - for (; ++n < r;) { - var o = e[n], - u = o[0], - c = t[u], - i = o[1]; - - if (o[2]) { - if (c === ae && !(u in t)) return false; - } else if (o = new S(), void 0 === ae ? !V(i, c, 3, void 0, o) : 1) return false; - } - - return true; - } - - function R(t) { - return Ct(t) && Nt(t.length) && !!me[L(t)]; - } - - function T(t) { - return typeof t == "function" ? t : null == t ? ne : typeof t == "object" ? Dn(t) ? G(t[0], t[1]) : q(t) : ue(t); - } - - function W(t, e) { - var n = -1, - r = Dt(t) ? Array(t.length) : []; - return On(t, function (t, o, u) { - r[++n] = e(t, o, u); - }), r; - } - - function q(t) { - var e = vt(t); - return 1 == e.length && e[0][2] ? kt(e[0][0], e[0][1]) : function (n) { - return n === t || C(n, e); - }; - } - - function G(t, e) { - return Ot(t) && e === e && !Vt(e) ? kt(xt(t), e) : function (n) { - var r = Qt(n, t); - return r === ae && r === e ? Xt(n, t) : V(e, r, 3); - }; - } - - function H(t, e, n, r, o) { - t !== e && Sn(e, function (u, c) { - if (Vt(u)) { - o || (o = new S()); - var i = o, - a = t[c], - f = e[c], - l = i.get(f); - if (l) z(t, c, l);else { - var l = r ? r(a, f, c + "", t, e, i) : ae, - s = l === ae; - - if (s) { - var b = Dn(f), - h = !b && Pn(f), - p = !b && !h && Ln(f), - l = f; - b || h || p ? Dn(a) ? l = a : Pt(a) ? l = ot(a) : h ? (s = false, l = et(f, true)) : p ? (s = false, l = rt(f, true)) : l = [] : Rt(f) || Bn(f) ? (l = a, Bn(a) ? l = Jt(a) : (!Vt(a) || n && Lt(a)) && (l = dt(f))) : s = false; - } - - s && (i.set(f, l), H(l, f, n, r, i), i.delete(f)), z(t, c, l); - } - } else i = r ? r(t[c], u, c + "", t, e, o) : ae, i === ae && (i = u), z(t, c, i); - }, Zt); - } - - function J(t, e) { - return K(t, e, function (e, n) { - return Xt(t, n); - }); - } - - function K(t, e, n) { - for (var r = -1, o = e.length, u = {}; ++r < o;) { - var c = e[r], - i = D(t, c); - - if (n(i, c)) { - var a = u, - c = tt(c, t); - if (Vt(a)) for (var c = tt(c, a), f = -1, l = c.length, s = l - 1; null != a && ++f < l;) { - var b = xt(c[f]), - h = i; - - if (f != s) { - var p = a[b], - h = ae; - h === ae && (h = Vt(p) ? p : mt(c[f + 1]) ? [] : {}); - } - - x(a, b, h), a = a[b]; - } - } - } - - return u; - } - - function Q(t) { - return function (e) { - return D(e, t); - }; - } - - function X(t) { - return En(zt(t, void 0, ne), t + ""); - } - - function Y(t) { - if (typeof t == "string") return t; - if (Dn(t)) return c(t, Y) + ""; - if (Wt(t)) return wn ? wn.call(t) : ""; - var e = t + ""; - return "0" == e && 1 / t == -fe ? "-0" : e; - } - - function Z(t, e) { - e = tt(e, t); - var n; - if (2 > e.length) n = t;else { - n = e; - var r = 0, - o = -1, - u = -1, - c = n.length; - - for (0 > r && (r = -r > c ? 0 : c + r), o = o > c ? c : o, 0 > o && (o += c), c = r > o ? 0 : o - r >>> 0, r >>>= 0, o = Array(c); ++u < c;) o[u] = n[u + r]; - - n = D(t, o); - } - t = n, null == t || delete t[xt(Mt(e))]; - } - - function tt(t, e) { - return Dn(t) ? t : Ot(t, e) ? [t] : Mn(Kt(t)); - } - - function et(t, e) { - if (e) return t.slice(); - var n = t.length, - n = He ? He(n) : new t.constructor(n); - return t.copy(n), n; - } - - function nt(t) { - var e = new t.constructor(t.byteLength); - return new Ge(e).set(new Ge(t)), e; - } - - function rt(t, e) { - return new t.constructor(e ? nt(t.buffer) : t.buffer, t.byteOffset, t.length); - } - - function ot(t, e) { - var n = -1, - r = t.length; - - for (e || (e = Array(r)); ++n < r;) e[n] = t[n]; - - return e; - } - - function ut(t, e, n) { - var r = !n; - n || (n = {}); - - for (var o = -1, u = e.length; ++o < u;) { - var c = e[o], - i = ae; - i === ae && (i = t[c]), r ? M(n, c, i) : x(n, c, i); - } - - return n; - } - - function ct(t, e) { - return ut(t, xn(t), e); - } - - function it(t, e) { - return ut(t, In(t), e); - } - - function at(t) { - return X(function (e, n) { - var r, - o = -1, - u = n.length, - c = 1 < u ? n[u - 1] : ae, - i = 2 < u ? n[2] : ae, - c = 3 < t.length && typeof c == "function" ? (u--, c) : ae; - - if (r = i) { - r = n[0]; - var a = n[1]; - - if (Vt(i)) { - var f = typeof a; - r = !!("number" == f ? Dt(i) && mt(a, i.length) : "string" == f && a in i) && Bt(i[a], r); - } else r = false; - } - - for (r && (c = 3 > u ? ae : c, u = 1), e = Object(e); ++o < u;) (i = n[o]) && t(e, i, o, c); - - return e; - }); - } - - function ft(t) { - return Rt(t) ? ae : t; - } - - function lt(t, e, n, r, o, u) { - var c = 1 & n, - i = t.length, - a = e.length; - if (i != a && !(c && a > i)) return false; - if ((a = u.get(t)) && u.get(e)) return a == e; - var a = -1, - l = true, - s = 2 & n ? new O() : ae; - - for (u.set(t, e), u.set(e, t); ++a < i;) { - var b = t[a], - h = e[a]; - if (r) var p = c ? r(h, b, a, e, t, u) : r(b, h, a, t, e, u); - - if (p !== ae) { - if (p) continue; - l = false; - break; - } - - if (s) { - if (!f(e, function (t, e) { - if (!j(s, e) && (b === t || o(b, t, n, r, u))) return s.push(e); - })) { - l = false; - break; - } - } else if (b !== h && !o(b, h, n, r, u)) { - l = false; - break; - } - } - - return u.delete(t), u.delete(e), l; - } - - function st(t, e, n, r, o, u, c) { - switch (n) { - case "[object DataView]": - if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset) break; - t = t.buffer, e = e.buffer; - - case "[object ArrayBuffer]": - if (t.byteLength != e.byteLength || !u(new Ge(t), new Ge(e))) break; - return true; - - case "[object Boolean]": - case "[object Date]": - case "[object Number]": - return Bt(+t, +e); - - case "[object Error]": - return t.name == e.name && t.message == e.message; - - case "[object RegExp]": - case "[object String]": - return t == e + ""; - - case "[object Map]": - var i = v; - - case "[object Set]": - if (i || (i = _), t.size != e.size && !(1 & r)) break; - return (n = c.get(t)) ? n == e : (r |= 2, c.set(t, e), e = lt(i(t), i(e), r, o, u, c), c.delete(t), e); - - case "[object Symbol]": - if (An) return An.call(t) == An.call(e); - } - - return false; - } - - function bt(t) { - return En(zt(t, ae, Et), t + ""); - } - - function ht(t) { - return P(t, Yt, xn); - } - - function pt(t) { - return P(t, Zt, In); - } - - function yt() { - var t = d.iteratee || re, - t = t === re ? T : t; - return arguments.length ? t(arguments[0], arguments[1]) : t; - } - - function jt(t, e) { - var n = t.__data__, - r = typeof e; - return ("string" == r || "number" == r || "symbol" == r || "boolean" == r ? "__proto__" !== e : null === e) ? n[typeof e == "string" ? "string" : "hash"] : n.map; - } - - function vt(t) { - for (var e = Yt(t), n = e.length; n--;) { - var r = e[n], - o = t[r]; - e[n] = [r, o, o === o && !Vt(o)]; - } - - return e; - } - - function gt(t, e) { - var n = null == t ? ae : t[e]; - return (!Vt(n) || Ve && Ve in n ? 0 : (Lt(n) ? Te : de).test(It(n))) ? n : ae; - } - - function _t(t) { - var e = t.length, - n = t.constructor(e); - return e && "string" == typeof t[0] && Ne.call(t, "index") && (n.index = t.index, n.input = t.input), n; - } - - function dt(t) { - return typeof t.constructor != "function" || St(t) ? {} : mn(Je(t)); - } - - function At(n, r, o, u) { - var c = n.constructor; - - switch (r) { - case "[object ArrayBuffer]": - return nt(n); - - case "[object Boolean]": - case "[object Date]": - return new c(+n); - - case "[object DataView]": - return r = u ? nt(n.buffer) : n.buffer, new n.constructor(r, n.byteOffset, n.byteLength); - - case "[object Float32Array]": - case "[object Float64Array]": - case "[object Int8Array]": - case "[object Int16Array]": - case "[object Int32Array]": - case "[object Uint8Array]": - case "[object Uint8ClampedArray]": - case "[object Uint16Array]": - case "[object Uint32Array]": - return rt(n, u); - - case "[object Map]": - return r = u ? o(v(n), 1) : v(n), a(r, t, new n.constructor()); - - case "[object Number]": - case "[object String]": - return new c(n); - - case "[object RegExp]": - return r = new n.constructor(n.source, ve.exec(n)), r.lastIndex = n.lastIndex, r; - - case "[object Set]": - return r = u ? o(_(n), 1) : _(n), a(r, e, new n.constructor()); - - case "[object Symbol]": - return An ? Object(An.call(n)) : {}; - } - } - - function wt(t) { - return Dn(t) || Bn(t) || !!(Ye && t && t[Ye]); - } - - function mt(t, e) { - return e = null == e ? 9007199254740991 : e, !!e && (typeof t == "number" || we.test(t)) && -1 < t && 0 == t % 1 && t < e; - } - - function Ot(t, e) { - if (Dn(t)) return false; - var n = typeof t; - return !("number" != n && "symbol" != n && "boolean" != n && null != t && !Wt(t)) || be.test(t) || !se.test(t) || null != e && t in Object(e); - } - - function St(t) { - var e = t && t.constructor; - return t === (typeof e == "function" && e.prototype || De); - } - - function kt(t, e) { - return function (n) { - return null != n && n[t] === e && (e !== ae || t in Object(n)); - }; - } - - function zt(t, e, r) { - return e = un(e === ae ? t.length - 1 : e, 0), function () { - for (var o = arguments, u = -1, c = un(o.length - e, 0), i = Array(c); ++u < c;) i[u] = o[e + u]; - - for (u = -1, c = Array(e + 1); ++u < e;) c[u] = o[u]; - - return c[e] = r(i), n(t, this, c); - }; - } - - function xt(t) { - if (typeof t == "string" || Wt(t)) return t; - var e = t + ""; - return "0" == e && 1 / t == -fe ? "-0" : e; - } - - function It(t) { - if (null != t) { - try { - return Le.call(t); - } catch (t) {} - - return t + ""; - } - - return ""; - } - - function Ft(t, e, n) { - var r = null == t ? 0 : t.length; - return r ? (n = null == n ? 0 : Gt(n), 0 > n && (n = un(r + n, 0)), l(t, yt(e, 3), n)) : -1; - } - - function Et(t) { - return (null == t ? 0 : t.length) ? B(t, 1) : []; - } - - function Mt(t) { - var e = null == t ? 0 : t.length; - return e ? t[e - 1] : ae; - } - - function $t(t, e) { - var n; - - if (t && t.length && e && e.length) { - n = e; - var r = s, - o = -1, - u = n.length; - - for (t === n && (n = ot(n)); ++o < u;) for (var c = 0, i = n[o]; -1 < (c = r(t, i, c, void 0));) t !== t && Xe.call(t, c, 1), Xe.call(t, c, 1); - - n = t; - } else n = t; - - return n; - } - - function Ut(t, e) { - function n() { - var r = arguments, - o = e ? e.apply(this, r) : r[0], - u = n.cache; - return u.has(o) ? u.get(o) : (r = t.apply(this, r), n.cache = u.set(o, r) || u, r); - } - - if (typeof t != "function" || null != e && typeof e != "function") throw new TypeError("Expected a function"); - return n.cache = new (Ut.Cache || m)(), n; - } - - function Bt(t, e) { - return t === e || t !== t && e !== e; - } - - function Dt(t) { - return null != t && Nt(t.length) && !Lt(t); - } - - function Pt(t) { - return Ct(t) && Dt(t); - } - - function Lt(t) { - return !!Vt(t) && (t = L(t), "[object Function]" == t || "[object GeneratorFunction]" == t || "[object AsyncFunction]" == t || "[object Proxy]" == t); - } - - function Nt(t) { - return typeof t == "number" && -1 < t && 0 == t % 1 && 9007199254740991 >= t; - } - - function Vt(t) { - var e = typeof t; - return null != t && ("object" == e || "function" == e); - } - - function Ct(t) { - return null != t && typeof t == "object"; - } - - function Rt(t) { - return !(!Ct(t) || "[object Object]" != L(t)) && (t = Je(t), null === t || (t = Ne.call(t, "constructor") && t.constructor, typeof t == "function" && t instanceof t && Le.call(t) == Re)); - } - - function Tt(t) { - return typeof t == "string" || !Dn(t) && Ct(t) && "[object String]" == L(t); - } - - function Wt(t) { - return typeof t == "symbol" || Ct(t) && "[object Symbol]" == L(t); - } - - function qt(t) { - return t ? (t = Ht(t), t === fe || t === -fe ? 1.7976931348623157e308 * (0 > t ? -1 : 1) : t === t ? t : 0) : 0 === t ? t : 0; - } - - function Gt(t) { - t = qt(t); - var e = t % 1; - return t === t ? e ? t - e : t : 0; - } - - function Ht(t) { - if (typeof t == "number") return t; - if (Wt(t)) return le; - if (Vt(t) && (t = typeof t.valueOf == "function" ? t.valueOf() : t, t = Vt(t) ? t + "" : t), typeof t != "string") return 0 === t ? t : +t; - t = t.replace(ye, ""); - - var e = _e.test(t); - - return e || Ae.test(t) ? ke(t.slice(2), e ? 2 : 8) : ge.test(t) ? le : +t; - } - - function Jt(t) { - return ut(t, Zt(t)); - } - - function Kt(t) { - return null == t ? "" : Y(t); - } - - function Qt(t, e, n) { - return t = null == t ? ae : D(t, e), t === ae ? n : t; - } - - function Xt(t, e) { - var n; - - if (n = null != t) { - n = t; - var r; - r = tt(e, n); - - for (var o = -1, u = r.length, c = false; ++o < u;) { - var i = xt(r[o]); - if (!(c = null != n && null != n && i in Object(n))) break; - n = n[i]; - } - - c || ++o != u ? n = c : (u = null == n ? 0 : n.length, n = !!u && Nt(u) && mt(i, u) && (Dn(n) || Bn(n))); - } - - return n; - } - - function Yt(t) { - if (Dt(t)) t = k(t);else if (St(t)) { - var e, - n = []; - - for (e in Object(t)) Ne.call(t, e) && "constructor" != e && n.push(e); - - t = n; - } else t = on(t); - return t; - } - - function Zt(t) { - if (Dt(t)) t = k(t, true);else if (Vt(t)) { - var e, - n = St(t), - r = []; - - for (e in t) ("constructor" != e || !n && Ne.call(t, e)) && r.push(e); - - t = r; - } else { - if (e = [], null != t) for (n in Object(t)) e.push(n); - t = e; - } - return t; - } - - function te(t) { - return null == t ? [] : y(t, Yt(t)); - } - - function ee(t) { - return function () { - return t; - }; - } - - function ne(t) { - return t; - } - - function re(t) { - return T(typeof t == "function" ? t : $(t, 1)); - } - - function oe() {} - - function ue(t) { - return Ot(t) ? h(xt(t)) : Q(t); - } - - function ce() { - return []; - } - - function ie() { - return false; - } - - var ae, - fe = 1 / 0, - le = NaN, - se = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - be = /^\w*$/, - he = /^\./, - pe = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, - ye = /^\s+|\s+$/g, - je = /\\(\\)?/g, - ve = /\w*$/, - ge = /^[-+]0x[0-9a-f]+$/i, - _e = /^0b[01]+$/i, - de = /^\[object .+?Constructor\]$/, - Ae = /^0o[0-7]+$/i, - we = /^(?:0|[1-9]\d*)$/, - me = {}; - me["[object Float32Array]"] = me["[object Float64Array]"] = me["[object Int8Array]"] = me["[object Int16Array]"] = me["[object Int32Array]"] = me["[object Uint8Array]"] = me["[object Uint8ClampedArray]"] = me["[object Uint16Array]"] = me["[object Uint32Array]"] = true, me["[object Arguments]"] = me["[object Array]"] = me["[object ArrayBuffer]"] = me["[object Boolean]"] = me["[object DataView]"] = me["[object Date]"] = me["[object Error]"] = me["[object Function]"] = me["[object Map]"] = me["[object Number]"] = me["[object Object]"] = me["[object RegExp]"] = me["[object Set]"] = me["[object String]"] = me["[object WeakMap]"] = false; - var Oe = {}; - Oe["[object Arguments]"] = Oe["[object Array]"] = Oe["[object ArrayBuffer]"] = Oe["[object DataView]"] = Oe["[object Boolean]"] = Oe["[object Date]"] = Oe["[object Float32Array]"] = Oe["[object Float64Array]"] = Oe["[object Int8Array]"] = Oe["[object Int16Array]"] = Oe["[object Int32Array]"] = Oe["[object Map]"] = Oe["[object Number]"] = Oe["[object Object]"] = Oe["[object RegExp]"] = Oe["[object Set]"] = Oe["[object String]"] = Oe["[object Symbol]"] = Oe["[object Uint8Array]"] = Oe["[object Uint8ClampedArray]"] = Oe["[object Uint16Array]"] = Oe["[object Uint32Array]"] = true, Oe["[object Error]"] = Oe["[object Function]"] = Oe["[object WeakMap]"] = false; - var Se, - ke = parseInt, - ze = typeof global == "object" && global && global.Object === Object && global, - xe = typeof self == "object" && self && self.Object === Object && self, - Ie = ze || xe || Function("return this")(), - Fe = typeof exports == "object" && exports && !exports.nodeType && exports, - Ee = Fe && typeof module == "object" && module && !module.nodeType && module, - Me = Ee && Ee.exports === Fe, - $e = Me && ze.process; - - t: { - try { - Se = $e && $e.binding && $e.binding("util"); - break t; - } catch (t) {} - - Se = void 0; - } - - var Ue = Se && Se.isTypedArray, - Be = Array.prototype, - De = Object.prototype, - Pe = Ie["__core-js_shared__"], - Le = Function.prototype.toString, - Ne = De.hasOwnProperty, - Ve = function () { - var t = /[^.]+$/.exec(Pe && Pe.keys && Pe.keys.IE_PROTO || ""); - return t ? "Symbol(src)_1." + t : ""; - }(), - Ce = De.toString, - Re = Le.call(Object), - Te = RegExp("^" + Le.call(Ne).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), - We = Me ? Ie.Buffer : ae, - qe = Ie.Symbol, - Ge = Ie.Uint8Array, - He = We ? We.a : ae, - Je = g(Object.getPrototypeOf), - Ke = Object.create, - Qe = De.propertyIsEnumerable, - Xe = Be.splice, - Ye = qe ? qe.isConcatSpreadable : ae, - Ze = qe ? qe.toStringTag : ae, - tn = function () { - try { - var t = gt(Object, "defineProperty"); - return t({}, "", {}), t; - } catch (t) {} - }(), - en = Math.floor, - nn = Object.getOwnPropertySymbols, - rn = We ? We.isBuffer : ae, - on = g(Object.keys), - un = Math.max, - cn = Math.min, - an = Date.now, - fn = gt(Ie, "DataView"), - ln = gt(Ie, "Map"), - sn = gt(Ie, "Promise"), - bn = gt(Ie, "Set"), - hn = gt(Ie, "WeakMap"), - pn = gt(Object, "create"), - yn = It(fn), - jn = It(ln), - vn = It(sn), - gn = It(bn), - _n = It(hn), - dn = qe ? qe.prototype : ae, - An = dn ? dn.valueOf : ae, - wn = dn ? dn.toString : ae, - mn = function () { - function t() {} - - return function (e) { - return Vt(e) ? Ke ? Ke(e) : (t.prototype = e, e = new t(), t.prototype = ae, e) : {}; - }; - }(); - - A.prototype.clear = function () { - this.__data__ = pn ? pn(null) : {}, this.size = 0; - }, A.prototype.delete = function (t) { - return t = this.has(t) && delete this.__data__[t], this.size -= t ? 1 : 0, t; - }, A.prototype.get = function (t) { - var e = this.__data__; - return pn ? (t = e[t], "__lodash_hash_undefined__" === t ? ae : t) : Ne.call(e, t) ? e[t] : ae; - }, A.prototype.has = function (t) { - var e = this.__data__; - return pn ? e[t] !== ae : Ne.call(e, t); - }, A.prototype.set = function (t, e) { - var n = this.__data__; - return this.size += this.has(t) ? 0 : 1, n[t] = pn && e === ae ? "__lodash_hash_undefined__" : e, this; - }, w.prototype.clear = function () { - this.__data__ = [], this.size = 0; - }, w.prototype.delete = function (t) { - var e = this.__data__; - return t = I(e, t), !(0 > t) && (t == e.length - 1 ? e.pop() : Xe.call(e, t, 1), --this.size, true); - }, w.prototype.get = function (t) { - var e = this.__data__; - return t = I(e, t), 0 > t ? ae : e[t][1]; - }, w.prototype.has = function (t) { - return -1 < I(this.__data__, t); - }, w.prototype.set = function (t, e) { - var n = this.__data__, - r = I(n, t); - return 0 > r ? (++this.size, n.push([t, e])) : n[r][1] = e, this; - }, m.prototype.clear = function () { - this.size = 0, this.__data__ = { - hash: new A(), - map: new (ln || w)(), - string: new A() - }; - }, m.prototype.delete = function (t) { - return t = jt(this, t).delete(t), this.size -= t ? 1 : 0, t; - }, m.prototype.get = function (t) { - return jt(this, t).get(t); - }, m.prototype.has = function (t) { - return jt(this, t).has(t); - }, m.prototype.set = function (t, e) { - var n = jt(this, t), - r = n.size; - return n.set(t, e), this.size += n.size == r ? 0 : 1, this; - }, O.prototype.add = O.prototype.push = function (t) { - return this.__data__.set(t, "__lodash_hash_undefined__"), this; - }, O.prototype.has = function (t) { - return this.__data__.has(t); - }, S.prototype.clear = function () { - this.__data__ = new w(), this.size = 0; - }, S.prototype.delete = function (t) { - var e = this.__data__; - return t = e.delete(t), this.size = e.size, t; - }, S.prototype.get = function (t) { - return this.__data__.get(t); - }, S.prototype.has = function (t) { - return this.__data__.has(t); - }, S.prototype.set = function (t, e) { - var n = this.__data__; - - if (n instanceof w) { - var r = n.__data__; - if (!ln || 199 > r.length) return r.push([t, e]), this.size = ++n.size, this; - n = this.__data__ = new m(r); - } - - return n.set(t, e), this.size = n.size, this; - }; - - var On = function (t, e) { - return function (n, r) { - if (null == n) return n; - if (!Dt(n)) return t(n, r); - - for (var o = n.length, u = e ? o : -1, c = Object(n); (e ? u-- : ++u < o) && false !== r(c[u], u, c);); - - return n; - }; - }(function (t, e) { - return t && Sn(t, e, Yt); - }), - Sn = function (t) { - return function (e, n, r) { - var o = -1, - u = Object(e); - r = r(e); - - for (var c = r.length; c--;) { - var i = r[t ? c : ++o]; - if (false === n(u[i], i, u)) break; - } - - return e; - }; - }(), - kn = tn ? function (t, e) { - return tn(t, "toString", { - configurable: true, - enumerable: false, - value: ee(e), - writable: true - }); - } : ne, - zn = bn && 1 / _(new bn([, -0]))[1] == fe ? function (t) { - return new bn(t); - } : oe, - xn = nn ? function (t) { - return null == t ? [] : (t = Object(t), o(nn(t), function (e) { - return Qe.call(t, e); - })); - } : ce, - In = nn ? function (t) { - for (var e = []; t;) i(e, xn(t)), t = Je(t); - - return e; - } : ce, - Fn = L; - - (fn && "[object DataView]" != Fn(new fn(new ArrayBuffer(1))) || ln && "[object Map]" != Fn(new ln()) || sn && "[object Promise]" != Fn(sn.resolve()) || bn && "[object Set]" != Fn(new bn()) || hn && "[object WeakMap]" != Fn(new hn())) && (Fn = function (t) { - var e = L(t); - if (t = (t = "[object Object]" == e ? t.constructor : ae) ? It(t) : "") switch (t) { - case yn: - return "[object DataView]"; - - case jn: - return "[object Map]"; - - case vn: - return "[object Promise]"; - - case gn: - return "[object Set]"; - - case _n: - return "[object WeakMap]"; - } - return e; - }); - - var En = function (t) { - var e = 0, - n = 0; - return function () { - var r = an(), - o = 16 - (r - n); - - if (n = r, 0 < o) { - if (800 <= ++e) return arguments[0]; - } else e = 0; - - return t.apply(ae, arguments); - }; - }(kn), - Mn = function (t) { - t = Ut(t, function (t) { - return 500 === e.size && e.clear(), t; - }); - var e = t.cache; - return t; - }(function (t) { - var e = []; - return he.test(t) && e.push(""), t.replace(pe, function (t, n, r, o) { - e.push(r ? o.replace(je, "$1") : n || t); - }), e; - }), - $n = X($t), - Un = function (t) { - return function (e, n, r) { - var o = Object(e); - - if (!Dt(e)) { - var u = yt(n, 3); - e = Yt(e), n = function (t) { - return u(o[t], t, o); - }; - } - - return n = t(e, n, r), -1 < n ? o[u ? e[n] : n] : ae; - }; - }(Ft); - - Ut.Cache = m; - var Bn = N(function () { - return arguments; - }()) ? N : function (t) { - return Ct(t) && Ne.call(t, "callee") && !Qe.call(t, "callee"); - }, - Dn = Array.isArray, - Pn = rn || ie, - Ln = Ue ? p(Ue) : R, - Nn = at(function (t, e, n) { - H(t, e, n); - }), - Vn = at(function (t, e, n, r) { - H(t, e, n, r); - }), - Cn = bt(function (t, e) { - var n = {}; - if (null == t) return n; - var r = false; - e = c(e, function (e) { - return e = tt(e, t), r || (r = 1 < e.length), e; - }), ut(t, pt(t), n), r && (n = $(n, 7, ft)); - - for (var o = e.length; o--;) Z(n, e[o]); - - return n; - }), - Rn = bt(function (t, e) { - return null == t ? {} : J(t, e); - }); - d.constant = ee, d.filter = function (t, e) { - return (Dn(t) ? o : U)(t, yt(e, 3)); - }, d.flatten = Et, d.iteratee = re, d.keys = Yt, d.keysIn = Zt, d.map = function (t, e) { - return (Dn(t) ? c : W)(t, yt(e, 3)); - }, d.memoize = Ut, d.merge = Nn, d.mergeWith = Vn, d.omit = Cn, d.pick = Rn, d.property = ue, d.pull = $n, d.pullAll = $t, d.remove = function (t, e) { - var n = []; - if (!t || !t.length) return n; - var r = -1, - o = [], - u = t.length; - - for (e = yt(e, 3); ++r < u;) { - var c = t[r]; - e(c, r, t) && (n.push(c), o.push(r)); - } - - for (r = t ? o.length : 0, u = r - 1; r--;) if (c = o[r], r == u || c !== i) { - var i = c; - mt(c) ? Xe.call(t, c, 1) : Z(t, c); - } - - return n; - }, d.toPlainObject = Jt, d.uniq = function (t) { - if (t && t.length) t: { - var e = -1, - n = u, - r = t.length, - o = true, - c = [], - i = c; - - if (200 <= r) { - if (n = zn(t)) { - t = _(n); - break t; - } - - o = false, n = j, i = new O(); - } else i = c; - - e: for (; ++e < r;) { - var a = t[e], - f = a, - a = 0 !== a ? a : 0; - - if (o && f === f) { - for (var l = i.length; l--;) if (i[l] === f) continue e; - - c.push(a); - } else n(i, f, void 0) || (i !== c && i.push(f), c.push(a)); - } - - t = c; - } else t = []; - return t; - }, d.values = te, d.cloneDeep = function (t) { - return $(t, 5); - }, d.eq = Bt, d.find = Un, d.findIndex = Ft, d.get = Qt, d.hasIn = Xt, d.identity = ne, d.includes = function (t, e, n, r) { - return t = Dt(t) ? t : te(t), n = n && !r ? Gt(n) : 0, r = t.length, 0 > n && (n = un(r + n, 0)), Tt(t) ? n <= r && -1 < t.indexOf(e, n) : !!r && -1 < s(t, e, n); - }, d.isArguments = Bn, d.isArray = Dn, d.isArrayLike = Dt, d.isArrayLikeObject = Pt, d.isBuffer = Pn, d.isFunction = Lt, d.isLength = Nt, d.isObject = Vt, d.isObjectLike = Ct, d.isPlainObject = Rt, d.isString = Tt, d.isSymbol = Wt, d.isTypedArray = Ln, d.last = Mt, d.stubArray = ce, d.stubFalse = ie, d.noop = oe, d.sortedIndexBy = function (t, e, n) { - n = yt(n, 2), e = n(e); - - for (var r = 0, o = null == t ? 0 : t.length, u = e !== e, c = null === e, i = Wt(e), a = e === ae; r < o;) { - var f = en((r + o) / 2), - l = n(t[f]), - s = l !== ae, - b = null === l, - h = l === l, - p = Wt(l); - (u ? h : a ? h && s : c ? h && s && !b : i ? h && s && !b && !p : b || p ? 0 : l < e) ? r = f + 1 : o = f; - } - - return cn(o, 4294967294); - }, d.toFinite = qt, d.toInteger = Gt, d.toNumber = Ht, d.toString = Kt, d.VERSION = "4.17.4", true ? (Ie._ = d, !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { - return d; - }).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))) : Ee ? ((Ee.exports = d)._ = d, Fe._ = d) : Ie._ = d; -}).call(this); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3), __webpack_require__(6)(module))) - -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -module.exports = function (module) { - if (!module.webpackPolyfill) { - module.deprecate = function () {}; - - module.paths = []; // module.parent = undefined by default - - if (!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function () { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function () { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - - return module; -}; - -/***/ }), -/* 7 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RelayManager; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_standard_file_js__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_standard_file_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_standard_file_js__); -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); }); }; } - -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; } - - - - -var RelayManager = -/*#__PURE__*/ -function () { - function RelayManager() { - _classCallCheck(this, RelayManager); - - this.httpManger = new __WEBPACK_IMPORTED_MODULE_1_standard_file_js__["SFHttpManager"](); - this.httpManger.setJWTRequestHandler(function () {}); - } - - _createClass(RelayManager, [{ - key: "setCredentials", - value: function setCredentials(credentials) { - this.credentials = credentials; - } - }, { - key: "uploadFile", - value: function () { - var _uploadFile = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee(name, item, integration) { - var _this = this; - - var url, params; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - url = "".concat(integration.content.relayUrl, "/integrations/save-item"); - params = { - file: { - name: name, - item: item // base64 string of file - - }, - source: integration.content.source, - authorization: integration.content.authorization - }; - return _context.abrupt("return", new Promise(function (resolve, reject) { - _this.httpManger.postAbsolute(url, params, function (response) { - resolve(response.metadata); - }, function (errorResponse) { - var error = errorResponse.error; - - if (!error) { - error = { - message: "File upload failed." - }; - } - - console.log("Upload error response", error); - reject(error); - }); - })); - - case 3: - case "end": - return _context.stop(); - } - } - }, _callee); - })); - - function uploadFile(_x, _x2, _x3) { - return _uploadFile.apply(this, arguments); - } - - return uploadFile; - }() - }, { - key: "downloadFile", - value: function () { - var _downloadFile = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee2(fileDescriptor, integration) { - var _this2 = this; - - var url, params; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - url = "".concat(integration.content.relayUrl, "/integrations/download-item"); - params = { - metadata: fileDescriptor.content.serverMetadata, - authorization: integration.content.authorization - }; - return _context2.abrupt("return", new Promise(function (resolve, reject) { - _this2.httpManger.postAbsolute(url, params, function (response) { - resolve(response); - }, function (errorResponse) { - var error = errorResponse.error; - console.log("Download error response", errorResponse); - reject(error); - }); - })); - - case 3: - case "end": - return _context2.stop(); - } - } - }, _callee2); - })); - - function downloadFile(_x4, _x5) { - return _downloadFile.apply(this, arguments); - } - - return downloadFile; - }() - }, { - key: "deleteFile", - value: function () { - var _deleteFile = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee3(fileDescriptor, integration) { - var _this3 = this; - - var url, params; - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - url = "".concat(integration.content.relayUrl, "/integrations/delete-item"); - params = { - metadata: fileDescriptor.content.serverMetadata, - authorization: integration.content.authorization - }; - return _context3.abrupt("return", new Promise(function (resolve, reject) { - _this3.httpManger.postAbsolute(url, params, function (response) { - resolve(response); - }, function (errorResponse) { - var error = errorResponse.error; - console.log("Download error response", errorResponse); - reject(error); - }); - })); - - case 3: - case "end": - return _context3.stop(); - } - } - }, _callee3); - })); - - function deleteFile(_x6, _x7) { - return _deleteFile.apply(this, arguments); - } - - return deleteFile; - }() - }]); - - return RelayManager; -}(); - - - -/***/ }), -/* 8 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IntegrationManager; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_standard_file_js__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_standard_file_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_standard_file_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ExtensionBridge__ = __webpack_require__(2); -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); }); }; } - -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; } - - - - - -var IntegrationManager = -/*#__PURE__*/ -function () { - function IntegrationManager(extensionBridge) { - _classCallCheck(this, IntegrationManager); - - this.extensionBridge = extensionBridge; - } - - _createClass(IntegrationManager, [{ - key: "integrationForFileDescriptor", - value: function integrationForFileDescriptor(descriptor) { - return this.integrations.find(function (integration) { - return descriptor.content.serverMetadata && integration.content.source == descriptor.content.serverMetadata.source; - }); - } - }, { - key: "parseIntegrationCode", - value: function parseIntegrationCode(code) { - var jsonString = atob(code); - var integration = JSON.parse(jsonString); - integration.rawCode = code; - return integration; - } - }, { - key: "saveIntegrationFromCode", - value: function () { - var _saveIntegrationFromCode = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee(code) { - var content, integration; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - content = this.parseIntegrationCode(code); - - if (this.integrations.length == 0) { - content.isDefaultUploadSource = true; - } - - integration = this.createAndSaveIntegrationObject(content); - return _context.abrupt("return", integration); - - case 4: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function saveIntegrationFromCode(_x) { - return _saveIntegrationFromCode.apply(this, arguments); - } - - return saveIntegrationFromCode; - }() - }, { - key: "createAndSaveIntegrationObject", - value: function createAndSaveIntegrationObject(content) { - var integration = new __WEBPACK_IMPORTED_MODULE_1_standard_file_js__["SFItem"]({ - content_type: __WEBPACK_IMPORTED_MODULE_2__ExtensionBridge__["a" /* default */].FileSafeIntegrationContentTypeKey, - content: content - }); - this.extensionBridge.createItems([integration]); - return integration; - } - }, { - key: "getDefaultIntegration", - value: function getDefaultIntegration() { - return this.integrations.find(function (integration) { - return integration.content.isDefaultUploadSource; - }); - } - }, { - key: "setIntegrationAsDefault", - value: function setIntegrationAsDefault(integration) { - var saveItems = [integration]; - var currentDefault = this.getDefaultIntegration(); - - if (currentDefault) { - currentDefault.content.isDefaultUploadSource = false; - saveItems.push(currentDefault); - } - - integration.content.isDefaultUploadSource = true; - this.extensionBridge.saveItems(saveItems); - } - }, { - key: "displayStringForIntegration", - value: function displayStringForIntegration(integration) { - var capitalizeFirstLetter = function capitalizeFirstLetter(string) { - return string.charAt(0).toUpperCase() + string.slice(1); - }; - - var comps = integration.content.source.split("_"); - var result = ""; - var index = 0; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = comps[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var comp = _step.value; - result += capitalizeFirstLetter(comp); - - if (index < comps.length - 1) { - result += " "; - } - - index++; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator["return"] != null) { - _iterator["return"](); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return result; - } - }, { - key: "deleteIntegration", - value: function deleteIntegration(integrationObject) { - var _this = this; - - var isDefault = integrationObject.content.isDefaultUploadSource; - this.extensionBridge.deleteItem(integrationObject, function (response) { - if (response.deleted && isDefault) { - if (_this.integrations.length > 0) { - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = _this.integrations[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var currentIntegration = _step2.value; - - if (currentIntegration != integrationObject) { - _this.setIntegrationAsDefault(currentIntegration); - - break; - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { - _iterator2["return"](); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - } - } - }); - } - }, { - key: "integrations", - get: function get() { - return this.extensionBridge.filterItems(__WEBPACK_IMPORTED_MODULE_2__ExtensionBridge__["a" /* default */].FileSafeIntegrationContentTypeKey); - } - }]); - - return IntegrationManager; -}(); - - - -/***/ }), -/* 9 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CredentialManager; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_standard_file_js__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_standard_file_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_standard_file_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ExtensionBridge__ = __webpack_require__(2); -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); }); }; } - -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 _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; } - - - - - -var CredentialManager = -/*#__PURE__*/ -function () { - function CredentialManager(_ref) { - var _this = this; - - var extensionBridge = _ref.extensionBridge, - onCredentialLoad = _ref.onCredentialLoad; - - _classCallCheck(this, CredentialManager); - - _defineProperty(this, "getDefaultCredentials", function () { - var defaultCredentials = _this.credentials.find(function (candidate) { - return candidate.content.isDefault; - }); - - if (!defaultCredentials && _this.credentials.length > 0) { - defaultCredentials = _this.credentials[0]; - } - - return defaultCredentials; - }); - - _defineProperty(this, "setCredentialAsDefault", function (credential) { - var currentDefault = _this.getDefaultCredentials(); - - if (currentDefault) { - currentDefault.content.isDefault = false; - } - - credential.content.isDefault = true; - - _this.extensionBridge.saveItems([currentDefault, credential]); - }); - - _defineProperty(this, "deleteCredential", function (credential) { - _this.extensionBridge.deleteItem(credential); - }); - - this.extensionBridge = extensionBridge; - this.onCredentialLoad = onCredentialLoad; - this.credentials = []; - this.extensionBridge.addEventHandler(function (event) { - if (event == __WEBPACK_IMPORTED_MODULE_2__ExtensionBridge__["a" /* default */].BridgeEventReceivedItems) { - _this.reloadCredentials(); - } - }); - } - - _createClass(CredentialManager, [{ - key: "reloadCredentials", - value: function reloadCredentials() { - // clear current credentials, search results should contain all items and not just new incoming stuff. - this.credentials = []; - var searchResults = this.extensionBridge.filterItems(__WEBPACK_IMPORTED_MODULE_2__ExtensionBridge__["a" /* default */].FileSafeCredentialsContentType); - - if (searchResults.length == 0) { - return; - } - - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = searchResults[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var incomingCredentials = _step.value; - - if (!this.credentials.find(function (candidate) { - return candidate.uuid == incomingCredentials.uuid; - })) { - this.credentials.push(incomingCredentials); - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator["return"] != null) { - _iterator["return"](); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - this.onCredentialLoad(); - - if (this.credentials.length > 0) { - this.didLoadCredentials(); - } - } - }, { - key: "createNewCredentials", - value: function () { - var _createNewCredentials = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee() { - var bits, identifer, password, credentialParams, credentials; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - bits = 256; - _context.next = 3; - return SFJS.crypto.generateRandomKey(bits); - - case 3: - identifer = _context.sent; - _context.next = 6; - return SFJS.crypto.generateRandomKey(bits); - - case 6: - password = _context.sent; - _context.next = 9; - return SFJS.crypto.generateInitialKeysAndAuthParamsForUser(identifer, password); - - case 9: - credentialParams = _context.sent; - credentialParams.isDefault = this.credentials.length == 0; - credentials = new __WEBPACK_IMPORTED_MODULE_1_standard_file_js__["SFItem"]({ - content_type: __WEBPACK_IMPORTED_MODULE_2__ExtensionBridge__["a" /* default */].FileSafeCredentialsContentType, - content: credentialParams - }); - this.extensionBridge.saveItem(credentials); - this.didLoadCredentials(); - return _context.abrupt("return", credentials); - - case 15: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function createNewCredentials() { - return _createNewCredentials.apply(this, arguments); - } - - return createNewCredentials; - }() - }, { - key: "didLoadCredentials", - value: function didLoadCredentials() { - this.extensionBridge.notifyObserversOfEvent(__WEBPACK_IMPORTED_MODULE_2__ExtensionBridge__["a" /* default */].BridgeEventLoadedCredentials); - } - }, { - key: "credentialForFileDescriptor", - value: function credentialForFileDescriptor(fileDescriptor) { - return this.credentials.find(function (candidate) { - return fileDescriptor.content.references.find(function (ref) { - return ref.uuid == candidate.uuid; - }); - }); - } - }, { - key: "getAllCredentials", - value: function getAllCredentials() { - return this.credentials; - } - }, { - key: "saveCredential", - value: function saveCredential(credentials) { - this.extensionBridge.saveItem(credentials); - } - }]); - - return CredentialManager; -}(); - - - -/***/ }), -/* 10 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FileManager; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_standard_file_js_dist_regenerator_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_standard_file_js__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_standard_file_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_standard_file_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_encryption_worker_js__ = __webpack_require__(11); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_encryption_worker_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__util_encryption_worker_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ExtensionBridge__ = __webpack_require__(2); -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 UploadFilesView = +/*#__PURE__*/ +function (_React$Component) { + __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_inherits___default()(UploadFilesView, _React$Component); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function UploadFilesView(props) { + var _this; -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); } } + __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck___default()(this, UploadFilesView); -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + _this = __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_possibleConstructorReturn___default()(this, __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_getPrototypeOf___default()(UploadFilesView).call(this, props)); -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; } + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "event_preventDefaults", function (e) { + e.preventDefault(); + e.stopPropagation(); + }); + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "event_highlight", function (e) { + _this.event_preventDefaults(e); + _this.rootElement.classList.add('highlight'); + }); + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "event_unhighlight", function (e) { + _this.event_preventDefaults(e); + _this.rootElement.classList.remove('highlight'); + }); + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "event_drop", function (e) { + _this.event_unhighlight(e); -var FileManager = -/*#__PURE__*/ -function () { - function FileManager(extensionBridge, relayManager, integrationManager, credentialManager) { - _classCallCheck(this, FileManager); + _this.event_preventDefaults(e); - this.extensionBridge = extensionBridge; - this.relayManager = relayManager; - this.integrationManager = integrationManager; - this.credentialManager = credentialManager; - } + var dt = e.dataTransfer; + var files = dt.files; - _createClass(FileManager, [{ - key: "getAllFileDescriptors", - value: function getAllFileDescriptors() { - return this.extensionBridge.getFileDescriptors(); - } - }, { - key: "fileDescriptorsForNote", - value: function fileDescriptorsForNote(note) { - if (!note) { - return []; - } + _this.handleDroppedFiles(files); + }); - return this.extensionBridge.getFileDescriptors().filter(function (fileDescriptor) { - return fileDescriptor.hasRelationshipWithItem(note); - }); - } - }, { - key: "findFileDescriptor", - value: function findFileDescriptor(uuid) { - return this.extensionBridge.getFileDescriptors().find(function (fileDescriptor) { - return fileDescriptor.uuid == uuid; - }); - } - }, { - key: "fileDescriptorsEncryptedWithCredential", - value: function fileDescriptorsEncryptedWithCredential(credential) { - var descriptors = this.extensionBridge.getFileDescriptors(); - return descriptors.filter(function (descriptor) { - return descriptor.content.references.find(function (ref) { - return ref.uuid == credential.uuid; - }); - }); - } - }, { - key: "deleteFileFromDescriptor", - value: function () { - var _deleteFileFromDescriptor = _asyncToGenerator( + __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_assertThisInitialized___default()(_this), "handleDroppedFiles", + /*#__PURE__*/ + function () { + var _ref = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee(fileDescriptor) { - var _this = this; + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee(files) { + var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, file; - return regeneratorRuntime.wrap(function _callee$(_context) { + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - return _context.abrupt("return", new Promise(function (resolve, reject) { - _this.extensionBridge.deleteItems([fileDescriptor], function (response) { - if (response.deleted) { - var integration = _this.integrationManager.integrationForFileDescriptor(fileDescriptor); + if (!(__WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllIntegrations().length == 0)) { + _context.next = 3; + break; + } - if (integration) { - _this.relayManager.deleteFile(fileDescriptor, integration).then(function (relayResponse) { - resolve(); - }); - } - } else { - resolve(response); - } - }); - })); + alert("Please set up at least one integration before attempting to upload a file. To do this, press Expand, and select Add New in the Integrations section."); + return _context.abrupt("return"); - case 1: - case "end": - return _context.stop(); - } - } - }, _callee); - })); + case 3: + _iteratorNormalCompletion = true; + _didIteratorError = false; + _iteratorError = undefined; + _context.prev = 6; + _iterator = files[Symbol.iterator](); - function deleteFileFromDescriptor(_x) { - return _deleteFileFromDescriptor.apply(this, arguments); - } + case 8: + if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { + _context.next = 17; + break; + } - return deleteFileFromDescriptor; - }() - }, { - key: "uploadFile", - value: function () { - var _uploadFile = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee2(_ref) { - var _this2 = this; + file = _step.value; - var fileItem, inputFileName, fileType, credential, note, integration, fileExt, outputFileName; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - fileItem = _ref.fileItem, inputFileName = _ref.inputFileName, fileType = _ref.fileType, credential = _ref.credential, note = _ref.note; - integration = this.integrationManager.getDefaultIntegration(); - fileExt = inputFileName.split(".")[1]; - outputFileName = "".concat(fileItem.uuid, ".sf.json"); - return _context2.abrupt("return", new Promise(function (resolve, reject) { - var worker = new __WEBPACK_IMPORTED_MODULE_2__util_encryption_worker_js___default.a(); - worker.addEventListener("message", function (event) { - var data = event.data; + if (file) { + _context.next = 12; + break; + } - if (data.error) { - console.log("Error uploading file", data.error); - reject(data.error); - return; - } + return _context.abrupt("continue", 14); - var fileDescriptor = new __WEBPACK_IMPORTED_MODULE_1_standard_file_js__["SFItem"]({ - content_type: __WEBPACK_IMPORTED_MODULE_3__ExtensionBridge__["a" /* default */].FileDescriptorContentTypeKey, - content: { - serverMetadata: event.data.metadata, - fileName: inputFileName, - fileType: fileType - } - }); + case 12: + _context.next = 14; + return _this.readFile(file); - if (note) { - fileDescriptor.addItemAsRelationship(note); - } + case 14: + _iteratorNormalCompletion = true; + _context.next = 8; + break; - fileDescriptor.addItemAsRelationship(credential); + case 17: + _context.next = 23; + break; - _this2.extensionBridge.createItem(fileDescriptor, function (createdItems) { - resolve(createdItems[0]); - }); - }); - var operation = "upload"; - var params = { - outputFileName: outputFileName, - fileItem: fileItem, - integration: integration, - operation: operation, - credentials: _this2.credentialManager.getDefaultCredentials() - }; - worker.postMessage(params); - })); + case 19: + _context.prev = 19; + _context.t0 = _context["catch"](6); + _didIteratorError = true; + _iteratorError = _context.t0; - case 5: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); + case 23: + _context.prev = 23; + _context.prev = 24; - function uploadFile(_x2) { - return _uploadFile.apply(this, arguments); - } + if (!_iteratorNormalCompletion && _iterator["return"] != null) { + _iterator["return"](); + } - return uploadFile; - }() - }, { - key: "downloadFileFromDescriptor", - value: function () { - var _downloadFileFromDescriptor = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee3(fileDescriptor) { - var integration, serverMetadata; - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - integration = this.integrationManager.integrationForFileDescriptor(fileDescriptor); + case 26: + _context.prev = 26; - if (integration) { - _context3.next = 6; + if (!_didIteratorError) { + _context.next = 29; break; } - serverMetadata = fileDescriptor.content.serverMetadata; + throw _iteratorError; - if (serverMetadata) { - alert("Unable to find integration named '".concat(serverMetadata.source, "'.")); - } else { - alert("Unable to find integration for this file."); - } + case 29: + return _context.finish(26); - throw "Unable to find integration"; + case 30: + return _context.finish(23); - case 6: - return _context3.abrupt("return", this.relayManager.downloadFile(fileDescriptor, integration).then(function (data) { - var item = data.items[0]; - return item; - })); + case 31: + setTimeout(function () { + _this.setState({ + status: null + }); + }, 2000); - case 7: + case 32: case "end": - return _context3.stop(); + return _context.stop(); } } - }, _callee3, this); + }, _callee, null, [[6, 19, 23, 31], [24,, 26, 30]]); })); - function downloadFileFromDescriptor(_x3) { - return _downloadFileFromDescriptor.apply(this, arguments); - } + return function (_x) { + return _ref.apply(this, arguments); + }; + }()); - return downloadFileFromDescriptor; - }() - }, { - key: "encryptFile", + _this.messagesManager = new __WEBPACK_IMPORTED_MODULE_10__lib_MessagesManager__["a" /* default */]({ + credentialManager: __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.credentialManager, + integrationManager: __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.integrationManager + }); + + _this.messagesManager.getMessages().then(function (messages) { + _this.setState({ + messages: messages + }); + }); + + _this.state = { + noteFiles: __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.fileDescriptorsForCurrentNote(), + messages: [] + }; + __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().addDataChangeObserver(function () { + _this.reload(); + }); + __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().addUnloadHandler(function () { + window.removeEventListener('dragenter', _this.event_highlight, false); + window.removeEventListener('dragover', _this.event_highlight, false); + window.removeEventListener('dragleave', _this.event_unhighlight, false); + window.removeEventListener('drop', _this.event_drop, false); + }); + return _this; + } + + __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass___default()(UploadFilesView, [{ + key: "reload", value: function () { - var _encryptFile = _asyncToGenerator( + var _reload = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee4(_ref2) { - var data, inputFileName, fileType, credential; - return regeneratorRuntime.wrap(function _callee4$(_context4) { + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee2() { + var messages; + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee2$(_context2) { while (1) { - switch (_context4.prev = _context4.next) { + switch (_context2.prev = _context2.next) { case 0: - data = _ref2.data, inputFileName = _ref2.inputFileName, fileType = _ref2.fileType, credential = _ref2.credential; - return _context4.abrupt("return", new Promise(function (resolve, reject) { - var worker = new __WEBPACK_IMPORTED_MODULE_2__util_encryption_worker_js___default.a(); - worker.addEventListener("message", function (event) { - resolve(event.data.fileItem); - }); - worker.postMessage({ - operation: "encrypt", - keys: credential.content.keys, - authParams: credential.content.authParams, - contentType: __WEBPACK_IMPORTED_MODULE_3__ExtensionBridge__["a" /* default */].FileItemContentTypeKey, - fileData: data, - fileName: inputFileName, - fileType: fileType - }); - })); + _context2.next = 2; + return this.messagesManager.getMessages(); case 2: + messages = _context2.sent; + this.setState({ + noteFiles: __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.fileDescriptorsForCurrentNote(), + messages: messages + }); + + case 4: case "end": - return _context4.stop(); + return _context2.stop(); } } - }, _callee4); + }, _callee2, this); })); - function encryptFile(_x4) { - return _encryptFile.apply(this, arguments); + function reload() { + return _reload.apply(this, arguments); } - return encryptFile; + return reload; }() }, { - key: "decryptFile", + key: "componentDidMount", + value: function componentDidMount() { + this.configureFileForm(); + window.addEventListener('dragenter', this.event_highlight, false); + window.addEventListener('dragover', this.event_highlight, false); + window.addEventListener('dragleave', this.event_unhighlight, false); + window.addEventListener('drop', this.event_drop, false); + } + }, { + key: "configureFileForm", + value: function configureFileForm() { + var _this2 = this; + + var fileInput = this.fileInput; + var dropContainer = this.dropContainer; + + if (!fileInput) { + return; + } + + fileInput.onchange = function (event) { + // On firefox, this event doesnt get triggered. INstead we handle it on window.addEventListener("drop") + // Which gets called on all browsers + var files = event.target.files; + + if (!_this2.handledFiles) { + _this2.handleDroppedFiles(files); + } + }; + } + }, { + key: "reset", + value: function reset() { + this.setState({ + rawData: null, + decryptedItems: null, + requestPassword: false + }); + } + }, { + key: "readFile", value: function () { - var _decryptFile = _asyncToGenerator( + var _readFile = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee5(_ref3) { - var fileDescriptor, fileItem, credential; - return regeneratorRuntime.wrap(function _callee5$(_context5) { + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee4(file) { + var _this3 = this; + + var MegabyteLimit, BytesInMegabyte, ByteLimit; + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee4$(_context4) { while (1) { - switch (_context5.prev = _context5.next) { + switch (_context4.prev = _context4.next) { case 0: - fileDescriptor = _ref3.fileDescriptor, fileItem = _ref3.fileItem, credential = _ref3.credential; - - if (!credential) { - credential = this.credentialManager.credentialForFileDescriptor(fileDescriptor); - } - - return _context5.abrupt("return", new Promise(function (resolve, reject) { - var worker = new __WEBPACK_IMPORTED_MODULE_2__util_encryption_worker_js___default.a(); - worker.addEventListener("message", function (event) { - var data = event.data; + MegabyteLimit = 50; + BytesInMegabyte = 1000000; // 50mb - if (data.error) { - reject(data.error); - return; - } + ByteLimit = MegabyteLimit * BytesInMegabyte; + return _context4.abrupt("return", new Promise(function (resolve, reject) { + var reader = new FileReader(); + var decrypt = false; - resolve(data); - }); - worker.postMessage({ - operation: "decrypt", - keys: credential.content.keys, - item: fileItem - }); - })); + reader.onload = + /*#__PURE__*/ + function () { + var _ref2 = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( + /*#__PURE__*/ + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee3(e) { + var data, item, arrayBuffer, bytes, string; + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + data = e.target.result; - case 3: - case "end": - return _context5.stop(); - } - } - }, _callee5, this); - })); + if (!decrypt) { + _context3.next = 7; + break; + } - function decryptFile(_x5) { - return _decryptFile.apply(this, arguments); - } + data = JSON.parse(data); + item = data.items[0]; - return decryptFile; - }() - }]); + _this3.decryptDraggedFile(item).then(resolve); - return FileManager; -}(); + _context3.next = 20; + break; -_defineProperty(FileManager, "FileItemContentTypeKey", "SN|FileSafe|File"); + case 7: + arrayBuffer = data; + bytes = arrayBuffer.byteLength; -_defineProperty(FileManager, "FileDescriptorContentTypeKey", "SN|FileSafe|FileMetadata"); + if (!(bytes > ByteLimit)) { + _context3.next = 14; + break; + } + alert("The maximum upload size is ".concat(MegabyteLimit, " megabytes per file.")); + _this3.setState({ + status: null + }); -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { + resolve(); + return _context3.abrupt("return"); -module.exports = function () { - return new Worker(__webpack_require__.p + "filesafe-js/EncryptionWorker.js"); -}; + case 14: + _context3.next = 16; + return SFJS.crypto.arrayBufferToBase64(arrayBuffer); -/***/ }), -/* 12 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + case 16: + string = _context3.sent; + _context3.next = 19; + return _this3.encryptFile(string, file.name, file.type); -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Utils; }); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + case 19: + resolve(); -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); } } + case 20: + case "end": + return _context3.stop(); + } + } + }, _callee3); + })); -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + return function (_x3) { + return _ref2.apply(this, arguments); + }; + }(); -var Utils = -/*#__PURE__*/ -function () { - function Utils() { - _classCallCheck(this, Utils); - } + _this3.setState({ + status: "Reading file..." + }); - _createClass(Utils, null, [{ - key: "base64toBinary", - value: function base64toBinary(dataURI) { - var binary = atob(dataURI); - var array = []; + if (file.name.endsWith(".sf") || file.name.endsWith(".json")) { + decrypt = true; + reader.readAsText(file); + } else { + reader.readAsArrayBuffer(file); + } + })); - for (var i = 0; i < binary.length; i++) { - array.push(binary.charCodeAt(i)); + case 4: + case "end": + return _context4.stop(); + } + } + }, _callee4); + })); + + function readFile(_x2) { + return _readFile.apply(this, arguments); } - return new Uint8Array(array); - } + return readFile; + }() }, { - key: "downloadData", - value: function downloadData(data, fileName, fileType) { - var _this = this; + key: "decryptDraggedFile", + value: function () { + var _decryptDraggedFile = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( + /*#__PURE__*/ + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee6(fileDescriptor) { + var _this4 = this; - var useNavigation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - var link = document.createElement('a'); - link.setAttribute('download', fileName); - var tempUrl = this.tempUrlForData(data, fileType); - link.href = tempUrl; - link.setAttribute("target", "_blank"); + var credentials, decryptWithCredential, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, credential, success; - if (useNavigation) { - window.location.href = link.href; - } else { - document.body.appendChild(link); - link.click(); - link.remove(); - } + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee6$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + this.setState({ + status: "Decrypting..." + }); + credentials = __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllCredentials(); - setTimeout(function () { - _this.revokeTempUrl(tempUrl); - }, 500); - } - }, { - key: "tempUrlForData", - value: function tempUrlForData(data, fileType) { - return window.URL.createObjectURL(new Blob([data], { - type: fileType ? fileType : 'text/json' - })); - } - }, { - key: "revokeTempUrl", - value: function revokeTempUrl(url) { - window.URL.revokeObjectURL(url); - } - }, { - key: "copyTextToClipboard", - value: function copyTextToClipboard(text) { - if (window.clipboardData && window.clipboardData.setData) { - // IE specific code path to prevent textarea being shown while dialog is visible. - return clipboardData.setData("Text", text); - } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { - var textarea; - var result; + decryptWithCredential = + /*#__PURE__*/ + function () { + var _ref3 = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( + /*#__PURE__*/ + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee5(credential) { + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + return _context5.abrupt("return", new Promise(function (resolve, reject) { + __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.decryptFile({ + fileDescriptor: fileDescriptor, + credential: credential + }).then(function (data) { + var item = data.decryptedItem; + __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.downloadBase64Data({ + base64Data: data.decryptedData, + fileName: item.content.fileName, + fileType: item.content.fileType + }); - try { - textarea = document.createElement('textarea'); - textarea.setAttribute('readonly', true); - textarea.setAttribute('contenteditable', true); - textarea.style.position = 'fixed'; // prevent scroll from jumping to the bottom when focus is set. + _this4.setState({ + status: null + }); - textarea.value = text; - document.body.appendChild(textarea); - textarea.focus(); - textarea.select(); - var range = document.createRange(); - range.selectNodeContents(textarea); - var sel = window.getSelection(); - sel.removeAllRanges(); - sel.addRange(range); - textarea.setSelectionRange(0, textarea.value.length); - result = document.execCommand('copy'); - } catch (err) { - console.error(err); - result = null; - } finally { - document.body.removeChild(textarea); - } - } - } - }]); + resolve(true); + })["catch"](function (decryptionError) { + console.error("Error decrypting:", decryptionError); - return Utils; -}(); + _this4.flashError("Error decrypting file."); + + reject(false); + }); + })); + + case 1: + case "end": + return _context5.stop(); + } + } + }, _callee5); + })); + return function decryptWithCredential(_x5) { + return _ref3.apply(this, arguments); + }; + }(); // Try all credentials until one succeeds -/***/ }) -/******/ ]); -//# sourceMappingURL=filesafe.js.map + _iteratorNormalCompletion2 = true; + _didIteratorError2 = false; + _iteratorError2 = undefined; + _context6.prev = 6; + _iterator2 = credentials[Symbol.iterator](); -/***/ }), -/* 9 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + case 8: + if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { + _context6.next = 18; + break; + } -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UploadFilesView; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__lib_MessagesManager__ = __webpack_require__(10); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__MessagesView_js__ = __webpack_require__(11); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__FilesView__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__ = __webpack_require__(1); -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + credential = _step2.value; + _context6.next = 12; + return decryptWithCredential(credential); -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); } } + case 12: + success = _context6.sent; -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); }); }; } + if (!success) { + _context6.next = 15; + break; + } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + return _context6.abrupt("return"); -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); } } + case 15: + _iteratorNormalCompletion2 = true; + _context6.next = 8; + break; -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + case 18: + _context6.next = 24; + break; -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + case 20: + _context6.prev = 20; + _context6.t0 = _context6["catch"](6); + _didIteratorError2 = true; + _iteratorError2 = _context6.t0; -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + case 24: + _context6.prev = 24; + _context6.prev = 25; -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { + _iterator2["return"](); + } -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); } + case 27: + _context6.prev = 27; -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + if (!_didIteratorError2) { + _context6.next = 30; + break; + } -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; } + throw _iteratorError2; + case 30: + return _context6.finish(27); + case 31: + return _context6.finish(24); + case 32: + case "end": + return _context6.stop(); + } + } + }, _callee6, this, [[6, 20, 24, 32], [25,, 27, 31]]); + })); + function decryptDraggedFile(_x4) { + return _decryptDraggedFile.apply(this, arguments); + } + return decryptDraggedFile; + }() + }, { + key: "wait", + value: function () { + var _wait = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( + /*#__PURE__*/ + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee7(seconds) { + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee7$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + return _context7.abrupt("return", new Promise(function (resolve, reject) { + setTimeout(function () { + resolve(); + }, seconds * 1000.0); + })); + case 1: + case "end": + return _context7.stop(); + } + } + }, _callee7); + })); -var UploadFilesView = -/*#__PURE__*/ -function (_React$Component) { - _inherits(UploadFilesView, _React$Component); + function wait(_x6) { + return _wait.apply(this, arguments); + } - function UploadFilesView(props) { - var _this; + return wait; + }() + }, { + key: "encryptFile", + value: function () { + var _encryptFile = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( + /*#__PURE__*/ + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee9(data, inputFileName, fileType) { + var _this5 = this; - _classCallCheck(this, UploadFilesView); + var credential, integration; + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee9$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + this.setState({ + status: "Encrypting..." + }); + credential = __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.getDefaultCredentials(); + integration = __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.getDefaultIntegration(); + return _context9.abrupt("return", __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.encryptFile({ + data: data, + inputFileName: inputFileName, + fileType: fileType, + credential: credential + }).then( + /*#__PURE__*/ + function () { + var _ref4 = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( + /*#__PURE__*/ + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee8(fileItem) { + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee8$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + _this5.setState({ + status: "Uploading to ".concat(__WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.displayStringForIntegration(integration), "...") + }); - _this = _possibleConstructorReturn(this, _getPrototypeOf(UploadFilesView).call(this, props)); + _context8.next = 3; + return _this5.wait(0.5); - _defineProperty(_assertThisInitialized(_this), "event_preventDefaults", function (e) { - e.preventDefault(); - e.stopPropagation(); - }); + case 3: + return _context8.abrupt("return", __WEBPACK_IMPORTED_MODULE_13__lib_FilesafeManager__["a" /* default */].get().filesafe.uploadFile({ + fileItem: fileItem, + inputFileName: inputFileName, + fileType: fileType, + credential: credential + }).then(function () { + _this5.setState({ + status: "Upload Success." + }); + })["catch"](function (uploadError) { + console.error("fs-embed | error uploading file:", uploadError); - _defineProperty(_assertThisInitialized(_this), "event_highlight", function (e) { - _this.event_preventDefaults(e); + _this5.flashError("Error uploading file."); + })); - _this.rootElement.classList.add('highlight'); - }); + case 4: + case "end": + return _context8.stop(); + } + } + }, _callee8); + })); - _defineProperty(_assertThisInitialized(_this), "event_unhighlight", function (e) { - _this.event_preventDefaults(e); + return function (_x10) { + return _ref4.apply(this, arguments); + }; + }())); - _this.rootElement.classList.remove('highlight'); - }); + case 4: + case "end": + return _context9.stop(); + } + } + }, _callee9, this); + })); - _defineProperty(_assertThisInitialized(_this), "event_drop", function (e) { - _this.event_unhighlight(e); + function encryptFile(_x7, _x8, _x9) { + return _encryptFile.apply(this, arguments); + } - _this.event_preventDefaults(e); + return encryptFile; + }() + }, { + key: "flashError", + value: function flashError(error) { + var _this6 = this; - var dt = e.dataTransfer; - var files = dt.files; + this.setState({ + status: error, + statusClass: "danger" + }); + setTimeout(function () { + _this6.setState({ + status: null, + statusClass: null + }); + }, 2500); + } + }, { + key: "render", + value: function render() { + var _this7 = this; - _this.handleDroppedFiles(files); - }); + var statusClass = this.state.statusClass ? this.state.statusClass : "info"; + var hasSpinner = statusClass == "info"; + return __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { + className: "sn-component files-view" + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { + className: "sk-panel-row align-top" + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { + className: "files" + }, this.state.messages.length > 0 && __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { + id: "messages-container", + className: "sk-panel-section" + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11__MessagesView_js__["a" /* default */], { + messages: this.state.messages + })), this.state.status && __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { + id: "file-upload-status", + className: "sk-horizontal-group" + }, hasSpinner && __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { + className: "sk-spinner info small" + }), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { + className: statusClass + }, this.state.status)), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { + id: "add-file-button-container" + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { + className: "file sk-button info" + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("label", { + className: "no-style" + }, __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("input", { + type: "file", + style: { + display: "none" + }, + onChange: function onChange(event) { + _this7.handleDroppedFiles(event.target.files); + } + }), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement("div", { + id: "attach-file-button-label", + className: "sk-label" + }, "Attach File")))), __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_12__FilesView__["a" /* default */], { + files: this.state.noteFiles + })))); + } + }, { + key: "rootElement", + get: function get() { + return document.getElementById("filesafe-embed"); + } + }, { + key: "dropContainer", + get: function get() { + return document.getElementById("files-view"); + } + }, { + key: "fileInput", + get: function get() { + return document.getElementById("file-input"); + } + }]); - _defineProperty(_assertThisInitialized(_this), "handleDroppedFiles", - /*#__PURE__*/ - function () { - var _ref = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee(files) { - var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, file; + return UploadFilesView; +}(__WEBPACK_IMPORTED_MODULE_9_react___default.a.Component); - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (!(__WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllIntegrations().length == 0)) { - _context.next = 3; - break; - } - alert("Please set up at least one integration before attempting to upload a file. To do this, press Expand, and select Add New in the Integrations section."); - return _context.abrupt("return"); - case 3: - _iteratorNormalCompletion = true; - _didIteratorError = false; - _iteratorError = undefined; - _context.prev = 6; - _iterator = files[Symbol.iterator](); +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - case 8: - if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { - _context.next = 17; - break; - } +var runtime = (function (exports) { + "use strict"; - file = _step.value; + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - if (file) { - _context.next = 12; - break; - } + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); - return _context.abrupt("continue", 14); + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); - case 12: - _context.next = 14; - return _this.readFile(file); + return generator; + } + exports.wrap = wrap; - case 14: - _iteratorNormalCompletion = true; - _context.next = 8; - break; + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } - case 17: - _context.next = 23; - break; + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; - case 19: - _context.prev = 19; - _context.t0 = _context["catch"](6); - _didIteratorError = true; - _iteratorError = _context.t0; + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; - case 23: - _context.prev = 23; - _context.prev = 24; + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} - if (!_iteratorNormalCompletion && _iterator["return"] != null) { - _iterator["return"](); - } + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; - case 26: - _context.prev = 26; + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } - if (!_didIteratorError) { - _context.next = 29; - break; - } + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; - throw _iteratorError; + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } - case 29: - return _context.finish(26); + exports.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; - case 30: - return _context.finish(23); + exports.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; - case 31: - setTimeout(function () { - _this.setState({ - status: null - }); - }, 2000); + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + exports.awrap = function(arg) { + return { __await: arg }; + }; - case 32: - case "end": - return _context.stop(); - } - } - }, _callee, null, [[6, 19, 23, 31], [24,, 26, 30]]); - })); + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } - return function (_x) { - return _ref.apply(this, arguments); - }; - }()); + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, function(error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, reject); + }); + } + } - _this.messagesManager = new __WEBPACK_IMPORTED_MODULE_1__lib_MessagesManager__["a" /* default */]({ - credentialManager: __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.credentialManager, - integrationManager: __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.integrationManager - }); + var previousPromise; - _this.messagesManager.getMessages().then(function (messages) { - _this.setState({ - messages: messages - }); - }); + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } - _this.state = { - noteFiles: __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.fileDescriptorsForCurrentNote(), - messages: [] - }; - __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().addDataChangeObserver(function () { - _this.reload(); - }); - __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().addUnloadHandler(function () { - window.removeEventListener('dragenter', _this.event_highlight, false); - window.removeEventListener('dragover', _this.event_highlight, false); - window.removeEventListener('dragleave', _this.event_unhighlight, false); - window.removeEventListener('drop', _this.event_drop, false); - }); - return _this; + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; } - _createClass(UploadFilesView, [{ - key: "reload", - value: function () { - var _reload = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee2() { - var messages; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return this.messagesManager.getMessages(); + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + exports.AsyncIterator = AsyncIterator; - case 2: - messages = _context2.sent; - this.setState({ - noteFiles: __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.fileDescriptorsForCurrentNote(), - messages: messages - }); + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + exports.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return exports.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; - case 4: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; - function reload() { - return _reload.apply(this, arguments); + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); } - return reload; - }() - }, { - key: "componentDidMount", - value: function componentDidMount() { - this.configureFileForm(); - window.addEventListener('dragenter', this.event_highlight, false); - window.addEventListener('dragover', this.event_highlight, false); - window.addEventListener('dragleave', this.event_unhighlight, false); - window.addEventListener('drop', this.event_drop, false); - } - }, { - key: "configureFileForm", - value: function configureFileForm() { - var _this2 = this; + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } - var fileInput = this.fileInput; - var dropContainer = this.dropContainer; + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; - if (!fileInput) { - return; - } + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } - fileInput.onchange = function (event) { - // On firefox, this event doesnt get triggered. INstead we handle it on window.addEventListener("drop") - // Which gets called on all browsers - var files = event.target.files; + context.dispatchException(context.arg); - if (!_this2.handledFiles) { - _this2.handleDroppedFiles(files); + } else if (context.method === "return") { + context.abrupt("return", context.arg); } - }; - } - }, { - key: "reset", - value: function reset() { - this.setState({ - rawData: null, - decryptedItems: null, - requestPassword: false - }); - } - }, { - key: "readFile", - value: function () { - var _readFile = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee4(file) { - var _this3 = this; - - var MegabyteLimit, BytesInMegabyte, ByteLimit; - return regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - MegabyteLimit = 50; - BytesInMegabyte = 1000000; // 50mb - ByteLimit = MegabyteLimit * BytesInMegabyte; - return _context4.abrupt("return", new Promise(function (resolve, reject) { - var reader = new FileReader(); - var decrypt = false; + state = GenStateExecuting; - reader.onload = - /*#__PURE__*/ - function () { - var _ref2 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee3(e) { - var data, item, arrayBuffer, bytes, string; - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - data = e.target.result; + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; - if (!decrypt) { - _context3.next = 7; - break; - } + if (record.arg === ContinueSentinel) { + continue; + } - data = JSON.parse(data); - item = data.items[0]; + return { + value: record.arg, + done: context.done + }; - _this3.decryptDraggedFile(item).then(resolve); + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } - _context3.next = 20; - break; + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; - case 7: - arrayBuffer = data; - bytes = arrayBuffer.byteLength; + if (context.method === "throw") { + // Note: ["return"] must be used for ES3 parsing compatibility. + if (delegate.iterator["return"]) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); - if (!(bytes > ByteLimit)) { - _context3.next = 14; - break; - } + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } - alert("The maximum upload size is ".concat(MegabyteLimit, " megabytes per file.")); + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } - _this3.setState({ - status: null - }); + return ContinueSentinel; + } - resolve(); - return _context3.abrupt("return"); + var record = tryCatch(method, delegate.iterator, context.arg); - case 14: - _context3.next = 16; - return SFJS.crypto.arrayBufferToBase64(arrayBuffer); + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } - case 16: - string = _context3.sent; - _context3.next = 19; - return _this3.encryptFile(string, file.name, file.type); + var info = record.arg; - case 19: - resolve(); + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } - case 20: - case "end": - return _context3.stop(); - } - } - }, _callee3); - })); + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; - return function (_x3) { - return _ref2.apply(this, arguments); - }; - }(); + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; - _this3.setState({ - status: "Reading file..." - }); + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } - if (file.name.endsWith(".sf") || file.name.endsWith(".json")) { - decrypt = true; - reader.readAsText(file); - } else { - reader.readAsArrayBuffer(file); - } - })); + } else { + // Re-yield the result returned by the delegate method. + return info; + } - case 4: - case "end": - return _context4.stop(); - } - } - }, _callee4); - })); + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } - function readFile(_x2) { - return _readFile.apply(this, arguments); - } + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); - return readFile; - }() - }, { - key: "decryptDraggedFile", - value: function () { - var _decryptDraggedFile = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee6(fileDescriptor) { - var _this4 = this; + Gp[toStringTagSymbol] = "Generator"; - var credentials, decryptWithCredential, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, credential, success; + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; - return regeneratorRuntime.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - this.setState({ - status: "Decrypting..." - }); - credentials = __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllCredentials(); + Gp.toString = function() { + return "[object Generator]"; + }; - decryptWithCredential = - /*#__PURE__*/ - function () { - var _ref3 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee5(credential) { - return regeneratorRuntime.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - return _context5.abrupt("return", new Promise(function (resolve, reject) { - __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.decryptFile({ - fileDescriptor: fileDescriptor, - credential: credential - }).then(function (data) { - var item = data.decryptedItem; - __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.downloadBase64Data({ - base64Data: data.decryptedData, - fileName: item.content.fileName, - fileType: item.content.fileType - }); + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; - _this4.setState({ - status: null - }); + if (1 in locs) { + entry.catchLoc = locs[1]; + } - resolve(true); - })["catch"](function (decryptionError) { - console.error("Error decrypting:", decryptionError); + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } - _this4.flashError("Error decrypting file."); + this.tryEntries.push(entry); + } - reject(false); - }); - })); + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } - case 1: - case "end": - return _context5.stop(); - } - } - }, _callee5); - })); + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } - return function decryptWithCredential(_x5) { - return _ref3.apply(this, arguments); - }; - }(); // Try all credentials until one succeeds + exports.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } - _iteratorNormalCompletion2 = true; - _didIteratorError2 = false; - _iteratorError2 = undefined; - _context6.prev = 6; - _iterator2 = credentials[Symbol.iterator](); + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; - case 8: - if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { - _context6.next = 18; - break; - } + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } - credential = _step2.value; - _context6.next = 12; - return decryptWithCredential(credential); + if (typeof iterable.next === "function") { + return iterable; + } - case 12: - success = _context6.sent; + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } - if (!success) { - _context6.next = 15; - break; - } + next.value = undefined; + next.done = true; - return _context6.abrupt("return"); + return next; + }; - case 15: - _iteratorNormalCompletion2 = true; - _context6.next = 8; - break; + return next.next = next; + } + } - case 18: - _context6.next = 24; - break; + // Return an iterator with no values. + return { next: doneResult }; + } + exports.values = values; - case 20: - _context6.prev = 20; - _context6.t0 = _context6["catch"](6); - _didIteratorError2 = true; - _iteratorError2 = _context6.t0; + function doneResult() { + return { value: undefined, done: true }; + } - case 24: - _context6.prev = 24; - _context6.prev = 25; + Context.prototype = { + constructor: Context, - if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { - _iterator2["return"](); - } + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; - case 27: - _context6.prev = 27; + this.method = "next"; + this.arg = undefined; - if (!_didIteratorError2) { - _context6.next = 30; - break; - } + this.tryEntries.forEach(resetTryEntry); - throw _iteratorError2; + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, - case 30: - return _context6.finish(27); + stop: function() { + this.done = true; - case 31: - return _context6.finish(24); + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } - case 32: - case "end": - return _context6.stop(); - } - } - }, _callee6, this, [[6, 20, 24, 32], [25,, 27, 31]]); - })); + return this.rval; + }, - function decryptDraggedFile(_x4) { - return _decryptDraggedFile.apply(this, arguments); + dispatchException: function(exception) { + if (this.done) { + throw exception; } - return decryptDraggedFile; - }() - }, { - key: "wait", - value: function () { - var _wait = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee7(seconds) { - return regeneratorRuntime.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - return _context7.abrupt("return", new Promise(function (resolve, reject) { - setTimeout(function () { - resolve(); - }, seconds * 1000.0); - })); + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; - case 1: - case "end": - return _context7.stop(); - } - } - }, _callee7); - })); + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } - function wait(_x6) { - return _wait.apply(this, arguments); + return !! caught; } - return wait; - }() - }, { - key: "encryptFile", - value: function () { - var _encryptFile = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee9(data, inputFileName, fileType) { - var _this5 = this; + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; - var credential, integration; - return regeneratorRuntime.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - this.setState({ - status: "Encrypting..." - }); - credential = __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.getDefaultCredentials(); - integration = __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.getDefaultIntegration(); - return _context9.abrupt("return", __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.encryptFile({ - data: data, - inputFileName: inputFileName, - fileType: fileType, - credential: credential - }).then( - /*#__PURE__*/ - function () { - var _ref4 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee8(fileItem) { - return regeneratorRuntime.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - _this5.setState({ - status: "Uploading to ".concat(__WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.displayStringForIntegration(integration), "...") - }); + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } - _context8.next = 3; - return _this5.wait(0.5); + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, - case 3: - return _context8.abrupt("return", __WEBPACK_IMPORTED_MODULE_4__lib_FilesafeManager__["a" /* default */].get().filesafe.uploadFile({ - fileItem: fileItem, - inputFileName: inputFileName, - fileType: fileType, - credential: credential - }).then(function () { - _this5.setState({ - status: "Upload Success." - }); - })["catch"](function (uploadError) { - console.error("fs-embed | error uploading file:", uploadError); + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } - _this5.flashError("Error uploading file."); - })); + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } - case 4: - case "end": - return _context8.stop(); - } - } - }, _callee8); - })); + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; - return function (_x10) { - return _ref4.apply(this, arguments); - }; - }())); + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } - case 4: - case "end": - return _context9.stop(); - } - } - }, _callee9, this); - })); + return this.complete(record); + }, - function encryptFile(_x7, _x8, _x9) { - return _encryptFile.apply(this, arguments); + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; } - return encryptFile; - }() - }, { - key: "flashError", - value: function flashError(error) { - var _this6 = this; + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } - this.setState({ - status: error, - statusClass: "danger" - }); - setTimeout(function () { - _this6.setState({ - status: null, - statusClass: null - }); - }, 2500); - } - }, { - key: "render", - value: function render() { - var _this7 = this; + return ContinueSentinel; + }, - var statusClass = this.state.statusClass ? this.state.statusClass : "info"; - var hasSpinner = statusClass == "info"; - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { - className: "sn-component files-view" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { - className: "sk-panel-row align-top" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { - className: "files" - }, this.state.messages.length > 0 && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { - id: "messages-container", - className: "sk-panel-section" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__MessagesView_js__["a" /* default */], { - messages: this.state.messages - })), this.state.status && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { - id: "file-upload-status", - className: "sk-horizontal-group" - }, hasSpinner && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { - className: "sk-spinner info small" - }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { - className: statusClass - }, this.state.status)), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { - id: "add-file-button-container" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { - className: "file sk-button info" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("label", { - className: "no-style" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("input", { - type: "file", - style: { - display: "none" - }, - onChange: function onChange(event) { - _this7.handleDroppedFiles(event.target.files); + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; } - }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { - id: "attach-file-button-label", - className: "sk-label" - }, "Attach File")))), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__FilesView__["a" /* default */], { - files: this.state.noteFiles - })))); - } - }, { - key: "rootElement", - get: function get() { - return document.getElementById("filesafe-embed"); - } - }, { - key: "dropContainer", - get: function get() { - return document.getElementById("files-view"); - } - }, { - key: "fileInput", - get: function get() { - return document.getElementById("file-input"); + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; } - }]); + }; - return UploadFilesView; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + +}( + // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + true ? module.exports : {} +)); +try { + regeneratorRuntime = runtime; +} catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + Function("r", "regeneratorRuntime = r")(runtime); +} /***/ }), -/* 10 */ +/* 21 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MessagesManager; }); -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); } } +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator__ = __webpack_require__(10); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass__); -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); }); }; } -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; } var MessagesManager = /*#__PURE__*/ @@ -20352,20 +3862,20 @@ function () { var credentialManager = _ref.credentialManager, integrationManager = _ref.integrationManager; - _classCallCheck(this, MessagesManager); + __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_classCallCheck___default()(this, MessagesManager); this.credentialManager = credentialManager; this.integrationManager = integrationManager; } - _createClass(MessagesManager, [{ + __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_createClass___default()(MessagesManager, [{ key: "getMessages", value: function () { - var _getMessages = _asyncToGenerator( + var _getMessages = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_asyncToGenerator___default()( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee() { + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.mark(function _callee() { var messages, credentials, integrations; - return regeneratorRuntime.wrap(function _callee$(_context) { + return __WEBPACK_IMPORTED_MODULE_0__babel_runtime_regenerator___default.a.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: @@ -20422,57 +3932,54 @@ function () { /***/ }), -/* 11 */ +/* 22 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MessagesView; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__); -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 _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var MessagesView = /*#__PURE__*/ function (_React$Component) { - _inherits(MessagesView, _React$Component); + __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_inherits___default()(MessagesView, _React$Component); function MessagesView(props) { var _this; - _classCallCheck(this, MessagesView); + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default()(this, MessagesView); - _this = _possibleConstructorReturn(this, _getPrototypeOf(MessagesView).call(this, props)); + _this = __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn___default()(this, __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf___default()(MessagesView).call(this, props)); _this.state = {}; return _this; } - _createClass(MessagesView, [{ + __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default()(MessagesView, [{ key: "render", value: function render() { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", { id: "messages" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", { className: "title" - }, "Complete the following steps before uploading your first file:"), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("ul", null, this.props.messages.map(function (message) { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("li", { + }, "Complete the following steps before uploading your first file:"), __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("ul", null, this.props.messages.map(function (message) { + return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("li", { dangerouslySetInnerHTML: { __html: message.message }, @@ -20483,39 +3990,40 @@ function (_React$Component) { }]); return MessagesView; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); +}(__WEBPACK_IMPORTED_MODULE_5_react___default.a.Component); /***/ }), -/* 12 */ +/* 23 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AllFilesView; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__FilesView__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__lib_FilesafeManager__ = __webpack_require__(1); -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -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; } +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__FilesView__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__lib_FilesafeManager__ = __webpack_require__(6); -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -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; } @@ -20524,16 +4032,16 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope var AllFilesView = /*#__PURE__*/ function (_React$Component) { - _inherits(AllFilesView, _React$Component); + __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits___default()(AllFilesView, _React$Component); function AllFilesView(props) { var _this; - _classCallCheck(this, AllFilesView); + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default()(this, AllFilesView); - _this = _possibleConstructorReturn(this, _getPrototypeOf(AllFilesView).call(this, props)); + _this = __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn___default()(this, __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf___default()(AllFilesView).call(this, props)); - _defineProperty(_assertThisInitialized(_this), "toggleVisibility", function () { + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "toggleVisibility", function () { _this.setState({ expanded: !_this.state.expanded }); @@ -20541,77 +4049,78 @@ function (_React$Component) { _this.state = { expanded: false, - files: __WEBPACK_IMPORTED_MODULE_2__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllFileDescriptors() || [] + files: __WEBPACK_IMPORTED_MODULE_9__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllFileDescriptors() || [] }; - __WEBPACK_IMPORTED_MODULE_2__lib_FilesafeManager__["a" /* default */].get().addDataChangeObserver(function () { + __WEBPACK_IMPORTED_MODULE_9__lib_FilesafeManager__["a" /* default */].get().addDataChangeObserver(function () { _this.setState({ - files: __WEBPACK_IMPORTED_MODULE_2__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllFileDescriptors() + files: __WEBPACK_IMPORTED_MODULE_9__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllFileDescriptors() }); }); return _this; } - _createClass(AllFilesView, [{ + __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default()(AllFilesView, [{ key: "render", value: function render() { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "files-view" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-panel-row justify-left" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-horizontal-group" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-panel-section-title" - }, "All Files ", __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("span", { + }, "All Files ", __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("span", { style: { fontWeight: "normal" } - }, "(", this.state.files.length, ")")), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", { + }, "(", this.state.files.length, ")")), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("a", { className: "info", onClick: this.toggleVisibility - }, this.state.expanded ? "Hide" : "Show"))), this.state.expanded && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, this.state.expanded ? "Hide" : "Show"))), this.state.expanded && __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-panel-row" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "files" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1__FilesView__["a" /* default */], { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__FilesView__["a" /* default */], { files: this.state.files })))); } }]); return AllFilesView; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); +}(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component); /***/ }), -/* 13 */ +/* 24 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IntegrationsView; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__ = __webpack_require__(1); -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -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; } +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__ = __webpack_require__(6); -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -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; } @@ -20619,22 +4128,22 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope var IntegrationsView = /*#__PURE__*/ function (_React$Component) { - _inherits(IntegrationsView, _React$Component); + __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_inherits___default()(IntegrationsView, _React$Component); function IntegrationsView(props) { var _this; - _classCallCheck(this, IntegrationsView); + __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_classCallCheck___default()(this, IntegrationsView); - _this = _possibleConstructorReturn(this, _getPrototypeOf(IntegrationsView).call(this, props)); + _this = __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_possibleConstructorReturn___default()(this, __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_getPrototypeOf___default()(IntegrationsView).call(this, props)); - _defineProperty(_assertThisInitialized(_this), "handleKeyPress", function (e) { + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "handleKeyPress", function (e) { if (e.key === 'Enter') { _this.submitIntegrationCode(); } }); - _defineProperty(_assertThisInitialized(_this), "handleTextChange", function (event) { + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "handleTextChange", function (event) { var text = event.target.value; _this.setState({ @@ -20642,14 +4151,14 @@ function (_React$Component) { }); }); - _defineProperty(_assertThisInitialized(_this), "submitIntegrationCode", function () { + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "submitIntegrationCode", function () { var code = _this.state.integrationCode; if (!code || code.length == 0) { return; } - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.saveIntegrationFromCode(code); + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.saveIntegrationFromCode(code); _this.setState({ integrationCode: null, @@ -20659,41 +4168,41 @@ function (_React$Component) { _this.reloadIntegrations(); }); - _defineProperty(_assertThisInitialized(_this), "addNewIntegrationClicked", function () { - window.open(__WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().defaultRelayServerUrl(), "_blank"); + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "addNewIntegrationClicked", function () { + window.open(__WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().defaultRelayServerUrl(), "_blank"); _this.setState({ showInputForm: true }); }); - _defineProperty(_assertThisInitialized(_this), "cancelIntegrationForm", function () { + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "cancelIntegrationForm", function () { _this.setState({ showInputForm: false }); }); - _defineProperty(_assertThisInitialized(_this), "deleteIntegration", function (integration) { - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.deleteIntegration(integration); + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "deleteIntegration", function (integration) { + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.deleteIntegration(integration); }); - _defineProperty(_assertThisInitialized(_this), "setIntegrationAsDefaultUploadSource", function (integration) { - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.setIntegrationAsDefault(integration); + __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_defineProperty___default()(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_assertThisInitialized___default()(_this), "setIntegrationAsDefaultUploadSource", function (integration) { + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.setIntegrationAsDefault(integration); }); _this.state = { - integrations: __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllIntegrations() || [] + integrations: __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllIntegrations() || [] }; - __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().addDataChangeObserver(function () { + __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().addDataChangeObserver(function () { _this.reloadIntegrations(); }); return _this; } - _createClass(IntegrationsView, [{ + __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_createClass___default()(IntegrationsView, [{ key: "reloadIntegrations", value: function reloadIntegrations() { - var integrations = __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllIntegrations(); + var integrations = __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.getAllIntegrations(); this.setState({ integrations: integrations }); @@ -20707,7 +4216,7 @@ function (_React$Component) { }, { key: "displayStringForIntegration", value: function displayStringForIntegration(integration) { - return __WEBPACK_IMPORTED_MODULE_1__lib_FilesafeManager__["a" /* default */].get().filesafe.displayStringForIntegration(integration); + return __WEBPACK_IMPORTED_MODULE_8__lib_FilesafeManager__["a" /* default */].get().filesafe.displayStringForIntegration(integration); } }, { key: "render", @@ -20715,64 +4224,64 @@ function (_React$Component) { var _this2 = this; var hasMultipleIntegrations = this.state.integrations.length > 1; - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", null, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", null, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-panel-row" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-h2 sk-bold" - }, "Integrations"), !this.state.showInputForm && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "Integrations"), !this.state.showInputForm && __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-button info no-border", onClick: this.addNewIntegrationClicked - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-label" - }, "Add New"))), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "Add New"))), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { id: "integrations" - }, this.state.showInputForm && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, this.state.showInputForm && __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-notification info" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("strong", null, "New Integration"), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("p", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("strong", null, "New Integration"), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("p", { className: "sk-p" - }, "A new tab has opened. After you complete the authentication flow, enter the code you receive below."), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "A new tab has opened. After you complete the authentication flow, enter the code you receive below."), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-panel-row" - }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("input", { + }), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("input", { className: "title sk-input contrast", type: "text", placeholder: "Enter integration code", value: this.state.integrationCode, onChange: this.handleTextChange, onKeyPress: this.handleKeyPress - }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-button-group", style: { marginTop: 10 } - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-button neutral", onClick: this.cancelIntegrationForm - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("a", { className: "sk-label" - }, "Cancel")), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "Cancel")), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-button sk-base", onClick: this.submitIntegrationCode - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("a", { className: "sk-label" - }, "Submit"))))), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, "Submit"))))), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "list-container" }, this.state.integrations.map(function (integration) { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "list-item sk-horizontal-group top" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-circle x-small " + (integration.content.isDefaultUploadSource ? "info" : "sk-secondary-contrast") - }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", null, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", null, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-panel-row condensed sk-bold" - }, _this2.displayStringForIntegration(integration)), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, _this2.displayStringForIntegration(integration)), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-panel-row condensed" - }, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", { + }, __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("div", { className: "sk-horizontal-group" - }, hasMultipleIntegrations && !integration.content.isDefaultUploadSource && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", { + }, hasMultipleIntegrations && !integration.content.isDefaultUploadSource && __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("a", { className: "info", onClick: function onClick() { _this2.setIntegrationAsDefaultUploadSource(integration); } - }, "Make Default"), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", { + }, "Make Default"), __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement("a", { className: "danger", onClick: function onClick() { _this2.deleteIntegration(integration); @@ -20783,7 +4292,7 @@ function (_React$Component) { }]); return IntegrationsView; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); +}(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component); diff --git a/dist/dist.min.js b/dist/dist.min.js index f72d57d..f0f7505 100644 --- a/dist/dist.min.js +++ b/dist/dist.min.js @@ -1,6 +1,6 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=6)}([function(e,t,n){"use strict";e.exports=n(7)},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* +!function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=6)}([function(e,t,n){"use strict";e.exports=n(7)},function(e,t,n){"use strict";function r(e){return function(){return e}}var a=function(){};a.thatReturns=r,a.thatReturnsFalse=r(!1),a.thatReturnsTrue=r(!0),a.thatReturnsNull=r(null),a.thatReturnsThis=function(){return this},a.thatReturnsArgument=function(e){return e},e.exports=a},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* object-assign (c) Sindre Sorhus @license MIT */ -var i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),c=1;cD.length&&D.push(e)}function p(e,t,n,i){var a=typeof e;if("undefined"!==a&&"boolean"!==a||(e=null),null===e||"string"===a||"number"===a||"object"===a&&e.$$typeof===F)return n(i,e,""===t?"."+h(e,0):t),1;var o=0;if(t=""===t?".":t+":",Array.isArray(e))for(var s=0;s=V(e.last.priorityLevel,t))n=e.last;else for(e=e.first;null!==e&&0>=V(e.priorityLevel,t);)n=e,e=e.next;return n}function G(e,t){var n=e.alternate,r=e.updateQueue;null===r&&(r=e.updateQueue=J()),null!==n?null===(e=n.updateQueue)&&(e=n.updateQueue=J()):e=null,Tr=r,Nr=e!==r?e:null;var i=Tr;n=Nr;var a=$(i,t),o=null!==a?a.next:i.first;return null===n?(q(i,t,a,o),null):(r=$(n,t),e=null!==r?r.next:n.first,q(i,t,a,o),o===e&&null!==o||a===r&&null!==a?(null===r&&(n.first=t),null===e&&(n.last=null),null):(t={priorityLevel:t.priorityLevel,partialState:t.partialState,callback:t.callback,isReplace:t.isReplace,isForced:t.isForced,isTopLevelUnmount:t.isTopLevelUnmount,next:null},q(n,t,r,e),t))}function Q(e,t,n,r){return e=e.partialState,"function"==typeof e?e.call(t,n,r):e}function Y(e,t,n){e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n}function X(e){return e.tag===zr&&null!=e.type.childContextTypes}function Z(e,t){var n=e.stateNode,i=e.type.childContextTypes;if("function"!=typeof n.getChildContext)return t;n=n.getChildContext();for(var a in n)a in i||r("108",p(e)||"Unknown",a);return gt({},t,n)}function ee(e,t,n){this.tag=e,this.key=t,this.stateNode=this.type=null,this.sibling=this.child=this.return=null,this.index=0,this.memoizedState=this.updateQueue=this.memoizedProps=this.pendingProps=this.ref=null,this.internalContextTag=n,this.effectTag=ci,this.lastEffect=this.firstEffect=this.nextEffect=null,this.pendingWorkPriority=si,this.alternate=null}function te(e,t,n){var i=void 0;return"function"==typeof e?(i=e.prototype&&e.prototype.isReactComponent?new ee(Zr,t,n):new ee(Xr,t,n),i.type=e):"string"==typeof e?(i=new ee(ti,t,n),i.type=e):"object"==typeof e&&null!==e&&"number"==typeof e.tag?i=e:r("130",null==e?e:typeof e,""),i}function ne(e){return null===e||void 0===e?null:(e=Hi&&e[Hi]||e["@@iterator"],"function"==typeof e?e:null)}function re(e,t){var n=t.ref;if(null!==n&&"function"!=typeof n){if(t._owner){t=t._owner;var i=void 0;t&&("number"==typeof t.tag?(t.tag!==Di&&r("110"),i=t.stateNode):i=t.getPublicInstance()),i||r("147",n);var a=""+n;return null!==e&&null!==e.ref&&e.ref._stringRef===a?e.ref:(e=function(e){var t=i.refs===kt?i.refs={}:i.refs;null===e?delete t[a]:t[a]=e},e._stringRef=a,e)}"string"!=typeof n&&r("148"),t._owner||r("149",n)}return n}function ie(e,t){"textarea"!==e.type&&r("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function ae(e,t){function n(n,r){if(t){if(!e){if(null===r.alternate)return;r=r.alternate}var i=n.lastEffect;null!==i?(i.nextEffect=r,n.lastEffect=r):n.firstEffect=n.lastEffect=r,r.nextEffect=null,r.effectTag=Li}}function i(e,r){if(!t)return null;for(;null!==r;)n(e,r),r=r.sibling;return null}function a(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(t,n){return e?(t=xi(t,n),t.index=0,t.sibling=null,t):(t.pendingWorkPriority=n,t.effectTag=ji,t.index=0,t.sibling=null,t)}function s(e,n,r){return e.index=r,t?null!==(r=e.alternate)?(r=r.index,rp?(h=f,f=null):h=f.sibling;var d=v(e,f,o[p],u);if(null===d){null===f&&(f=h);break}t&&f&&null===d.alternate&&n(e,f),r=s(d,r,p),null===l?c=d:l.sibling=d,l=d,f=h}if(p===o.length)return i(e,f),c;if(null===f){for(;ph?(d=p,p=null):d=p.sibling;var b=v(e,p,m.value,c);if(null===b){p||(p=d);break}t&&p&&null===b.alternate&&n(e,p),o=s(b,o,h),null===f?l=b:f.sibling=b,f=b,p=d}if(m.done)return i(e,p),l;if(null===p){for(;!m.done;h++,m=u.next())null!==(m=y(e,m.value,c))&&(o=s(m,o,h),null===f?l=m:f.sibling=m,f=m);return l}for(p=a(e,p);!m.done;h++,m=u.next())null!==(m=g(p,e,h,m.value,c))&&(t&&null!==m.alternate&&p.delete(null===m.key?h:m.key),o=s(m,o,h),null===f?l=m:f.sibling=m,f=m);return t&&p.forEach(function(t){return n(e,t)}),l}return function(e,t,a,s){var c="object"==typeof a&&null!==a;if(c)switch(a.$$typeof){case Ui:e:{var l=a.key;for(c=t;null!==c;){if(c.key===l){if(c.type===a.type){i(e,c.sibling),t=o(c,s),t.ref=re(c,a),t.pendingProps=a.props,t.return=e,e=t;break e}i(e,c);break}n(e,c),c=c.sibling}s=Si(a,e.internalContextTag,s),s.ref=re(t,a),s.return=e,e=s}return u(e);case bi:e:{for(c=a.key;null!==t;){if(t.key===c){if(t.tag===Ai){i(e,t.sibling),t=o(t,s),t.pendingProps=a,t.return=e,e=t;break e}i(e,t);break}n(e,t),t=t.sibling}a=Ii(a,e.internalContextTag,s),a.return=e,e=a}return u(e);case ki:e:{if(null!==t){if(t.tag===Ti){i(e,t.sibling),t=o(t,s),t.type=a.value,t.return=e,e=t;break e}i(e,t)}t=Ri(a,e.internalContextTag,s),t.type=a.value,t.return=e,e=t}return u(e);case wi:e:{for(c=a.key;null!==t;){if(t.key===c){if(t.tag===Mi&&t.stateNode.containerInfo===a.containerInfo&&t.stateNode.implementation===a.implementation){i(e,t.sibling),t=o(t,s),t.pendingProps=a.children||[],t.return=e,e=t;break e}i(e,t);break}n(e,t),t=t.sibling}a=Ei(a,e.internalContextTag,s),a.return=e,e=a}return u(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==t&&t.tag===Oi?(i(e,t.sibling),t=o(t,s),t.pendingProps=a,t.return=e,e=t):(i(e,t),a=Ci(a,e.internalContextTag,s),a.return=e,e=a),u(e);if(Fi(a))return m(e,t,a,s);if(ne(a))return b(e,t,a,s);if(c&&ie(e,a),void 0===a)switch(e.tag){case Di:case Pi:a=e.type,r("152",a.displayName||a.name||"Component")}return i(e,t)}}function oe(e,t,n,i){function a(e,t){t.updater=o,e.stateNode=t,$t.set(t,e)}var o={isMounted:ra,enqueueSetState:function(n,r,i){n=$t.get(n);var a=t(n,!1);Xi(n,r,void 0===i?null:i,a),e(n,a)},enqueueReplaceState:function(n,r,i){n=$t.get(n);var a=t(n,!1);Zi(n,r,void 0===i?null:i,a),e(n,a)},enqueueForceUpdate:function(n,r){n=$t.get(n);var i=t(n,!1);ea(n,void 0===r?null:r,i),e(n,i)}};return{adoptClassInstance:a,constructClassInstance:function(e,t){var n=e.type,r=Qi(e),i=Yi(e),o=i?Gi(e,r):kt;return t=new n(t,o),a(e,t),i&&$i(e,r,o),t},mountClassInstance:function(e,t){var n=e.alternate,i=e.stateNode,a=i.state||null,s=e.pendingProps;s||r("158");var u=Qi(e);i.props=s,i.state=a,i.refs=kt,i.context=Gi(e,u),Rr.enableAsyncSubtreeAPI&&null!=e.type&&null!=e.type.prototype&&!0===e.type.prototype.unstable_isAsyncReactComponent&&(e.internalContextTag|=qi),"function"==typeof i.componentWillMount&&(u=i.state,i.componentWillMount(),u!==i.state&&o.enqueueReplaceState(i,i.state,null),null!==(u=e.updateQueue)&&(i.state=ta(n,e,u,i,a,s,t))),"function"==typeof i.componentDidMount&&(e.effectTag|=Ji)},updateClassInstance:function(e,t,a){var s=t.stateNode;s.props=t.memoizedProps,s.state=t.memoizedState;var u=t.memoizedProps,c=t.pendingProps;c||null==(c=u)&&r("159");var l=s.context,f=Qi(t);if(f=Gi(t,f),"function"!=typeof s.componentWillReceiveProps||u===c&&l===f||(l=s.state,s.componentWillReceiveProps(c,f),s.state!==l&&o.enqueueReplaceState(s,s.state,null)),l=t.memoizedState,a=null!==t.updateQueue?ta(e,t,t.updateQueue,s,l,c,a):l,!(u!==c||l!==a||na()||null!==t.updateQueue&&t.updateQueue.hasForceUpdate))return"function"!=typeof s.componentDidUpdate||u===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=Ji),!1;var p=c;if(null===u||null!==t.updateQueue&&t.updateQueue.hasForceUpdate)p=!0;else{var h=t.stateNode,d=t.type;p="function"==typeof h.shouldComponentUpdate?h.shouldComponentUpdate(p,a,f):!d.prototype||!d.prototype.isPureReactComponent||(!wt(u,p)||!wt(l,a))}return p?("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(c,a,f),"function"==typeof s.componentDidUpdate&&(t.effectTag|=Ji)):("function"!=typeof s.componentDidUpdate||u===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=Ji),n(t,c),i(t,a)),s.props=c,s.state=a,s.context=f,p}}}function se(e,t,n,i,a){function o(e,t,n){s(e,t,n,t.pendingWorkPriority)}function s(e,t,n,r){t.child=null===e?ia(t,t.child,n,r):e.child===t.child?aa(t,t.child,n,r):oa(t,t.child,n,r)}function u(e,t){var n=t.ref;null===n||e&&e.ref===n||(t.effectTag|=Oa)}function c(e,t,n,r){if(u(e,t),!n)return r&&da(t,!1),f(e,t);n=t.stateNode,Ma.current=t;var i=n.render();return t.effectTag|=Ea,o(e,t,i),t.memoizedState=n.state,t.memoizedProps=n.props,r&&da(t,!0),t.child}function l(e){var t=e.stateNode;t.pendingContext?ha(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ha(e,t.context,!1),g(e,t.containerInfo)}function f(e,t){return sa(e,t),t.child}function p(e,t){switch(t.tag){case ma:l(t);break;case ga:pa(t);break;case wa:g(t,t.stateNode.containerInfo)}return null}var h=e.shouldSetTextContent,d=e.useSyncScheduling,y=e.shouldDeprioritizeSubtree,v=t.pushHostContext,g=t.pushHostContainer,m=n.enterHydrationState,b=n.resetHydrationState,k=n.tryToClaimNextHydratableInstance;e=oe(i,a,function(e,t){e.memoizedProps=t},function(e,t){e.memoizedState=t});var w=e.adoptClassInstance,x=e.constructClassInstance,S=e.mountClassInstance,_=e.updateClassInstance;return{beginWork:function(e,t,n){if(t.pendingWorkPriority===Ia||t.pendingWorkPriority>n)return p(e,t);switch(t.tag){case ya:null!==e&&r("155");var i=t.type,a=t.pendingProps,s=la(t);return s=ca(t,s),i=i(a,s),t.effectTag|=Ea,"object"==typeof i&&null!==i&&"function"==typeof i.render?(t.tag=ga,a=pa(t),w(t,i),S(t,n),t=c(e,t,!0,a)):(t.tag=va,o(e,t,i),t.memoizedProps=a,t=t.child),t;case va:e:{if(a=t.type,n=t.pendingProps,i=t.memoizedProps,fa())null===n&&(n=i);else if(null===n||i===n){t=f(e,t);break e}i=la(t),i=ca(t,i),a=a(n,i),t.effectTag|=Ea,o(e,t,a),t.memoizedProps=n,t=t.child}return t;case ga:return a=pa(t),i=void 0,null===e?t.stateNode?r("153"):(x(t,t.pendingProps),S(t,n),i=!0):i=_(e,t,n),c(e,t,i,a);case ma:return l(t),i=t.updateQueue,null!==i?(a=t.memoizedState,i=ua(e,t,i,null,a,null,n),a===i?(b(),t=f(e,t)):(a=i.element,null!==e&&null!==e.child||!m(t)?(b(),o(e,t,a)):(t.effectTag|=Fa,t.child=ia(t,t.child,a,n)),t.memoizedState=i,t=t.child)):(b(),t=f(e,t)),t;case ba:v(t),null===e&&k(t),a=t.type;var C=t.memoizedProps;return i=t.pendingProps,null===i&&null===(i=C)&&r("154"),s=null!==e?e.memoizedProps:null,fa()||null!==i&&C!==i?(C=i.children,h(a,i)?C=null:s&&h(a,s)&&(t.effectTag|=Pa),u(e,t),n!==Ra&&!d&&y(a,i)?(t.pendingWorkPriority=Ra,t=null):(o(e,t,C),t.memoizedProps=i,t=t.child)):t=f(e,t),t;case ka:return null===e&&k(t),e=t.pendingProps,null===e&&(e=t.memoizedProps),t.memoizedProps=e,null;case Sa:t.tag=xa;case xa:return n=t.pendingProps,fa()?null===n&&null===(n=e&&e.memoizedProps)&&r("154"):null!==n&&t.memoizedProps!==n||(n=t.memoizedProps),a=n.children,i=t.pendingWorkPriority,t.stateNode=null===e?ia(t,t.stateNode,a,i):e.child===t.child?aa(t,t.stateNode,a,i):oa(t,t.stateNode,a,i),t.memoizedProps=n,t.stateNode;case _a:return null;case wa:e:{if(g(t,t.stateNode.containerInfo),n=t.pendingWorkPriority,a=t.pendingProps,fa())null===a&&null==(a=e&&e.memoizedProps)&&r("154");else if(null===a||t.memoizedProps===a){t=f(e,t);break e}null===e?t.child=oa(t,t.child,a,n):o(e,t,a),t.memoizedProps=a,t=t.child}return t;case Ca:e:{if(n=t.pendingProps,fa())null===n&&(n=t.memoizedProps);else if(null===n||t.memoizedProps===n){t=f(e,t);break e}o(e,t,n),t.memoizedProps=n,t=t.child}return t;default:r("156")}},beginFailedWork:function(e,t,n){switch(t.tag){case ga:pa(t);break;case ma:l(t);break;default:r("157")}return t.effectTag|=Da,null===e?t.child=null:t.child!==e.child&&(t.child=e.child),t.pendingWorkPriority===Ia||t.pendingWorkPriority>n?p(e,t):(t.firstEffect=null,t.lastEffect=null,s(e,t,null,n),t.tag===ga&&(e=t.stateNode,t.memoizedProps=e.props,t.memoizedState=e.state),t.child)}}}function ue(e,t,n){var i=e.createInstance,a=e.createTextInstance,o=e.appendInitialChild,s=e.finalizeInitialChildren,u=e.prepareUpdate,c=t.getRootHostContainer,l=t.popHostContext,f=t.getHostContext,p=t.popHostContainer,h=n.prepareToHydrateHostInstance,d=n.prepareToHydrateHostTextInstance,y=n.popHydrationState;return{completeWork:function(e,t,n){var v=t.pendingProps;switch(null===v?v=t.memoizedProps:t.pendingWorkPriority===Ya&&n!==Ya||(t.pendingProps=null),t.tag){case Ba:return null;case La:return Ta(t),null;case Ha:return p(t),Na(t),v=t.stateNode,v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),null!==e&&null!==e.child||(y(t),t.effectTag&=~$a),null;case Ua:l(t),n=c();var g=t.type;if(null!==e&&null!=t.stateNode){var m=e.memoizedProps,b=t.stateNode,k=f();v=u(b,g,m,v,n,k),(t.updateQueue=v)&&(t.effectTag|=Qa),e.ref!==t.ref&&(t.effectTag|=Ga)}else{if(!v)return null===t.stateNode&&r("166"),null;if(e=f(),y(t))h(t,n,e)&&(t.effectTag|=Qa);else{e=i(g,v,n,e,t);e:for(m=t.child;null!==m;){if(m.tag===Ua||m.tag===za)o(e,m.stateNode);else if(m.tag!==Ka&&null!==m.child){m=m.child;continue}if(m===t)break e;for(;null===m.sibling;){if(null===m.return||m.return===t)break e;m=m.return}m=m.sibling}s(e,g,v,n)&&(t.effectTag|=Qa),t.stateNode=e}null!==t.ref&&(t.effectTag|=Ga)}return null;case za:if(e&&null!=t.stateNode)e.memoizedProps!==v&&(t.effectTag|=Qa);else{if("string"!=typeof v)return null===t.stateNode&&r("166"),null;e=c(),n=f(),y(t)?d(t)&&(t.effectTag|=Qa):t.stateNode=a(v,e,n,t)}return null;case Wa:(v=t.memoizedProps)||r("165"),t.tag=Va,n=[];e:for((g=t.stateNode)&&(g.return=t);null!==g;){if(g.tag===Ua||g.tag===za||g.tag===Ka)r("164");else if(g.tag===Ja)n.push(g.type);else if(null!==g.child){g.child.return=g,g=g.child;continue}for(;null===g.sibling;){if(null===g.return||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}return g=v.handler,v=g(v.props,n),t.child=Aa(t,null!==e?e.child:null,v,t.pendingWorkPriority),t.child;case Va:return t.tag=Wa,null;case Ja:case qa:return null;case Ka:return t.effectTag|=Qa,p(t),null;case ja:r("167");default:r("156")}}}}function ce(e){return function(t){try{return e(t)}catch(e){}}}function le(e,t){function n(e){var n=e.ref;if(null!==n)try{n(null)}catch(n){t(e,n)}}function i(e){return e.tag===ro||e.tag===no||e.tag===ao}function a(e){for(var t=e;;)if(s(t),null!==t.child&&t.tag!==ao)t.child.return=t,t=t.child;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}}function o(e){for(var t=e,n=!1,i=void 0,o=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&r("160"),n.tag){case ro:i=n.stateNode,o=!1;break e;case no:case ao:i=n.stateNode.containerInfo,o=!0;break e}n=n.return}n=!0}if(t.tag===ro||t.tag===io)a(t),o?g(i,t.stateNode):v(i,t.stateNode);else if(t.tag===ao?i=t.stateNode.containerInfo:s(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return,t.tag===ao&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function s(e){switch("function"==typeof uo&&uo(e),e.tag){case to:n(e);var r=e.stateNode;if("function"==typeof r.componentWillUnmount)try{r.props=e.memoizedProps,r.state=e.memoizedState,r.componentWillUnmount()}catch(n){t(e,n)}break;case ro:n(e);break;case oo:a(e.stateNode);break;case ao:o(e)}}var u=e.commitMount,c=e.commitUpdate,l=e.resetTextContent,f=e.commitTextUpdate,p=e.appendChild,h=e.appendChildToContainer,d=e.insertBefore,y=e.insertInContainerBefore,v=e.removeChild,g=e.removeChildFromContainer,m=e.getPublicInstance;return{commitPlacement:function(e){e:{for(var t=e.return;null!==t;){if(i(t)){var n=t;break e}t=t.return}r("160"),n=void 0}var a=t=void 0;switch(n.tag){case ro:t=n.stateNode,a=!1;break;case no:case ao:t=n.stateNode.containerInfo,a=!0;break;default:r("161")}n.effectTag&po&&(l(t),n.effectTag&=~po);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||i(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==ro&&n.tag!==io;){if(n.effectTag&co)continue t;if(null===n.child||n.tag===ao)continue t;n.child.return=n,n=n.child}if(!(n.effectTag&co)){n=n.stateNode;break e}}for(var o=e;;){if(o.tag===ro||o.tag===io)n?a?y(t,o.stateNode,n):d(t,o.stateNode,n):a?h(t,o.stateNode):p(t,o.stateNode);else if(o.tag!==ao&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===e)break;for(;null===o.sibling;){if(null===o.return||o.return===e)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},commitDeletion:function(e){o(e),e.return=null,e.child=null,e.alternate&&(e.alternate.child=null,e.alternate.return=null)},commitWork:function(e,t){switch(t.tag){case to:break;case ro:var n=t.stateNode;if(null!=n){var i=t.memoizedProps;e=null!==e?e.memoizedProps:i;var a=t.type,o=t.updateQueue;t.updateQueue=null,null!==o&&c(n,o,a,e,i,t)}break;case io:null===t.stateNode&&r("162"),n=t.memoizedProps,f(t.stateNode,null!==e?e.memoizedProps:n,n);break;case no:case ao:break;default:r("163")}},commitLifeCycles:function(e,t){switch(t.tag){case to:var n=t.stateNode;if(t.effectTag&lo)if(null===e)n.props=t.memoizedProps,n.state=t.memoizedState,n.componentDidMount();else{var i=e.memoizedProps;e=e.memoizedState,n.props=t.memoizedProps,n.state=t.memoizedState,n.componentDidUpdate(i,e)}t.effectTag&fo&&null!==t.updateQueue&&so(t,t.updateQueue,n);break;case no:e=t.updateQueue,null!==e&&so(t,e,t.child&&t.child.stateNode);break;case ro:n=t.stateNode,null===e&&t.effectTag&lo&&u(n,t.type,t.memoizedProps,t);break;case io:case ao:break;default:r("163")}},commitAttachRef:function(e){var t=e.ref;if(null!==t){var n=e.stateNode;switch(e.tag){case ro:t(m(n));break;default:t(n)}}},commitDetachRef:function(e){null!==(e=e.ref)&&e(null)}}}function fe(e){function t(e){return e===go&&r("174"),e}var n=e.getChildHostContext,i=e.getRootHostContext,a=ho(go),o=ho(go),s=ho(go);return{getHostContext:function(){return t(a.current)},getRootHostContainer:function(){return t(s.current)},popHostContainer:function(e){yo(a,e),yo(o,e),yo(s,e)},popHostContext:function(e){o.current===e&&(yo(a,e),yo(o,e))},pushHostContainer:function(e,t){vo(s,t,e),t=i(t),vo(o,e,e),vo(a,t,e)},pushHostContext:function(e){var r=t(s.current),i=t(a.current);r=n(i,e.type,r),i!==r&&(vo(o,e,e),vo(a,r,e))},resetHostContainer:function(){a.current=go,s.current=go}}}function pe(e){function t(e,t){var n=So();n.stateNode=t,n.return=e,n.effectTag=wo,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function n(e,t){switch(e.tag){case mo:return o(t,e.type,e.pendingProps);case bo:return s(t,e.pendingProps);default:return!1}}function i(e){for(e=e.return;null!==e&&e.tag!==mo&&e.tag!==ko;)e=e.return;d=e}var a=e.shouldSetTextContent,o=e.canHydrateInstance,s=e.canHydrateTextInstance,u=e.getNextHydratableSibling,c=e.getFirstHydratableChild,l=e.hydrateInstance,f=e.hydrateTextInstance,p=e.didNotHydrateInstance,h=e.didNotFindHydratableInstance;if(e=e.didNotFindHydratableTextInstance,!(o&&s&&u&&c&&l&&f&&p&&h&&e))return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){r("175")},prepareToHydrateHostTextInstance:function(){r("176")},popHydrationState:function(){return!1}};var d=null,y=null,v=!1;return{enterHydrationState:function(e){return y=c(e.stateNode.containerInfo),d=e,v=!0},resetHydrationState:function(){y=d=null,v=!1},tryToClaimNextHydratableInstance:function(e){if(v){var r=y;if(r){if(!n(e,r)){if(!(r=u(r))||!n(e,r))return e.effectTag|=xo,v=!1,void(d=e);t(d,y)}e.stateNode=r,d=e,y=c(r)}else e.effectTag|=xo,v=!1,d=e}},prepareToHydrateHostInstance:function(e,t,n){return t=l(e.stateNode,e.type,e.memoizedProps,t,n,e),e.updateQueue=t,null!==t},prepareToHydrateHostTextInstance:function(e){return f(e.stateNode,e.memoizedProps,e)},popHydrationState:function(e){if(e!==d)return!1;if(!v)return i(e),v=!0,!1;var n=e.type;if(e.tag!==mo||"head"!==n&&"body"!==n&&!a(n,e.memoizedProps))for(n=y;n;)t(e,n),n=u(n);return i(e),y=d?u(e.stateNode):null,!0}}}function he(e){function t(){for(;null!==J&&J.current.pendingWorkPriority===Po;){J.isScheduled=!1;var e=J.nextScheduledRoot;if(J.nextScheduledRoot=null,J===q)return q=J=null,K=Po,null;J=e}e=J;for(var t=null,n=Po;null!==e;)e.current.pendingWorkPriority!==Po&&(n===Po||n>e.current.pendingWorkPriority)&&(n=e.current.pendingWorkPriority,t=e),e=e.nextScheduledRoot;null!==t?(K=n,Co(),Yo(),x(),z=Ro(t.current,n),t!==ie&&(re=0,ie=t)):(K=Po,ie=z=null)}function n(n){ee=!0,V=null;var i=n.stateNode;if(i.current===n&&r("177"),K!==Do&&K!==Oo||re++,Io.current=null,n.effectTag>jo)if(null!==n.lastEffect){n.lastEffect.nextEffect=n;var a=n.firstEffect}else a=n;else a=n.firstEffect;for(T(),W=a;null!==W;){var o=!1,s=void 0;try{for(;null!==W;){var u=W.effectTag;if(u&zo&&e.resetTextContent(W.stateNode),u&Vo){var c=W.alternate;null!==c&&O(c)}switch(u&~(Ko|Wo|zo|Vo|jo)){case Bo:R(W),W.effectTag&=~Bo;break;case Ho:R(W),W.effectTag&=~Bo,F(W.alternate,W);break;case Lo:F(W.alternate,W);break;case Uo:te=!0,E(W),te=!1}W=W.nextEffect}}catch(e){o=!0,s=e}o&&(null===W&&r("178"),f(W,s),null!==W&&(W=W.nextEffect))}for(N(),i.current=n,W=a;null!==W;){i=!1,a=void 0;try{for(;null!==W;){var l=W.effectTag;if(l&(Lo|Ko)&&P(W.alternate,W),l&Vo&&D(W),l&Wo)switch(o=W,s=void 0,null!==G&&(s=G.get(o),G.delete(o),null==s&&null!==o.alternate&&(o=o.alternate,s=G.get(o),G.delete(o))),null==s&&r("184"),o.tag){case Go:o.stateNode.componentDidCatch(s.error,{componentStack:s.componentStack});break;case Jo:null===X&&(X=s.error);break;default:r("157")}var p=W.nextEffect;W.nextEffect=null,W=p}}catch(e){i=!0,a=e}i&&(null===W&&r("178"),f(W,a),null!==W&&(W=W.nextEffect))}ee=!1,"function"==typeof Fo&&Fo(n.stateNode),Y&&(Y.forEach(g),Y=null),t()}function i(e){for(;;){var t=I(e.alternate,e,K),n=e.return,r=e.sibling,i=e;if(!(i.pendingWorkPriority!==Po&&i.pendingWorkPriority>K)){for(var a=Qo(i),o=i.child;null!==o;)a=Eo(a,o.pendingWorkPriority),o=o.sibling;i.pendingWorkPriority=a}if(null!==t)return t;if(null!==n&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),e.effectTag>jo&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e)),null!==r)return r;if(null===n){V=e;break}e=n}return null}function a(e){var t=_(e.alternate,e,K);return null===t&&(t=i(e)),Io.current=null,t}function o(e){var t=C(e.alternate,e,K);return null===t&&(t=i(e)),Io.current=null,t}function s(e){l(To,e)}function u(){if(null!==G&&0e)){j=K;e:for(;;){if(K<=Oo)for(;null!==z&&!(null===(z=a(z))&&(null===V&&r("179"),j=Oo,n(V),j=K,u(),K===Po||K>e||K>Oo)););else if(null!==i)for(;null!==z&&!L;)if(1e||KOo&&!$&&(M(s),$=!0),e=X,Z=L=B=!1,ie=Q=G=X=null,re=0,null!==e)throw e}function f(e,t){var n=Io.current=null,r=!1,i=!1,a=null;if(e.tag===Jo)n=e,h(e)&&(Z=!0);else for(var o=e.return;null!==o&&null===n;){if(o.tag===Go?"function"==typeof o.stateNode.componentDidCatch&&(r=!0,a=p(o),n=o,i=!0):o.tag===Jo&&(n=o),h(o)){if(te||null!==Y&&(Y.has(o)||null!==o.alternate&&Y.has(o.alternate)))return null;n=null,i=!1}o=o.return}if(null!==n){null===Q&&(Q=new Set),Q.add(n);var s="";o=e;do{e:switch(o.tag){case pi:case hi:case di:case yi:var u=o._debugOwner,c=o._debugSource,l=p(o),f=null;u&&(f=p(u)),u=c,l="\n in "+(l||"Unknown")+(u?" (at "+u.fileName.replace(/^.*[\\\/]/,"")+":"+u.lineNumber+")":f?" (created by "+f+")":"");break e;default:l=""}s+=l,o=o.return}while(o);o=s,e=p(e),null===G&&(G=new Map),t={componentName:e,componentStack:o,error:t,errorBoundary:r?n.stateNode:null,errorBoundaryFound:r,errorBoundaryName:a,willRetry:i},G.set(n,t);try{console.error(t.error)}catch(e){console.error(e)}return ee?(null===Y&&(Y=new Set),Y.add(n)):g(n),n}return null===X&&(X=t),null}function h(e){return null!==Q&&(Q.has(e)||null!==e.alternate&&Q.has(e.alternate))}function d(e,t){return y(e,t,!1)}function y(e,t){re>ne&&(Z=!0,r("185")),!B&&t<=K&&(z=null);for(var n=!0;null!==e&&n;){if(n=!1,(e.pendingWorkPriority===Po||e.pendingWorkPriority>t)&&(n=!0,e.pendingWorkPriority=t),null!==e.alternate&&(e.alternate.pendingWorkPriority===Po||e.alternate.pendingWorkPriority>t)&&(n=!0,e.alternate.pendingWorkPriority=t),null===e.return){if(e.tag!==Jo)break;var i=e.stateNode;if(t===Po||i.isScheduled||(i.isScheduled=!0,q?q.nextScheduledRoot=i:J=i,q=i),!B)switch(t){case Do:U?l(Do,null):l(Oo,null);break;case Oo:H||r("186");break;default:$||(M(s),$=!0)}}e=e.return}}function v(e,t){var n=j;return n===Po&&(n=!A||e.internalContextTag&No||t?Ao:Do),n===Do&&(B||H)?Oo:n}function g(e){y(e,Oo,!0)}var m=fe(e),b=pe(e),k=m.popHostContainer,w=m.popHostContext,x=m.resetHostContainer,S=se(e,m,b,d,v),_=S.beginWork,C=S.beginFailedWork,I=ue(e,m,b).completeWork;m=le(e,f);var R=m.commitPlacement,E=m.commitDeletion,F=m.commitWork,P=m.commitLifeCycles,D=m.commitAttachRef,O=m.commitDetachRef,M=e.scheduleDeferredCallback,A=e.useSyncScheduling,T=e.prepareForCommit,N=e.resetAfterCommit,j=Po,B=!1,L=!1,H=!1,U=!1,z=null,K=Po,W=null,V=null,J=null,q=null,$=!1,G=null,Q=null,Y=null,X=null,Z=!1,ee=!1,te=!1,ne=1e3,re=0,ie=null;return{scheduleUpdate:d,getPriorityContext:v,batchedUpdates:function(e,t){var n=H;H=!0;try{return e(t)}finally{H=n,B||H||l(Oo,null)}},unbatchedUpdates:function(e){var t=U,n=H;U=H,H=!1;try{return e()}finally{H=n,U=t}},flushSync:function(e){var t=H,n=j;H=!0,j=Do;try{return e()}finally{H=t,j=n,B&&r("187"),l(Oo,null)}},deferredUpdates:function(e){var t=j;j=Ao;try{return e()}finally{j=t}}}}function de(){r("196")}function ye(e){return e?(e=$t.get(e),"number"==typeof e.tag?de(e):e._processChildContext(e._context)):kt}function ve(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ge(e,t){var n=ve(e);e=0;for(var r;n;){if(n.nodeType===as){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ve(n)}}function me(){return!os&&vt.canUseDOM&&(os="textContent"in document.documentElement?"textContent":"innerText"),os}function be(){r("211")}function ke(){r("212")}function we(e){if(null==e)return null;if(e.nodeType===fs)return e;var t=$t.get(e);if(t)return"number"==typeof t.tag?be(t):ke(t);"function"==typeof e.render?r("188"):r("213",Object.keys(e))}function xe(e){if(void 0!==e._hostParent)return e._hostParent;if("number"==typeof e.tag){do{e=e.return}while(e&&e.tag!==ps);if(e)return e}return null}function Se(e,t){for(var n=0,r=e;r;r=xe(r))n++;r=0;for(var i=t;i;i=xe(i))r++;for(;0this.eventPool.length&&this.eventPool.push(e)}function Oe(e){e.eventPool=[],e.getPooled=Pe,e.release=De}function Me(e,t,n,r){return Fe.call(this,e,t,n,r)}function Ae(e,t,n,r){return Fe.call(this,e,t,n,r)}function Te(e,t){switch(e){case"topKeyUp":return-1!==ws.indexOf(t.keyCode);case"topKeyDown":return 229!==t.keyCode;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function Ne(e){return e=e.detail,"object"==typeof e&&"data"in e?e.data:null}function je(e,t){switch(e){case"topCompositionEnd":return Ne(t);case"topKeyPress":return 32!==t.which?null:(Ps=!0,Es);case"topTextInput":return e=t.data,e===Es&&Ps?null:e;default:return null}}function Be(e,t){if(Ds)return"topCompositionEnd"===e||!xs&&Te(e,t)?(e=ms.getData(),ms.reset(),Ds=!1,e):null;switch(e){case"topPaste":return null;case"topKeyPress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=u.hasBooleanValue+u.hasNumericValue+u.hasOverloadedBooleanValue||r("50",o),a.hasOwnProperty(o)&&(u.attributeName=a[o]),i.hasOwnProperty(o)&&(u.attributeNamespace=i[o]),e.hasOwnProperty(o)&&(u.mutationMethod=e[o]),At.properties[o]=u}}},At={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ATTRIBUTE_NAME_CHAR:":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},shouldSetAttribute:function(e,t){if(At.isReservedProp(e)||!("o"!==e[0]&&"O"!==e[0]||"n"!==e[1]&&"N"!==e[1]))return!1;if(null===t)return!0;switch(typeof t){case"boolean":return At.shouldAttributeAcceptBooleanValue(e);case"undefined":case"number":case"string":case"object":return!0;default:return!1}},getPropertyInfo:function(e){return At.properties.hasOwnProperty(e)?At.properties[e]:null},shouldAttributeAcceptBooleanValue:function(e){if(At.isReservedProp(e))return!0;var t=At.getPropertyInfo(e);return t?t.hasBooleanValue||t.hasStringBooleanValue||t.hasOverloadedBooleanValue:"data-"===(e=e.toLowerCase().slice(0,5))||"aria-"===e},isReservedProp:function(e){return Ot.hasOwnProperty(e)},injection:Mt},Tt=At,Nt={IndeterminateComponent:0,FunctionalComponent:1,ClassComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,CoroutineComponent:7,CoroutineHandlerPhase:8,YieldComponent:9,Fragment:10},jt={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_FRAGMENT_NODE:11},Bt=Nt.HostComponent,Lt=Nt.HostText,Ht=jt.ELEMENT_NODE,Ut=jt.COMMENT_NODE,zt=Tt.ID_ATTRIBUTE_NAME,Kt={hasCachedChildNodes:1},Wt=Math.random().toString(36).slice(2),Vt="__reactInternalInstance$"+Wt,Jt="__reactEventHandlers$"+Wt,qt={getClosestInstanceFromNode:f,getInstanceFromNode:function(e){var t=e[Vt];return t?t.tag===Bt||t.tag===Lt?t:t._hostNode===e?t:null:(t=f(e),null!=t&&t._hostNode===e?t:null)},getNodeFromInstance:function(e){if(e.tag===Bt||e.tag===Lt)return e.stateNode;if(void 0===e._hostNode&&r("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||r("34"),e=e._hostParent;for(;t.length;e=t.pop())l(e,e._hostNode);return e._hostNode},precacheChildNodes:l,precacheNode:c,uncacheNode:function(e){var t=e._hostNode;t&&(delete t[Vt],e._hostNode=null)},precacheFiberNode:function(e,t){t[Vt]=e},getFiberCurrentPropsFromNode:function(e){return e[Jt]||null},updateFiberProps:function(e,t){e[Jt]=t}},$t={remove:function(e){e._reactInternalFiber=void 0},get:function(e){return e._reactInternalFiber},has:function(e){return void 0!==e._reactInternalFiber},set:function(e,t){e._reactInternalFiber=t}},Gt={ReactCurrentOwner:yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner},Qt={NoEffect:0,PerformedWork:1,Placement:2,Update:4,PlacementAndUpdate:6,Deletion:8,ContentReset:16,Callback:32,Err:64,Ref:128},Yt=Nt.HostComponent,Xt=Nt.HostRoot,Zt=Nt.HostPortal,en=Nt.HostText,tn=Qt.NoEffect,nn=Qt.Placement,rn={isFiberMounted:function(e){return 2===h(e)},isMounted:function(e){return!!(e=$t.get(e))&&2===h(e)},findCurrentFiberUsingSlowPath:y,findCurrentHostFiber:function(e){if(!(e=y(e)))return null;for(var t=e;;){if(t.tag===Yt||t.tag===en)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null},findCurrentHostFiberWithNoPortals:function(e){if(!(e=y(e)))return null;for(var t=e;;){if(t.tag===Yt||t.tag===en)return t;if(t.child&&t.tag!==Zt)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}},an={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,injection:{injectErrorUtils:function(e){"function"!=typeof e.invokeGuardedCallback&&r("197"),v=e.invokeGuardedCallback}},invokeGuardedCallback:function(e,t,n,r,i,a,o,s,u){v.apply(an,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,i,a,o,s,u){if(an.invokeGuardedCallback.apply(this,arguments),an.hasCaughtError()){var c=an.clearCaughtError();an._hasRethrowError||(an._hasRethrowError=!0,an._rethrowError=c)}},rethrowCaughtError:function(){return g.apply(an,arguments)},hasCaughtError:function(){return an._hasCaughtError},clearCaughtError:function(){if(an._hasCaughtError){var e=an._caughtError;return an._caughtError=null,an._hasCaughtError=!1,e}r("198")}},on=an,sn={isEndish:function(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e},isMoveish:function(e){return"topMouseMove"===e||"topTouchMove"===e},isStartish:function(e){return"topMouseDown"===e||"topTouchStart"===e},executeDirectDispatch:function(e){var t=e._dispatchListeners,n=e._dispatchInstances;return Array.isArray(t)&&r("103"),e.currentTarget=t?sn.getNodeFromInstance(n):null,t=t?t(e):null,e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,t},executeDispatchesInOrder:function(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var i=0;ign.length&&gn.push(e)}}}},bn=mn,kn=null,wn={injection:{injectEventPluginOrder:Dt.injectEventPluginOrder,injectEventPluginsByName:Dt.injectEventPluginsByName},getListener:function(e,t){if("number"==typeof e.tag){var n=e.stateNode;if(!n)return null;var i=un.getFiberCurrentPropsFromNode(n);if(!i)return null;if(n=i[t],P(t,e.type,i))return null}else{if("string"==typeof(i=e._currentElement)||"number"==typeof i||!e._rootNodeID)return null;if(e=i.props,n=e[t],P(t,i.type,e))return null}return n&&"function"!=typeof n&&r("231",t,typeof n),n},extractEvents:function(e,t,n,r){for(var i,a=Dt.plugins,o=0;on||r.hasOverloadedBooleanValue&&!1===n?Un.deleteValueForProperty(e,t):r.mustUseProperty?e[r.propertyName]=n:(t=r.attributeName,(i=r.attributeNamespace)?e.setAttributeNS(i,t,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&!0===n?e.setAttribute(t,""):e.setAttribute(t,""+n))}else Un.setValueForAttribute(e,t,Tt.shouldSetAttribute(t,n)?n:null)},setValueForAttribute:function(e,t,n){T(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=Tt.getPropertyInfo(t);n?(t=n.mutationMethod)?t(e,void 0):n.mustUseProperty?e[n.propertyName]=!n.hasBooleanValue&&"":e.removeAttribute(n.attributeName):e.removeAttribute(t)}},zn=Un,Kn=Gt.ReactDebugCurrentFrame,Wn={current:null,phase:null,resetCurrentFiber:function(){Kn.getCurrentStack=null,Wn.current=null,Wn.phase=null},setCurrentFiber:function(e,t){Kn.getCurrentStack=N,Wn.current=e,Wn.phase=t},getCurrentFiberOwnerName:function(){return null},getCurrentFiberStackAddendum:N},Vn=Wn,Jn={getHostProps:function(e,t){var n=t.value,r=t.checked;return gt({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked})},initWrapperState:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}},updateWrapper:function(e,t){var n=t.checked;null!=n&&zn.setValueForProperty(e,"checked",n||!1),n=t.value,null!=n?0===n&&""===e.value?e.value="0":"number"===t.type?(t=parseFloat(e.value)||0,(n!=t||n==t&&e.value!=n)&&(e.value=""+n)):e.value!==""+n&&(e.value=""+n):(null==t.value&&null!=t.defaultValue&&e.defaultValue!==""+t.defaultValue&&(e.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked))},postMountWrapper:function(e,t){switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":e.value="",e.value=e.defaultValue;break;default:e.value=e.value}t=e.name,""!==t&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!e.defaultChecked,""!==t&&(e.name=t)},restoreControlledState:function(e,t){Jn.updateWrapper(e,t);var n=t.name;if("radio"===t.type&&null!=n){for(t=e;t.parentNode;)t=t.parentNode;for(n=t.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),t=0;t=t.length||r("93"),t=t[0]),n=""+t),null==n&&(n=""),i=n),e._wrapperState={initialValue:""+i}},updateWrapper:function(e,t){var n=t.value;null!=n&&(n=""+n,n!==e.value&&(e.value=n),null==t.defaultValue&&(e.defaultValue=n)),null!=t.defaultValue&&(e.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)},restoreControlledState:function(e,t){Qn.updateWrapper(e,t)}},Yn=Qn,Xn=gt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Zn={_getTrackerFromNode:function(e){return e._valueTracker},track:function(e){e._valueTracker||(e._valueTracker=U(e))},updateValueIfChanged:function(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=H(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)},stopTracking:function(e){(e=e._valueTracker)&&e.stopTracking()}},er=Rt.Namespaces,tr=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if(e.namespaceURI!==er.svg||"innerHTML"in e)e.innerHTML=t;else for(Nn=Nn||document.createElement("div"),Nn.innerHTML=""+t+"",t=Nn.firstChild;t.firstChild;)e.appendChild(t.firstChild)}),nr=/["'&<>]/,rr=jt.TEXT_NODE;vt.canUseDOM&&("textContent"in document.documentElement||(K=function(e,t){if(e.nodeType===rr)e.nodeValue=t;else{if("boolean"==typeof t||"number"==typeof t)t=""+t;else{t=""+t;var n=nr.exec(t);if(n){var r,i="",a=0;for(r=n.index;r<\/script>",e=e.removeChild(e.firstChild)):e="string"==typeof t.is?n.createElement(e,{is:t.is}):n.createElement(e):e=n.createElementNS(r,e),e},createTextNode:function(e,t){return(t.nodeType===ar?t:t.ownerDocument).createTextNode(e)},setInitialProperties:function(e,t,n,r){var i=z(t,n);switch(t){case"iframe":case"object":Fn.trapBubbledEvent("topLoad","load",e);var a=n;break;case"video":case"audio":for(a in fr)fr.hasOwnProperty(a)&&Fn.trapBubbledEvent(a,fr[a],e);a=n;break;case"source":Fn.trapBubbledEvent("topError","error",e),a=n;break;case"img":case"image":Fn.trapBubbledEvent("topError","error",e),Fn.trapBubbledEvent("topLoad","load",e),a=n;break;case"form":Fn.trapBubbledEvent("topReset","reset",e),Fn.trapBubbledEvent("topSubmit","submit",e),a=n;break;case"details":Fn.trapBubbledEvent("topToggle","toggle",e),a=n;break;case"input":qn.initWrapperState(e,n),a=qn.getHostProps(e,n),Fn.trapBubbledEvent("topInvalid","invalid",e),W(r,"onChange");break;case"option":$n.validateProps(e,n),a=$n.getHostProps(e,n);break;case"select":Gn.initWrapperState(e,n),a=Gn.getHostProps(e,n),Fn.trapBubbledEvent("topInvalid","invalid",e),W(r,"onChange");break;case"textarea":Yn.initWrapperState(e,n),a=Yn.getHostProps(e,n),Fn.trapBubbledEvent("topInvalid","invalid",e),W(r,"onChange");break;default:a=n}L(t,a);var o,s=a;for(o in s)if(s.hasOwnProperty(o)){var u=s[o];"style"===o?jn.setValueForStyles(e,u):"dangerouslySetInnerHTML"===o?null!=(u=u?u.__html:void 0)&&tr(e,u):"children"===o?"string"==typeof u?ir(e,u):"number"==typeof u&&ir(e,""+u):"suppressContentEditableWarning"!==o&&(ur.hasOwnProperty(o)?null!=u&&W(r,o):i?zn.setValueForAttribute(e,o,u):null!=u&&zn.setValueForProperty(e,o,u))}switch(t){case"input":Zn.track(e),qn.postMountWrapper(e,n);break;case"textarea":Zn.track(e),Yn.postMountWrapper(e,n);break;case"option":$n.postMountWrapper(e,n);break;case"select":Gn.postMountWrapper(e,n);break;default:"function"==typeof a.onClick&&(e.onclick=bt)}},diffProperties:function(e,t,n,r,i){var a=null;switch(t){case"input":n=qn.getHostProps(e,n),r=qn.getHostProps(e,r),a=[];break;case"option":n=$n.getHostProps(e,n),r=$n.getHostProps(e,r),a=[];break;case"select":n=Gn.getHostProps(e,n),r=Gn.getHostProps(e,r),a=[];break;case"textarea":n=Yn.getHostProps(e,n),r=Yn.getHostProps(e,r),a=[];break;default:"function"!=typeof n.onClick&&"function"==typeof r.onClick&&(e.onclick=bt)}L(t,r);var o,s;e=null;for(o in n)if(!r.hasOwnProperty(o)&&n.hasOwnProperty(o)&&null!=n[o])if("style"===o)for(s in t=n[o])t.hasOwnProperty(s)&&(e||(e={}),e[s]="");else"dangerouslySetInnerHTML"!==o&&"children"!==o&&"suppressContentEditableWarning"!==o&&(ur.hasOwnProperty(o)?a||(a=[]):(a=a||[]).push(o,null));for(o in r){var u=r[o];if(t=null!=n?n[o]:void 0,r.hasOwnProperty(o)&&u!==t&&(null!=u||null!=t))if("style"===o)if(t){for(s in t)!t.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(e||(e={}),e[s]="");for(s in u)u.hasOwnProperty(s)&&t[s]!==u[s]&&(e||(e={}),e[s]=u[s])}else e||(a||(a=[]),a.push(o,e)),e=u;else"dangerouslySetInnerHTML"===o?(u=u?u.__html:void 0,t=t?t.__html:void 0,null!=u&&t!==u&&(a=a||[]).push(o,""+u)):"children"===o?t===u||"string"!=typeof u&&"number"!=typeof u||(a=a||[]).push(o,""+u):"suppressContentEditableWarning"!==o&&(ur.hasOwnProperty(o)?(null!=u&&W(i,o),a||t===u||(a=[])):(a=a||[]).push(o,u))}return e&&(a=a||[]).push("style",e),a},updateProperties:function(e,t,n,r,i){z(n,r),r=z(n,i);for(var a=0;at&&(t=8),kr=t=V(c.priorityLevel,o);){n.first=c.next,null===n.first&&(n.last=null);var l;c.isReplace?(i=Q(c,r,i,a),u=!0):(l=Q(c,r,i,a))&&(i=u?gt({},i,l):gt(i,l),u=!1),c.isForced&&(s=!0),null===c.callback||c.isTopLevelUnmount&&null!==c.next||(e=null!==e?e:[],e.push(c.callback),t.effectTag|=Fr),c=c.next}return n.callbackList=e,n.hasForceUpdate=s,null!==n.first||null!==e||s||(t.updateQueue=null),i},commitCallbacks:function(e,t,n){if(null!==(e=t.callbackList))for(t.callbackList=null,t=0;tLr||(e.current=Br[Lr],Br[Lr]=null,Lr--)},push:function(e,t){Lr++,Br[Lr]=e.current,e.current=t},reset:function(){for(;-1e)?e:t}},fi=li.createHostRootFiber,pi=Nt.IndeterminateComponent,hi=Nt.FunctionalComponent,di=Nt.ClassComponent,yi=Nt.HostComponent;"function"==typeof Symbol&&Symbol.for?(_r=Symbol.for("react.coroutine"),Cr=Symbol.for("react.yield")):(_r=60104,Cr=60105);var vi={createCoroutine:function(e,t,n){var r=3t&&(r=t,t=i,i=r),r=ge(e,i),e=ge(e,t),r&&e){var a=document.createRange();a.setStart(r.node,r.offset),n.removeAllRanges(),i>t?(n.addRange(a),n.extend(e.node,e.offset)):(a.setEnd(e.node,e.offset),n.addRange(a))}}}},us=jt.ELEMENT_NODE,cs={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=_t();return{focusedElem:e,selectionRange:cs.hasSelectionCapabilities(e)?cs.getSelection(e):null}},restoreSelection:function(e){var t=_t(),n=e.focusedElem;if(e=e.selectionRange,t!==n&&xt(document.documentElement,n)){for(cs.hasSelectionCapabilities(n)&&cs.setSelection(n,e),t=[],e=n;e=e.parentNode;)e.nodeType===us&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(St(n),n=0;n=parseInt(Cs.version(),10))}var Is=_s,Rs=vt.canUseDOM&&(!xs||Ss&&8=Ss),Es=String.fromCharCode(32),Fs={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}},Ps=!1,Ds=!1,Os={eventTypes:Fs,extractEvents:function(e,t,n,r){var i;if(xs)e:{switch(e){case"topCompositionStart":var a=Fs.compositionStart;break e;case"topCompositionEnd":a=Fs.compositionEnd;break e;case"topCompositionUpdate":a=Fs.compositionUpdate;break e}a=void 0}else Ds?Te(e,n)&&(a=Fs.compositionEnd):"topKeyDown"===e&&229===n.keyCode&&(a=Fs.compositionStart);return a?(Rs&&(Ds||a!==Fs.compositionStart?a===Fs.compositionEnd&&Ds&&(i=ms.getData()):Ds=ms.initialize(r)),a=Me.getPooled(a,t,n,r),i?a.data=i:null!==(i=Ne(n))&&(a.data=i),ys.accumulateTwoPhaseDispatches(a),i=a):i=null,(e=Is?je(e,n):Be(e,n))?(t=Ae.getPooled(Fs.beforeInput,t,n,r),t.data=e,ys.accumulateTwoPhaseDispatches(t)):t=null,[i,t]}},Ms={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},As={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange".split(" ")}},Ts=null,Ns=null,js=!1;vt.canUseDOM&&(js=D("input")&&(!document.documentMode||9=document.documentMode,Ws={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}},Vs=null,Js=null,qs=null,$s=!1,Gs=Fn.isListeningToAllDependencies,Qs={eventTypes:Ws,extractEvents:function(e,t,n,r){var i=r.window===r?r.document:r.nodeType===zs?r:r.ownerDocument;if(!i||!Gs("onSelect",i))return null;switch(i=t?qt.getNodeFromInstance(t):window,e){case"topFocus":(Le(i)||"true"===i.contentEditable)&&(Vs=i,Js=t,qs=null);break;case"topBlur":qs=Js=Vs=null;break;case"topMouseDown":$s=!0;break;case"topContextMenu":case"topMouseUp":return $s=!1,et(n,r);case"topSelectionChange":if(Ks)break;case"topKeyDown":case"topKeyUp":return et(n,r)}return null}};Fe.augmentClass(tt,{animationName:null,elapsedTime:null,pseudoElement:null}),Fe.augmentClass(nt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qe.augmentClass(rt,{relatedTarget:null});var Ys={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xs={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};Qe.augmentClass(at,{key:function(e){if(e.key){var t=Ys[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?(e=it(e),13===e?"Enter":String.fromCharCode(e)):"keydown"===e.type||"keyup"===e.type?Xs[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Xe,charCode:function(e){return"keypress"===e.type?it(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?it(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Ze.augmentClass(ot,{dataTransfer:null}),Qe.augmentClass(st,{touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Xe}),Fe.augmentClass(ut,{propertyName:null,elapsedTime:null,pseudoElement:null}),Ze.augmentClass(ct,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null});var Zs={},eu={};"abort animationEnd animationIteration animationStart blur cancel canPlay canPlayThrough click close contextMenu copy cut doubleClick drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error focus input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing progress rateChange reset scroll seeked seeking stalled submit suspend timeUpdate toggle touchCancel touchEnd touchMove touchStart transitionEnd volumeChange waiting wheel".split(" ").forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t;t="top"+t,n={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[t]},Zs[e]=n,eu[t]=n});var tu={eventTypes:Zs,extractEvents:function(e,t,n,i){var a=eu[e];if(!a)return null;switch(e){case"topAbort":case"topCancel":case"topCanPlay":case"topCanPlayThrough":case"topClose":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topToggle":case"topVolumeChange":case"topWaiting":var o=Fe;break;case"topKeyPress":if(0===it(n))return null;case"topKeyDown":case"topKeyUp":o=at;break;case"topBlur":case"topFocus":o=rt;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":o=Ze;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":o=ot;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":o=st;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":o=tt;break;case"topTransitionEnd":o=ut;break;case"topScroll":o=Qe;break;case"topWheel":o=ct;break;case"topCopy":case"topCut":case"topPaste":o=nt}return o||r("86",e),e=o.getPooled(a,t,n,i),ys.accumulateTwoPhaseDispatches(e),e}};bn.setHandleTopLevel(Fn.handleTopLevel),wn.injection.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin TapEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),un.injection.injectComponentTree(qt),wn.injection.injectEventPluginsByName({SimpleEventPlugin:tu,EnterLeaveEventPlugin:Us,ChangeEventPlugin:Bs,SelectEventPlugin:Qs,BeforeInputEventPlugin:Os});var nu=Tt.injection.MUST_USE_PROPERTY,ru=Tt.injection.HAS_BOOLEAN_VALUE,iu=Tt.injection.HAS_NUMERIC_VALUE,au=Tt.injection.HAS_POSITIVE_NUMERIC_VALUE,ou=Tt.injection.HAS_STRING_BOOLEAN_VALUE,su={Properties:{allowFullScreen:ru,allowTransparency:ou,async:ru,autoPlay:ru,capture:ru,checked:nu|ru,cols:au,contentEditable:ou,controls:ru,default:ru,defer:ru,disabled:ru,download:Tt.injection.HAS_OVERLOADED_BOOLEAN_VALUE,draggable:ou,formNoValidate:ru,hidden:ru,loop:ru,multiple:nu|ru,muted:nu|ru,noValidate:ru,open:ru,playsInline:ru,readOnly:ru,required:ru,reversed:ru,rows:au,rowSpan:iu,scoped:ru,seamless:ru,selected:nu|ru,size:au,start:iu,span:au,spellCheck:ou,style:0,itemScope:ru,acceptCharset:0,className:0,htmlFor:0,httpEquiv:0,value:ou},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}},uu=Tt.injection.HAS_STRING_BOOLEAN_VALUE,cu={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},lu={Properties:{autoReverse:uu,externalResourcesRequired:uu,preserveAlpha:uu},DOMAttributeNames:{autoReverse:"autoReverse",externalResourcesRequired:"externalResourcesRequired",preserveAlpha:"preserveAlpha"},DOMAttributeNamespaces:{xlinkActuate:cu.xlink,xlinkArcrole:cu.xlink,xlinkHref:cu.xlink,xlinkRole:cu.xlink,xlinkShow:cu.xlink,xlinkTitle:cu.xlink,xlinkType:cu.xlink,xmlBase:cu.xml,xmlLang:cu.xml,xmlSpace:cu.xml}},fu=/[\-\:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode x-height xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xmlns:xlink xml:lang xml:space".split(" ").forEach(function(e){var t=e.replace(fu,lt);lu.Properties[t]=0,lu.DOMAttributeNames[t]=e}),Tt.injection.injectDOMPropertyConfig(su),Tt.injection.injectDOMPropertyConfig(lu);var pu=eo.injectInternals,hu=jt.ELEMENT_NODE,du=jt.TEXT_NODE,yu=jt.COMMENT_NODE,vu=jt.DOCUMENT_NODE,gu=jt.DOCUMENT_FRAGMENT_NODE,mu=Tt.ROOT_ATTRIBUTE_NAME,bu=Rt.getChildNamespace,ku=pr.createElement,wu=pr.createTextNode,xu=pr.setInitialProperties,Su=pr.diffProperties,_u=pr.updateProperties,Cu=pr.diffHydratedProperties,Iu=pr.diffHydratedText,Ru=pr.warnForDeletedHydratableElement,Eu=pr.warnForDeletedHydratableText,Fu=pr.warnForInsertedHydratedElement,Pu=pr.warnForInsertedHydratedText,Du=qt.precacheFiberNode,Ou=qt.updateFiberProps;pn.injection.injectFiberControlledHostComponent(pr),we._injectFiber(function(e){return Tu.findHostInstance(e)});var Mu=null,Au=null,Tu=function(e){var t=e.getPublicInstance;e=he(e);var n=e.scheduleUpdate,r=e.getPriorityContext;return{createContainer:function(e){var t=fi();return e={current:t,containerInfo:e,isScheduled:!1,nextScheduledRoot:null,context:null,pendingContext:null},t.stateNode=e},updateContainer:function(e,t,i,a){var o=t.current;i=ye(i),null===t.context?t.context=i:t.pendingContext=i,t=a,a=r(o,Rr.enableAsyncSubtreeAPI&&null!=e&&null!=e.type&&null!=e.type.prototype&&!0===e.type.prototype.unstable_isAsyncReactComponent),e={element:e},Xo(o,e,void 0===t?null:t,a),n(o,a)},batchedUpdates:e.batchedUpdates,unbatchedUpdates:e.unbatchedUpdates,deferredUpdates:e.deferredUpdates,flushSync:e.flushSync,getPublicRootInstance:function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case ns:return t(e.child.stateNode);default:return e.child.stateNode}},findHostInstance:function(e){return e=rs(e),null===e?null:e.stateNode},findHostInstanceWithNoPortals:function(e){return e=is(e),null===e?null:e.stateNode}}}({getRootHostContext:function(e){if(e.nodeType===vu)e=(e=e.documentElement)?e.namespaceURI:bu(null,"");else{var t=e.nodeType===yu?e.parentNode:e;e=t.namespaceURI||null,t=t.tagName,e=bu(e,t)}return e},getChildHostContext:function(e,t){return bu(e,t)},getPublicInstance:function(e){return e},prepareForCommit:function(){Mu=Fn.isEnabled(),Au=ls.getSelectionInformation(),Fn.setEnabled(!1)},resetAfterCommit:function(){ls.restoreSelection(Au),Au=null,Fn.setEnabled(Mu),Mu=null},createInstance:function(e,t,n,r,i){return e=ku(e,t,n,r),Du(i,e),Ou(e,t),e},appendInitialChild:function(e,t){e.appendChild(t)},finalizeInitialChildren:function(e,t,n,r){xu(e,t,n,r);e:{switch(t){case"button":case"input":case"select":case"textarea":e=!!n.autoFocus;break e}e=!1}return e},prepareUpdate:function(e,t,n,r,i){return Su(e,t,n,r,i)},commitMount:function(e){e.focus()},commitUpdate:function(e,t,n,r,i){Ou(e,i),_u(e,t,n,r,i)},shouldSetTextContent:function(e,t){return"textarea"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html},resetTextContent:function(e){e.textContent=""},shouldDeprioritizeSubtree:function(e,t){return!!t.hidden},createTextInstance:function(e,t,n,r){return e=wu(e,t),Du(r,e),e},commitTextUpdate:function(e,t,n){e.nodeValue=n},appendChild:function(e,t){e.appendChild(t)},appendChildToContainer:function(e,t){e.nodeType===yu?e.parentNode.insertBefore(t,e):e.appendChild(t)},insertBefore:function(e,t,n){e.insertBefore(t,n)},insertInContainerBefore:function(e,t,n){e.nodeType===yu?e.parentNode.insertBefore(t,n):e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},removeChildFromContainer:function(e,t){e.nodeType===yu?e.parentNode.removeChild(t):e.removeChild(t)},canHydrateInstance:function(e,t){return e.nodeType===hu&&t===e.nodeName.toLowerCase()},canHydrateTextInstance:function(e,t){return""!==t&&e.nodeType===du},getNextHydratableSibling:function(e){for(e=e.nextSibling;e&&e.nodeType!==hu&&e.nodeType!==du;)e=e.nextSibling;return e},getFirstHydratableChild:function(e){for(e=e.firstChild;e&&e.nodeType!==hu&&e.nodeType!==du;)e=e.nextSibling;return e},hydrateInstance:function(e,t,n,r,i,a){return Du(a,e),Ou(e,n),Cu(e,t,n,i,r)},hydrateTextInstance:function(e,t,n){return Du(n,e),Iu(e,t)},didNotHydrateInstance:function(e,t){1===t.nodeType?Ru(e,t):Eu(e,t)},didNotFindHydratableInstance:function(e,t,n){Fu(e,t,n)},didNotFindHydratableTextInstance:function(e,t){Pu(e,t)},scheduleDeferredCallback:Ir.rIC,useSyncScheduling:!0});dn.injection.injectFiberBatchedUpdates(Tu.batchedUpdates);var Nu={createPortal:dt,hydrate:function(e,t,n){return ht(null,e,t,!0,n)},render:function(e,t,n){return ht(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,i){return null!=e&&$t.has(e)||r("38"),ht(e,t,n,!1,i)},unmountComponentAtNode:function(e){return ft(e)||r("40"),!!e._reactRootContainer&&(Tu.unbatchedUpdates(function(){ht(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},findDOMNode:we,unstable_createPortal:dt,unstable_batchedUpdates:dn.batchedUpdates,unstable_deferredUpdates:Tu.deferredUpdates,flushSync:Tu.flushSync,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{EventPluginHub:wn,EventPluginRegistry:Dt,EventPropagators:ys,ReactControlledComponent:pn,ReactDOMComponentTree:qt,ReactDOMEventListener:bn}};pu({findFiberByHostInstance:qt.getClosestInstanceFromNode,findHostInstanceByFiber:Tu.findHostInstance,bundleType:0,version:"16.0.1",rendererPackageName:"react-dom"}),e.exports=Nu},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=i},function(e,t,n){"use strict";var r=n(1),i={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=i},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function i(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var o=0;o1&&!t.content.isDefault&&d.a.createElement("a",{className:"info",onClick:function(){e.setCredentialAsDefault(t)}},"Make Default"),d.a.createElement("a",{className:"info",onClick:function(){e.exportCredential(t)}},"Export"),d.a.createElement("a",{className:"danger",onClick:function(){e.deleteCredential(t)}},"Delete")))))})))}}]),t}(d.a.Component)},function(e,t){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){(function(t){var n,n;!function(t){e.exports=t()}(function(){return function(){function e(t,r,i){function a(s,u){if(!r[s]){if(!t[s]){var c="function"==typeof n&&n;if(!u&&c)return n(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var f=r[s]={exports:{}};t[s][0].call(f.exports,function(e){return a(t[s][1][e]||e)},f,f.exports,e,t,r,i)}return r[s].exports}for(var o="function"==typeof n&&n,s=0;s>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*a,i=e.min(4*t,i),t){for(var u=0;u>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;4>o&&i+.75*o>>6*(3-o)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map,i=r.charAt(64);i&&-1!=(i=e.indexOf(i))&&(n=i);for(var i=[],a=0,o=0;o>>6-o%4*2;i[a>>>2]|=(s|u)<<24-a%4*8,a++}return t.create(i,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,n,r,i,a,o){return((e=e+(t&n|~t&r)+i+o)<>>32-a)+t}function n(e,t,n,r,i,a,o){return((e=e+(t&r|n&~r)+i+o)<>>32-a)+t}function r(e,t,n,r,i,a,o){return((e=e+(t^n^r)+i+o)<>>32-a)+t}function i(e,t,n,r,i,a,o){return((e=e+(n^(t|~r))+i+o)<>>32-a)+t}for(var a=o,s=a.lib,u=s.WordArray,c=s.Hasher,s=a.algo,l=[],f=0;64>f;f++)l[f]=4294967296*e.abs(e.sin(f+1))|0;s=s.MD5=c.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,a){for(var o=0;16>o;o++){var s=a+o,u=e[s];e[s]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}var o=this._hash.words,s=e[a+0],u=e[a+1],c=e[a+2],f=e[a+3],p=e[a+4],h=e[a+5],d=e[a+6],y=e[a+7],v=e[a+8],g=e[a+9],m=e[a+10],b=e[a+11],k=e[a+12],w=e[a+13],x=e[a+14],S=e[a+15],_=o[0],C=o[1],I=o[2],R=o[3],_=t(_,C,I,R,s,7,l[0]),R=t(R,_,C,I,u,12,l[1]),I=t(I,R,_,C,c,17,l[2]),C=t(C,I,R,_,f,22,l[3]),_=t(_,C,I,R,p,7,l[4]),R=t(R,_,C,I,h,12,l[5]),I=t(I,R,_,C,d,17,l[6]),C=t(C,I,R,_,y,22,l[7]),_=t(_,C,I,R,v,7,l[8]),R=t(R,_,C,I,g,12,l[9]),I=t(I,R,_,C,m,17,l[10]),C=t(C,I,R,_,b,22,l[11]),_=t(_,C,I,R,k,7,l[12]),R=t(R,_,C,I,w,12,l[13]),I=t(I,R,_,C,x,17,l[14]),C=t(C,I,R,_,S,22,l[15]),_=n(_,C,I,R,u,5,l[16]),R=n(R,_,C,I,d,9,l[17]),I=n(I,R,_,C,b,14,l[18]),C=n(C,I,R,_,s,20,l[19]),_=n(_,C,I,R,h,5,l[20]),R=n(R,_,C,I,m,9,l[21]),I=n(I,R,_,C,S,14,l[22]),C=n(C,I,R,_,p,20,l[23]),_=n(_,C,I,R,g,5,l[24]),R=n(R,_,C,I,x,9,l[25]),I=n(I,R,_,C,f,14,l[26]),C=n(C,I,R,_,v,20,l[27]),_=n(_,C,I,R,w,5,l[28]),R=n(R,_,C,I,c,9,l[29]),I=n(I,R,_,C,y,14,l[30]),C=n(C,I,R,_,k,20,l[31]),_=r(_,C,I,R,h,4,l[32]),R=r(R,_,C,I,v,11,l[33]),I=r(I,R,_,C,b,16,l[34]),C=r(C,I,R,_,x,23,l[35]),_=r(_,C,I,R,u,4,l[36]),R=r(R,_,C,I,p,11,l[37]),I=r(I,R,_,C,y,16,l[38]),C=r(C,I,R,_,m,23,l[39]),_=r(_,C,I,R,w,4,l[40]),R=r(R,_,C,I,s,11,l[41]),I=r(I,R,_,C,f,16,l[42]),C=r(C,I,R,_,d,23,l[43]),_=r(_,C,I,R,g,4,l[44]),R=r(R,_,C,I,k,11,l[45]),I=r(I,R,_,C,S,16,l[46]),C=r(C,I,R,_,c,23,l[47]),_=i(_,C,I,R,s,6,l[48]),R=i(R,_,C,I,y,10,l[49]),I=i(I,R,_,C,x,15,l[50]),C=i(C,I,R,_,h,21,l[51]),_=i(_,C,I,R,k,6,l[52]),R=i(R,_,C,I,f,10,l[53]),I=i(I,R,_,C,m,15,l[54]),C=i(C,I,R,_,u,21,l[55]),_=i(_,C,I,R,v,6,l[56]),R=i(R,_,C,I,S,10,l[57]),I=i(I,R,_,C,d,15,l[58]),C=i(C,I,R,_,w,21,l[59]),_=i(_,C,I,R,p,6,l[60]),R=i(R,_,C,I,b,10,l[61]),I=i(I,R,_,C,c,15,l[62]),C=i(C,I,R,_,g,21,l[63]);o[0]=o[0]+_|0,o[1]=o[1]+C|0,o[2]=o[2]+I|0,o[3]=o[3]+R|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var a=e.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),t=this._hash,n=t.words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}}),a.MD5=c._createHelper(s),a.HmacMD5=c._createHmacHelper(s)}(Math),function(){var e=o,t=e.lib,n=t.Base,r=t.WordArray,t=e.algo,i=t.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,i=n.hasher.create(),a=r.create(),o=a.words,s=n.keySize,n=n.iterations;o.length>>2]}},n.BlockCipher=c.extend({cfg:c.cfg.extend({mode:l,padding:p}),reset:function(){c.reset.call(this);var e=this.cfg,t=e.iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var h=n.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),l=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return e=e.salt,(e?i.create([1398893684,1701076831]).concat(e).concat(t):t).toString(s)},parse:function(e){e=s.parse(e);var t=e.words;if(1398893684==t[0]&&1701076831==t[1]){var n=i.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return h.create({ciphertext:e,salt:n})}},d=n.SerializableCipher=r.extend({cfg:r.extend({format:l}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r);return t=i.finalize(t),i=i.cfg,h.create({ciphertext:t,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),t=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){return r||(r=i.random(8)),e=u.create({keySize:t+n}).compute(e,r),n=i.create(e.words.slice(t),4*n),e.sigBytes=4*t,h.create({key:e,iv:n,salt:r})}},y=n.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:t}),encrypt:function(e,t,n,r){return r=this.cfg.extend(r),n=r.kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,e=d.encrypt.call(this,e,t,n.key,r),e.mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,d.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=o,t=e.lib.BlockCipher,n=e.algo,r=[],i=[],a=[],s=[],u=[],c=[],l=[],f=[],p=[],h=[],d=[],y=0;256>y;y++)d[y]=128>y?y<<1:y<<1^283;for(var v=0,g=0,y=0;256>y;y++){var m=g^g<<1^g<<2^g<<3^g<<4,m=m>>>8^255&m^99;r[v]=m,i[m]=v;var b=d[v],k=d[b],w=d[k],x=257*d[m]^16843008*m;a[v]=x<<24|x>>>8,s[v]=x<<16|x>>>16,u[v]=x<<8|x>>>24,c[v]=x,x=16843009*w^65537*k^257*b^16843008*v,l[m]=x<<24|x>>>8,f[m]=x<<16|x>>>16,p[m]=x<<8|x>>>24,h[m]=x,v?(v=b^d[d[d[w^b]]],g^=d[d[g]]):v=g=1}var S=[0,1,2,4,8,16,32,64,128,27,54],n=n.AES=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes/4,e=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],a=0;a>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o]):(o=o<<8|o>>>24,o=r[o>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o],o^=S[a/n|0]<<24),i[a]=i[a-n]^o}for(t=this._invKeySchedule=[],n=0;nn||4>=a?o:l[r[o>>>24]]^f[r[o>>>16&255]]^p[r[o>>>8&255]]^h[r[255&o]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,u,c,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,f,p,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,a,o,s){for(var u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],f=e[t+2]^n[2],p=e[t+3]^n[3],h=4,d=1;d>>24]^i[l>>>16&255]^a[f>>>8&255]^o[255&p]^n[h++],v=r[l>>>24]^i[f>>>16&255]^a[p>>>8&255]^o[255&c]^n[h++],g=r[f>>>24]^i[p>>>16&255]^a[c>>>8&255]^o[255&l]^n[h++],p=r[p>>>24]^i[c>>>16&255]^a[l>>>8&255]^o[255&f]^n[h++],c=y,l=v,f=g;y=(s[c>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^n[h++],v=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&c])^n[h++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^n[h++],p=(s[p>>>24]<<24|s[c>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^n[h++],e[t]=y,e[t+1]=v,e[t+2]=g,e[t+3]=p},keySize:8});e.AES=t._createHelper(n)}();var o=o||function(e,t){var n={},r=n.lib={},i=function(){},a=r.Base={extend:function(e){i.prototype=this;var t=new i;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=r.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes;if(e=e.sigBytes,this.clamp(),r%4)for(var i=0;i>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*a,i=e.min(4*t,i),t){for(var u=0;ul;){var f;e:{f=c;for(var p=e.sqrt(f),h=2;h<=p;h++)if(!(f%h)){f=!1;break e}f=!0}f&&(8>l&&(a[l]=u(e.pow(c,.5))),s[l]=u(e.pow(c,1/3)),l++),c++}var d=[],n=n.SHA256=i.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],u=n[4],c=n[5],l=n[6],f=n[7],p=0;64>p;p++){if(16>p)d[p]=0|e[t+p];else{var h=d[p-15],y=d[p-2];d[p]=((h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3)+d[p-7]+((y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10)+d[p-16]}h=f+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+s[p]+d[p],y=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&a^i&a),f=l,l=c,c=u,u=o+h|0,o=a,a=i,i=r,r=h+y|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(n),t.HmacSHA256=i._createHmacHelper(n)}(Math),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var a=this._oKey=n.clone(),o=this._iKey=n.clone(),s=a.words,u=o.words,c=0;c>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*a,i=e.min(4*t,i),t){for(var u=0;uc;c++)u[c]=e();r=r.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],c=n[4],l=n[5],f=n[6],n=n[7],p=r.high,h=r.low,d=i.high,y=i.low,v=a.high,g=a.low,m=o.high,b=o.low,k=c.high,w=c.low,x=l.high,S=l.low,_=f.high,C=f.low,I=n.high,R=n.low,E=p,F=h,P=d,D=y,O=v,M=g,A=m,T=b,N=k,j=w,B=x,L=S,H=_,U=C,z=I,K=R,W=0;80>W;W++){var V=u[W];if(16>W)var J=V.high=0|e[t+2*W],q=V.low=0|e[t+2*W+1];else{var J=u[W-15],q=J.high,$=J.low,J=(q>>>1|$<<31)^(q>>>8|$<<24)^q>>>7,$=($>>>1|q<<31)^($>>>8|q<<24)^($>>>7|q<<25),G=u[W-2],q=G.high,Q=G.low,G=(q>>>19|Q<<13)^(q<<3|Q>>>29)^q>>>6,Q=(Q>>>19|q<<13)^(Q<<3|q>>>29)^(Q>>>6|q<<26),q=u[W-7],Y=q.high,X=u[W-16],Z=X.high,X=X.low,q=$+q.low,J=J+Y+(q>>>0<$>>>0?1:0),q=q+Q,J=J+G+(q>>>0>>0?1:0),q=q+X,J=J+Z+(q>>>0>>0?1:0);V.high=J,V.low=q}var Y=N&B^~N&H,X=j&L^~j&U,V=E&P^E&O^P&O,ee=F&D^F&M^D&M,$=(E>>>28|F<<4)^(E<<30|F>>>2)^(E<<25|F>>>7),G=(F>>>28|E<<4)^(F<<30|E>>>2)^(F<<25|E>>>7),Q=s[W],te=Q.high,ne=Q.low,Q=K+((j>>>14|N<<18)^(j>>>18|N<<14)^(j<<23|N>>>9)),Z=z+((N>>>14|j<<18)^(N>>>18|j<<14)^(N<<23|j>>>9))+(Q>>>0>>0?1:0),Q=Q+X,Z=Z+Y+(Q>>>0>>0?1:0),Q=Q+ne,Z=Z+te+(Q>>>0>>0?1:0),Q=Q+q,Z=Z+J+(Q>>>0>>0?1:0),q=G+ee,V=$+V+(q>>>0>>0?1:0),z=H,K=U,H=B,U=L,B=N,L=j,j=T+Q|0,N=A+Z+(j>>>0>>0?1:0)|0,A=O,T=M,O=P,M=D,P=E,D=F,F=Q+q|0,E=Z+V+(F>>>0>>0?1:0)|0}h=r.low=h+F,r.high=p+E+(h>>>0>>0?1:0),y=i.low=y+D,i.high=d+P+(y>>>0>>0?1:0),g=a.low=g+M,a.high=v+O+(g>>>0>>0?1:0),b=o.low=b+T,o.high=m+A+(b>>>0>>0?1:0),w=c.low=w+j,c.high=k+N+(w>>>0>>0?1:0),S=l.low=S+L,l.high=x+B+(S>>>0>>0?1:0),C=f.low=C+U,f.high=_+H+(C>>>0>>0?1:0),R=n.low=R+K,n.high=I+z+(R>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=n._createHelper(r),t.HmacSHA512=n._createHmacHelper(r)}(),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var a=this._oKey=n.clone(),o=this._iKey=n.clone(),s=a.words,u=o.words,c=0;c>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*a,i=e.min(4*t,i),t){for(var u=0;uc;c++){if(16>c)i[c]=0|e[t+c];else{var l=i[c-3]^i[c-8]^i[c-14]^i[c-16];i[c]=l<<1|l>>>31}l=(r<<5|r>>>27)+u+i[c],l=20>c?l+(1518500249+(a&o|~a&s)):40>c?l+(1859775393+(a^o^s)):60>c?l+((a&o|a&s|o&s)-1894007588):l+((a^o^s)-899497514),u=s,s=o,o=a<<30|a>>>2,a=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(t),e.HmacSHA1=r._createHmacHelper(t)}(),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var a=this._oKey=n.clone(),o=this._iKey=n.clone(),s=a.words,u=o.words,c=0;c>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*a,i=e.min(4*t,i),t){for(var u=0;uc;c++){if(16>c)i[c]=0|e[t+c];else{var l=i[c-3]^i[c-8]^i[c-14]^i[c-16];i[c]=l<<1|l>>>31}l=(r<<5|r>>>27)+u+i[c],l=20>c?l+(1518500249+(a&o|~a&s)):40>c?l+(1859775393+(a^o^s)):60>c?l+((a&o|a&s|o&s)-1894007588):l+((a^o^s)-899497514),u=s,s=o,o=a<<30|a>>>2,a=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(t),e.HmacSHA1=r._createHmacHelper(t)}(),Object.defineProperty(r,"__esModule",{value:!0});var s,u=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n=200&&c.status<=299?s.$timeout(function(){a(e),i(e)}):(console.error("Request error:",e),s.$timeout(function(){o(e,c.status),u(e)}))}},"get"==t&&Object.keys(r).length>0&&(n+=s.formatParams(r)),c.open(t,n,!0),e.next=6,s.setAuthHeadersForRequest(c);case 6:c.setRequestHeader("Content-type","application/json"),"post"==t||"patch"==t?c.send(JSON.stringify(r)):c.send();case 8:case"end":return e.stop()}},e,s)}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"formatParams",value:function(e){return"?"+Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}}]),e}(),y=r.SFMigrationManager=function(){function e(t,n,r,o){var s=this;a(this,e),this.modelManager=t,this.syncManager=n,this.storageManager=r,this.completionHandlers=[],this.loadMigrations();var u=!1,c=o.addEventHandler(function(e){e==p.DidSignInEvent&&(u=!0)});this.syncManager.addEventHandler(function(){var e=i(regeneratorRuntime.mark(function e(t,n){var r,i,a,l,f,p,h,d,y,v;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r="local-data-loaded"==t,i="sync:completed"==t,!r&&!i){e.next=40;break}if(r?s.receivedLocalDataEvent=!0:i&&(s.receivedSyncCompletedEvent=!0),!s.receivedLocalDataEvent||!s.receivedSyncCompletedEvent){e.next=40;break}if(!u){e.next=39;break}return u=!1,o.removeEventHandler(c),e.next=10,s.getCompletedMigrations();case 10:a=e.sent.slice(),l=!0,f=!1,p=void 0,e.prev=14,h=a[Symbol.iterator]();case 16:if(l=(d=h.next()).done){e.next=25;break}return y=d.value,e.next=20,s.migrationForEncodedName(y);case 20:v=e.sent,v.runOnlyOnce||_.pull(s._completed,y);case 22:l=!0,e.next=16;break;case 25:e.next=31;break;case 27:e.prev=27,e.t0=e.catch(14),f=!0,p=e.t0;case 31:e.prev=31,e.prev=32,!l&&h.return&&h.return();case 34:if(e.prev=34,!f){e.next=37;break}throw p;case 37:return e.finish(34);case 38:return e.finish(31);case 39:s.runPendingMigrations();case 40:case"end":return e.stop()}},e,s,[[14,27,31,39],[32,,34,38]])}));return function(t,n){return e.apply(this,arguments)}}())}return l(e,[{key:"addCompletionHandler",value:function(e){this.completionHandlers.push(e)}},{key:"removeCompletionHandler",value:function(e){_.pull(this.completionHandlers,e)}},{key:"migrationForEncodedName",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decode(t);case 2:return n=e.sent,e.abrupt("return",this.migrations.find(function(e){return e.name==n}));case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"loadMigrations",value:function(){this.migrations=this.registeredMigrations()}},{key:"registeredMigrations",value:function(){}},{key:"runPendingMigrations",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a,o,s,u,c,l,f,p,h,d,y,v,g,m,b,k,w,x,S,_,C,I,R,E,F;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPendingMigrations();case 2:for(t=e.sent,n=!0,r=!1,i=void 0,e.prev=6,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)s=o.value,s.items=[];e.next=14;break;case 10:e.prev=10,e.t0=e.catch(6),r=!0,i=e.t0;case 14:e.prev=14,e.prev=15,!n&&a.return&&a.return();case 17:if(e.prev=17,!r){e.next=20;break}throw i;case 20:return e.finish(17);case 21:return e.finish(14);case 22:u=!0,c=!1,l=void 0,e.prev=25,f=this.modelManager.allNondummyItems[Symbol.iterator]();case 27:if(u=(p=f.next()).done){e.next=51;break}for(h=p.value,d=!0,y=!1,v=void 0,e.prev=32,g=t[Symbol.iterator]();!(d=(m=g.next()).done);d=!0)s=m.value,h.content_type==s.content_type&&s.items.push(h);e.next=40;break;case 36:e.prev=36,e.t1=e.catch(32),y=!0,v=e.t1;case 40:e.prev=40,e.prev=41,!d&&g.return&&g.return();case 43:if(e.prev=43,!y){e.next=46;break}throw v;case 46:return e.finish(43);case 47:return e.finish(40);case 48:u=!0,e.next=27;break;case 51:e.next=57;break;case 53:e.prev=53,e.t2=e.catch(25),c=!0,l=e.t2;case 57:e.prev=57,e.prev=58,!u&&f.return&&f.return();case 60:if(e.prev=60,!c){e.next=63;break}throw l;case 63:return e.finish(60);case 64:return e.finish(57);case 65:b=!0,k=!1,w=void 0,e.prev=68,x=t[Symbol.iterator]();case 70:if(b=(S=x.next()).done){e.next=81;break}if(s=S.value,!(s.items&&s.items.length>0||s.customHandler)){e.next=77;break}return e.next=75,this.runMigration(s,s.items);case 75:e.next=78;break;case 77:this.markMigrationCompleted(s);case 78:b=!0,e.next=70;break;case 81:e.next=87;break;case 83:e.prev=83,e.t3=e.catch(68),k=!0,w=e.t3;case 87:e.prev=87,e.prev=88,!b&&x.return&&x.return();case 90:if(e.prev=90,!k){e.next=93;break}throw w;case 93:return e.finish(90);case 94:return e.finish(87);case 95:for(_=!0,C=!1,I=void 0,e.prev=98,R=this.completionHandlers[Symbol.iterator]();!(_=(E=R.next()).done);_=!0)(F=E.value)();e.next=106;break;case 102:e.prev=102,e.t4=e.catch(98),C=!0,I=e.t4;case 106:e.prev=106,e.prev=107,!_&&R.return&&R.return();case 109:if(e.prev=109,!C){e.next=112;break}throw I;case 112:return e.finish(109);case 113:return e.finish(106);case 114:case"end":return e.stop()}},e,this,[[6,10,14,22],[15,,17,21],[25,53,57,65],[32,36,40,48],[41,,43,47],[58,,60,64],[68,83,87,95],[88,,90,94],[98,102,106,114],[107,,109,113]])}));return e}()},{key:"encode",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.btoa(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"decode",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.atob(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"getCompletedMigrations",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._completed){e.next=5;break}return e.next=3,this.storageManager.getItem("migrations");case 3:t=e.sent,this._completed=t?JSON.parse(t):[];case 5:return e.abrupt("return",this._completed);case 6:case"end":return e.stop()}},e,this)}));return e}()},{key:"getPendingMigrations",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a,o,s,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCompletedMigrations();case 2:t=e.sent,n=[],r=!0,i=!1,a=void 0,e.prev=7,o=this.migrations[Symbol.iterator]();case 9:if(r=(s=o.next()).done){e.next=22;break}return u=s.value,e.t0=t,e.next=14,this.encode(u.name);case 14:if(e.t1=e.sent,e.t2=e.t0.indexOf.call(e.t0,e.t1),e.t3=-1,e.t2!=e.t3){e.next=19;break}n.push(u);case 19:r=!0,e.next=9;break;case 22:e.next=28;break;case 24:e.prev=24,e.t4=e.catch(7),i=!0,a=e.t4;case 28:e.prev=28,e.prev=29,!r&&o.return&&o.return();case 31:if(e.prev=31,!i){e.next=34;break}throw a;case 34:return e.finish(31);case 35:return e.finish(28);case 36:return e.abrupt("return",n);case 37:case"end":return e.stop()}},e,this,[[7,24,28,36],[29,,31,35]])}));return e}()},{key:"markMigrationCompleted",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCompletedMigrations();case 2:return n=e.sent,e.t0=n,e.next=6,this.encode(t.name);case 6:e.t1=e.sent,e.t0.push.call(e.t0,e.t1),this.storageManager.setItem("migrations",JSON.stringify(n)),t.running=!1;case 10:case"end":return e.stop()}},e,this)}));return e}()},{key:"runMigration",value:function(){function e(e,n){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n){var r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.running){e.next=2;break}return e.abrupt("return");case 2:if(console.log("Running migration:",t.name),t.running=!0,!t.customHandler){e.next=8;break}return e.abrupt("return",t.customHandler().then(function(){r.markMigrationCompleted(t)}));case 8:return e.abrupt("return",t.handler(n).then(function(){r.markMigrationCompleted(t)}));case 9:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),v=r.SFModelManager=function(){function e(t){a(this,e),e.MappingSourceRemoteRetrieved="MappingSourceRemoteRetrieved",e.MappingSourceRemoteSaved="MappingSourceRemoteSaved",e.MappingSourceLocalSaved="MappingSourceLocalSaved",e.MappingSourceLocalRetrieved="MappingSourceLocalRetrieved",e.MappingSourceComponentRetrieved="MappingSourceComponentRetrieved",e.MappingSourceDesktopInstalled="MappingSourceDesktopInstalled",e.MappingSourceRemoteActionRetrieved="MappingSourceRemoteActionRetrieved",e.MappingSourceFileImport="MappingSourceFileImport",e.isMappingSourceRetrieved=function(t){return[e.MappingSourceRemoteRetrieved,e.MappingSourceComponentRetrieved,e.MappingSourceRemoteActionRetrieved].includes(t)},this.$timeout=t||setTimeout.bind(window),this.itemSyncObservers=[],this.itemsPendingRemoval=[],this.items=[],this.itemsHash={},this.missedReferences={},this.uuidChangeObservers=[]}return l(e,[{key:"handleSignout",value:function(){this.items.length=0,this.itemsHash={},this.itemsPendingRemoval.length=0,this.missedReferences={}}},{key:"addModelUuidChangeObserver",value:function(e,t){this.uuidChangeObservers.push({id:e,callback:t})}},{key:"notifyObserversOfUuidChange",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var a,o=this.uuidChangeObservers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.callback(e,t)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}},{key:"alternateUUIDForItem",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r,i,a,o,s,u,c;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.createItem(n,!0),t.next=3,SFJS.crypto.generateUUID();case 3:for(r.uuid=t.sent,r.informReferencesOfUUIDChange(n.uuid,r.uuid),this.informModelsOfUUIDChangeForItem(r,n.uuid,r.uuid),i=!0,a=!1,o=void 0,t.prev=9,s=n.referencingObjects[Symbol.iterator]();!(i=(u=s.next()).done);i=!0)c=u.value,c.setIsNoLongerBeingReferencedBy(n),n.setIsNoLongerBeingReferencedBy(c),c.addItemAsRelationship(r),c.setDirty(!0);t.next=17;break;case 13:t.prev=13,t.t0=t.catch(9),a=!0,o=t.t0;case 17:t.prev=17,t.prev=18,!i&&s.return&&s.return();case 20:if(t.prev=20,!a){t.next=23;break}throw o;case 23:return t.finish(20);case 24:return t.finish(17);case 25:return this.resolveReferencesForItem(r),console.log(n.uuid,"--\x3e",r.uuid),n.deleted=!0,n.content.references=[],n.setDirty(!1),this.mapResponseItemsToLocalModels([n],e.MappingSourceLocalSaved),this.addItem(r),r.setDirty(!0),this.notifyObserversOfUuidChange(n,r),t.abrupt("return",r);case 35:case"end":return t.stop()}},t,this,[[9,13,17,25],[18,,20,24]])}));return t}()},{key:"informModelsOfUUIDChangeForItem",value:function(e,t,n){var r=!0,i=!1,a=void 0;try{for(var o,s=this.items[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){o.value.potentialItemOfInterestHasChangedItsUUID(e,t,n)}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}}},{key:"didSyncModelsOffline",value:function(t){this.notifySyncObserversOfModels(t,e.MappingSourceLocalSaved)}},{key:"mapResponseItemsToLocalModels",value:function(e,t,n){return this.mapResponseItemsToLocalModelsWithOptions({items:e,source:t,sourceKey:n})}},{key:"mapResponseItemsToLocalModelsOmittingFields",value:function(e,t,n,r){return this.mapResponseItemsToLocalModelsWithOptions({items:e,omitFields:t,source:n,sourceKey:r})}},{key:"mapResponseItemsToLocalModelsWithOptions",value:function(e){var t=e.items,n=e.omitFields,r=e.source,i=e.sourceKey,a=(e.options,[]),o=[],s=[],c=!0,l=!1,f=void 0;try{for(var p,h=t[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var d=p.value;if(d){var y=!d.content&&!d.errorDecrypting;if(!(!d.content_type||!d.uuid)&&!y||d.deleted){if(Array.isArray(n)){var v=!0,g=!1,m=void 0;try{for(var b,k=n[Symbol.iterator]();!(v=(b=k.next()).done);v=!0){delete d[b.value]}}catch(e){g=!0,m=e}finally{try{!v&&k.return&&k.return()}finally{if(g)throw m}}}var w=this.findItem(d.uuid);if(w&&(w.updateFromJSON(d),w.dummy=!1),this.itemsPendingRemoval.includes(d.uuid))_.pull(this.itemsPendingRemoval,d.uuid);else{var x=d.content_type||w&&w.content_type;if(!(this.acceptableContentTypes&&!this.acceptableContentTypes.includes(x))){var S=!1;if(1==d.deleted){if(!d.dirty){w&&(s.push(w),this.removeItemLocally(w));continue}S=!0}w||(w=this.createItem(d,!0)),this.addItem(w,S),w.errorDecrypting||s.push(w),a.push(w),o.push(d)}}}else console.error("Server response item is corrupt:",d)}}}catch(e){l=!0,f=e}finally{try{!c&&h.return&&h.return()}finally{if(l)throw f}}var C=!0,I=!1,R=void 0;try{for(var E,F=o.entries()[Symbol.iterator]();!(C=(E=F.next()).done);C=!0){var P=E.value,D=u(P,2),O=D[0],M=D[1],A=a[O];M.content&&this.resolveReferencesForItem(A),A.didFinishSyncing()}}catch(e){I=!0,R=e}finally{try{!C&&F.return&&F.return()}finally{if(I)throw R}}var T=this.popMissedReferenceStructsForObjects(o),N=!0,j=!1,B=void 0;try{for(var L,H=T[Symbol.iterator]();!(N=(L=H.next()).done);N=!0){var U=L.value;!function(e){var t=a.find(function(t){return t.uuid==e.reference_uuid});if(t){e.for_item.addItemAsRelationship(t)}}(U)}}catch(e){j=!0,B=e}finally{try{!N&&H.return&&H.return()}finally{if(j)throw B}}return this.notifySyncObserversOfModels(s,r,i),a}},{key:"missedReferenceBuildKey",value:function(e,t){return e+":"+t}},{key:"popMissedReferenceStructsForObjects",value:function(e){if(!e||0==e.length)return[];var t=[],n=[],r=e.map(function(e){return e.uuid}),i=r[0].length,a=Object.keys(this.missedReferences),o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;r.includes(f.substring(0,i))&&(t.push(this.missedReferences[f]),n.push(f))}}catch(e){s=!0,u=e}finally{try{!o&&l.return&&l.return()}finally{if(s)throw u}}var p=!0,h=!1,d=void 0;try{for(var y,v=n[Symbol.iterator]();!(p=(y=v.next()).done);p=!0){var g=y.value;delete this.missedReferences[g]}}catch(e){h=!0,d=e}finally{try{!p&&v.return&&v.return()}finally{if(h)throw d}}return t}},{key:"resolveReferencesForItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.errorDecrypting){var n=e.contentObject;if(e.updateLocalRelationships(),n.references){var r=n.references.slice(),i=r.map(function(e){return e.uuid}),a=this.findItems(i,!0),o=!0,s=!1,c=void 0;try{for(var l,f=a.entries()[Symbol.iterator]();!(o=(l=f.next()).done);o=!0){var p=l.value,h=u(p,2),d=h[0],y=h[1];if(y)e.addItemAsRelationship(y),t&&y.setDirty(!0);else{var v=i[d],g=this.missedReferenceBuildKey(v,e.uuid);if(!this.missedReferences[g]){var m={reference_uuid:v,for_item:e};this.missedReferences[g]=m}}}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}}}}},{key:"notifySyncObserversOfModels",value:function(e,t,n){var r=this,i=this.itemSyncObservers.sort(function(e,t){return e.priority0&&r._callSyncObserverCallbackWithTimeout(i,a,o,s,t,n)}(l)}}catch(e){o=!0,s=e}finally{try{!a&&c.return&&c.return()}finally{if(o)throw s}}}},{key:"_callSyncObserverCallbackWithTimeout",value:function(e,t,n,r,i,a){this.$timeout(function(){e.callback(t,n,r,i,a)})}},{key:"createItem",value:function(t,n){var r=e.ContentTypeClassMapping&&e.ContentTypeClassMapping[t.content_type];r||(r=x);var i=new r(t);return n||this.notifySyncObserversOfModels([i],e.MappingSourceLocalSaved),i}},{key:"createConflictedItem",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,SFJS.crypto.generateUUID();case 2:return n=e.sent,t=_.merge(t,{uuid:n}),r=this.createItem(t,!0),e.abrupt("return",r);case 6:case"end":return e.stop()}},e,this)}));return e}()},{key:"addConflictedItem",value:function(e,t){this.addItem(e);var n=!0,r=!1,i=void 0;try{for(var a,o=t.referencingObjects[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.addItemAsRelationship(e),s.setDirty(!0)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}this.resolveReferencesForItem(e),e.content.conflict_of=t.uuid,e.setDirty(!0)}},{key:"duplicateItem",value:function(e){var t=new e.constructor({content:e.content});t.created_at=e.created_at,t.content_type=e.content_type,this.addItem(t);var n=!0,r=!1,i=void 0;try{for(var a,o=e.referencingObjects[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.addItemAsRelationship(t),s.setDirty(!0)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return this.resolveReferencesForItem(t),t.setDirty(!0),t}},{key:"addItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.addItems([e],t)}},{key:"addItems",value:function(e){var t=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.forEach(function(e){t.itemsHash[e.uuid]||(t.itemsHash[e.uuid]=e,t.items.push(e))})}},{key:"addItemSyncObserver",value:function(e,t,n){this.addItemSyncObserverWithPriority({id:e,types:t,callback:n,priority:1})}},{key:"addItemSyncObserverWithPriority",value:function(e){var t=e.id,n=e.priority,r=e.types,i=e.callback;Array.isArray(r)||(r=[r]),this.itemSyncObservers.push({id:t,types:r,priority:n,callback:i})}},{key:"removeItemSyncObserver",value:function(e){_.remove(this.itemSyncObservers,_.find(this.itemSyncObservers,{id:e}))}},{key:"getDirtyItems",value:function(){return this.items.filter(function(e){return 1==e.dirty&&!e.dummy&&(!e.errorDecrypting||e.deleted)})}},{key:"clearDirtyItems",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){i.value.setDirty(!1)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}},{key:"setItemToBeDeleted",value:function(e){e.deleted=!0,e.dummy||e.setDirty(!0),this.removeAndDirtyAllRelationshipsForItem(e)}},{key:"removeAndDirtyAllRelationshipsForItem",value:function(e){if(!e.errorDecrypting){var t=!0,n=!1,r=void 0;try{for(var i,a=e.content.references[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=this.findItem(o.uuid);s&&(e.removeItemAsRelationship(s),s.hasRelationshipWithItem(e)&&(s.removeItemAsRelationship(e),s.setDirty(!0)))}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}var u=!0,c=!1,l=void 0;try{for(var f,p=e.referencingObjects[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var h=f.value;h.removeItemAsRelationship(e),h.setDirty(!0)}}catch(e){c=!0,l=e}finally{try{!u&&p.return&&p.return()}finally{if(c)throw l}}e.referencingObjects=[]}},{key:"setAllItemsDirty",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.allItems,n=!0,r=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.setDirty(!0,e)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}},{key:"removeItemLocally",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:_.remove(this.items,{uuid:t.uuid}),delete this.itemsHash[t.uuid],t.isBeingRemovedLocally(),this.itemsPendingRemoval.push(t.uuid);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"allItemsMatchingTypes",value:function(e){return this.allItems.filter(function(t){return(_.includes(e,t.content_type)||_.includes(e,"*"))&&!t.dummy})}},{key:"invalidItems",value:function(){return this.allItems.filter(function(e){return e.errorDecrypting})}},{key:"validItemsForContentType",value:function(e){return this.allItems.filter(function(t){return t.content_type==e&&!t.errorDecrypting})}},{key:"findItem",value:function(e){return this.itemsHash[e]}},{key:"findItems",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value,c=this.itemsHash[u];(c||t)&&n.push(c)}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}},{key:"itemsMatchingPredicate",value:function(e){return this.itemsMatchingPredicates([e])}},{key:"itemsMatchingPredicates",value:function(e){return this.filterItemsWithPredicates(this.allItems,e)}},{key:"filterItemsWithPredicates",value:function(e,t){return e.filter(function(e){var n=!0,r=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(!e.satisfiesPredicate(s))return!1}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return!0})}},{key:"importItems",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r,i,a,o,s,u,c,l,f,p,h,d,y,v,g,m;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=[],i=!0,a=!1,o=void 0,t.prev=4,s=n[Symbol.iterator]();case 6:if(i=(u=s.next()).done){t.next=21;break}if(c=u.value,!(l=this.findItem(c.uuid))||l.errorDecrypting){t.next=16;break}return t.next=12,this.createConflictedItem(c);case 12:f=t.sent,c.deleted||l.isItemContentEqualWith(f)||(this.addConflictedItem(f,l),r.push(f)),t.next=18;break;case 16:r.push(c),l&&l.errorDecrypting&&(l.errorDecrypting=!1);case 18:i=!0,t.next=6;break;case 21:t.next=27;break;case 23:t.prev=23,t.t0=t.catch(4),a=!0,o=t.t0;case 27:t.prev=27,t.prev=28,!i&&s.return&&s.return();case 30:if(t.prev=30,!a){t.next=33;break}throw o;case 33:return t.finish(30);case 34:return t.finish(27);case 35:for(p=this.mapResponseItemsToLocalModels(r,e.MappingSourceFileImport),h=!0,d=!1,y=void 0,t.prev=39,v=p[Symbol.iterator]();!(h=(g=v.next()).done);h=!0)m=g.value,m.setDirty(!0,!0),m.deleted=!1;t.next=47;break;case 43:t.prev=43,t.t1=t.catch(39),d=!0,y=t.t1;case 47:t.prev=47,t.prev=48,!h&&v.return&&v.return();case 50:if(t.prev=50,!d){t.next=53;break}throw y;case 53:return t.finish(50);case 54:return t.finish(47);case 55:return t.abrupt("return",p);case 56:case"end":return t.stop()}},t,this,[[4,23,27,35],[28,,30,34],[39,43,47,55],[48,,50,54]])}));return t}()},{key:"getAllItemsJSONData",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.getJSONDataForItems(this.allItems,t,n,r));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"getJSONDataForItems",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(t.map(function(e){return new S(e,n,r).paramsForExportFile()})).then(function(e){if(i&&0==e.length)return null;var t={items:e};return n&&(t.auth_params=r),JSON.stringify(t,null,2)}));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"computeDataIntegrityHash",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=this.allNondummyItems.sort(function(e,t){return t.updated_at-e.updated_at}),n=t.map(function(e){return e.updatedAtTimestamp()}),r=n.join(","),e.next=6,SFJS.crypto.sha256(r);case 6:return i=e.sent,e.abrupt("return",i);case 10:return e.prev=10,e.t0=e.catch(0),console.error("Error computing data integrity hash",e.t0),e.abrupt("return",null);case 14:case"end":return e.stop()}},e,this,[[0,10]])}));return e}()},{key:"allItems",get:function(){return this.items.slice()}},{key:"allNondummyItems",get:function(){return this.items.filter(function(e){return!e.dummy})}}]),e}(),g=r.SFPrivilegesManager=function(){function e(t,n,r){a(this,e),this.modelManager=t,this.syncManager=n,this.singletonManager=r,this.loadPrivileges(),e.CredentialAccountPassword="CredentialAccountPassword",e.CredentialLocalPasscode="CredentialLocalPasscode",e.ActionManageExtensions="ActionManageExtensions",e.ActionManageBackups="ActionManageBackups",e.ActionViewProtectedNotes="ActionViewProtectedNotes",e.ActionManagePrivileges="ActionManagePrivileges",e.ActionManagePasscode="ActionManagePasscode",e.ActionDeleteNote="ActionDeleteNote",e.SessionExpiresAtKey="SessionExpiresAtKey",e.SessionLengthKey="SessionLengthKey",e.SessionLengthNone=0,e.SessionLengthFiveMinutes=300,e.SessionLengthOneHour=3600,e.SessionLengthOneWeek=604800,this.availableActions=[e.ActionViewProtectedNotes,e.ActionDeleteNote,e.ActionManagePasscode,e.ActionManageBackups,e.ActionManageExtensions,e.ActionManagePrivileges],this.availableCredentials=[e.CredentialAccountPassword,e.CredentialLocalPasscode],this.sessionLengths=[e.SessionLengthNone,e.SessionLengthFiveMinutes,e.SessionLengthOneHour,e.SessionLengthOneWeek,e.SessionLengthIndefinite]}return l(e,[{key:"setDelegate",value:function(e){this.delegate=e}},{key:"getAvailableActions",value:function(){return this.availableActions}},{key:"getAvailableCredentials",value:function(){return this.availableCredentials}},{key:"netCredentialsForAction",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r,i,a,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getPrivileges();case 2:t.t0=n,r=t.sent.getCredentialsForAction(t.t0),i=[],a=!0,o=!1,s=void 0,t.prev=8,u=r[Symbol.iterator]();case 10:if(a=(c=u.next()).done){t.next=27;break}if((l=c.value)!=e.CredentialAccountPassword){t.next=19;break}return t.next=15,this.delegate.isOffline();case 15:f=t.sent,f||i.push(l),t.next=24;break;case 19:if(l!=e.CredentialLocalPasscode){t.next=24;break}return t.next=22,this.delegate.hasLocalPasscode();case 22:p=t.sent,p&&i.push(l);case 24:a=!0,t.next=10;break;case 27:t.next=33;break;case 29:t.prev=29,t.t1=t.catch(8),o=!0,s=t.t1;case 33:t.prev=33,t.prev=34,!a&&u.return&&u.return();case 36:if(t.prev=36,!o){t.next=39;break}throw s;case 39:return t.finish(36);case 40:return t.finish(33);case 41:return t.abrupt("return",i);case 42:case"end":return t.stop()}},t,this,[[8,29,33,41],[34,,36,40]])}));return t}()},{key:"loadPrivileges",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.loadPromise){e.next=2;break}return e.abrupt("return",this.loadPromise);case 2:return this.loadPromise=new Promise(function(e,n){var r=I.contentType(),a=new C("content_type","=",r);t.singletonManager.registerSingleton([a],function(n){t.privileges=n,e(n)},function(){var n=i(regeneratorRuntime.mark(function n(i){var a;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=new I({content_type:r}),SFJS.crypto.generateUUIDSync){n.next=4;break}return n.next=4,a.initUUID();case 4:t.modelManager.addItem(a),a.setDirty(!0),t.syncManager.sync(),i(a),e(a);case 9:case"end":return n.stop()}},n,t)}));return function(e){return n.apply(this,arguments)}}())}),e.abrupt("return",this.loadPromise);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"getPrivileges",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.privileges){e.next=4;break}return e.abrupt("return",this.privileges);case 4:return e.abrupt("return",this.loadPrivileges());case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"displayInfoForCredential",value:function(t){var n={};return n[e.CredentialAccountPassword]={label:"Account Password",prompt:"Please enter your account password."},n[e.CredentialLocalPasscode]={label:"Local Passcode",prompt:"Please enter your local passcode."},n[t]}},{key:"displayInfoForAction",value:function(t){var n={};return n[e.ActionManageExtensions]={label:"Manage Extensions"},n[e.ActionManageBackups]={label:"Download/Import Backups"},n[e.ActionViewProtectedNotes]={label:"View Protected Notes"},n[e.ActionManagePrivileges]={label:"Manage Privileges"},n[e.ActionManagePasscode]={label:"Manage Passcode"},n[e.ActionDeleteNote]={label:"Delete Notes"},n[t]}},{key:"getSessionLengthOptions",value:function(){return[{value:e.SessionLengthNone,label:"Don't Remember"},{value:e.SessionLengthFiveMinutes,label:"5 Minutes"},{value:e.SessionLengthOneHour,label:"1 Hour"},{value:e.SessionLengthOneWeek,label:"1 Week"}]}},{key:"setSessionLength",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r,i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=function(e){var t=new Date;return t.setSeconds(t.getSeconds()+e),t},i=r(n),t.abrupt("return",Promise.all([this.delegate.saveToStorage(e.SessionExpiresAtKey,JSON.stringify(i)),this.delegate.saveToStorage(e.SessionLengthKey,JSON.stringify(n))]));case 3:case"end":return t.stop()}},t,this)}));return t}()},{key:"clearSession",value:function(){function t(){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.setSessionLength(e.SessionLengthNone));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"getSelectedSessionLength",value:function(){function t(){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.delegate.getFromStorage(e.SessionLengthKey);case 2:if(!(n=t.sent)){t.next=7;break}return t.abrupt("return",JSON.parse(n));case 7:return t.abrupt("return",e.SessionLengthNone);case 8:case"end":return t.stop()}},t,this)}));return t}()},{key:"getSessionExpirey",value:function(){function t(){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.delegate.getFromStorage(e.SessionExpiresAtKey);case 2:if(!(n=t.sent)){t.next=7;break}return t.abrupt("return",new Date(JSON.parse(n)));case 7:return t.abrupt("return",new Date);case 8:case"end":return t.stop()}},t,this)}));return t}()},{key:"actionHasPrivilegesConfigured",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.netCredentialsForAction(t);case 2:return e.t0=e.sent.length,e.abrupt("return",e.t0>0);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"actionRequiresPrivilege",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSessionExpirey();case 2:if(!((n=e.sent)>new Date)){e.next=5;break}return e.abrupt("return",!1);case 5:return e.next=7,this.netCredentialsForAction(t);case 7:return r=e.sent,e.abrupt("return",r.length>0);case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"savePrivileges",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPrivileges();case 2:t=e.sent,t.setDirty(!0),this.syncManager.sync();case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"authenticateAction",value:function(){function e(e,n){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n){var r,i,a,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.netCredentialsForAction(t);case 2:r=e.sent,i=[],a=[],o=!0,s=!1,u=void 0,e.prev=7,c=r[Symbol.iterator]();case 9:if(o=(l=c.next()).done){e.next=18;break}return f=l.value,e.next=13,this._verifyAuthenticationParameters(f,n[f]);case 13:p=e.sent,p?i.push(f):a.push(f);case 15:o=!0,e.next=9;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(7),s=!0,u=e.t0;case 24:e.prev=24,e.prev=25,!o&&c.return&&c.return();case 27:if(e.prev=27,!s){e.next=30;break}throw u;case 30:return e.finish(27);case 31:return e.finish(24);case 32:return e.abrupt("return",{success:0==a.length,successfulCredentials:i,failedCredentials:a});case 33:case"end":return e.stop()}},e,this,[[7,20,24,32],[25,,27,31]])}));return e}()},{key:"_verifyAuthenticationParameters",value:function(){function t(e,t){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n,r){var a,o,s=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=function(){var e=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s.delegate.verifyAccountPassword(t));case 1:case"end":return e.stop()}},e,s)}));return function(t){return e.apply(this,arguments)}}(),o=function(){var e=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s.delegate.verifyLocalPasscode(t));case 1:case"end":return e.stop()}},e,s)}));return function(t){return e.apply(this,arguments)}}(),n!=e.CredentialAccountPassword){t.next=6;break}return t.abrupt("return",a(r));case 6:if(n!=e.CredentialLocalPasscode){t.next=8;break}return t.abrupt("return",o(r));case 8:case"end":return t.stop()}},t,this)}));return t}()}]),e}(),m=r.SFSessionHistoryManager=function(){function e(t,n,r,i,o){var s=this;a(this,e),this.modelManager=t,this.storageManager=n,this.$timeout=o||setTimeout.bind(window),this.keyRequestHandler=r,this.loadFromDisk().then(function(){s.modelManager.addItemSyncObserver("session-history",i,function(e,t,n,r,i){var a=!0,o=!1,u=void 0;try{for(var c,l=e[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value;try{s.addHistoryEntryForItem(f)}catch(e){console.log("Caught exception while trying to add item history entry",e)}}}catch(e){o=!0,u=e}finally{try{!a&&l.return&&l.return()}finally{if(o)throw u}}})})}return l(e,[{key:"encryptionParams",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.keyRequestHandler());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"addHistoryEntryForItem",value:function(e){var t=this,n={uuid:e.uuid,content_type:e.content_type,updated_at:e.updated_at,content:e.content},r=this.historySession.addEntryForItem(n);this.autoOptimize&&this.historySession.optimizeHistoryForItem(e),r&&this.diskEnabled&&(this.diskTimeout&&(this.$timeout.hasOwnProperty("cancel")?this.$timeout.cancel(this.diskTimeout):clearTimeout(this.diskTimeout)),this.diskTimeout=this.$timeout(function(){t.saveToDisk()},2e3))}},{key:"historyForItem",value:function(e){return this.historySession.historyForItem(e)}},{key:"clearHistoryForItem",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.historySession.clearItemHistory(t),e.abrupt("return",this.saveToDisk());case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"clearAllHistory",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.historySession.clearAllHistory(),e.abrupt("return",this.storageManager.removeItem("sessionHistory_revisions"));case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"toggleDiskSaving",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.diskEnabled=!this.diskEnabled,!this.diskEnabled){e.next=6;break}this.storageManager.setItem("sessionHistory_persist",JSON.stringify(!0)),this.saveToDisk(),e.next=8;break;case 6:return this.storageManager.setItem("sessionHistory_persist",JSON.stringify(!1)),e.abrupt("return",this.storageManager.removeItem("sessionHistory_revisions"));case 8:case"end":return e.stop()}},e,this)}));return e}()},{key:"saveToDisk",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.diskEnabled){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.encryptionParams();case 4:t=e.sent,n=new S(this.historySession,t.keys,t.auth_params),n.paramsForSync().then(function(e){r.storageManager.setItem("sessionHistory_revisions",JSON.stringify(e))});case 7:case"end":return e.stop()}},e,this)}));return e}()},{key:"loadFromDisk",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.storageManager.getItem("sessionHistory_persist");case 2:return t=e.sent,t&&(this.diskEnabled=JSON.parse(t)),e.next=6,this.storageManager.getItem("sessionHistory_revisions");case 6:if(!(n=e.sent)){e.next=18;break}return n=JSON.parse(n),e.next=11,this.encryptionParams();case 11:return r=e.sent,e.next=14,SFJS.itemTransformer.decryptItem(n,r.keys);case 14:i=new R(n),this.historySession=i,e.next=19;break;case 18:this.historySession=new R;case 19:return e.next=21,this.storageManager.getItem("sessionHistory_autoOptimize");case 21:a=e.sent,this.autoOptimize=!a||JSON.parse(a);case 23:case"end":return e.stop()}},e,this)}));return e}()},{key:"toggleAutoOptimize",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.autoOptimize=!this.autoOptimize,this.autoOptimize?this.storageManager.setItem("sessionHistory_autoOptimize",JSON.stringify(!0)):this.storageManager.setItem("sessionHistory_autoOptimize",JSON.stringify(!1));case 2:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),b=r.SFSingletonManager=function(){function e(t,n){var r=this;a(this,e),this.syncManager=n,this.modelManager=t,this.singletonHandlers=[],t.addItemSyncObserverWithPriority({id:"sf-singleton-manager",types:"*",priority:-1,callback:function(){r.resolveSingletons(t.allNondummyItems,null,!0)}}),n.addEventHandler(function(e,n){if("local-data-loaded"==e)r.resolveSingletons(t.allNondummyItems,null,!0),r.initialDataLoaded=!0;else if("sync:completed"==e){if(!r.initialDataLoaded)return;r.resolveSingletons(n.retrievedItems,n.savedItems)}}),t.addModelUuidChangeObserver("singleton-manager",function(e,t){var n=!0,i=!1,a=void 0;try{for(var o,s=r.singletonHandlers[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;u.singleton&&C.ItemSatisfiesPredicates(t,u.predicates)&&(u.singleton=null,r.resolveSingletons([t]))}}catch(e){i=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}})}return l(e,[{key:"registerSingleton",value:function(e,t,n){this.singletonHandlers.push({predicates:e,resolutionCallback:t,createBlock:n})}},{key:"resolveSingletons",value:function(e,t,n){var r=this;e=e||[],t=t||[];var i=!0,a=!1,o=void 0;try{for(var s,u=this.singletonHandlers[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;!function(i){var a=i.predicates.slice(),o=r.modelManager.filterItemsWithPredicates(e,a),s=function(){i.createBlock&&(i.pendingCreateBlockCallback=!0,i.createBlock(function(e){i.singleton=e,i.pendingCreateBlockCallback=!1,i.resolutionCallback&&i.resolutionCallback(e)}))},u=r.modelManager.filterItemsWithPredicates(t,a).length;if(o.length>0||u>0){var c=r.modelManager.itemsMatchingPredicates(a);if(c.length>=2){var l=c.sort(function(e,t){return e.errorDecrypting?1:t.errorDecrypting?-1:e.created_at=this.MaxDiscordanceBeforeOutOfSync&&(this.outOfSync||(this.outOfSync=!0,this.notifyEvent("enter-out-of-sync"))),e.abrupt("return",!1);case 13:return this.outOfSync&&(this.outOfSync=!1,this.notifyEvent("exit-out-of-sync")),this.syncDiscordance=0,e.abrupt("return",!0);case 16:case"end":return e.stop()}},e,this)}));return e}()},{key:"isOutOfSync",value:function(){return this.outOfSync}},{key:"getServerURL",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.storageManager.getItem("server");case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0=window._default_sf_server;case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}},e,this)}));return e}()},{key:"getSyncURL",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getServerURL();case 2:return e.t0=e.sent,e.abrupt("return",e.t0+"/items/sync");case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"registerSyncStatusObserver",value:function(e){var t={key:new Date,callback:e};return this.syncStatusObservers.push(t),t}},{key:"removeSyncStatusObserver",value:function(e){_.pull(this.syncStatusObservers,e)}},{key:"syncStatusDidChange",value:function(){var e=this;this.syncStatusObservers.forEach(function(t){t.callback(e.syncStatus)})}},{key:"addEventHandler",value:function(e){return this.eventHandlers.push(e),e}},{key:"removeEventHandler",value:function(e){_.pull(this.eventHandlers,e)}},{key:"notifyEvent",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var a,o=this.eventHandlers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){(0,a.value)(e,t||{})}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}},{key:"setKeyRequestHandler",value:function(e){this.keyRequestHandler=e}},{key:"getActiveKeyInfo",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.keyRequestHandler(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"initialDataLoaded",value:function(){return this._initialDataLoaded}},{key:"loadLocalItems",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.storageManager.getAllModels().then(function(t){t=t.sort(function(e,t){var n=new Date(t.updated_at)-new Date(e.updated_at),i=r.contentTypeLoadPriority,a=0,o=0;return i&&(a=i.indexOf(e.content_type),o=i.indexOf(t.content_type),-1==a&&(a=i.length),-1==o&&(o=i.length)),a==o?n:a5&&(this.notifyEvent("sync:taking-too-long"),this.stopCheckingIfSyncIsTakingTooLong())}.bind(this),500)}},{key:"stopCheckingIfSyncIsTakingTooLong",value:function(){this.$interval.hasOwnProperty("cancel")?this.$interval.cancel(this.syncStatus.checker):clearInterval(this.syncStatus.checker),this.syncStatus.checker=null}},{key:"lockSyncing",value:function(){this.syncLocked=!0}},{key:"unlockSyncing",value:function(){this.syncLocked=!1}},{key:"sync",value:function(){function t(){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=i(regeneratorRuntime.mark(function t(i,a){var o,s,u,c,l,f,p,h,d,y,v,g,m;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.syncLocked){t.next=4;break}return console.log("Sync Locked, Returning;"),i(),t.abrupt("return");case 4:if(r||(r={}),o=n.modelManager.getDirtyItems(),s=o.filter(function(e){return e.dirtyCount>0&&(e.dirtyCount=0,!0)}),!n.syncStatus.syncOpInProgress||r.force){t.next=14;break}return n.repeatOnCompletion=!0,n.queuedCallbacks.push(i),t.next=12,n.writeItemsToLocalStorage(s,!1);case 12:return console.log("Sync op in progress; returning."),t.abrupt("return");case 14:return t.next=16,n.getActiveKeyInfo(e.KeyRequestLoadSaveAccount);case 16:if(u=t.sent,!u.offline){t.next=20;break}return n.syncOffline(o).then(function(e){n.modelManager.clearDirtyItems(o),i(e)}).catch(function(e){n.notifyEvent("sync-exception",e)}),t.abrupt("return");case 20:return c=n.syncStatus.needsMoreSync,n.syncStatus.syncOpInProgress=!0,n.syncStatus.syncStart=new Date,n.beginCheckingIfSyncIsTakingTooLong(),l=n.PerSyncItemUploadLimit,f=o.slice(0,l),f.lengthn.syncStatus.total&&(n.syncStatus.total=n.syncStatus.current),n.syncStatusDidChange(),t.next=32,n.writeItemsToLocalStorage(s,!1);case 32:return r.onPreSyncSave&&r.onPreSyncSave(),n.allRetreivedItems||(n.allRetreivedItems=[]),n.allSavedItems||(n.allSavedItems=[]),p={},p.limit=150,r.performIntegrityCheck&&(p.compute_integrity=!0),t.prev=38,t.next=41,Promise.all(f.map(function(e){var t=new S(e,u.keys,u.auth_params);return t.additionalFields=r.additionalFields,t.paramsForSync()})).then(function(e){p.items=e});case 41:t.next=46;break;case 43:t.prev=43,t.t0=t.catch(38),n.notifyEvent("sync-exception",t.t0);case 46:for(h=!0,d=!1,y=void 0,t.prev=49,v=f[Symbol.iterator]();!(h=(g=v.next()).done);h=!0)m=g.value,m.dirtyCount=0;t.next=57;break;case 53:t.prev=53,t.t1=t.catch(49),d=!0,y=t.t1;case 57:t.prev=57,t.prev=58,!h&&v.return&&v.return();case 60:if(t.prev=60,!d){t.next=63;break}throw y;case 63:return t.finish(60);case 64:return t.finish(57);case 65:return t.next=67,n.getSyncToken();case 67:return p.sync_token=t.sent,t.next=70,n.getCursorToken();case 70:return p.cursor_token=t.sent,t.prev=71,t.t2=n.httpManager,t.next=75,n.getSyncURL();case 75:t.t3=t.sent,t.t4=p,t.t5=function(e){n.handleSyncSuccess(f,e,r).then(function(){i(e)}).catch(function(e){console.log("Caught sync success exception:",e),n.handleSyncError(null,null,o).then(function(e){i(e)})})},t.t6=function(e,t){n.handleSyncError(e,t,o).then(function(e){i(e)})},t.t2.postAbsolute.call(t.t2,t.t3,t.t4,t.t5,t.t6),t.next=85;break;case 82:t.prev=82,t.t7=t.catch(71),console.log("Sync exception caught:",t.t7);case 85:case"end":return t.stop()}},t,n,[[38,43],[49,53,57,65],[58,,60,64],[71,82]])}));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"handleSyncSuccess",value:function(){function t(e,t,r){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n,r,i){var a,o,s,u,c,l,f,p,h,d,y,g,m,b,k=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(a=[],o=!0,s=!1,u=void 0,t.prev=4,c=n[Symbol.iterator]();!(o=(l=c.next()).done);o=!0)f=l.value,0==f.dirtyCount&&a.push(f);t.next=12;break;case 8:t.prev=8,t.t0=t.catch(4),s=!0,u=t.t0;case 12:t.prev=12,t.prev=13,!o&&c.return&&c.return();case 15:if(t.prev=15,!s){t.next=18;break}throw u;case 18:return t.finish(15);case 19:return t.finish(12);case 20:return this.modelManager.clearDirtyItems(a),this.syncStatus.error=null,p=this.allSavedItems.map(function(e){return e.uuid}),r.retrieved_items=r.retrieved_items.filter(function(e){return!p.includes(e.uuid)}),t.next=26,this.handleItemsResponse(r.retrieved_items,null,v.MappingSourceRemoteRetrieved,e.KeyRequestLoadSaveAccount);case 26:return h=t.sent,this.allRetreivedItems=this.allRetreivedItems.concat(h),this.syncStatus.retrievedCount=this.allRetreivedItems.length,d=["content","auth_hash"],t.next=32,this.handleItemsResponse(r.saved_items,d,v.MappingSourceRemoteSaved,e.KeyRequestLoadSaveAccount);case 32:return y=t.sent,this.allSavedItems=this.allSavedItems.concat(y),g=r.unsaved,t.next=37,this.handleUnsavedItemsResponse(g);case 37:return t.next=39,this.writeItemsToLocalStorage(y,!1);case 39:return t.next=41,this.writeItemsToLocalStorage(h,!1);case 41:if(this.syncStatus.syncOpInProgress=!1,this.syncStatus.current+=n.length,this.syncStatusDidChange(),this.setSyncToken(r.sync_token),this.setCursorToken(r.cursor_token),this.stopCheckingIfSyncIsTakingTooLong(),!r.integrity_hash||r.cursor_token){t.next=52;break}return t.next=50,this.handleServerIntegrityHash(r.integrity_hash);case 50:m=t.sent,m||this.syncDiscordance=this.majorDataChangeThreshold||y.length>=this.majorDataChangeThreshold||g.length>=this.majorDataChangeThreshold)&&this.notifyEvent("major-data-change"),this.callQueuedCallbacks(r),this.notifyEvent("sync:completed",{retrievedItems:this.allRetreivedItems,savedItems:this.allSavedItems,unsavedItems:g}),this.allRetreivedItems=[],this.allSavedItems=[],t.abrupt("return",r);case 72:case"end":return t.stop()}},t,this,[[4,8,12,20],[13,,15,19]])}));return t}()},{key:"handleSyncError",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("Sync error: ",t),401==n&&this.notifyEvent("sync-session-invalid"),t?"string"==typeof t&&(t={error:{message:t}}):t={error:{message:"Could not connect to server."}},this.syncStatus.syncOpInProgress=!1,this.syncStatus.error=t.error,this.syncStatusDidChange(),this.writeItemsToLocalStorage(r,!1),this.modelManager.didSyncModelsOffline(r),this.stopCheckingIfSyncIsTakingTooLong(),this.notifyEvent("sync:error",t.error),this.callQueuedCallbacks({error:"Sync error"}),e.abrupt("return",t);case 12:case"end":return e.stop()}},e,this)}));return e}()},{key:"handleItemsResponse",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){var a,o,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getActiveKeyInfo(i);case 2:return a=e.sent.keys,e.next=5,SFJS.itemTransformer.decryptMultipleItems(t,a);case 5:return o=this.modelManager.mapResponseItemsToLocalModelsOmittingFields(t,n,r),s=o.filter(function(e){var t=e.errorDecryptingValueChanged;return e.errorDecryptingValueChanged=!1,t}),s.length>0&&this.writeItemsToLocalStorage(s,!1),e.abrupt("return",o);case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"refreshErroredItems",value:function(){function t(){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.modelManager.allNondummyItems.filter(function(e){return 1==e.errorDecrypting}),!(n.length>0)){t.next=3;break}return t.abrupt("return",this.handleItemsResponse(n,null,v.MappingSourceLocalRetrieved,e.KeyRequestLoadSaveAccount));case 3:case"end":return t.stop()}},t,this)}));return t}()},{key:"handleUnsavedItemsResponse",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r,i,a,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=n.length){t.next=2;break}return t.abrupt("return");case 2:console.log("Handle Conflicted Items:",n),r=!0,i=!1,a=void 0,t.prev=6,o=n[Symbol.iterator]();case 8:if(r=(s=o.next()).done){t.next=35;break}return u=s.value,c=u.item,t.t0=SFJS.itemTransformer,t.t1=[c],t.next=15,this.getActiveKeyInfo(e.KeyRequestLoadSaveAccount);case 15:return t.t2=t.sent.keys,t.next=18,t.t0.decryptMultipleItems.call(t.t0,t.t1,t.t2);case 18:if(l=this.modelManager.findItem(c.uuid)){t.next=21;break}return t.abrupt("continue",32);case 21:if(f=u.error,"uuid_conflict"!==f.tag){t.next=27;break}return t.next=25,this.modelManager.alternateUUIDForItem(l);case 25:t.next=32;break;case 27:if("sync_conflict"!==f.tag){t.next=32;break}return t.next=30,this.modelManager.createConflictedItem(c);case 30:p=t.sent,c.deleted||l.isItemContentEqualWith(p)||this.modelManager.addConflictedItem(p,l);case 32:r=!0,t.next=8;break;case 35:t.next=41;break;case 37:t.prev=37,t.t3=t.catch(6),i=!0,a=t.t3;case 41:t.prev=41,t.prev=42,!r&&o.return&&o.return();case 44:if(t.prev=44,!i){t.next=47;break}throw a;case 47:return t.finish(44);case 48:return t.finish(41);case 49:this.sync(null,{additionalFields:["created_at","updated_at"]});case 50:case"end":return t.stop()}},t,this,[[6,37,41,49],[42,,44,48]])}));return t}()},{key:"stateless_downloadAllItems",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var r=i(regeneratorRuntime.mark(function r(a,o){var s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return s={limit:n.limit||500,sync_token:n.syncToken,cursor_token:n.cursorToken,content_type:n.contentType,event:n.event},r.prev=1,r.t0=t.httpManager,r.next=5,t.getSyncURL();case 5:r.t1=r.sent,r.t2=s,r.t3=function(){var r=i(regeneratorRuntime.mark(function r(i){var o,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n.retrievedItems||(n.retrievedItems=[]),o=i.retrieved_items,r.next=4,t.getActiveKeyInfo(e.KeyRequestLoadSaveAccount);case 4:return s=r.sent.keys,r.next=7,SFJS.itemTransformer.decryptMultipleItems(o,s);case 7:n.retrievedItems=n.retrievedItems.concat(o.map(function(e){return t.modelManager.createItem(e,!0)})),n.syncToken=i.sync_token,n.cursorToken=i.cursor_token,n.cursorToken?t.stateless_downloadAllItems(n).then(a):a(n.retrievedItems);case 11:case"end":return r.stop()}},r,t)}));return function(e){return r.apply(this,arguments)}}(),r.t4=function(e,t){o(e)},r.t0.postAbsolute.call(r.t0,r.t1,r.t2,r.t3,r.t4),r.next=16;break;case 12:r.prev=12,r.t5=r.catch(1),console.log("Download all items exception caught:",r.t5),o(r.t5);case 16:case"end":return r.stop()}},r,t,[[1,12]])}));return function(e,t){return r.apply(this,arguments)}}())}},{key:"resolveOutOfSync",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stateless_downloadAllItems({event:"resolve-out-of-sync"}).then(function(){var e=i(regeneratorRuntime.mark(function e(n){var r,i,a,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=[],i=!0,a=!1,o=void 0,e.prev=4,s=n[Symbol.iterator]();case 6:if(i=(u=s.next()).done){e.next=20;break}if(c=u.value,!(l=t.modelManager.findItem(c.uuid))){e.next=16;break}if(!(f=!c.isItemContentEqualWith(l))){e.next=16;break}return e.next=14,t.modelManager.createConflictedItem(l,l);case 14:p=e.sent,t.modelManager.addConflictedItem(p,l);case 16:r.push(c);case 17:i=!0,e.next=6;break;case 20:e.next=26;break;case 22:e.prev=22,e.t0=e.catch(4),a=!0,o=e.t0;case 26:e.prev=26,e.prev=27,!i&&s.return&&s.return();case 29:if(e.prev=29,!a){e.next=32;break}throw o;case 32:return e.finish(29);case 33:return e.finish(26);case 34:return t.modelManager.mapResponseItemsToLocalModelsWithOptions({items:r,source:v.MappingSourceRemoteRetrieved}),e.next=37,t.writeItemsToLocalStorage(t.modelManager.allNondummyItems);case 37:return e.abrupt("return",t.sync({performIntegrityCheck:!0}));case 38:case"end":return e.stop()}},e,t,[[4,22,26,34],[27,,29,33]])}));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"handleSignout",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this._syncToken=null,this._cursorToken=null,this._queuedCallbacks=[],this.syncStatus={};case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"clearSyncToken",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this._syncToken=null,this._cursorToken=null,e.abrupt("return",this.storageManager.removeItem("syncToken"));case 3:case"end":return e.stop()}},e,this)}));return e}()},{key:"queuedCallbacks",get:function(){return this._queuedCallbacks||(this._queuedCallbacks=[]),this._queuedCallbacks}}]),e}(),x=r.SFItem=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.content={},this.referencingObjects=[],this.updateFromJSON(t),this.uuid||"undefined"!=typeof SFJS&&SFJS.crypto.generateUUIDSync&&(this.uuid=SFJS.crypto.generateUUIDSync()),"object"!==c(this.content)||this.content.references||(this.content.references=[])}return l(e,[{key:"initUUID",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.uuid){e.next=4;break}return e.next=3,SFJS.crypto.generateUUID();case 3:this.uuid=e.sent;case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"updateFromJSON",value:function(t){if(t){this.created_at=t.created_at,this.updated_at=t.updated_at,this.deleted=t.deleted,this.uuid=t.uuid,this.enc_item_key=t.enc_item_key,this.auth_hash=t.auth_hash,this.auth_params=t.auth_params;var n=["errorDecrypting","dirty","dirtyCount","dummy"],r=!0,i=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;void 0!==t[u]&&(this[u]=t[u])}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}if(this.content_type||(this.content_type=t.content_type),t.errorDecrypting)this.content=t.content;else try{var c="string"==typeof t.content?JSON.parse(t.content):t.content;e.deepMerge(this.contentObject,c)}catch(e){console.log("Error while updating item from json",e)}this.created_at?(this.created_at=new Date(this.created_at),this.updated_at=new Date(this.updated_at)):(this.created_at=new Date,this.updated_at=new Date),this._client_updated_at=null,t.content?this.mapContentToLocalProperties(this.contentObject):1==t.deleted&&this.handleDeletedContent()}}},{key:"mapContentToLocalProperties",value:function(e){}},{key:"createContentJSONFromProperties",value:function(){var t=this.structureParams();return e.deepMerge(this.contentObject,t),t}},{key:"structureParams",value:function(){return this.getContentCopy()}},{key:"handleDeletedContent",value:function(){}},{key:"setDirty",value:function(e,t){this.dirty=e,this.dirtyCount||(this.dirtyCount=0),e?this.dirtyCount++:this.dirtyCount=0,e&&!t?this.client_updated_at=new Date:this.hasRawClientUpdatedAtValue()||(this.client_updated_at=new Date(this.updated_at))}},{key:"updateLocalRelationships",value:function(){}},{key:"addItemAsRelationship",value:function(e){if(e.setIsBeingReferencedBy(this),!this.hasRelationshipWithItem(e)){var t=this.content.references||[];t.push({uuid:e.uuid,content_type:e.content_type}),this.content.references=t}}},{key:"removeItemAsRelationship",value:function(e){e.setIsNoLongerBeingReferencedBy(this),this.removeReferenceWithUuid(e.uuid)}},{key:"setIsBeingReferencedBy",value:function(e){_.find(this.referencingObjects,{uuid:e.uuid})||this.referencingObjects.push(e)}},{key:"setIsNoLongerBeingReferencedBy",value:function(e){_.remove(this.referencingObjects,{uuid:e.uuid}),this.hasRelationshipWithItem(e)&&(this.removeReferenceWithUuid(e.uuid),this.setDirty(!0))}},{key:"removeReferenceWithUuid",value:function(e){var t=this.content.references||[];t=t.filter(function(t){return t.uuid!=e}),this.content.references=t}},{key:"hasRelationshipWithItem",value:function(e){return null!=this.content.references.find(function(t){return t.uuid==e.uuid})}},{key:"isBeingRemovedLocally",value:function(){}},{key:"didFinishSyncing",value:function(){}},{key:"informReferencesOfUUIDChange",value:function(e,t){}},{key:"potentialItemOfInterestHasChangedItsUUID",value:function(e,t,n){var r=!0,i=!1,a=void 0;try{for(var o,s=this.content.references[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;u.uuid==t&&(u.uuid=n,this.setDirty(!0))}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}}},{key:"doNotEncrypt",value:function(){return!1}},{key:"setDomainDataItem",value:function(e,t,n){if(!n)return void console.error("SFItem.AppDomain needs to be set.");if(!this.errorDecrypting){this.content.appData||(this.content.appData={});var r=this.content.appData[n];r||(r={}),r[e]=t,this.content.appData[n]=r}}},{key:"getDomainDataItem",value:function(e,t){if(!t)return void console.error("SFItem.AppDomain needs to be set.");if(!this.errorDecrypting){this.content.appData||(this.content.appData={});var n=this.content.appData[t];return n?n[e]:null}}},{key:"setAppDataItem",value:function(t,n){this.setDomainDataItem(t,n,e.AppDomain)}},{key:"getAppDataItem",value:function(t){return this.getDomainDataItem(t,e.AppDomain)}},{key:"hasRawClientUpdatedAtValue",value:function(){return null!=this.getAppDataItem("client_updated_at")}},{key:"keysToIgnoreWhenCheckingContentEquality",value:function(){return[]}},{key:"appDataKeysToIgnoreWhenCheckingContentEquality",value:function(){return["client_updated_at"]}},{key:"getContentCopy",value:function(){return JSON.parse(JSON.stringify(this.content))}},{key:"isItemContentEqualWith",value:function(t){var n=function(e,t){if(!e)return e;var n=!0,r=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){delete e[a.value]}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return e},r=this.getContentCopy();r.appData&&n(r.appData[e.AppDomain],this.appDataKeysToIgnoreWhenCheckingContentEquality()),r=n(r,this.keysToIgnoreWhenCheckingContentEquality());var i=t.getContentCopy();return i.appData&&n(i.appData[e.AppDomain],t.appDataKeysToIgnoreWhenCheckingContentEquality()),i=n(i,t.keysToIgnoreWhenCheckingContentEquality()),JSON.stringify(r)===JSON.stringify(i)}},{key:"satisfiesPredicate",value:function(e){return C.ItemSatisfiesPredicate(this,e)}},{key:"createdAtString",value:function(){return this.dateToLocalizedString(this.created_at)}},{key:"updatedAtString",value:function(){return this.dateToLocalizedString(this.client_updated_at)}},{key:"updatedAtTimestamp",value:function(){return this.updated_at.getTime()}},{key:"dateToLocalizedString",value:function(e){if("undefined"!=typeof Intl&&Intl.DateTimeFormat){if(!s){var t=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;s=new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"})}return s.format(e)}return e.toDateString()+" "+e.toLocaleTimeString()}},{key:"contentObject",get:function(){if(this.errorDecrypting)return this.content;if(!this.content)return this.content={},this.content;if(null!==this.content&&"object"===c(this.content))return this.content;try{var e=JSON.parse(this.content);return this.content=e,this.content}catch(e){return console.log("Error parsing json",e,this),this.content={},this.content}}},{key:"pinned",get:function(){return this.getAppDataItem("pinned")}},{key:"archived",get:function(){return this.getAppDataItem("archived")}},{key:"locked",get:function(){return this.getAppDataItem("locked")}},{key:"displayName",get:function(){return"Item"}},{key:"client_updated_at",get:function(){if(!this._client_updated_at){var e=this.getAppDataItem("client_updated_at");this._client_updated_at=e?new Date(e):new Date(this.updated_at)}return this._client_updated_at},set:function(e){this._client_updated_at=e,this.setAppDataItem("client_updated_at",e)}}],[{key:"deepMerge",value:function(e,t){function n(e,t){if(_.isArray(e))return t}return _.mergeWith(e,t,n),e}}]),e}(),S=r.SFItemParams=function(){function e(t,n,r){if(a(this,e),this.item=t,this.keys=n,this.auth_params=r,this.keys&&!this.auth_params)throw"SFItemParams.auth_params must be supplied if supplying keys.";if(this.auth_params&&!this.auth_params.version)throw"SFItemParams.auth_params is missing version"}return l(e,[{key:"paramsForExportFile",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.additionalFields=["updated_at"],this.forExportFile=!0,!t){e.next=6;break}return e.abrupt("return",this.__params());case 6:return e.next=8,this.__params();case 8:return n=e.sent,e.abrupt("return",_.omit(n,["deleted"]));case 10:case"end":return e.stop()}},e,this)}));return e}()},{key:"paramsForExtension",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.paramsForExportFile());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"paramsForLocalStorage",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.additionalFields=["updated_at","dirty","errorDecrypting"],this.forExportFile=!0,e.abrupt("return",this.__params());case 3:case"end":return e.stop()}},e,this)}));return e}()},{key:"paramsForSync",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.__params());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"__params",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t={uuid:this.item.uuid,content_type:this.item.content_type,deleted:this.item.deleted,created_at:this.item.created_at},this.item.errorDecrypting){e.next=23;break}if(n=this.item.doNotEncrypt()&&!this.forExportFile,!this.keys||n){e.next=11;break}return e.next=6,SFJS.itemTransformer.encryptItem(this.item,this.keys,this.auth_params);case 6:r=e.sent,_.merge(t,r),"001"!==this.auth_params.version&&(t.auth_hash=null),e.next=21;break;case 11:if(!this.forExportFile){e.next=15;break}e.t0=this.item.createContentJSONFromProperties(),e.next=19;break;case 15:return e.next=17,SFJS.crypto.base64(JSON.stringify(this.item.createContentJSONFromProperties()));case 17:e.t1=e.sent,e.t0="000"+e.t1;case 19:t.content=e.t0,this.forExportFile||(t.enc_item_key=null,t.auth_hash=null);case 21:e.next=26;break;case 23:t.content=this.item.content,t.enc_item_key=this.item.enc_item_key,t.auth_hash=this.item.auth_hash;case 26:return this.additionalFields&&_.merge(t,_.pick(this.item,this.additionalFields)),e.abrupt("return",t);case 28:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),C=r.SFPredicate=function(){function e(t,n,r){a(this,e),this.keypath=t,this.operator=n,this.value=r,e.IsRecursiveOperator(this.operator)&&(this.value=this.value.map(e.fromArray))}return l(e,null,[{key:"fromArray",value:function(t){return new e(t[0],t[1],t[2])}},{key:"ObjectSatisfiesPredicate",value:function(t,n){if(Array.isArray(n)&&(n=this.fromArray(n)),e.IsRecursiveOperator(n.operator)){if("and"===n.operator){var r=!0,i=!1,a=void 0;try{for(var o,s=n.value[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(!this.ObjectSatisfiesPredicate(t,u))return!1}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return!0}if("or"===n.operator){var c=!0,l=!1,f=void 0;try{for(var p,h=n.value[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var u=p.value;if(this.ObjectSatisfiesPredicate(t,u))return!0}}catch(e){l=!0,f=e}finally{try{!c&&h.return&&h.return()}finally{if(l)throw f}}return!1}}var d=n.value;"string"==typeof d&&d.includes(".ago")&&(d=this.DateFromString(d));var y=n.keypath.split(".").reduce(function(e,t){return e&&e[t]},t),v=[!1,"",null,void 0,NaN];if(void 0==y)return"!="==n.operator?!v.includes(n.value):v.includes(n.value);if("="==n.operator)return Array.isArray(y)?JSON.stringify(y)==JSON.stringify(d):y==d;if("!="==n.operator)return Array.isArray(y)?JSON.stringify(y)!=JSON.stringify(d):y!==d;if("<"==n.operator)return y"==n.operator)return y>d;if("<="==n.operator)return y<=d;if(">="==n.operator)return y>=d;if("startsWith"==n.operator)return y.startsWith(d);if("in"==n.operator)return-1!=d.indexOf(y);if("includes"==n.operator)return this.resolveIncludesPredicate(y,d);if("matches"==n.operator){return new RegExp(d).test(y)}return!1}},{key:"resolveIncludesPredicate",value:function(t,n){if("string"==typeof n)return t.includes(n);var r;r=Array.isArray(n)?e.fromArray(n):n;var i=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;if(this.ObjectSatisfiesPredicate(c,r))return!0}}catch(e){a=!0,o=e}finally{try{!i&&u.return&&u.return()}finally{if(a)throw o}}return!1}},{key:"ItemSatisfiesPredicate",value:function(t,n){return Array.isArray(n)&&(n=e.fromArray(n)),this.ObjectSatisfiesPredicate(t,n)}},{key:"ItemSatisfiesPredicates",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(!this.ItemSatisfiesPredicate(e,s))return!1}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return!0}},{key:"DateFromString",value:function(e){var t=e.split("."),n=t[1],r=new Date,i=parseInt(t[0]);return"days"==n?r.setDate(r.getDate()-i):"hours"==n&&r.setHours(r.getHours()-i),r}},{key:"IsRecursiveOperator",value:function(e){return["and","or"].includes(e)}}]),e}(),I=r.SFPrivileges=function(e){function r(e){a(this,r);var n=t(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return n.content.desktopPrivileges||(n.content.desktopPrivileges={}),n}return n(r,e),l(r,null,[{key:"contentType",value:function(){return"SN|Privileges"}}]),l(r,[{key:"setCredentialsForAction",value:function(e,t){this.content.desktopPrivileges[e]=t}},{key:"getCredentialsForAction",value:function(e){return this.content.desktopPrivileges[e]||[]}},{key:"toggleCredentialForAction",value:function(e,t){this.isCredentialRequiredForAction(e,t)?this.removeCredentialForAction(e,t):this.addCredentialForAction(e,t)}},{key:"removeCredentialForAction",value:function(e,t){_.pull(this.content.desktopPrivileges[e],t)}},{key:"addCredentialForAction",value:function(e,t){var n=this.getCredentialsForAction(e);n.push(t),this.setCredentialsForAction(e,n)}},{key:"isCredentialRequiredForAction",value:function(e,t){return this.getCredentialsForAction(e).includes(t)}}]),r}(x),R=r.SFHistorySession=function(e){function r(e){a(this,r);var n=t(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return n.content.itemUUIDToItemHistoryMapping||(n.content.itemUUIDToItemHistoryMapping={}),Object.keys(n.content.itemUUIDToItemHistoryMapping).forEach(function(e){var t=n.content.itemUUIDToItemHistoryMapping[e];n.content.itemUUIDToItemHistoryMapping[e]=new E(t)}),n}return n(r,e),l(r,[{key:"addEntryForItem",value:function(e){return this.historyForItem(e).addHistoryEntryForItem(e)}},{key:"historyForItem",value:function(e){var t=this.content.itemUUIDToItemHistoryMapping[e.uuid];return t||(t=this.content.itemUUIDToItemHistoryMapping[e.uuid]=new E),t}},{key:"clearItemHistory",value:function(e){this.historyForItem(e).clear()}},{key:"clearAllHistory",value:function(){this.content.itemUUIDToItemHistoryMapping={}}},{key:"optimizeHistoryForItem",value:function(e){var t=this.historyForItem(e);t.entries.length>r.LargeItemEntryAmountThreshold&&t.optimize()}}]),r}(x);R.LargeItemEntryAmountThreshold=60;var E=r.SFItemHistory=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.entries||(this.entries=[]),t.entries){var n=!0,r=!1,i=void 0;try{for(var o,s=t.entries[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,c=this.createEntryForItem(u.item);c.setPreviousEntry(this.getLastEntry()),this.entries.push(c)}}catch(e){r=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw i}}}}return l(e,[{key:"createEntryForItem",value:function(t){var n=e.HistoryEntryClassMapping&&e.HistoryEntryClassMapping[t.content_type];return n||(n=F),new n(t)}},{key:"getLastEntry",value:function(){return this.entries[this.entries.length-1]}},{key:"addHistoryEntryForItem",value:function(e){var t=this.createEntryForItem(e),n=this.getLastEntry();if(t.setPreviousEntry(n),!t.isSameAsEntry(n))return this.entries.push(t),t}},{key:"clear",value:function(){this.entries.length=0}},{key:"optimize",value:function(){var t=this,n=[],r=function(t){return t.deltaSize()>e.LargeEntryDeltaThreshold},i=function(e,i,a){if(a)n.push(e);else{var i=n.indexOf(e);-1!==i&&n.splice(i,1)}if(a&&r(e)&&-1==e.operationVector()){var o=t.entries[i-1];o&&n.push(o)}};this.entries.forEach(function(e,n){if(0==n||n==t.entries.length-1)i(e,n,!0);else{var a=r(e);i(e,n,a)}}),this.entries=this.entries.filter(function(e,t){return-1!==n.indexOf(e)})}}]),e}();E.LargeEntryDeltaThreshold=15;var F=r.SFItemHistoryEntry=function(){function e(t){a(this,e),this.item=x.deepMerge({},t),this.defaultContentKeyToDiffOn="text",this.textCharDiffLength=0,"string"==typeof this.item.updated_at&&(this.item.updated_at=new Date(this.item.updated_at))}return l(e,[{key:"setPreviousEntry",value:function(e){this.hasPreviousEntry=null!=e,this.item.content[this.defaultContentKeyToDiffOn]&&(this.textCharDiffLength=e?this.item.content[this.defaultContentKeyToDiffOn].length-e.item.content[this.defaultContentKeyToDiffOn].length:this.item.content[this.defaultContentKeyToDiffOn].length)}},{key:"operationVector",value:function(){return void 0!=this.textCharDiffLength?this.hasPreviousEntry&&0!=this.textCharDiffLength?this.textCharDiffLength<0?-1:1:0:1}},{key:"deltaSize",value:function(){return void 0!=this.textCharDiffLength?Math.abs(this.textCharDiffLength):1}},{key:"isSameAsEntry",value:function(e){if(!e)return!1;var t=new x(this.item),n=new x(e.item);return t.isItemContentEqualWith(n)}}]),e}(),h="undefined"!=typeof window?window:void 0!==e?e:null,P=r.SFAbstractCrypto=function(){function e(){a(this,e),this.DefaultPBKDF2Length=768}return l(e,[{key:"generateUUIDSync",value:function(){var e=h.crypto||h.msCrypto;if(e){var t=new Uint32Array(4);e.getRandomValues(t);var n=-1;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){n++;var r=t[n>>3]>>n%8*4&15;return("x"==e?r:3&r|8).toString(16)})}var r=(new Date).getTime();return h.performance&&"function"==typeof h.performance.now&&(r+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"==e?t:3&t|8).toString(16)})}},{key:"generateUUID",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.generateUUIDSync());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"decryptText",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=a.ciphertextToAuth,u=a.contentCiphertext,c=a.encryptionKey,l=a.iv,f=a.authHash,p=a.authKey,h=arguments[1];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!h||f){e.next=3;break}return console.error("Auth hash is required."),e.abrupt("return");case 3:if(!f){e.next=10;break}return e.next=6,this.hmac256(s,p);case 6:if(t=e.sent,f===t){e.next=10;break}return console.error("Auth hash does not match, returning null."),e.abrupt("return",null);case 10:return n=o.enc.Hex.parse(c),r=o.enc.Hex.parse(l||""),i=o.AES.decrypt(u,n,{iv:r,mode:o.mode.CBC,padding:o.pad.Pkcs7}),e.abrupt("return",i.toString(o.enc.Utf8));case 14:case"end":return e.stop()}},e,this)}));return e}()},{key:"encryptText",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r){var i,a,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.enc.Hex.parse(n),a=o.enc.Hex.parse(r||""),s=o.AES.encrypt(t,i,{iv:a,mode:o.mode.CBC,padding:o.pad.Pkcs7}),e.abrupt("return",s.toString());case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateRandomKey",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o.lib.WordArray.random(t/8).toString());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateItemEncryptionKey",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=512,n=1,e.next=4,this.generateRandomKey(t);case 4:return r=e.sent,e.next=7,this.generateRandomKey(t);case 7:return i=e.sent,e.abrupt("return",this.pbkdf2(i,r,n,t));case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"firstHalfOfKey",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.substring(0,t.length/2));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"secondHalfOfKey",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.substring(t.length/2,t.length));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"base64",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",h.btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)})));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"base64Decode",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",h.atob(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"sha256",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o.SHA256(t).toString());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"hmac256",value:function(){function e(e,n){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n){var r,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.enc.Hex.parse(n),i=o.enc.Utf8.parse(t),a=o.HmacSHA256(i,r).toString(),e.abrupt("return",a);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateSalt",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sha256([t,"SF",n,r,i].join(":"));case 2:return a=e.sent,e.abrupt("return",a);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateSymmetricKeyPair",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a,o,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=s.password,c=s.pw_salt,l=s.pw_cost;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pbkdf2(u,c,l,this.DefaultPBKDF2Length);case 2:return t=e.sent,n=t.length,r=n/3,i=t.slice(0,r),a=t.slice(r,2*r),o=t.slice(2*r,3*r),e.abrupt("return",[i,a,o]);case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"computeEncryptionKeysForUser",value:function(){function e(e,n){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("003"!=n.version){e.next=9;break}if(n.identifier){e.next=4;break}return console.error("authParams is missing identifier."),e.abrupt("return");case 4:return e.next=6,this.generateSalt(n.identifier,n.version,n.pw_cost,n.pw_nonce);case 6:r=e.sent,e.next=10;break;case 9:r=n.pw_salt;case 10:return e.abrupt("return",this.generateSymmetricKeyPair({password:t,pw_salt:r,pw_cost:n.pw_cost}).then(function(e){return{pw:e[0],mk:e[1],ak:e[2]}}));case 11:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateInitialKeysAndAuthParamsForUser",value:function(){function e(e,n){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n){var r,i,a,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.SFJS.version,i=this.SFJS.defaultPasswordGenerationCost,e.next=4,this.generateRandomKey(256);case 4:return a=e.sent,e.next=7,this.generateSalt(t,r,i,a);case 7:return o=e.sent,e.abrupt("return",this.generateSymmetricKeyPair({password:n,pw_salt:o,pw_cost:i}).then(function(e){var n={pw_nonce:a,pw_cost:i,identifier:t,version:r};return{keys:{pw:e[0],mk:e[1],ak:e[2]},authParams:n}}));case 9:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),D=r.SFCryptoJS=function(e){function r(){return a(this,r),t(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return n(r,e),l(r,[{key:"pbkdf2",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a={keySize:i/32,hasher:o.algo.SHA512,iterations:r},e.abrupt("return",o.PBKDF2(t,n,a).toString());case 2:case"end":return e.stop()}},e,this)}));return e}()}]),r}(P),h="undefined"!=typeof window?window:void 0!==e?e:null,O=h.crypto?h.crypto.subtle:null,M=r.SFCryptoWeb=function(e){function r(){return a(this,r),t(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return n(r,e),l(r,[{key:"pbkdf2",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.webCryptoImportKey(t,"PBKDF2",["deriveBits"]);case 2:if(a=e.sent){e.next=6;break}return console.log("Key is null, unable to continue"),e.abrupt("return",null);case 6:return e.abrupt("return",this.webCryptoDeriveBits(a,n,r,i));case 7:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateRandomKey",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=!0,e.abrupt("return",O.generateKey({name:"AES-CBC",length:t},n,["encrypt","decrypt"]).then(function(e){return O.exportKey("raw",e).then(function(){var e=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.arrayBufferToHexString(new Uint8Array(t));case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,r)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.error("Error exporting key",e)})}).catch(function(e){console.error("Error generating key",e)}));case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateItemEncryptionKey",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=256,e.abrupt("return",Promise.all([this.generateRandomKey(t),this.generateRandomKey(t)]).then(function(e){return e.join("")}));case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"encryptText",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r){var a,o,s,u,c,l=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,this.hexStringToArrayBuffer(r);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=new ArrayBuffer(16);case 7:return a=e.t0,o={name:"AES-CBC",iv:a},e.next=11,this.hexStringToArrayBuffer(n);case 11:return s=e.sent,e.next=14,this.webCryptoImportKey(s,o.name,["encrypt"]);case 14:return u=e.sent,e.next=17,this.stringToArrayBuffer(t);case 17:return c=e.sent,e.abrupt("return",crypto.subtle.encrypt(o,u,c).then(function(){var e=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.arrayBufferToBase64(t);case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,l)}));return function(t){return e.apply(this,arguments)}}()));case 19:case"end":return e.stop()}},e,this)}));return e}()},{key:"decryptText",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,a,o,s,u=this,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=c.ciphertextToAuth,f=c.contentCiphertext,p=c.encryptionKey,h=c.iv,d=c.authHash,y=c.authKey,v=arguments[1];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!v||d){e.next=3;break}return console.error("Auth hash is required."),e.abrupt("return");case 3:if(!d){e.next=10;break}return e.next=6,this.hmac256(l,y);case 6:if(t=e.sent,d===t){e.next=10;break}return console.error("Auth hash does not match, returning null. "+d+" != "+t),e.abrupt("return",null);case 10:if(!h){e.next=16;break}return e.next=13,this.hexStringToArrayBuffer(h);case 13:e.t0=e.sent,e.next=17;break;case 16:e.t0=new ArrayBuffer(16);case 17:return n=e.t0,r={name:"AES-CBC",iv:n},e.next=21,this.hexStringToArrayBuffer(p);case 21:return a=e.sent,e.next=24,this.webCryptoImportKey(a,r.name,["decrypt"]);case 24:return o=e.sent,e.next=27,this.base64ToArrayBuffer(f);case 27:return s=e.sent,e.abrupt("return",crypto.subtle.decrypt(r,o,s).then(function(){var e=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.arrayBufferToString(t);case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,u)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.error("Error decrypting:",e)}));case 29:case"end":return e.stop()}},e,this)}));return e}()},{key:"webCryptoImportKey",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=6;break}return e.next=3,this.stringToArrayBuffer(t);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=t;case 7:return a=e.t0,e.abrupt("return",O.importKey("raw",a,{name:n,hash:i},!1,r).then(function(e){return e}).catch(function(e){return console.error(e),null}));case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"webCryptoDeriveBits",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,a){var o,s=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stringToArrayBuffer(n);case 2:return e.t0=e.sent,e.t1=r,e.t2={name:"SHA-512"},o={name:"PBKDF2",salt:e.t0,iterations:e.t1,hash:e.t2},e.abrupt("return",O.deriveBits(o,t,a).then(function(){var e=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.arrayBufferToHexString(new Uint8Array(t));case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,s)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){return console.error(e),null}));case 7:case"end":return e.stop()}},e,this)}));return e}()},{key:"stringToArrayBuffer",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=new Blob([t]),i=new FileReader;i.onload=function(t){e(t.target.result)},i.readAsArrayBuffer(r)}));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"arrayBufferToString",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=new Blob([t]),i=new FileReader;i.onload=function(t){e(t.target.result)},i.readAsText(r)}));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"arrayBufferToHexString",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n,r,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(n=new Uint8Array(t),r="",a=0;a5e3)||this.crypto instanceof M}},{key:"supportedVersions",value:function(){return["001","002","003"]}},{key:"isVersionNewerThanLibraryVersion",value:function(e){var t=this.version();return parseInt(e)>parseInt(t)}},{key:"isProtocolVersionOutdated",value:function(e){var t={"001":Date.parse("2018-01-01"),"002":Date.parse("2020-01-01")},n=t[e];return!!n&&new Date>n}},{key:"costMinimumForVersion",value:function(e){return{"001":3e3,"002":3e3,"003":11e4}[e]}},{key:"defaultPasswordGenerationCost",value:function(){return this.costMinimumForVersion(this.version())}}]),e}();if(h)try{h.StandardFile=T,h.SFJS=new T,h.SFCryptoWeb=M,h.SFCryptoJS=D,h.SFItemTransformer=A,h.SFModelManager=v,h.SFItem=x,h.SFItemParams=S,h.SFHttpManager=d,h.SFStorageManager=k,h.SFSyncManager=w,h.SFAuthManager=p,h.SFMigrationManager=y,h.SFAlertManager=f,h.SFPredicate=C,h.SFHistorySession=R,h.SFSessionHistoryManager=m,h.SFItemHistory=E,h.SFItemHistoryEntry=F,h.SFPrivilegesManager=g,h.SFPrivileges=I,h.SFSingletonManager=b}catch(e){console.log("Exception while exporting window variables",e)}}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(t,n(3))},function(e,t){!function(t){"use strict";function n(e,t,n,r){var a=t&&t.prototype instanceof i?t:i,o=Object.create(a.prototype),s=new h(r||[]);return o._invoke=c(e,n,s),o}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function a(){}function o(){}function s(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function u(e){function t(n,i,a,o){var s=r(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&m.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},o)}o(s.arg)}function n(e,n){function r(){return new Promise(function(r,i){t(e,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function c(e,t,n){var i=C;return function(a,o){if(i===R)throw new Error("Generator is already running");if(i===E){if("throw"===a)throw o;return y()}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var u=l(s,n);if(u){if(u===F)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===C)throw i=E,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=R;var c=r(e,t,n);if("normal"===c.type){if(i=n.done?E:I,c.arg===F)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=E,n.method="throw",n.arg=c.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===v){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=v,l(e,t),"throw"===t.method))return F;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return F}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,F;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=v),t.delegate=null,F):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,F)}function f(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function p(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function h(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(f,this),this.reset(!0)}function d(e){if(e){var t=e[k];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=m.call(i,"catchLoc"),s=m.call(i,"finallyLoc");if(o&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&m.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),p(n),F}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;p(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=v),F}}}(function(){return this}()||Function("return this")())},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){function o(e){r(u,i,a,o,s,"next",e)}function s(e){r(u,i,a,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n=0?this.items[c]=u:this.items.push(u);case 15:r=!0,t.next=5;break;case 18:t.next=24;break;case 20:t.prev=20,t.t0=t.catch(3),i=!0,a=t.t0;case 24:t.prev=24,t.prev=25,r||null==o.return||o.return();case 27:if(t.prev=27,!i){t.next=30;break}throw a;case 30:return t.finish(27);case 31:return t.finish(24);case 32:this.notifyObserversOfEvent(e.BridgeEventReceivedItems);case 33:case"end":return t.stop()}},t,this,[[3,20,24,32],[25,,27,31]])}));return t}()},{key:"indexOfItem",value:function(e){for(var t in this.items)if(this.items[t].uuid==e.uuid)return t;return-1}},{key:"removeItemFromItems",value:function(e){this.items=this.items.filter(function(t){return t.uuid!==e.uuid})}},{key:"createItem",value:function(e,t){this.createItems([e],t)}},{key:"createItems",value:function(e,t){this.componentManager.createItems(e,function(e){t&&t(e.map(function(e){return new f.SFItem(e)}))})}},{key:"saveItem",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.saveItems([t]));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"saveItems",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,i){r.componentManager.saveItems(n,function(n){t(n),r.notifyObserversOfEvent(e.BridgeEventSavedItem)})}));case 1:case"end":return t.stop()}},t)}));return t}()},{key:"indexOfItem",value:function(e){for(var t in this.items)if(this.items[t].uuid==e.uuid)return t;return-1}},{key:"deleteItem",value:function(e,t){this.deleteItems([e],t)}},{key:"deleteItems",value:function(e,t){this.componentManager.deleteItems(e,t)}},{key:"removeItemFromItems",value:function(e){this.items=this.items.filter(function(t){return t.uuid!==e.uuid})}}]),e}());u(p,"FileItemContentTypeKey","SN|FileSafe|File"),u(p,"FileSafeCredentialsContentType","SN|FileSafe|Credentials"),u(p,"FileDescriptorContentTypeKey","SN|FileSafe|FileMetadata"),u(p,"FileSafeIntegrationContentTypeKey","SN|FileSafe|Integration"),u(p,"BridgeEventLoadedCredentials","BridgeEventLoadedCredentials"),u(p,"BridgeEventReceivedItems","BridgeEventReceivedItems"),u(p,"BridgeEventSavedItem","BridgeEventSavedItem")},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){function o(e){r(u,i,a,o,s,"next",e)}function s(e){r(u,i,a,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;nt.length)n=e;else{n=t;var r=0,i=-1,a=-1,o=n.length;for(0>r&&(r=-r>o?0:o+r),i=i>o?o:i,0>i&&(i+=o),o=r>i?0:i-r>>>0,r>>>=0,i=Array(o);++aa?pt:o,a=1),t=Object(t);++is))return!1;if((u=a.get(e))&&a.get(t))return u==t;var u=-1,c=!0,l=2&n?new E:pt;for(a.set(e,t),a.set(t,e);++un&&(n=ln(r+n,0)),y(e,be(t,3),n)):-1}function Te(e){return(null==e?0:e.length)?L(e,1):[]}function Ne(e){var t=null==e?0:e.length;return t?e[t-1]:pt}function je(e,t){var n;if(e&&e.length&&t&&t.length){n=t;var r=v,i=-1,a=n.length;for(e===n&&(n=ue(n));++i=e}function We(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ve(e){return null!=e&&"object"==typeof e}function Je(e){return!(!Ve(e)||"[object Object]"!=z(e))&&(null===(e=Xt(e))||"function"==typeof(e=Kt.call(e,"constructor")&&e.constructor)&&e instanceof e&&zt.call(e)==Jt)}function qe(e){return"string"==typeof e||!Hn(e)&&Ve(e)&&"[object String]"==z(e)}function $e(e){return"symbol"==typeof e||Ve(e)&&"[object Symbol]"==z(e)}function Ge(e){return e?(e=Ye(e),e===ht||e===-ht?1.7976931348623157e308*(0>e?-1:1):e===e?e:0):0===e?e:0}function Qe(e){e=Ge(e);var t=e%1;return e===e?t?e-t:e:0}function Ye(e){if("number"==typeof e)return e;if($e(e))return dt;if(We(e)&&(e="function"==typeof e.valueOf?e.valueOf():e,e=We(e)?e+"":e),"string"!=typeof e)return 0===e?e:+e;e=e.replace(bt,"");var t=St.test(e);return t||Ct.test(e)?Pt(e.slice(2),t?2:8):xt.test(e)?dt:+e}function Xe(e){return ce(e,rt(e))}function Ze(e){return null==e?"":ne(e)}function et(e,t,n){return e=null==e?pt:H(e,t),e===pt?n:e}function tt(e,t){var n;if(n=null!=e){n=e;var r;r=ie(t,n);for(var i=-1,a=r.length,o=!1;++i(e=M(t,e))||(e==t.length-1?t.pop():tn.call(t,e,1),--this.size,0))},I.prototype.get=function(e){var t=this.__data__;return e=M(t,e),0>e?pt:t[e][1]},I.prototype.has=function(e){return-1r?(++this.size,n.push([e,t])):n[r][1]=t,this},R.prototype.clear=function(){this.size=0,this.__data__={hash:new C,map:new(dn||I),string:new C}},R.prototype.delete=function(e){return e=ke(this,e).delete(e),this.size-=e?1:0,e},R.prototype.get=function(e){return ke(this,e).get(e)},R.prototype.has=function(e){return ke(this,e).has(e)},R.prototype.set=function(e,t){var n=ke(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},E.prototype.add=E.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},E.prototype.has=function(e){return this.__data__.has(e)},F.prototype.clear=function(){this.__data__=new I,this.size=0},F.prototype.delete=function(e){var t=this.__data__;return e=t.delete(e),this.size=t.size,e},F.prototype.get=function(e){return this.__data__.get(e)},F.prototype.has=function(e){return this.__data__.has(e)},F.prototype.set=function(e,t){var n=this.__data__;if(n instanceof I){var r=n.__data__;if(!dn||199>r.length)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new R(r)}return n.set(e,t),this.size=n.size,this};var En=function(e,t){return function(t,n){if(null==t)return t;if(!He(t))return e(t,n);for(var r=t.length,i=-1,a=Object(t);++in&&(n=ln(r+n,0)),qe(e)?n<=r&&-10){var i=!0,a=!1,o=void 0;try{for(var s,u=t.integrations[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;if(c!=e){t.setIntegrationAsDefault(c);break}}}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}}})}},{key:"integrations",get:function(){return this.extensionBridge.filterItems(l.a.FileSafeIntegrationContentTypeKey)}}]),e}()},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){function o(e){r(u,i,a,o,s,"next",e)}function s(e){r(u,i,a,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&(e=n.credentials[0]),e}),u(this,"setCredentialAsDefault",function(e){var t=n.getDefaultCredentials();t&&(t.content.isDefault=!1),e.content.isDefault=!0,n.extensionBridge.saveItems([t,e])}),u(this,"deleteCredential",function(e){n.extensionBridge.deleteItem(e)}),this.extensionBridge=r,this.onCredentialLoad=i,this.credentials=[],this.extensionBridge.addEventHandler(function(e){e==f.a.BridgeEventReceivedItems&&n.reloadCredentials()})}return s(e,[{key:"reloadCredentials",value:function(){this.credentials=[];var e=this.extensionBridge.filterItems(f.a.FileSafeCredentialsContentType);if(0!=e.length){var t=!0,n=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;this.credentials.find(function(e){return e.uuid==o.uuid})||this.credentials.push(o)}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}this.onCredentialLoad(),this.credentials.length>0&&this.didLoadCredentials()}}},{key:"createNewCredentials",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=256,e.next=3,SFJS.crypto.generateRandomKey(t);case 3:return n=e.sent,e.next=6,SFJS.crypto.generateRandomKey(t);case 6:return r=e.sent,e.next=9,SFJS.crypto.generateInitialKeysAndAuthParamsForUser(n,r);case 9:return i=e.sent,i.isDefault=0==this.credentials.length,a=new l.SFItem({content_type:f.a.FileSafeCredentialsContentType,content:i}),this.extensionBridge.saveItem(a),this.didLoadCredentials(),e.abrupt("return",a);case 15:case"end":return e.stop()}},e,this)}));return e}()},{key:"didLoadCredentials",value:function(){this.extensionBridge.notifyObserversOfEvent(f.a.BridgeEventLoadedCredentials)}},{key:"credentialForFileDescriptor",value:function(e){return this.credentials.find(function(t){return e.content.references.find(function(e){return e.uuid==t.uuid})})}},{key:"getAllCredentials",value:function(){return this.credentials}},{key:"saveCredential",value:function(e){this.extensionBridge.saveItem(e)}}]),e}()},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){function o(e){r(u,i,a,o,s,"next",e)}function s(e){r(u,i,a,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3],a=document.createElement("a");a.setAttribute("download",t);var o=this.tempUrlForData(e,n);a.href=o,a.setAttribute("target","_blank"),i?window.location.href=a.href:(document.body.appendChild(a),a.click(),a.remove()),setTimeout(function(){r.revokeTempUrl(o)},500)}},{key:"tempUrlForData",value:function(e,t){return window.URL.createObjectURL(new Blob([e],{type:t||"text/json"}))}},{key:"revokeTempUrl",value:function(e){window.URL.revokeObjectURL(e)}},{key:"copyTextToClipboard",value:function(e){if(window.clipboardData&&window.clipboardData.setData)return clipboardData.setData("Text",e);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var t;try{t=document.createElement("textarea"),t.setAttribute("readonly",!0),t.setAttribute("contenteditable",!0),t.style.position="fixed",t.value=e,document.body.appendChild(t),t.focus(),t.select();var n=document.createRange();n.selectNodeContents(t);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),t.setSelectionRange(0,t.value.length),document.execCommand("copy")}catch(e){console.error(e),null}finally{document.body.removeChild(t)}}}}]),e}()}])},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){function o(e){i(u,r,a,o,s,"next",e)}function s(e){i(u,r,a,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;ni)){r.next=14;break}return alert("The maximum upload size is ".concat(n," megabytes per file.")),o.setState({status:null}),e(),r.abrupt("return");case 14:return r.next=16,SFJS.crypto.arrayBufferToBase64(l);case 16:return p=r.sent,r.next=19,o.encryptFile(p,t.name,t.type);case 19:e();case 20:case"end":return r.stop()}},r)}));return function(e){return r.apply(this,arguments)}}(),o.setState({status:"Reading file..."}),t.name.endsWith(".sf")||t.name.endsWith(".json")?(u=!0,s.readAsText(t)):s.readAsArrayBuffer(t)}));case 4:case"end":return e.stop()}},e)}));return e}()},{key:"decryptDraggedFile",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){var n,r,i,o,s,u,c,l,f,p=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({status:"Decrypting..."}),n=k.a.get().filesafe.getAllCredentials(),r=function(){var e=a(regeneratorRuntime.mark(function e(n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){k.a.get().filesafe.decryptFile({fileDescriptor:t,credential:n}).then(function(t){var n=t.decryptedItem;k.a.get().filesafe.downloadBase64Data({base64Data:t.decryptedData,fileName:n.content.fileName,fileType:n.content.fileType}),p.setState({status:null}),e(!0)}).catch(function(e){console.error("Error decrypting:",e),p.flashError("Error decrypting file."),r(!1)})}));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),i=!0,o=!1,s=void 0,e.prev=6,u=n[Symbol.iterator]();case 8:if(i=(c=u.next()).done){e.next=18;break}return l=c.value,e.next=12,r(l);case 12:if(!(f=e.sent)){e.next=15;break}return e.abrupt("return");case 15:i=!0,e.next=8;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(6),o=!0,s=e.t0;case 24:e.prev=24,e.prev=25,i||null==u.return||u.return();case 27:if(e.prev=27,!o){e.next=30;break}throw s;case 30:return e.finish(27);case 31:return e.finish(24);case 32:case"end":return e.stop()}},e,this,[[6,20,24,32],[25,,27,31]])}));return e}()},{key:"wait",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){setTimeout(function(){e()},1e3*t)}));case 1:case"end":return e.stop()}},e)}));return e}()},{key:"encryptFile",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r){var i,o,s=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({status:"Encrypting..."}),i=k.a.get().filesafe.getDefaultCredentials(),o=k.a.get().filesafe.getDefaultIntegration(),e.abrupt("return",k.a.get().filesafe.encryptFile({data:t,inputFileName:n,fileType:r,credential:i}).then(function(){var e=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s.setState({status:"Uploading to ".concat(k.a.get().filesafe.displayStringForIntegration(o),"...")}),e.next=3,s.wait(.5);case 3:return e.abrupt("return",k.a.get().filesafe.uploadFile({fileItem:t,inputFileName:n,fileType:r,credential:i}).then(function(){s.setState({status:"Upload Success."})}).catch(function(e){console.error("fs-embed | error uploading file:",e),s.flashError("Error uploading file.")}));case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()));case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"flashError",value:function(e){var t=this;this.setState({status:e,statusClass:"danger"}),setTimeout(function(){t.setState({status:null,statusClass:null})},2500)}},{key:"render",value:function(){var e=this,t=this.state.statusClass?this.state.statusClass:"info",n="info"==t;return v.a.createElement("div",{className:"sn-component files-view"},v.a.createElement("div",{className:"sk-panel-row align-top"},v.a.createElement("div",{className:"files"},this.state.messages.length>0&&v.a.createElement("div",{id:"messages-container",className:"sk-panel-section"},v.a.createElement(m.a,{messages:this.state.messages})),this.state.status&&v.a.createElement("div",{id:"file-upload-status",className:"sk-horizontal-group"},n&&v.a.createElement("div",{className:"sk-spinner info small"}),v.a.createElement("div",{className:t},this.state.status)),v.a.createElement("div",{id:"add-file-button-container"},v.a.createElement("div",{className:"file sk-button info"},v.a.createElement("label",{className:"no-style"},v.a.createElement("input",{type:"file",style:{display:"none"},onChange:function(t){e.handleDroppedFiles(t.target.files)}}),v.a.createElement("div",{id:"attach-file-button-label",className:"sk-label"},"Attach File")))),v.a.createElement(b.a,{files:this.state.noteFiles}))))}},{key:"rootElement",get:function(){return document.getElementById("filesafe-embed")}},{key:"dropContainer",get:function(){return document.getElementById("files-view")}},{key:"fileInput",get:function(){return document.getElementById("file-input")}}]),t}(v.a.Component)},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){function o(e){r(u,i,a,o,s,"next",e)}function s(e){r(u,i,a,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;nCreate New under Keys.",css:"sk-base"}),r=this.integrationManager.integrations,r&&0!=r.length||t.push({message:"Add a new integration by selecting Add New under Integrations",css:"sk-base"}),e.abrupt("return",t);case 8:case"end":return e.stop()}},e,this)}));return e}()}]),e}()},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n1;return d.a.createElement("div",null,d.a.createElement("div",{className:"sk-panel-row"},d.a.createElement("div",{className:"sk-h2 sk-bold"},"Integrations"),!this.state.showInputForm&&d.a.createElement("div",{className:"sk-button info no-border",onClick:this.addNewIntegrationClicked},d.a.createElement("div",{className:"sk-label"},"Add New"))),d.a.createElement("div",{id:"integrations"},this.state.showInputForm&&d.a.createElement("div",{className:"sk-notification info"},d.a.createElement("strong",null,"New Integration"),d.a.createElement("p",{className:"sk-p"},"A new tab has opened. After you complete the authentication flow, enter the code you receive below."),d.a.createElement("div",{className:"sk-panel-row"}),d.a.createElement("input",{className:"title sk-input contrast",type:"text",placeholder:"Enter integration code",value:this.state.integrationCode,onChange:this.handleTextChange,onKeyPress:this.handleKeyPress}),d.a.createElement("div",{className:"sk-button-group",style:{marginTop:10}},d.a.createElement("div",{className:"sk-button neutral",onClick:this.cancelIntegrationForm},d.a.createElement("a",{className:"sk-label"},"Cancel")),d.a.createElement("div",{className:"sk-button sk-base",onClick:this.submitIntegrationCode},d.a.createElement("a",{className:"sk-label"},"Submit"))))),d.a.createElement("div",{className:"list-container"},this.state.integrations.map(function(n){return d.a.createElement("div",{className:"list-item sk-horizontal-group top"},d.a.createElement("div",{className:"sk-circle x-small "+(n.content.isDefaultUploadSource?"info":"sk-secondary-contrast")}),d.a.createElement("div",null,d.a.createElement("div",{className:"sk-panel-row condensed sk-bold"},e.displayStringForIntegration(n)),d.a.createElement("div",{className:"sk-panel-row condensed"},d.a.createElement("div",{className:"sk-horizontal-group"},t&&!n.content.isDefaultUploadSource&&d.a.createElement("a",{className:"info",onClick:function(){e.setIntegrationAsDefaultUploadSource(n)}},"Make Default"),d.a.createElement("a",{className:"danger",onClick:function(){e.deleteIntegration(n)}},"Delete")))))})))}}]),t}(d.a.Component)}])},function(e,t){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){(function(t){var n,n;!function(t){e.exports=t()}(function(){return function(){function e(t,r,i){function a(s,u){if(!r[s]){if(!t[s]){var c="function"==typeof n&&n;if(!u&&c)return n(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var f=r[s]={exports:{}};t[s][0].call(f.exports,function(e){return a(t[s][1][e]||e)},f,f.exports,e,t,r,i)}return r[s].exports}for(var o="function"==typeof n&&n,s=0;s>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*a,i=e.min(4*t,i),t){for(var u=0;u>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;4>o&&i+.75*o>>6*(3-o)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map,i=r.charAt(64);i&&-1!=(i=e.indexOf(i))&&(n=i);for(var i=[],a=0,o=0;o>>6-o%4*2;i[a>>>2]|=(s|u)<<24-a%4*8,a++}return t.create(i,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,n,r,i,a,o){return((e=e+(t&n|~t&r)+i+o)<>>32-a)+t}function n(e,t,n,r,i,a,o){return((e=e+(t&r|n&~r)+i+o)<>>32-a)+t}function r(e,t,n,r,i,a,o){return((e=e+(t^n^r)+i+o)<>>32-a)+t}function i(e,t,n,r,i,a,o){return((e=e+(n^(t|~r))+i+o)<>>32-a)+t}for(var a=o,s=a.lib,u=s.WordArray,c=s.Hasher,s=a.algo,l=[],f=0;64>f;f++)l[f]=4294967296*e.abs(e.sin(f+1))|0;s=s.MD5=c.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,a){for(var o=0;16>o;o++){var s=a+o,u=e[s];e[s]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}var o=this._hash.words,s=e[a+0],u=e[a+1],c=e[a+2],f=e[a+3],p=e[a+4],h=e[a+5],d=e[a+6],y=e[a+7],v=e[a+8],g=e[a+9],m=e[a+10],b=e[a+11],k=e[a+12],w=e[a+13],x=e[a+14],S=e[a+15],_=o[0],C=o[1],I=o[2],R=o[3],_=t(_,C,I,R,s,7,l[0]),R=t(R,_,C,I,u,12,l[1]),I=t(I,R,_,C,c,17,l[2]),C=t(C,I,R,_,f,22,l[3]),_=t(_,C,I,R,p,7,l[4]),R=t(R,_,C,I,h,12,l[5]),I=t(I,R,_,C,d,17,l[6]),C=t(C,I,R,_,y,22,l[7]),_=t(_,C,I,R,v,7,l[8]),R=t(R,_,C,I,g,12,l[9]),I=t(I,R,_,C,m,17,l[10]),C=t(C,I,R,_,b,22,l[11]),_=t(_,C,I,R,k,7,l[12]),R=t(R,_,C,I,w,12,l[13]),I=t(I,R,_,C,x,17,l[14]),C=t(C,I,R,_,S,22,l[15]),_=n(_,C,I,R,u,5,l[16]),R=n(R,_,C,I,d,9,l[17]),I=n(I,R,_,C,b,14,l[18]),C=n(C,I,R,_,s,20,l[19]),_=n(_,C,I,R,h,5,l[20]),R=n(R,_,C,I,m,9,l[21]),I=n(I,R,_,C,S,14,l[22]),C=n(C,I,R,_,p,20,l[23]),_=n(_,C,I,R,g,5,l[24]),R=n(R,_,C,I,x,9,l[25]),I=n(I,R,_,C,f,14,l[26]),C=n(C,I,R,_,v,20,l[27]),_=n(_,C,I,R,w,5,l[28]),R=n(R,_,C,I,c,9,l[29]),I=n(I,R,_,C,y,14,l[30]),C=n(C,I,R,_,k,20,l[31]),_=r(_,C,I,R,h,4,l[32]),R=r(R,_,C,I,v,11,l[33]),I=r(I,R,_,C,b,16,l[34]),C=r(C,I,R,_,x,23,l[35]),_=r(_,C,I,R,u,4,l[36]),R=r(R,_,C,I,p,11,l[37]),I=r(I,R,_,C,y,16,l[38]),C=r(C,I,R,_,m,23,l[39]),_=r(_,C,I,R,w,4,l[40]),R=r(R,_,C,I,s,11,l[41]),I=r(I,R,_,C,f,16,l[42]),C=r(C,I,R,_,d,23,l[43]),_=r(_,C,I,R,g,4,l[44]),R=r(R,_,C,I,k,11,l[45]),I=r(I,R,_,C,S,16,l[46]),C=r(C,I,R,_,c,23,l[47]),_=i(_,C,I,R,s,6,l[48]),R=i(R,_,C,I,y,10,l[49]),I=i(I,R,_,C,x,15,l[50]),C=i(C,I,R,_,h,21,l[51]),_=i(_,C,I,R,k,6,l[52]),R=i(R,_,C,I,f,10,l[53]),I=i(I,R,_,C,m,15,l[54]),C=i(C,I,R,_,u,21,l[55]),_=i(_,C,I,R,v,6,l[56]),R=i(R,_,C,I,S,10,l[57]),I=i(I,R,_,C,d,15,l[58]),C=i(C,I,R,_,w,21,l[59]),_=i(_,C,I,R,p,6,l[60]),R=i(R,_,C,I,b,10,l[61]),I=i(I,R,_,C,c,15,l[62]),C=i(C,I,R,_,g,21,l[63]);o[0]=o[0]+_|0,o[1]=o[1]+C|0,o[2]=o[2]+I|0,o[3]=o[3]+R|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var a=e.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),t=this._hash,n=t.words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}}),a.MD5=c._createHelper(s),a.HmacMD5=c._createHmacHelper(s)}(Math),function(){var e=o,t=e.lib,n=t.Base,r=t.WordArray,t=e.algo,i=t.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,i=n.hasher.create(),a=r.create(),o=a.words,s=n.keySize,n=n.iterations;o.length>>2]}},n.BlockCipher=c.extend({cfg:c.cfg.extend({mode:l,padding:p}),reset:function(){c.reset.call(this);var e=this.cfg,t=e.iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var h=n.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),l=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return e=e.salt,(e?i.create([1398893684,1701076831]).concat(e).concat(t):t).toString(s)},parse:function(e){e=s.parse(e);var t=e.words;if(1398893684==t[0]&&1701076831==t[1]){var n=i.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return h.create({ciphertext:e,salt:n})}},d=n.SerializableCipher=r.extend({cfg:r.extend({format:l}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r);return t=i.finalize(t),i=i.cfg,h.create({ciphertext:t,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),t=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){return r||(r=i.random(8)),e=u.create({keySize:t+n}).compute(e,r),n=i.create(e.words.slice(t),4*n),e.sigBytes=4*t,h.create({key:e,iv:n,salt:r})}},y=n.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:t}),encrypt:function(e,t,n,r){return r=this.cfg.extend(r),n=r.kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,e=d.encrypt.call(this,e,t,n.key,r),e.mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,d.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=o,t=e.lib.BlockCipher,n=e.algo,r=[],i=[],a=[],s=[],u=[],c=[],l=[],f=[],p=[],h=[],d=[],y=0;256>y;y++)d[y]=128>y?y<<1:y<<1^283;for(var v=0,g=0,y=0;256>y;y++){var m=g^g<<1^g<<2^g<<3^g<<4,m=m>>>8^255&m^99;r[v]=m,i[m]=v;var b=d[v],k=d[b],w=d[k],x=257*d[m]^16843008*m;a[v]=x<<24|x>>>8,s[v]=x<<16|x>>>16,u[v]=x<<8|x>>>24,c[v]=x,x=16843009*w^65537*k^257*b^16843008*v,l[m]=x<<24|x>>>8,f[m]=x<<16|x>>>16,p[m]=x<<8|x>>>24,h[m]=x,v?(v=b^d[d[d[w^b]]],g^=d[d[g]]):v=g=1}var S=[0,1,2,4,8,16,32,64,128,27,54],n=n.AES=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes/4,e=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],a=0;a>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o]):(o=o<<8|o>>>24,o=r[o>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o],o^=S[a/n|0]<<24),i[a]=i[a-n]^o}for(t=this._invKeySchedule=[],n=0;nn||4>=a?o:l[r[o>>>24]]^f[r[o>>>16&255]]^p[r[o>>>8&255]]^h[r[255&o]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,u,c,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,f,p,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,a,o,s){for(var u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],f=e[t+2]^n[2],p=e[t+3]^n[3],h=4,d=1;d>>24]^i[l>>>16&255]^a[f>>>8&255]^o[255&p]^n[h++],v=r[l>>>24]^i[f>>>16&255]^a[p>>>8&255]^o[255&c]^n[h++],g=r[f>>>24]^i[p>>>16&255]^a[c>>>8&255]^o[255&l]^n[h++],p=r[p>>>24]^i[c>>>16&255]^a[l>>>8&255]^o[255&f]^n[h++],c=y,l=v,f=g;y=(s[c>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^n[h++],v=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&c])^n[h++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^n[h++],p=(s[p>>>24]<<24|s[c>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^n[h++],e[t]=y,e[t+1]=v,e[t+2]=g,e[t+3]=p},keySize:8});e.AES=t._createHelper(n)}();var o=o||function(e,t){var n={},r=n.lib={},i=function(){},a=r.Base={extend:function(e){i.prototype=this;var t=new i;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=r.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes;if(e=e.sigBytes,this.clamp(),r%4)for(var i=0;i>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*a,i=e.min(4*t,i),t){for(var u=0;ul;){var f;e:{f=c;for(var p=e.sqrt(f),h=2;h<=p;h++)if(!(f%h)){f=!1;break e}f=!0}f&&(8>l&&(a[l]=u(e.pow(c,.5))),s[l]=u(e.pow(c,1/3)),l++),c++}var d=[],n=n.SHA256=i.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],u=n[4],c=n[5],l=n[6],f=n[7],p=0;64>p;p++){if(16>p)d[p]=0|e[t+p];else{var h=d[p-15],y=d[p-2];d[p]=((h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3)+d[p-7]+((y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10)+d[p-16]}h=f+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+s[p]+d[p],y=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&a^i&a),f=l,l=c,c=u,u=o+h|0,o=a,a=i,i=r,r=h+y|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(n),t.HmacSHA256=i._createHmacHelper(n)}(Math),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var a=this._oKey=n.clone(),o=this._iKey=n.clone(),s=a.words,u=o.words,c=0;c>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*a,i=e.min(4*t,i),t){for(var u=0;uc;c++)u[c]=e();r=r.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],c=n[4],l=n[5],f=n[6],n=n[7],p=r.high,h=r.low,d=i.high,y=i.low,v=a.high,g=a.low,m=o.high,b=o.low,k=c.high,w=c.low,x=l.high,S=l.low,_=f.high,C=f.low,I=n.high,R=n.low,E=p,F=h,P=d,D=y,O=v,M=g,A=m,T=b,N=k,j=w,B=x,L=S,H=_,U=C,z=I,K=R,W=0;80>W;W++){var V=u[W];if(16>W)var J=V.high=0|e[t+2*W],q=V.low=0|e[t+2*W+1];else{var J=u[W-15],q=J.high,$=J.low,J=(q>>>1|$<<31)^(q>>>8|$<<24)^q>>>7,$=($>>>1|q<<31)^($>>>8|q<<24)^($>>>7|q<<25),G=u[W-2],q=G.high,Q=G.low,G=(q>>>19|Q<<13)^(q<<3|Q>>>29)^q>>>6,Q=(Q>>>19|q<<13)^(Q<<3|q>>>29)^(Q>>>6|q<<26),q=u[W-7],Y=q.high,X=u[W-16],Z=X.high,X=X.low,q=$+q.low,J=J+Y+(q>>>0<$>>>0?1:0),q=q+Q,J=J+G+(q>>>0>>0?1:0),q=q+X,J=J+Z+(q>>>0>>0?1:0);V.high=J,V.low=q}var Y=N&B^~N&H,X=j&L^~j&U,V=E&P^E&O^P&O,ee=F&D^F&M^D&M,$=(E>>>28|F<<4)^(E<<30|F>>>2)^(E<<25|F>>>7),G=(F>>>28|E<<4)^(F<<30|E>>>2)^(F<<25|E>>>7),Q=s[W],te=Q.high,ne=Q.low,Q=K+((j>>>14|N<<18)^(j>>>18|N<<14)^(j<<23|N>>>9)),Z=z+((N>>>14|j<<18)^(N>>>18|j<<14)^(N<<23|j>>>9))+(Q>>>0>>0?1:0),Q=Q+X,Z=Z+Y+(Q>>>0>>0?1:0),Q=Q+ne,Z=Z+te+(Q>>>0>>0?1:0),Q=Q+q,Z=Z+J+(Q>>>0>>0?1:0),q=G+ee,V=$+V+(q>>>0>>0?1:0),z=H,K=U,H=B,U=L,B=N,L=j,j=T+Q|0,N=A+Z+(j>>>0>>0?1:0)|0,A=O,T=M,O=P,M=D,P=E,D=F,F=Q+q|0,E=Z+V+(F>>>0>>0?1:0)|0}h=r.low=h+F,r.high=p+E+(h>>>0>>0?1:0),y=i.low=y+D,i.high=d+P+(y>>>0>>0?1:0),g=a.low=g+M,a.high=v+O+(g>>>0>>0?1:0),b=o.low=b+T,o.high=m+A+(b>>>0>>0?1:0),w=c.low=w+j,c.high=k+N+(w>>>0>>0?1:0),S=l.low=S+L,l.high=x+B+(S>>>0>>0?1:0),C=f.low=C+U,f.high=_+H+(C>>>0>>0?1:0),R=n.low=R+K,n.high=I+z+(R>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=n._createHelper(r),t.HmacSHA512=n._createHmacHelper(r)}(),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var a=this._oKey=n.clone(),o=this._iKey=n.clone(),s=a.words,u=o.words,c=0;c>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*a,i=e.min(4*t,i),t){for(var u=0;uc;c++){if(16>c)i[c]=0|e[t+c];else{var l=i[c-3]^i[c-8]^i[c-14]^i[c-16];i[c]=l<<1|l>>>31}l=(r<<5|r>>>27)+u+i[c],l=20>c?l+(1518500249+(a&o|~a&s)):40>c?l+(1859775393+(a^o^s)):60>c?l+((a&o|a&s|o&s)-1894007588):l+((a^o^s)-899497514),u=s,s=o,o=a<<30|a>>>2,a=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(t),e.HmacSHA1=r._createHmacHelper(t)}(),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var a=this._oKey=n.clone(),o=this._iKey=n.clone(),s=a.words,u=o.words,c=0;c>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*a,i=e.min(4*t,i),t){for(var u=0;uc;c++){if(16>c)i[c]=0|e[t+c];else{var l=i[c-3]^i[c-8]^i[c-14]^i[c-16];i[c]=l<<1|l>>>31}l=(r<<5|r>>>27)+u+i[c],l=20>c?l+(1518500249+(a&o|~a&s)):40>c?l+(1859775393+(a^o^s)):60>c?l+((a&o|a&s|o&s)-1894007588):l+((a^o^s)-899497514),u=s,s=o,o=a<<30|a>>>2,a=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(t),e.HmacSHA1=r._createHmacHelper(t)}(),Object.defineProperty(r,"__esModule",{value:!0});var s,u=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n=200&&c.status<=299?s.$timeout(function(){a(e),i(e)}):(console.error("Request error:",e),s.$timeout(function(){o(e,c.status),u(e)}))}},"get"==t&&Object.keys(r).length>0&&(n+=s.formatParams(r)),c.open(t,n,!0),e.next=6,s.setAuthHeadersForRequest(c);case 6:c.setRequestHeader("Content-type","application/json"),"post"==t||"patch"==t?c.send(JSON.stringify(r)):c.send();case 8:case"end":return e.stop()}},e,s)}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"formatParams",value:function(e){return"?"+Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}}]),e}(),y=r.SFMigrationManager=function(){function e(t,n,r,o){var s=this;a(this,e),this.modelManager=t,this.syncManager=n,this.storageManager=r,this.completionHandlers=[],this.loadMigrations();var u=!1,c=o.addEventHandler(function(e){e==p.DidSignInEvent&&(u=!0)});this.syncManager.addEventHandler(function(){var e=i(regeneratorRuntime.mark(function e(t,n){var r,i,a,l,f,p,h,d,y,v;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r="local-data-loaded"==t,i="sync:completed"==t,!r&&!i){e.next=40;break}if(r?s.receivedLocalDataEvent=!0:i&&(s.receivedSyncCompletedEvent=!0),!s.receivedLocalDataEvent||!s.receivedSyncCompletedEvent){e.next=40;break}if(!u){e.next=39;break}return u=!1,o.removeEventHandler(c),e.next=10,s.getCompletedMigrations();case 10:a=e.sent.slice(),l=!0,f=!1,p=void 0,e.prev=14,h=a[Symbol.iterator]();case 16:if(l=(d=h.next()).done){e.next=25;break}return y=d.value,e.next=20,s.migrationForEncodedName(y);case 20:v=e.sent,v.runOnlyOnce||_.pull(s._completed,y);case 22:l=!0,e.next=16;break;case 25:e.next=31;break;case 27:e.prev=27,e.t0=e.catch(14),f=!0,p=e.t0;case 31:e.prev=31,e.prev=32,!l&&h.return&&h.return();case 34:if(e.prev=34,!f){e.next=37;break}throw p;case 37:return e.finish(34);case 38:return e.finish(31);case 39:s.runPendingMigrations();case 40:case"end":return e.stop()}},e,s,[[14,27,31,39],[32,,34,38]])}));return function(t,n){return e.apply(this,arguments)}}())}return l(e,[{key:"addCompletionHandler",value:function(e){this.completionHandlers.push(e)}},{key:"removeCompletionHandler",value:function(e){_.pull(this.completionHandlers,e)}},{key:"migrationForEncodedName",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decode(t);case 2:return n=e.sent,e.abrupt("return",this.migrations.find(function(e){return e.name==n}));case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"loadMigrations",value:function(){this.migrations=this.registeredMigrations()}},{key:"registeredMigrations",value:function(){}},{key:"runPendingMigrations",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a,o,s,u,c,l,f,p,h,d,y,v,g,m,b,k,w,x,S,_,C,I,R,E,F;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPendingMigrations();case 2:for(t=e.sent,n=!0,r=!1,i=void 0,e.prev=6,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)s=o.value,s.items=[];e.next=14;break;case 10:e.prev=10,e.t0=e.catch(6),r=!0,i=e.t0;case 14:e.prev=14,e.prev=15,!n&&a.return&&a.return();case 17:if(e.prev=17,!r){e.next=20;break}throw i;case 20:return e.finish(17);case 21:return e.finish(14);case 22:u=!0,c=!1,l=void 0,e.prev=25,f=this.modelManager.allNondummyItems[Symbol.iterator]();case 27:if(u=(p=f.next()).done){e.next=51;break}for(h=p.value,d=!0,y=!1,v=void 0,e.prev=32,g=t[Symbol.iterator]();!(d=(m=g.next()).done);d=!0)s=m.value,h.content_type==s.content_type&&s.items.push(h);e.next=40;break;case 36:e.prev=36,e.t1=e.catch(32),y=!0,v=e.t1;case 40:e.prev=40,e.prev=41,!d&&g.return&&g.return();case 43:if(e.prev=43,!y){e.next=46;break}throw v;case 46:return e.finish(43);case 47:return e.finish(40);case 48:u=!0,e.next=27;break;case 51:e.next=57;break;case 53:e.prev=53,e.t2=e.catch(25),c=!0,l=e.t2;case 57:e.prev=57,e.prev=58,!u&&f.return&&f.return();case 60:if(e.prev=60,!c){e.next=63;break}throw l;case 63:return e.finish(60);case 64:return e.finish(57);case 65:b=!0,k=!1,w=void 0,e.prev=68,x=t[Symbol.iterator]();case 70:if(b=(S=x.next()).done){e.next=81;break}if(s=S.value,!(s.items&&s.items.length>0||s.customHandler)){e.next=77;break}return e.next=75,this.runMigration(s,s.items);case 75:e.next=78;break;case 77:this.markMigrationCompleted(s);case 78:b=!0,e.next=70;break;case 81:e.next=87;break;case 83:e.prev=83,e.t3=e.catch(68),k=!0,w=e.t3;case 87:e.prev=87,e.prev=88,!b&&x.return&&x.return();case 90:if(e.prev=90,!k){e.next=93;break}throw w;case 93:return e.finish(90);case 94:return e.finish(87);case 95:for(_=!0,C=!1,I=void 0,e.prev=98,R=this.completionHandlers[Symbol.iterator]();!(_=(E=R.next()).done);_=!0)(F=E.value)();e.next=106;break;case 102:e.prev=102,e.t4=e.catch(98),C=!0,I=e.t4;case 106:e.prev=106,e.prev=107,!_&&R.return&&R.return();case 109:if(e.prev=109,!C){e.next=112;break}throw I;case 112:return e.finish(109);case 113:return e.finish(106);case 114:case"end":return e.stop()}},e,this,[[6,10,14,22],[15,,17,21],[25,53,57,65],[32,36,40,48],[41,,43,47],[58,,60,64],[68,83,87,95],[88,,90,94],[98,102,106,114],[107,,109,113]])}));return e}()},{key:"encode",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.btoa(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"decode",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.atob(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"getCompletedMigrations",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._completed){e.next=5;break}return e.next=3,this.storageManager.getItem("migrations");case 3:t=e.sent,this._completed=t?JSON.parse(t):[];case 5:return e.abrupt("return",this._completed);case 6:case"end":return e.stop()}},e,this)}));return e}()},{key:"getPendingMigrations",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a,o,s,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCompletedMigrations();case 2:t=e.sent,n=[],r=!0,i=!1,a=void 0,e.prev=7,o=this.migrations[Symbol.iterator]();case 9:if(r=(s=o.next()).done){e.next=22;break}return u=s.value,e.t0=t,e.next=14,this.encode(u.name);case 14:if(e.t1=e.sent,e.t2=e.t0.indexOf.call(e.t0,e.t1),e.t3=-1,e.t2!=e.t3){e.next=19;break}n.push(u);case 19:r=!0,e.next=9;break;case 22:e.next=28;break;case 24:e.prev=24,e.t4=e.catch(7),i=!0,a=e.t4;case 28:e.prev=28,e.prev=29,!r&&o.return&&o.return();case 31:if(e.prev=31,!i){e.next=34;break}throw a;case 34:return e.finish(31);case 35:return e.finish(28);case 36:return e.abrupt("return",n);case 37:case"end":return e.stop()}},e,this,[[7,24,28,36],[29,,31,35]])}));return e}()},{key:"markMigrationCompleted",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCompletedMigrations();case 2:return n=e.sent,e.t0=n,e.next=6,this.encode(t.name);case 6:e.t1=e.sent,e.t0.push.call(e.t0,e.t1),this.storageManager.setItem("migrations",JSON.stringify(n)),t.running=!1;case 10:case"end":return e.stop()}},e,this)}));return e}()},{key:"runMigration",value:function(){function e(e,n){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n){var r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.running){e.next=2;break}return e.abrupt("return");case 2:if(console.log("Running migration:",t.name),t.running=!0,!t.customHandler){e.next=8;break}return e.abrupt("return",t.customHandler().then(function(){r.markMigrationCompleted(t)}));case 8:return e.abrupt("return",t.handler(n).then(function(){r.markMigrationCompleted(t)}));case 9:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),v=r.SFModelManager=function(){function e(t){a(this,e),e.MappingSourceRemoteRetrieved="MappingSourceRemoteRetrieved",e.MappingSourceRemoteSaved="MappingSourceRemoteSaved",e.MappingSourceLocalSaved="MappingSourceLocalSaved",e.MappingSourceLocalRetrieved="MappingSourceLocalRetrieved",e.MappingSourceComponentRetrieved="MappingSourceComponentRetrieved",e.MappingSourceDesktopInstalled="MappingSourceDesktopInstalled",e.MappingSourceRemoteActionRetrieved="MappingSourceRemoteActionRetrieved",e.MappingSourceFileImport="MappingSourceFileImport",e.isMappingSourceRetrieved=function(t){return[e.MappingSourceRemoteRetrieved,e.MappingSourceComponentRetrieved,e.MappingSourceRemoteActionRetrieved].includes(t)},this.$timeout=t||setTimeout.bind(window),this.itemSyncObservers=[],this.itemsPendingRemoval=[],this.items=[],this.itemsHash={},this.missedReferences={},this.uuidChangeObservers=[]}return l(e,[{key:"handleSignout",value:function(){this.items.length=0,this.itemsHash={},this.itemsPendingRemoval.length=0,this.missedReferences={}}},{key:"addModelUuidChangeObserver",value:function(e,t){this.uuidChangeObservers.push({id:e,callback:t})}},{key:"notifyObserversOfUuidChange",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var a,o=this.uuidChangeObservers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.callback(e,t)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}},{key:"alternateUUIDForItem",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r,i,a,o,s,u,c;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.createItem(n,!0),t.next=3,SFJS.crypto.generateUUID();case 3:for(r.uuid=t.sent,r.informReferencesOfUUIDChange(n.uuid,r.uuid),this.informModelsOfUUIDChangeForItem(r,n.uuid,r.uuid),i=!0,a=!1,o=void 0,t.prev=9,s=n.referencingObjects[Symbol.iterator]();!(i=(u=s.next()).done);i=!0)c=u.value,c.setIsNoLongerBeingReferencedBy(n),n.setIsNoLongerBeingReferencedBy(c),c.addItemAsRelationship(r),c.setDirty(!0);t.next=17;break;case 13:t.prev=13,t.t0=t.catch(9),a=!0,o=t.t0;case 17:t.prev=17,t.prev=18,!i&&s.return&&s.return();case 20:if(t.prev=20,!a){t.next=23;break}throw o;case 23:return t.finish(20);case 24:return t.finish(17);case 25:return this.resolveReferencesForItem(r),console.log(n.uuid,"--\x3e",r.uuid),n.deleted=!0,n.content.references=[],n.setDirty(!1),this.mapResponseItemsToLocalModels([n],e.MappingSourceLocalSaved),this.addItem(r),r.setDirty(!0),this.notifyObserversOfUuidChange(n,r),t.abrupt("return",r);case 35:case"end":return t.stop()}},t,this,[[9,13,17,25],[18,,20,24]])}));return t}()},{key:"informModelsOfUUIDChangeForItem",value:function(e,t,n){var r=!0,i=!1,a=void 0;try{for(var o,s=this.items[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){o.value.potentialItemOfInterestHasChangedItsUUID(e,t,n)}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}}},{key:"didSyncModelsOffline",value:function(t){this.notifySyncObserversOfModels(t,e.MappingSourceLocalSaved)}},{key:"mapResponseItemsToLocalModels",value:function(e,t,n){return this.mapResponseItemsToLocalModelsWithOptions({items:e,source:t,sourceKey:n})}},{key:"mapResponseItemsToLocalModelsOmittingFields",value:function(e,t,n,r){return this.mapResponseItemsToLocalModelsWithOptions({items:e,omitFields:t,source:n,sourceKey:r})}},{key:"mapResponseItemsToLocalModelsWithOptions",value:function(e){var t=e.items,n=e.omitFields,r=e.source,i=e.sourceKey,a=(e.options,[]),o=[],s=[],c=!0,l=!1,f=void 0;try{for(var p,h=t[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var d=p.value;if(d){var y=!d.content&&!d.errorDecrypting;if(!(!d.content_type||!d.uuid)&&!y||d.deleted){if(Array.isArray(n)){var v=!0,g=!1,m=void 0;try{for(var b,k=n[Symbol.iterator]();!(v=(b=k.next()).done);v=!0){delete d[b.value]}}catch(e){g=!0,m=e}finally{try{!v&&k.return&&k.return()}finally{if(g)throw m}}}var w=this.findItem(d.uuid);if(w&&(w.updateFromJSON(d),w.dummy=!1),this.itemsPendingRemoval.includes(d.uuid))_.pull(this.itemsPendingRemoval,d.uuid);else{var x=d.content_type||w&&w.content_type;if(!(this.acceptableContentTypes&&!this.acceptableContentTypes.includes(x))){var S=!1;if(1==d.deleted){if(!d.dirty){w&&(s.push(w),this.removeItemLocally(w));continue}S=!0}w||(w=this.createItem(d,!0)),this.addItem(w,S),w.errorDecrypting||s.push(w),a.push(w),o.push(d)}}}else console.error("Server response item is corrupt:",d)}}}catch(e){l=!0,f=e}finally{try{!c&&h.return&&h.return()}finally{if(l)throw f}}var C=!0,I=!1,R=void 0;try{for(var E,F=o.entries()[Symbol.iterator]();!(C=(E=F.next()).done);C=!0){var P=E.value,D=u(P,2),O=D[0],M=D[1],A=a[O];M.content&&this.resolveReferencesForItem(A),A.didFinishSyncing()}}catch(e){I=!0,R=e}finally{try{!C&&F.return&&F.return()}finally{if(I)throw R}}var T=this.popMissedReferenceStructsForObjects(o),N=!0,j=!1,B=void 0;try{for(var L,H=T[Symbol.iterator]();!(N=(L=H.next()).done);N=!0){var U=L.value;!function(e){var t=a.find(function(t){return t.uuid==e.reference_uuid});if(t){e.for_item.addItemAsRelationship(t)}}(U)}}catch(e){j=!0,B=e}finally{try{!N&&H.return&&H.return()}finally{if(j)throw B}}return this.notifySyncObserversOfModels(s,r,i),a}},{key:"missedReferenceBuildKey",value:function(e,t){return e+":"+t}},{key:"popMissedReferenceStructsForObjects",value:function(e){if(!e||0==e.length)return[];var t=[],n=[],r=e.map(function(e){return e.uuid}),i=r[0].length,a=Object.keys(this.missedReferences),o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;r.includes(f.substring(0,i))&&(t.push(this.missedReferences[f]),n.push(f))}}catch(e){s=!0,u=e}finally{try{!o&&l.return&&l.return()}finally{if(s)throw u}}var p=!0,h=!1,d=void 0;try{for(var y,v=n[Symbol.iterator]();!(p=(y=v.next()).done);p=!0){var g=y.value;delete this.missedReferences[g]}}catch(e){h=!0,d=e}finally{try{!p&&v.return&&v.return()}finally{if(h)throw d}}return t}},{key:"resolveReferencesForItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.errorDecrypting){var n=e.contentObject;if(e.updateLocalRelationships(),n.references){var r=n.references.slice(),i=r.map(function(e){return e.uuid}),a=this.findItems(i,!0),o=!0,s=!1,c=void 0;try{for(var l,f=a.entries()[Symbol.iterator]();!(o=(l=f.next()).done);o=!0){var p=l.value,h=u(p,2),d=h[0],y=h[1];if(y)e.addItemAsRelationship(y),t&&y.setDirty(!0);else{var v=i[d],g=this.missedReferenceBuildKey(v,e.uuid);if(!this.missedReferences[g]){var m={reference_uuid:v,for_item:e};this.missedReferences[g]=m}}}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}}}}},{key:"notifySyncObserversOfModels",value:function(e,t,n){var r=this,i=this.itemSyncObservers.sort(function(e,t){return e.priority0&&r._callSyncObserverCallbackWithTimeout(i,a,o,s,t,n)}(l)}}catch(e){o=!0,s=e}finally{try{!a&&c.return&&c.return()}finally{if(o)throw s}}}},{key:"_callSyncObserverCallbackWithTimeout",value:function(e,t,n,r,i,a){this.$timeout(function(){e.callback(t,n,r,i,a)})}},{key:"createItem",value:function(t,n){var r=e.ContentTypeClassMapping&&e.ContentTypeClassMapping[t.content_type];r||(r=x);var i=new r(t);return n||this.notifySyncObserversOfModels([i],e.MappingSourceLocalSaved),i}},{key:"createConflictedItem",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,SFJS.crypto.generateUUID();case 2:return n=e.sent,t=_.merge(t,{uuid:n}),r=this.createItem(t,!0),e.abrupt("return",r);case 6:case"end":return e.stop()}},e,this)}));return e}()},{key:"addConflictedItem",value:function(e,t){this.addItem(e);var n=!0,r=!1,i=void 0;try{for(var a,o=t.referencingObjects[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.addItemAsRelationship(e),s.setDirty(!0)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}this.resolveReferencesForItem(e),e.content.conflict_of=t.uuid,e.setDirty(!0)}},{key:"duplicateItem",value:function(e){var t=new e.constructor({content:e.content});t.created_at=e.created_at,t.content_type=e.content_type,this.addItem(t);var n=!0,r=!1,i=void 0;try{for(var a,o=e.referencingObjects[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.addItemAsRelationship(t),s.setDirty(!0)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return this.resolveReferencesForItem(t),t.setDirty(!0),t}},{key:"addItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.addItems([e],t)}},{key:"addItems",value:function(e){var t=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.forEach(function(e){t.itemsHash[e.uuid]||(t.itemsHash[e.uuid]=e,t.items.push(e))})}},{key:"addItemSyncObserver",value:function(e,t,n){this.addItemSyncObserverWithPriority({id:e,types:t,callback:n,priority:1})}},{key:"addItemSyncObserverWithPriority",value:function(e){var t=e.id,n=e.priority,r=e.types,i=e.callback;Array.isArray(r)||(r=[r]),this.itemSyncObservers.push({id:t,types:r,priority:n,callback:i})}},{key:"removeItemSyncObserver",value:function(e){_.remove(this.itemSyncObservers,_.find(this.itemSyncObservers,{id:e}))}},{key:"getDirtyItems",value:function(){return this.items.filter(function(e){return 1==e.dirty&&!e.dummy&&(!e.errorDecrypting||e.deleted)})}},{key:"clearDirtyItems",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){i.value.setDirty(!1)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}},{key:"setItemToBeDeleted",value:function(e){e.deleted=!0,e.dummy||e.setDirty(!0),this.removeAndDirtyAllRelationshipsForItem(e)}},{key:"removeAndDirtyAllRelationshipsForItem",value:function(e){if(!e.errorDecrypting){var t=!0,n=!1,r=void 0;try{for(var i,a=e.content.references[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=this.findItem(o.uuid);s&&(e.removeItemAsRelationship(s),s.hasRelationshipWithItem(e)&&(s.removeItemAsRelationship(e),s.setDirty(!0)))}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}var u=!0,c=!1,l=void 0;try{for(var f,p=e.referencingObjects[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var h=f.value;h.removeItemAsRelationship(e),h.setDirty(!0)}}catch(e){c=!0,l=e}finally{try{!u&&p.return&&p.return()}finally{if(c)throw l}}e.referencingObjects=[]}},{key:"setAllItemsDirty",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.allItems,n=!0,r=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.setDirty(!0,e)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}},{key:"removeItemLocally",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:_.remove(this.items,{uuid:t.uuid}),delete this.itemsHash[t.uuid],t.isBeingRemovedLocally(),this.itemsPendingRemoval.push(t.uuid);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"allItemsMatchingTypes",value:function(e){return this.allItems.filter(function(t){return(_.includes(e,t.content_type)||_.includes(e,"*"))&&!t.dummy})}},{key:"invalidItems",value:function(){return this.allItems.filter(function(e){return e.errorDecrypting})}},{key:"validItemsForContentType",value:function(e){return this.allItems.filter(function(t){return t.content_type==e&&!t.errorDecrypting})}},{key:"findItem",value:function(e){return this.itemsHash[e]}},{key:"findItems",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value,c=this.itemsHash[u];(c||t)&&n.push(c)}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}},{key:"itemsMatchingPredicate",value:function(e){return this.itemsMatchingPredicates([e])}},{key:"itemsMatchingPredicates",value:function(e){return this.filterItemsWithPredicates(this.allItems,e)}},{key:"filterItemsWithPredicates",value:function(e,t){return e.filter(function(e){var n=!0,r=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(!e.satisfiesPredicate(s))return!1}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return!0})}},{key:"importItems",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r,i,a,o,s,u,c,l,f,p,h,d,y,v,g,m;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=[],i=!0,a=!1,o=void 0,t.prev=4,s=n[Symbol.iterator]();case 6:if(i=(u=s.next()).done){t.next=21;break}if(c=u.value,!(l=this.findItem(c.uuid))||l.errorDecrypting){t.next=16;break}return t.next=12,this.createConflictedItem(c);case 12:f=t.sent,c.deleted||l.isItemContentEqualWith(f)||(this.addConflictedItem(f,l),r.push(f)),t.next=18;break;case 16:r.push(c),l&&l.errorDecrypting&&(l.errorDecrypting=!1);case 18:i=!0,t.next=6;break;case 21:t.next=27;break;case 23:t.prev=23,t.t0=t.catch(4),a=!0,o=t.t0;case 27:t.prev=27,t.prev=28,!i&&s.return&&s.return();case 30:if(t.prev=30,!a){t.next=33;break}throw o;case 33:return t.finish(30);case 34:return t.finish(27);case 35:for(p=this.mapResponseItemsToLocalModels(r,e.MappingSourceFileImport),h=!0,d=!1,y=void 0,t.prev=39,v=p[Symbol.iterator]();!(h=(g=v.next()).done);h=!0)m=g.value,m.setDirty(!0,!0),m.deleted=!1;t.next=47;break;case 43:t.prev=43,t.t1=t.catch(39),d=!0,y=t.t1;case 47:t.prev=47,t.prev=48,!h&&v.return&&v.return();case 50:if(t.prev=50,!d){t.next=53;break}throw y;case 53:return t.finish(50);case 54:return t.finish(47);case 55:return t.abrupt("return",p);case 56:case"end":return t.stop()}},t,this,[[4,23,27,35],[28,,30,34],[39,43,47,55],[48,,50,54]])}));return t}()},{key:"getAllItemsJSONData",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.getJSONDataForItems(this.allItems,t,n,r));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"getJSONDataForItems",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(t.map(function(e){return new S(e,n,r).paramsForExportFile()})).then(function(e){if(i&&0==e.length)return null;var t={items:e};return n&&(t.auth_params=r),JSON.stringify(t,null,2)}));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"computeDataIntegrityHash",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=this.allNondummyItems.sort(function(e,t){return t.updated_at-e.updated_at}),n=t.map(function(e){return e.updatedAtTimestamp()}),r=n.join(","),e.next=6,SFJS.crypto.sha256(r);case 6:return i=e.sent,e.abrupt("return",i);case 10:return e.prev=10,e.t0=e.catch(0),console.error("Error computing data integrity hash",e.t0),e.abrupt("return",null);case 14:case"end":return e.stop()}},e,this,[[0,10]])}));return e}()},{key:"allItems",get:function(){return this.items.slice()}},{key:"allNondummyItems",get:function(){return this.items.filter(function(e){return!e.dummy})}}]),e}(),g=r.SFPrivilegesManager=function(){function e(t,n,r){a(this,e),this.modelManager=t,this.syncManager=n,this.singletonManager=r,this.loadPrivileges(),e.CredentialAccountPassword="CredentialAccountPassword",e.CredentialLocalPasscode="CredentialLocalPasscode",e.ActionManageExtensions="ActionManageExtensions",e.ActionManageBackups="ActionManageBackups",e.ActionViewProtectedNotes="ActionViewProtectedNotes",e.ActionManagePrivileges="ActionManagePrivileges",e.ActionManagePasscode="ActionManagePasscode",e.ActionDeleteNote="ActionDeleteNote",e.SessionExpiresAtKey="SessionExpiresAtKey",e.SessionLengthKey="SessionLengthKey",e.SessionLengthNone=0,e.SessionLengthFiveMinutes=300,e.SessionLengthOneHour=3600,e.SessionLengthOneWeek=604800,this.availableActions=[e.ActionViewProtectedNotes,e.ActionDeleteNote,e.ActionManagePasscode,e.ActionManageBackups,e.ActionManageExtensions,e.ActionManagePrivileges],this.availableCredentials=[e.CredentialAccountPassword,e.CredentialLocalPasscode],this.sessionLengths=[e.SessionLengthNone,e.SessionLengthFiveMinutes,e.SessionLengthOneHour,e.SessionLengthOneWeek,e.SessionLengthIndefinite]}return l(e,[{key:"setDelegate",value:function(e){this.delegate=e}},{key:"getAvailableActions",value:function(){return this.availableActions}},{key:"getAvailableCredentials",value:function(){return this.availableCredentials}},{key:"netCredentialsForAction",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r,i,a,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getPrivileges();case 2:t.t0=n,r=t.sent.getCredentialsForAction(t.t0),i=[],a=!0,o=!1,s=void 0,t.prev=8,u=r[Symbol.iterator]();case 10:if(a=(c=u.next()).done){t.next=27;break}if((l=c.value)!=e.CredentialAccountPassword){t.next=19;break}return t.next=15,this.delegate.isOffline();case 15:f=t.sent,f||i.push(l),t.next=24;break;case 19:if(l!=e.CredentialLocalPasscode){t.next=24;break}return t.next=22,this.delegate.hasLocalPasscode();case 22:p=t.sent,p&&i.push(l);case 24:a=!0,t.next=10;break;case 27:t.next=33;break;case 29:t.prev=29,t.t1=t.catch(8),o=!0,s=t.t1;case 33:t.prev=33,t.prev=34,!a&&u.return&&u.return();case 36:if(t.prev=36,!o){t.next=39;break}throw s;case 39:return t.finish(36);case 40:return t.finish(33);case 41:return t.abrupt("return",i);case 42:case"end":return t.stop()}},t,this,[[8,29,33,41],[34,,36,40]])}));return t}()},{key:"loadPrivileges",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.loadPromise){e.next=2;break}return e.abrupt("return",this.loadPromise);case 2:return this.loadPromise=new Promise(function(e,n){var r=I.contentType(),a=new C("content_type","=",r);t.singletonManager.registerSingleton([a],function(n){t.privileges=n,e(n)},function(){var n=i(regeneratorRuntime.mark(function n(i){var a;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=new I({content_type:r}),SFJS.crypto.generateUUIDSync){n.next=4;break}return n.next=4,a.initUUID();case 4:t.modelManager.addItem(a),a.setDirty(!0),t.syncManager.sync(),i(a),e(a);case 9:case"end":return n.stop()}},n,t)}));return function(e){return n.apply(this,arguments)}}())}),e.abrupt("return",this.loadPromise);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"getPrivileges",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.privileges){e.next=4;break}return e.abrupt("return",this.privileges);case 4:return e.abrupt("return",this.loadPrivileges());case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"displayInfoForCredential",value:function(t){var n={};return n[e.CredentialAccountPassword]={label:"Account Password",prompt:"Please enter your account password."},n[e.CredentialLocalPasscode]={label:"Local Passcode",prompt:"Please enter your local passcode."},n[t]}},{key:"displayInfoForAction",value:function(t){var n={};return n[e.ActionManageExtensions]={label:"Manage Extensions"},n[e.ActionManageBackups]={label:"Download/Import Backups"},n[e.ActionViewProtectedNotes]={label:"View Protected Notes"},n[e.ActionManagePrivileges]={label:"Manage Privileges"},n[e.ActionManagePasscode]={label:"Manage Passcode"},n[e.ActionDeleteNote]={label:"Delete Notes"},n[t]}},{key:"getSessionLengthOptions",value:function(){return[{value:e.SessionLengthNone,label:"Don't Remember"},{value:e.SessionLengthFiveMinutes,label:"5 Minutes"},{value:e.SessionLengthOneHour,label:"1 Hour"},{value:e.SessionLengthOneWeek,label:"1 Week"}]}},{key:"setSessionLength",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r,i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=function(e){var t=new Date;return t.setSeconds(t.getSeconds()+e),t},i=r(n),t.abrupt("return",Promise.all([this.delegate.saveToStorage(e.SessionExpiresAtKey,JSON.stringify(i)),this.delegate.saveToStorage(e.SessionLengthKey,JSON.stringify(n))]));case 3:case"end":return t.stop()}},t,this)}));return t}()},{key:"clearSession",value:function(){function t(){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.setSessionLength(e.SessionLengthNone));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"getSelectedSessionLength",value:function(){function t(){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.delegate.getFromStorage(e.SessionLengthKey);case 2:if(!(n=t.sent)){t.next=7;break}return t.abrupt("return",JSON.parse(n));case 7:return t.abrupt("return",e.SessionLengthNone);case 8:case"end":return t.stop()}},t,this)}));return t}()},{key:"getSessionExpirey",value:function(){function t(){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.delegate.getFromStorage(e.SessionExpiresAtKey);case 2:if(!(n=t.sent)){t.next=7;break}return t.abrupt("return",new Date(JSON.parse(n)));case 7:return t.abrupt("return",new Date);case 8:case"end":return t.stop()}},t,this)}));return t}()},{key:"actionHasPrivilegesConfigured",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.netCredentialsForAction(t);case 2:return e.t0=e.sent.length,e.abrupt("return",e.t0>0);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"actionRequiresPrivilege",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSessionExpirey();case 2:if(!((n=e.sent)>new Date)){e.next=5;break}return e.abrupt("return",!1);case 5:return e.next=7,this.netCredentialsForAction(t);case 7:return r=e.sent,e.abrupt("return",r.length>0);case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"savePrivileges",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPrivileges();case 2:t=e.sent,t.setDirty(!0),this.syncManager.sync();case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"authenticateAction",value:function(){function e(e,n){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n){var r,i,a,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.netCredentialsForAction(t);case 2:r=e.sent,i=[],a=[],o=!0,s=!1,u=void 0,e.prev=7,c=r[Symbol.iterator]();case 9:if(o=(l=c.next()).done){e.next=18;break}return f=l.value,e.next=13,this._verifyAuthenticationParameters(f,n[f]);case 13:p=e.sent,p?i.push(f):a.push(f);case 15:o=!0,e.next=9;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(7),s=!0,u=e.t0;case 24:e.prev=24,e.prev=25,!o&&c.return&&c.return();case 27:if(e.prev=27,!s){e.next=30;break}throw u;case 30:return e.finish(27);case 31:return e.finish(24);case 32:return e.abrupt("return",{success:0==a.length,successfulCredentials:i,failedCredentials:a});case 33:case"end":return e.stop()}},e,this,[[7,20,24,32],[25,,27,31]])}));return e}()},{key:"_verifyAuthenticationParameters",value:function(){function t(e,t){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n,r){var a,o,s=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=function(){var e=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s.delegate.verifyAccountPassword(t));case 1:case"end":return e.stop()}},e,s)}));return function(t){return e.apply(this,arguments)}}(),o=function(){var e=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s.delegate.verifyLocalPasscode(t));case 1:case"end":return e.stop()}},e,s)}));return function(t){return e.apply(this,arguments)}}(),n!=e.CredentialAccountPassword){t.next=6;break}return t.abrupt("return",a(r));case 6:if(n!=e.CredentialLocalPasscode){t.next=8;break}return t.abrupt("return",o(r));case 8:case"end":return t.stop()}},t,this)}));return t}()}]),e}(),m=r.SFSessionHistoryManager=function(){function e(t,n,r,i,o){var s=this;a(this,e),this.modelManager=t,this.storageManager=n,this.$timeout=o||setTimeout.bind(window),this.keyRequestHandler=r,this.loadFromDisk().then(function(){s.modelManager.addItemSyncObserver("session-history",i,function(e,t,n,r,i){var a=!0,o=!1,u=void 0;try{for(var c,l=e[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value;try{s.addHistoryEntryForItem(f)}catch(e){console.log("Caught exception while trying to add item history entry",e)}}}catch(e){o=!0,u=e}finally{try{!a&&l.return&&l.return()}finally{if(o)throw u}}})})}return l(e,[{key:"encryptionParams",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.keyRequestHandler());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"addHistoryEntryForItem",value:function(e){var t=this,n={uuid:e.uuid,content_type:e.content_type,updated_at:e.updated_at,content:e.content},r=this.historySession.addEntryForItem(n);this.autoOptimize&&this.historySession.optimizeHistoryForItem(e),r&&this.diskEnabled&&(this.diskTimeout&&(this.$timeout.hasOwnProperty("cancel")?this.$timeout.cancel(this.diskTimeout):clearTimeout(this.diskTimeout)),this.diskTimeout=this.$timeout(function(){t.saveToDisk()},2e3))}},{key:"historyForItem",value:function(e){return this.historySession.historyForItem(e)}},{key:"clearHistoryForItem",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.historySession.clearItemHistory(t),e.abrupt("return",this.saveToDisk());case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"clearAllHistory",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.historySession.clearAllHistory(),e.abrupt("return",this.storageManager.removeItem("sessionHistory_revisions"));case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"toggleDiskSaving",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.diskEnabled=!this.diskEnabled,!this.diskEnabled){e.next=6;break}this.storageManager.setItem("sessionHistory_persist",JSON.stringify(!0)),this.saveToDisk(),e.next=8;break;case 6:return this.storageManager.setItem("sessionHistory_persist",JSON.stringify(!1)),e.abrupt("return",this.storageManager.removeItem("sessionHistory_revisions"));case 8:case"end":return e.stop()}},e,this)}));return e}()},{key:"saveToDisk",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.diskEnabled){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.encryptionParams();case 4:t=e.sent,n=new S(this.historySession,t.keys,t.auth_params),n.paramsForSync().then(function(e){r.storageManager.setItem("sessionHistory_revisions",JSON.stringify(e))});case 7:case"end":return e.stop()}},e,this)}));return e}()},{key:"loadFromDisk",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.storageManager.getItem("sessionHistory_persist");case 2:return t=e.sent,t&&(this.diskEnabled=JSON.parse(t)),e.next=6,this.storageManager.getItem("sessionHistory_revisions");case 6:if(!(n=e.sent)){e.next=18;break}return n=JSON.parse(n),e.next=11,this.encryptionParams();case 11:return r=e.sent,e.next=14,SFJS.itemTransformer.decryptItem(n,r.keys);case 14:i=new R(n),this.historySession=i,e.next=19;break;case 18:this.historySession=new R;case 19:return e.next=21,this.storageManager.getItem("sessionHistory_autoOptimize");case 21:a=e.sent,this.autoOptimize=!a||JSON.parse(a);case 23:case"end":return e.stop()}},e,this)}));return e}()},{key:"toggleAutoOptimize",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.autoOptimize=!this.autoOptimize,this.autoOptimize?this.storageManager.setItem("sessionHistory_autoOptimize",JSON.stringify(!0)):this.storageManager.setItem("sessionHistory_autoOptimize",JSON.stringify(!1));case 2:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),b=r.SFSingletonManager=function(){function e(t,n){var r=this;a(this,e),this.syncManager=n,this.modelManager=t,this.singletonHandlers=[],t.addItemSyncObserverWithPriority({id:"sf-singleton-manager",types:"*",priority:-1,callback:function(){r.resolveSingletons(t.allNondummyItems,null,!0)}}),n.addEventHandler(function(e,n){if("local-data-loaded"==e)r.resolveSingletons(t.allNondummyItems,null,!0),r.initialDataLoaded=!0;else if("sync:completed"==e){if(!r.initialDataLoaded)return;r.resolveSingletons(n.retrievedItems,n.savedItems)}}),t.addModelUuidChangeObserver("singleton-manager",function(e,t){var n=!0,i=!1,a=void 0;try{for(var o,s=r.singletonHandlers[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;u.singleton&&C.ItemSatisfiesPredicates(t,u.predicates)&&(u.singleton=null,r.resolveSingletons([t]))}}catch(e){i=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}})}return l(e,[{key:"registerSingleton",value:function(e,t,n){this.singletonHandlers.push({predicates:e,resolutionCallback:t,createBlock:n})}},{key:"resolveSingletons",value:function(e,t,n){var r=this;e=e||[],t=t||[];var i=!0,a=!1,o=void 0;try{for(var s,u=this.singletonHandlers[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;!function(i){var a=i.predicates.slice(),o=r.modelManager.filterItemsWithPredicates(e,a),s=function(){i.createBlock&&(i.pendingCreateBlockCallback=!0,i.createBlock(function(e){i.singleton=e,i.pendingCreateBlockCallback=!1,i.resolutionCallback&&i.resolutionCallback(e)}))},u=r.modelManager.filterItemsWithPredicates(t,a).length;if(o.length>0||u>0){var c=r.modelManager.itemsMatchingPredicates(a);if(c.length>=2){var l=c.sort(function(e,t){return e.errorDecrypting?1:t.errorDecrypting?-1:e.created_at=this.MaxDiscordanceBeforeOutOfSync&&(this.outOfSync||(this.outOfSync=!0,this.notifyEvent("enter-out-of-sync"))),e.abrupt("return",!1);case 13:return this.outOfSync&&(this.outOfSync=!1,this.notifyEvent("exit-out-of-sync")),this.syncDiscordance=0,e.abrupt("return",!0);case 16:case"end":return e.stop()}},e,this)}));return e}()},{key:"isOutOfSync",value:function(){return this.outOfSync}},{key:"getServerURL",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.storageManager.getItem("server");case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0=window._default_sf_server;case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}},e,this)}));return e}()},{key:"getSyncURL",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getServerURL();case 2:return e.t0=e.sent,e.abrupt("return",e.t0+"/items/sync");case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"registerSyncStatusObserver",value:function(e){var t={key:new Date,callback:e};return this.syncStatusObservers.push(t),t}},{key:"removeSyncStatusObserver",value:function(e){_.pull(this.syncStatusObservers,e)}},{key:"syncStatusDidChange",value:function(){var e=this;this.syncStatusObservers.forEach(function(t){t.callback(e.syncStatus)})}},{key:"addEventHandler",value:function(e){return this.eventHandlers.push(e),e}},{key:"removeEventHandler",value:function(e){_.pull(this.eventHandlers,e)}},{key:"notifyEvent",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var a,o=this.eventHandlers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){(0,a.value)(e,t||{})}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}},{key:"setKeyRequestHandler",value:function(e){this.keyRequestHandler=e}},{key:"getActiveKeyInfo",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.keyRequestHandler(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"initialDataLoaded",value:function(){return this._initialDataLoaded}},{key:"loadLocalItems",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.storageManager.getAllModels().then(function(t){t=t.sort(function(e,t){var n=new Date(t.updated_at)-new Date(e.updated_at),i=r.contentTypeLoadPriority,a=0,o=0;return i&&(a=i.indexOf(e.content_type),o=i.indexOf(t.content_type),-1==a&&(a=i.length),-1==o&&(o=i.length)),a==o?n:a5&&(this.notifyEvent("sync:taking-too-long"),this.stopCheckingIfSyncIsTakingTooLong())}.bind(this),500)}},{key:"stopCheckingIfSyncIsTakingTooLong",value:function(){this.$interval.hasOwnProperty("cancel")?this.$interval.cancel(this.syncStatus.checker):clearInterval(this.syncStatus.checker),this.syncStatus.checker=null}},{key:"lockSyncing",value:function(){this.syncLocked=!0}},{key:"unlockSyncing",value:function(){this.syncLocked=!1}},{key:"sync",value:function(){function t(){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=i(regeneratorRuntime.mark(function t(i,a){var o,s,u,c,l,f,p,h,d,y,v,g,m;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.syncLocked){t.next=4;break}return console.log("Sync Locked, Returning;"),i(),t.abrupt("return");case 4:if(r||(r={}),o=n.modelManager.getDirtyItems(),s=o.filter(function(e){return e.dirtyCount>0&&(e.dirtyCount=0,!0)}),!n.syncStatus.syncOpInProgress||r.force){t.next=14;break}return n.repeatOnCompletion=!0,n.queuedCallbacks.push(i),t.next=12,n.writeItemsToLocalStorage(s,!1);case 12:return console.log("Sync op in progress; returning."),t.abrupt("return");case 14:return t.next=16,n.getActiveKeyInfo(e.KeyRequestLoadSaveAccount);case 16:if(u=t.sent,!u.offline){t.next=20;break}return n.syncOffline(o).then(function(e){n.modelManager.clearDirtyItems(o),i(e)}).catch(function(e){n.notifyEvent("sync-exception",e)}),t.abrupt("return");case 20:return c=n.syncStatus.needsMoreSync,n.syncStatus.syncOpInProgress=!0,n.syncStatus.syncStart=new Date,n.beginCheckingIfSyncIsTakingTooLong(),l=n.PerSyncItemUploadLimit,f=o.slice(0,l),f.lengthn.syncStatus.total&&(n.syncStatus.total=n.syncStatus.current),n.syncStatusDidChange(),t.next=32,n.writeItemsToLocalStorage(s,!1);case 32:return r.onPreSyncSave&&r.onPreSyncSave(),n.allRetreivedItems||(n.allRetreivedItems=[]),n.allSavedItems||(n.allSavedItems=[]),p={},p.limit=150,r.performIntegrityCheck&&(p.compute_integrity=!0),t.prev=38,t.next=41,Promise.all(f.map(function(e){var t=new S(e,u.keys,u.auth_params);return t.additionalFields=r.additionalFields,t.paramsForSync()})).then(function(e){p.items=e});case 41:t.next=46;break;case 43:t.prev=43,t.t0=t.catch(38),n.notifyEvent("sync-exception",t.t0);case 46:for(h=!0,d=!1,y=void 0,t.prev=49,v=f[Symbol.iterator]();!(h=(g=v.next()).done);h=!0)m=g.value,m.dirtyCount=0;t.next=57;break;case 53:t.prev=53,t.t1=t.catch(49),d=!0,y=t.t1;case 57:t.prev=57,t.prev=58,!h&&v.return&&v.return();case 60:if(t.prev=60,!d){t.next=63;break}throw y;case 63:return t.finish(60);case 64:return t.finish(57);case 65:return t.next=67,n.getSyncToken();case 67:return p.sync_token=t.sent,t.next=70,n.getCursorToken();case 70:return p.cursor_token=t.sent,t.prev=71,t.t2=n.httpManager,t.next=75,n.getSyncURL();case 75:t.t3=t.sent,t.t4=p,t.t5=function(e){n.handleSyncSuccess(f,e,r).then(function(){i(e)}).catch(function(e){console.log("Caught sync success exception:",e),n.handleSyncError(null,null,o).then(function(e){i(e)})})},t.t6=function(e,t){n.handleSyncError(e,t,o).then(function(e){i(e)})},t.t2.postAbsolute.call(t.t2,t.t3,t.t4,t.t5,t.t6),t.next=85;break;case 82:t.prev=82,t.t7=t.catch(71),console.log("Sync exception caught:",t.t7);case 85:case"end":return t.stop()}},t,n,[[38,43],[49,53,57,65],[58,,60,64],[71,82]])}));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"handleSyncSuccess",value:function(){function t(e,t,r){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n,r,i){var a,o,s,u,c,l,f,p,h,d,y,g,m,b,k=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(a=[],o=!0,s=!1,u=void 0,t.prev=4,c=n[Symbol.iterator]();!(o=(l=c.next()).done);o=!0)f=l.value,0==f.dirtyCount&&a.push(f);t.next=12;break;case 8:t.prev=8,t.t0=t.catch(4),s=!0,u=t.t0;case 12:t.prev=12,t.prev=13,!o&&c.return&&c.return();case 15:if(t.prev=15,!s){t.next=18;break}throw u;case 18:return t.finish(15);case 19:return t.finish(12);case 20:return this.modelManager.clearDirtyItems(a),this.syncStatus.error=null,p=this.allSavedItems.map(function(e){return e.uuid}),r.retrieved_items=r.retrieved_items.filter(function(e){return!p.includes(e.uuid)}),t.next=26,this.handleItemsResponse(r.retrieved_items,null,v.MappingSourceRemoteRetrieved,e.KeyRequestLoadSaveAccount);case 26:return h=t.sent,this.allRetreivedItems=this.allRetreivedItems.concat(h),this.syncStatus.retrievedCount=this.allRetreivedItems.length,d=["content","auth_hash"],t.next=32,this.handleItemsResponse(r.saved_items,d,v.MappingSourceRemoteSaved,e.KeyRequestLoadSaveAccount);case 32:return y=t.sent,this.allSavedItems=this.allSavedItems.concat(y),g=r.unsaved,t.next=37,this.handleUnsavedItemsResponse(g);case 37:return t.next=39,this.writeItemsToLocalStorage(y,!1);case 39:return t.next=41,this.writeItemsToLocalStorage(h,!1);case 41:if(this.syncStatus.syncOpInProgress=!1,this.syncStatus.current+=n.length,this.syncStatusDidChange(),this.setSyncToken(r.sync_token),this.setCursorToken(r.cursor_token),this.stopCheckingIfSyncIsTakingTooLong(),!r.integrity_hash||r.cursor_token){t.next=52;break}return t.next=50,this.handleServerIntegrityHash(r.integrity_hash);case 50:m=t.sent,m||this.syncDiscordance=this.majorDataChangeThreshold||y.length>=this.majorDataChangeThreshold||g.length>=this.majorDataChangeThreshold)&&this.notifyEvent("major-data-change"),this.callQueuedCallbacks(r),this.notifyEvent("sync:completed",{retrievedItems:this.allRetreivedItems,savedItems:this.allSavedItems,unsavedItems:g}),this.allRetreivedItems=[],this.allSavedItems=[],t.abrupt("return",r);case 72:case"end":return t.stop()}},t,this,[[4,8,12,20],[13,,15,19]])}));return t}()},{key:"handleSyncError",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("Sync error: ",t),401==n&&this.notifyEvent("sync-session-invalid"),t?"string"==typeof t&&(t={error:{message:t}}):t={error:{message:"Could not connect to server."}},this.syncStatus.syncOpInProgress=!1,this.syncStatus.error=t.error,this.syncStatusDidChange(),this.writeItemsToLocalStorage(r,!1),this.modelManager.didSyncModelsOffline(r),this.stopCheckingIfSyncIsTakingTooLong(),this.notifyEvent("sync:error",t.error),this.callQueuedCallbacks({error:"Sync error"}),e.abrupt("return",t);case 12:case"end":return e.stop()}},e,this)}));return e}()},{key:"handleItemsResponse",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){var a,o,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getActiveKeyInfo(i);case 2:return a=e.sent.keys,e.next=5,SFJS.itemTransformer.decryptMultipleItems(t,a);case 5:return o=this.modelManager.mapResponseItemsToLocalModelsOmittingFields(t,n,r),s=o.filter(function(e){var t=e.errorDecryptingValueChanged;return e.errorDecryptingValueChanged=!1,t}),s.length>0&&this.writeItemsToLocalStorage(s,!1),e.abrupt("return",o);case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"refreshErroredItems",value:function(){function t(){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.modelManager.allNondummyItems.filter(function(e){return 1==e.errorDecrypting}),!(n.length>0)){t.next=3;break}return t.abrupt("return",this.handleItemsResponse(n,null,v.MappingSourceLocalRetrieved,e.KeyRequestLoadSaveAccount));case 3:case"end":return t.stop()}},t,this)}));return t}()},{key:"handleUnsavedItemsResponse",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r,i,a,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=n.length){t.next=2;break}return t.abrupt("return");case 2:console.log("Handle Conflicted Items:",n),r=!0,i=!1,a=void 0,t.prev=6,o=n[Symbol.iterator]();case 8:if(r=(s=o.next()).done){t.next=35;break}return u=s.value,c=u.item,t.t0=SFJS.itemTransformer,t.t1=[c],t.next=15,this.getActiveKeyInfo(e.KeyRequestLoadSaveAccount);case 15:return t.t2=t.sent.keys,t.next=18,t.t0.decryptMultipleItems.call(t.t0,t.t1,t.t2);case 18:if(l=this.modelManager.findItem(c.uuid)){t.next=21;break}return t.abrupt("continue",32);case 21:if(f=u.error,"uuid_conflict"!==f.tag){t.next=27;break}return t.next=25,this.modelManager.alternateUUIDForItem(l);case 25:t.next=32;break;case 27:if("sync_conflict"!==f.tag){t.next=32;break}return t.next=30,this.modelManager.createConflictedItem(c);case 30:p=t.sent,c.deleted||l.isItemContentEqualWith(p)||this.modelManager.addConflictedItem(p,l);case 32:r=!0,t.next=8;break;case 35:t.next=41;break;case 37:t.prev=37,t.t3=t.catch(6),i=!0,a=t.t3;case 41:t.prev=41,t.prev=42,!r&&o.return&&o.return();case 44:if(t.prev=44,!i){t.next=47;break}throw a;case 47:return t.finish(44);case 48:return t.finish(41);case 49:this.sync(null,{additionalFields:["created_at","updated_at"]});case 50:case"end":return t.stop()}},t,this,[[6,37,41,49],[42,,44,48]])}));return t}()},{key:"stateless_downloadAllItems",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var r=i(regeneratorRuntime.mark(function r(a,o){var s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return s={limit:n.limit||500,sync_token:n.syncToken,cursor_token:n.cursorToken,content_type:n.contentType,event:n.event},r.prev=1,r.t0=t.httpManager,r.next=5,t.getSyncURL();case 5:r.t1=r.sent,r.t2=s,r.t3=function(){var r=i(regeneratorRuntime.mark(function r(i){var o,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n.retrievedItems||(n.retrievedItems=[]),o=i.retrieved_items,r.next=4,t.getActiveKeyInfo(e.KeyRequestLoadSaveAccount);case 4:return s=r.sent.keys,r.next=7,SFJS.itemTransformer.decryptMultipleItems(o,s);case 7:n.retrievedItems=n.retrievedItems.concat(o.map(function(e){return t.modelManager.createItem(e,!0)})),n.syncToken=i.sync_token,n.cursorToken=i.cursor_token,n.cursorToken?t.stateless_downloadAllItems(n).then(a):a(n.retrievedItems);case 11:case"end":return r.stop()}},r,t)}));return function(e){return r.apply(this,arguments)}}(),r.t4=function(e,t){o(e)},r.t0.postAbsolute.call(r.t0,r.t1,r.t2,r.t3,r.t4),r.next=16;break;case 12:r.prev=12,r.t5=r.catch(1),console.log("Download all items exception caught:",r.t5),o(r.t5);case 16:case"end":return r.stop()}},r,t,[[1,12]])}));return function(e,t){return r.apply(this,arguments)}}())}},{key:"resolveOutOfSync",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stateless_downloadAllItems({event:"resolve-out-of-sync"}).then(function(){var e=i(regeneratorRuntime.mark(function e(n){var r,i,a,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=[],i=!0,a=!1,o=void 0,e.prev=4,s=n[Symbol.iterator]();case 6:if(i=(u=s.next()).done){e.next=20;break}if(c=u.value,!(l=t.modelManager.findItem(c.uuid))){e.next=16;break}if(!(f=!c.isItemContentEqualWith(l))){e.next=16;break}return e.next=14,t.modelManager.createConflictedItem(l,l);case 14:p=e.sent,t.modelManager.addConflictedItem(p,l);case 16:r.push(c);case 17:i=!0,e.next=6;break;case 20:e.next=26;break;case 22:e.prev=22,e.t0=e.catch(4),a=!0,o=e.t0;case 26:e.prev=26,e.prev=27,!i&&s.return&&s.return();case 29:if(e.prev=29,!a){e.next=32;break}throw o;case 32:return e.finish(29);case 33:return e.finish(26);case 34:return t.modelManager.mapResponseItemsToLocalModelsWithOptions({items:r,source:v.MappingSourceRemoteRetrieved}),e.next=37,t.writeItemsToLocalStorage(t.modelManager.allNondummyItems);case 37:return e.abrupt("return",t.sync({performIntegrityCheck:!0}));case 38:case"end":return e.stop()}},e,t,[[4,22,26,34],[27,,29,33]])}));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"handleSignout",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this._syncToken=null,this._cursorToken=null,this._queuedCallbacks=[],this.syncStatus={};case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"clearSyncToken",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this._syncToken=null,this._cursorToken=null,e.abrupt("return",this.storageManager.removeItem("syncToken"));case 3:case"end":return e.stop()}},e,this)}));return e}()},{key:"queuedCallbacks",get:function(){return this._queuedCallbacks||(this._queuedCallbacks=[]),this._queuedCallbacks}}]),e}(),x=r.SFItem=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.content={},this.referencingObjects=[],this.updateFromJSON(t),this.uuid||"undefined"!=typeof SFJS&&SFJS.crypto.generateUUIDSync&&(this.uuid=SFJS.crypto.generateUUIDSync()),"object"!==c(this.content)||this.content.references||(this.content.references=[])}return l(e,[{key:"initUUID",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.uuid){e.next=4;break}return e.next=3,SFJS.crypto.generateUUID();case 3:this.uuid=e.sent;case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"updateFromJSON",value:function(t){if(t){this.created_at=t.created_at,this.updated_at=t.updated_at,this.deleted=t.deleted,this.uuid=t.uuid,this.enc_item_key=t.enc_item_key,this.auth_hash=t.auth_hash,this.auth_params=t.auth_params;var n=["errorDecrypting","dirty","dirtyCount","dummy"],r=!0,i=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;void 0!==t[u]&&(this[u]=t[u])}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}if(this.content_type||(this.content_type=t.content_type),t.errorDecrypting)this.content=t.content;else try{var c="string"==typeof t.content?JSON.parse(t.content):t.content;e.deepMerge(this.contentObject,c)}catch(e){console.log("Error while updating item from json",e)}this.created_at?(this.created_at=new Date(this.created_at),this.updated_at=new Date(this.updated_at)):(this.created_at=new Date,this.updated_at=new Date),this._client_updated_at=null,t.content?this.mapContentToLocalProperties(this.contentObject):1==t.deleted&&this.handleDeletedContent()}}},{key:"mapContentToLocalProperties",value:function(e){}},{key:"createContentJSONFromProperties",value:function(){var t=this.structureParams();return e.deepMerge(this.contentObject,t),t}},{key:"structureParams",value:function(){return this.getContentCopy()}},{key:"handleDeletedContent",value:function(){}},{key:"setDirty",value:function(e,t){this.dirty=e,this.dirtyCount||(this.dirtyCount=0),e?this.dirtyCount++:this.dirtyCount=0,e&&!t?this.client_updated_at=new Date:this.hasRawClientUpdatedAtValue()||(this.client_updated_at=new Date(this.updated_at))}},{key:"updateLocalRelationships",value:function(){}},{key:"addItemAsRelationship",value:function(e){if(e.setIsBeingReferencedBy(this),!this.hasRelationshipWithItem(e)){var t=this.content.references||[];t.push({uuid:e.uuid,content_type:e.content_type}),this.content.references=t}}},{key:"removeItemAsRelationship",value:function(e){e.setIsNoLongerBeingReferencedBy(this),this.removeReferenceWithUuid(e.uuid)}},{key:"setIsBeingReferencedBy",value:function(e){_.find(this.referencingObjects,{uuid:e.uuid})||this.referencingObjects.push(e)}},{key:"setIsNoLongerBeingReferencedBy",value:function(e){_.remove(this.referencingObjects,{uuid:e.uuid}),this.hasRelationshipWithItem(e)&&(this.removeReferenceWithUuid(e.uuid),this.setDirty(!0))}},{key:"removeReferenceWithUuid",value:function(e){var t=this.content.references||[];t=t.filter(function(t){return t.uuid!=e}),this.content.references=t}},{key:"hasRelationshipWithItem",value:function(e){return null!=this.content.references.find(function(t){return t.uuid==e.uuid})}},{key:"isBeingRemovedLocally",value:function(){}},{key:"didFinishSyncing",value:function(){}},{key:"informReferencesOfUUIDChange",value:function(e,t){}},{key:"potentialItemOfInterestHasChangedItsUUID",value:function(e,t,n){var r=!0,i=!1,a=void 0;try{for(var o,s=this.content.references[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;u.uuid==t&&(u.uuid=n,this.setDirty(!0))}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}}},{key:"doNotEncrypt",value:function(){return!1}},{key:"setDomainDataItem",value:function(e,t,n){if(!n)return void console.error("SFItem.AppDomain needs to be set.");if(!this.errorDecrypting){this.content.appData||(this.content.appData={});var r=this.content.appData[n];r||(r={}),r[e]=t,this.content.appData[n]=r}}},{key:"getDomainDataItem",value:function(e,t){if(!t)return void console.error("SFItem.AppDomain needs to be set.");if(!this.errorDecrypting){this.content.appData||(this.content.appData={});var n=this.content.appData[t];return n?n[e]:null}}},{key:"setAppDataItem",value:function(t,n){this.setDomainDataItem(t,n,e.AppDomain)}},{key:"getAppDataItem",value:function(t){return this.getDomainDataItem(t,e.AppDomain)}},{key:"hasRawClientUpdatedAtValue",value:function(){return null!=this.getAppDataItem("client_updated_at")}},{key:"keysToIgnoreWhenCheckingContentEquality",value:function(){return[]}},{key:"appDataKeysToIgnoreWhenCheckingContentEquality",value:function(){return["client_updated_at"]}},{key:"getContentCopy",value:function(){return JSON.parse(JSON.stringify(this.content))}},{key:"isItemContentEqualWith",value:function(t){var n=function(e,t){if(!e)return e;var n=!0,r=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){delete e[a.value]}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return e},r=this.getContentCopy();r.appData&&n(r.appData[e.AppDomain],this.appDataKeysToIgnoreWhenCheckingContentEquality()),r=n(r,this.keysToIgnoreWhenCheckingContentEquality());var i=t.getContentCopy();return i.appData&&n(i.appData[e.AppDomain],t.appDataKeysToIgnoreWhenCheckingContentEquality()),i=n(i,t.keysToIgnoreWhenCheckingContentEquality()),JSON.stringify(r)===JSON.stringify(i)}},{key:"satisfiesPredicate",value:function(e){return C.ItemSatisfiesPredicate(this,e)}},{key:"createdAtString",value:function(){return this.dateToLocalizedString(this.created_at)}},{key:"updatedAtString",value:function(){return this.dateToLocalizedString(this.client_updated_at)}},{key:"updatedAtTimestamp",value:function(){return this.updated_at.getTime()}},{key:"dateToLocalizedString",value:function(e){if("undefined"!=typeof Intl&&Intl.DateTimeFormat){if(!s){var t=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;s=new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"})}return s.format(e)}return e.toDateString()+" "+e.toLocaleTimeString()}},{key:"contentObject",get:function(){if(this.errorDecrypting)return this.content;if(!this.content)return this.content={},this.content;if(null!==this.content&&"object"===c(this.content))return this.content;try{var e=JSON.parse(this.content);return this.content=e,this.content}catch(e){return console.log("Error parsing json",e,this),this.content={},this.content}}},{key:"pinned",get:function(){return this.getAppDataItem("pinned")}},{key:"archived",get:function(){return this.getAppDataItem("archived")}},{key:"locked",get:function(){return this.getAppDataItem("locked")}},{key:"displayName",get:function(){return"Item"}},{key:"client_updated_at",get:function(){if(!this._client_updated_at){var e=this.getAppDataItem("client_updated_at");this._client_updated_at=e?new Date(e):new Date(this.updated_at)}return this._client_updated_at},set:function(e){this._client_updated_at=e,this.setAppDataItem("client_updated_at",e)}}],[{key:"deepMerge",value:function(e,t){function n(e,t){if(_.isArray(e))return t}return _.mergeWith(e,t,n),e}}]),e}(),S=r.SFItemParams=function(){function e(t,n,r){if(a(this,e),this.item=t,this.keys=n,this.auth_params=r,this.keys&&!this.auth_params)throw"SFItemParams.auth_params must be supplied if supplying keys.";if(this.auth_params&&!this.auth_params.version)throw"SFItemParams.auth_params is missing version"}return l(e,[{key:"paramsForExportFile",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.additionalFields=["updated_at"],this.forExportFile=!0,!t){e.next=6;break}return e.abrupt("return",this.__params());case 6:return e.next=8,this.__params();case 8:return n=e.sent,e.abrupt("return",_.omit(n,["deleted"]));case 10:case"end":return e.stop()}},e,this)}));return e}()},{key:"paramsForExtension",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.paramsForExportFile());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"paramsForLocalStorage",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.additionalFields=["updated_at","dirty","errorDecrypting"],this.forExportFile=!0,e.abrupt("return",this.__params());case 3:case"end":return e.stop()}},e,this)}));return e}()},{key:"paramsForSync",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.__params());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"__params",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t={uuid:this.item.uuid,content_type:this.item.content_type,deleted:this.item.deleted,created_at:this.item.created_at},this.item.errorDecrypting){e.next=23;break}if(n=this.item.doNotEncrypt()&&!this.forExportFile,!this.keys||n){e.next=11;break}return e.next=6,SFJS.itemTransformer.encryptItem(this.item,this.keys,this.auth_params);case 6:r=e.sent,_.merge(t,r),"001"!==this.auth_params.version&&(t.auth_hash=null),e.next=21;break;case 11:if(!this.forExportFile){e.next=15;break}e.t0=this.item.createContentJSONFromProperties(),e.next=19;break;case 15:return e.next=17,SFJS.crypto.base64(JSON.stringify(this.item.createContentJSONFromProperties()));case 17:e.t1=e.sent,e.t0="000"+e.t1;case 19:t.content=e.t0,this.forExportFile||(t.enc_item_key=null,t.auth_hash=null);case 21:e.next=26;break;case 23:t.content=this.item.content,t.enc_item_key=this.item.enc_item_key,t.auth_hash=this.item.auth_hash;case 26:return this.additionalFields&&_.merge(t,_.pick(this.item,this.additionalFields)),e.abrupt("return",t);case 28:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),C=r.SFPredicate=function(){function e(t,n,r){a(this,e),this.keypath=t,this.operator=n,this.value=r,e.IsRecursiveOperator(this.operator)&&(this.value=this.value.map(e.fromArray))}return l(e,null,[{key:"fromArray",value:function(t){return new e(t[0],t[1],t[2])}},{key:"ObjectSatisfiesPredicate",value:function(t,n){if(Array.isArray(n)&&(n=this.fromArray(n)),e.IsRecursiveOperator(n.operator)){if("and"===n.operator){var r=!0,i=!1,a=void 0;try{for(var o,s=n.value[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(!this.ObjectSatisfiesPredicate(t,u))return!1}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return!0}if("or"===n.operator){var c=!0,l=!1,f=void 0;try{for(var p,h=n.value[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var u=p.value;if(this.ObjectSatisfiesPredicate(t,u))return!0}}catch(e){l=!0,f=e}finally{try{!c&&h.return&&h.return()}finally{if(l)throw f}}return!1}}var d=n.value;"string"==typeof d&&d.includes(".ago")&&(d=this.DateFromString(d));var y=n.keypath.split(".").reduce(function(e,t){return e&&e[t]},t),v=[!1,"",null,void 0,NaN];if(void 0==y)return"!="==n.operator?!v.includes(n.value):v.includes(n.value);if("="==n.operator)return Array.isArray(y)?JSON.stringify(y)==JSON.stringify(d):y==d;if("!="==n.operator)return Array.isArray(y)?JSON.stringify(y)!=JSON.stringify(d):y!==d;if("<"==n.operator)return y"==n.operator)return y>d;if("<="==n.operator)return y<=d;if(">="==n.operator)return y>=d;if("startsWith"==n.operator)return y.startsWith(d);if("in"==n.operator)return-1!=d.indexOf(y);if("includes"==n.operator)return this.resolveIncludesPredicate(y,d);if("matches"==n.operator){return new RegExp(d).test(y)}return!1}},{key:"resolveIncludesPredicate",value:function(t,n){if("string"==typeof n)return t.includes(n);var r;r=Array.isArray(n)?e.fromArray(n):n;var i=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;if(this.ObjectSatisfiesPredicate(c,r))return!0}}catch(e){a=!0,o=e}finally{try{!i&&u.return&&u.return()}finally{if(a)throw o}}return!1}},{key:"ItemSatisfiesPredicate",value:function(t,n){return Array.isArray(n)&&(n=e.fromArray(n)),this.ObjectSatisfiesPredicate(t,n)}},{key:"ItemSatisfiesPredicates",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(!this.ItemSatisfiesPredicate(e,s))return!1}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return!0}},{key:"DateFromString",value:function(e){var t=e.split("."),n=t[1],r=new Date,i=parseInt(t[0]);return"days"==n?r.setDate(r.getDate()-i):"hours"==n&&r.setHours(r.getHours()-i),r}},{key:"IsRecursiveOperator",value:function(e){return["and","or"].includes(e)}}]),e}(),I=r.SFPrivileges=function(e){function r(e){a(this,r);var n=t(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return n.content.desktopPrivileges||(n.content.desktopPrivileges={}),n}return n(r,e),l(r,null,[{key:"contentType",value:function(){return"SN|Privileges"}}]),l(r,[{key:"setCredentialsForAction",value:function(e,t){this.content.desktopPrivileges[e]=t}},{key:"getCredentialsForAction",value:function(e){return this.content.desktopPrivileges[e]||[]}},{key:"toggleCredentialForAction",value:function(e,t){this.isCredentialRequiredForAction(e,t)?this.removeCredentialForAction(e,t):this.addCredentialForAction(e,t)}},{key:"removeCredentialForAction",value:function(e,t){_.pull(this.content.desktopPrivileges[e],t)}},{key:"addCredentialForAction",value:function(e,t){var n=this.getCredentialsForAction(e);n.push(t),this.setCredentialsForAction(e,n)}},{key:"isCredentialRequiredForAction",value:function(e,t){return this.getCredentialsForAction(e).includes(t)}}]),r}(x),R=r.SFHistorySession=function(e){function r(e){a(this,r);var n=t(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return n.content.itemUUIDToItemHistoryMapping||(n.content.itemUUIDToItemHistoryMapping={}),Object.keys(n.content.itemUUIDToItemHistoryMapping).forEach(function(e){var t=n.content.itemUUIDToItemHistoryMapping[e];n.content.itemUUIDToItemHistoryMapping[e]=new E(t)}),n}return n(r,e),l(r,[{key:"addEntryForItem",value:function(e){return this.historyForItem(e).addHistoryEntryForItem(e)}},{key:"historyForItem",value:function(e){var t=this.content.itemUUIDToItemHistoryMapping[e.uuid];return t||(t=this.content.itemUUIDToItemHistoryMapping[e.uuid]=new E),t}},{key:"clearItemHistory",value:function(e){this.historyForItem(e).clear()}},{key:"clearAllHistory",value:function(){this.content.itemUUIDToItemHistoryMapping={}}},{key:"optimizeHistoryForItem",value:function(e){var t=this.historyForItem(e);t.entries.length>r.LargeItemEntryAmountThreshold&&t.optimize()}}]),r}(x);R.LargeItemEntryAmountThreshold=60;var E=r.SFItemHistory=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,e),this.entries||(this.entries=[]),t.entries){var n=!0,r=!1,i=void 0;try{for(var o,s=t.entries[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,c=this.createEntryForItem(u.item);c.setPreviousEntry(this.getLastEntry()),this.entries.push(c)}}catch(e){r=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw i}}}}return l(e,[{key:"createEntryForItem",value:function(t){var n=e.HistoryEntryClassMapping&&e.HistoryEntryClassMapping[t.content_type];return n||(n=F),new n(t)}},{key:"getLastEntry",value:function(){return this.entries[this.entries.length-1]}},{key:"addHistoryEntryForItem",value:function(e){var t=this.createEntryForItem(e),n=this.getLastEntry();if(t.setPreviousEntry(n),!t.isSameAsEntry(n))return this.entries.push(t),t}},{key:"clear",value:function(){this.entries.length=0}},{key:"optimize",value:function(){var t=this,n=[],r=function(t){return t.deltaSize()>e.LargeEntryDeltaThreshold},i=function(e,i,a){if(a)n.push(e);else{var i=n.indexOf(e);-1!==i&&n.splice(i,1)}if(a&&r(e)&&-1==e.operationVector()){var o=t.entries[i-1];o&&n.push(o)}};this.entries.forEach(function(e,n){if(0==n||n==t.entries.length-1)i(e,n,!0);else{var a=r(e);i(e,n,a)}}),this.entries=this.entries.filter(function(e,t){return-1!==n.indexOf(e)})}}]),e}();E.LargeEntryDeltaThreshold=15;var F=r.SFItemHistoryEntry=function(){function e(t){a(this,e),this.item=x.deepMerge({},t),this.defaultContentKeyToDiffOn="text",this.textCharDiffLength=0,"string"==typeof this.item.updated_at&&(this.item.updated_at=new Date(this.item.updated_at))}return l(e,[{key:"setPreviousEntry",value:function(e){this.hasPreviousEntry=null!=e,this.item.content[this.defaultContentKeyToDiffOn]&&(this.textCharDiffLength=e?this.item.content[this.defaultContentKeyToDiffOn].length-e.item.content[this.defaultContentKeyToDiffOn].length:this.item.content[this.defaultContentKeyToDiffOn].length)}},{key:"operationVector",value:function(){return void 0!=this.textCharDiffLength?this.hasPreviousEntry&&0!=this.textCharDiffLength?this.textCharDiffLength<0?-1:1:0:1}},{key:"deltaSize",value:function(){return void 0!=this.textCharDiffLength?Math.abs(this.textCharDiffLength):1}},{key:"isSameAsEntry",value:function(e){if(!e)return!1;var t=new x(this.item),n=new x(e.item);return t.isItemContentEqualWith(n)}}]),e}(),h="undefined"!=typeof window?window:void 0!==e?e:null,P=r.SFAbstractCrypto=function(){function e(){a(this,e),this.DefaultPBKDF2Length=768}return l(e,[{key:"generateUUIDSync",value:function(){var e=h.crypto||h.msCrypto;if(e){var t=new Uint32Array(4);e.getRandomValues(t);var n=-1;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){n++;var r=t[n>>3]>>n%8*4&15;return("x"==e?r:3&r|8).toString(16)})}var r=(new Date).getTime();return h.performance&&"function"==typeof h.performance.now&&(r+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"==e?t:3&t|8).toString(16)})}},{key:"generateUUID",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.generateUUIDSync());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"decryptText",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=a.ciphertextToAuth,u=a.contentCiphertext,c=a.encryptionKey,l=a.iv,f=a.authHash,p=a.authKey,h=arguments[1];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!h||f){e.next=3;break}return console.error("Auth hash is required."),e.abrupt("return");case 3:if(!f){e.next=10;break}return e.next=6,this.hmac256(s,p);case 6:if(t=e.sent,f===t){e.next=10;break}return console.error("Auth hash does not match, returning null."),e.abrupt("return",null);case 10:return n=o.enc.Hex.parse(c),r=o.enc.Hex.parse(l||""),i=o.AES.decrypt(u,n,{iv:r,mode:o.mode.CBC,padding:o.pad.Pkcs7}),e.abrupt("return",i.toString(o.enc.Utf8));case 14:case"end":return e.stop()}},e,this)}));return e}()},{key:"encryptText",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r){var i,a,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.enc.Hex.parse(n),a=o.enc.Hex.parse(r||""),s=o.AES.encrypt(t,i,{iv:a,mode:o.mode.CBC,padding:o.pad.Pkcs7}),e.abrupt("return",s.toString());case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateRandomKey",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o.lib.WordArray.random(t/8).toString());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateItemEncryptionKey",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=512,n=1,e.next=4,this.generateRandomKey(t);case 4:return r=e.sent,e.next=7,this.generateRandomKey(t);case 7:return i=e.sent,e.abrupt("return",this.pbkdf2(i,r,n,t));case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"firstHalfOfKey",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.substring(0,t.length/2));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"secondHalfOfKey",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.substring(t.length/2,t.length));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"base64",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",h.btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)})));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"base64Decode",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",h.atob(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"sha256",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o.SHA256(t).toString());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"hmac256",value:function(){function e(e,n){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n){var r,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.enc.Hex.parse(n),i=o.enc.Utf8.parse(t),a=o.HmacSHA256(i,r).toString(),e.abrupt("return",a);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateSalt",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sha256([t,"SF",n,r,i].join(":"));case 2:return a=e.sent,e.abrupt("return",a);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateSymmetricKeyPair",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a,o,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=s.password,c=s.pw_salt,l=s.pw_cost;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pbkdf2(u,c,l,this.DefaultPBKDF2Length);case 2:return t=e.sent,n=t.length,r=n/3,i=t.slice(0,r),a=t.slice(r,2*r),o=t.slice(2*r,3*r),e.abrupt("return",[i,a,o]);case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"computeEncryptionKeysForUser",value:function(){function e(e,n){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("003"!=n.version){e.next=9;break}if(n.identifier){e.next=4;break}return console.error("authParams is missing identifier."),e.abrupt("return");case 4:return e.next=6,this.generateSalt(n.identifier,n.version,n.pw_cost,n.pw_nonce);case 6:r=e.sent,e.next=10;break;case 9:r=n.pw_salt;case 10:return e.abrupt("return",this.generateSymmetricKeyPair({password:t,pw_salt:r,pw_cost:n.pw_cost}).then(function(e){return{pw:e[0],mk:e[1],ak:e[2]}}));case 11:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateInitialKeysAndAuthParamsForUser",value:function(){function e(e,n){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n){var r,i,a,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.SFJS.version,i=this.SFJS.defaultPasswordGenerationCost,e.next=4,this.generateRandomKey(256);case 4:return a=e.sent,e.next=7,this.generateSalt(t,r,i,a);case 7:return o=e.sent,e.abrupt("return",this.generateSymmetricKeyPair({password:n,pw_salt:o,pw_cost:i}).then(function(e){var n={pw_nonce:a,pw_cost:i,identifier:t,version:r};return{keys:{pw:e[0],mk:e[1],ak:e[2]},authParams:n}}));case 9:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),D=r.SFCryptoJS=function(e){function r(){return a(this,r),t(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return n(r,e),l(r,[{key:"pbkdf2",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a={keySize:i/32,hasher:o.algo.SHA512,iterations:r},e.abrupt("return",o.PBKDF2(t,n,a).toString());case 2:case"end":return e.stop()}},e,this)}));return e}()}]),r}(P),h="undefined"!=typeof window?window:void 0!==e?e:null,O=h.crypto?h.crypto.subtle:null,M=r.SFCryptoWeb=function(e){function r(){return a(this,r),t(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return n(r,e),l(r,[{key:"pbkdf2",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.webCryptoImportKey(t,"PBKDF2",["deriveBits"]);case 2:if(a=e.sent){e.next=6;break}return console.log("Key is null, unable to continue"),e.abrupt("return",null);case 6:return e.abrupt("return",this.webCryptoDeriveBits(a,n,r,i));case 7:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateRandomKey",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=!0,e.abrupt("return",O.generateKey({name:"AES-CBC",length:t},n,["encrypt","decrypt"]).then(function(e){return O.exportKey("raw",e).then(function(){var e=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.arrayBufferToHexString(new Uint8Array(t));case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,r)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.error("Error exporting key",e)})}).catch(function(e){console.error("Error generating key",e)}));case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateItemEncryptionKey",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=256,e.abrupt("return",Promise.all([this.generateRandomKey(t),this.generateRandomKey(t)]).then(function(e){return e.join("")}));case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"encryptText",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r){var a,o,s,u,c,l=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,this.hexStringToArrayBuffer(r);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=new ArrayBuffer(16);case 7:return a=e.t0,o={name:"AES-CBC",iv:a},e.next=11,this.hexStringToArrayBuffer(n);case 11:return s=e.sent,e.next=14,this.webCryptoImportKey(s,o.name,["encrypt"]);case 14:return u=e.sent,e.next=17,this.stringToArrayBuffer(t);case 17:return c=e.sent,e.abrupt("return",crypto.subtle.encrypt(o,u,c).then(function(){var e=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.arrayBufferToBase64(t);case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,l)}));return function(t){return e.apply(this,arguments)}}()));case 19:case"end":return e.stop()}},e,this)}));return e}()},{key:"decryptText",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,a,o,s,u=this,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=c.ciphertextToAuth,f=c.contentCiphertext,p=c.encryptionKey,h=c.iv,d=c.authHash,y=c.authKey,v=arguments[1];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!v||d){e.next=3;break}return console.error("Auth hash is required."),e.abrupt("return");case 3:if(!d){e.next=10;break}return e.next=6,this.hmac256(l,y);case 6:if(t=e.sent,d===t){e.next=10;break}return console.error("Auth hash does not match, returning null. "+d+" != "+t),e.abrupt("return",null);case 10:if(!h){e.next=16;break}return e.next=13,this.hexStringToArrayBuffer(h);case 13:e.t0=e.sent,e.next=17;break;case 16:e.t0=new ArrayBuffer(16);case 17:return n=e.t0,r={name:"AES-CBC",iv:n},e.next=21,this.hexStringToArrayBuffer(p);case 21:return a=e.sent,e.next=24,this.webCryptoImportKey(a,r.name,["decrypt"]);case 24:return o=e.sent,e.next=27,this.base64ToArrayBuffer(f);case 27:return s=e.sent,e.abrupt("return",crypto.subtle.decrypt(r,o,s).then(function(){var e=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.arrayBufferToString(t);case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,u)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.error("Error decrypting:",e)}));case 29:case"end":return e.stop()}},e,this)}));return e}()},{key:"webCryptoImportKey",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,i){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=6;break}return e.next=3,this.stringToArrayBuffer(t);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=t;case 7:return a=e.t0,e.abrupt("return",O.importKey("raw",a,{name:n,hash:i},!1,r).then(function(e){return e}).catch(function(e){return console.error(e),null}));case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"webCryptoDeriveBits",value:function(){function e(e,n,r,i){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t,n,r,a){var o,s=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stringToArrayBuffer(n);case 2:return e.t0=e.sent,e.t1=r,e.t2={name:"SHA-512"},o={name:"PBKDF2",salt:e.t0,iterations:e.t1,hash:e.t2},e.abrupt("return",O.deriveBits(o,t,a).then(function(){var e=i(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.arrayBufferToHexString(new Uint8Array(t));case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,s)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){return console.error(e),null}));case 7:case"end":return e.stop()}},e,this)}));return e}()},{key:"stringToArrayBuffer",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=new Blob([t]),i=new FileReader;i.onload=function(t){e(t.target.result)},i.readAsArrayBuffer(r)}));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"arrayBufferToString",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=new Blob([t]),i=new FileReader;i.onload=function(t){e(t.target.result)},i.readAsText(r)}));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"arrayBufferToHexString",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){var n,r,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(n=new Uint8Array(t),r="",a=0;a5e3)||this.crypto instanceof M}},{key:"supportedVersions",value:function(){return["001","002","003"]}},{key:"isVersionNewerThanLibraryVersion",value:function(e){var t=this.version();return parseInt(e)>parseInt(t)}},{key:"isProtocolVersionOutdated",value:function(e){var t={"001":Date.parse("2018-01-01"),"002":Date.parse("2020-01-01")},n=t[e];return!!n&&new Date>n}},{key:"costMinimumForVersion",value:function(e){return{"001":3e3,"002":3e3,"003":11e4}[e]}},{key:"defaultPasswordGenerationCost",value:function(){return this.costMinimumForVersion(this.version())}}]),e}();if(h)try{h.StandardFile=T,h.SFJS=new T,h.SFCryptoWeb=M,h.SFCryptoJS=D,h.SFItemTransformer=A,h.SFModelManager=v,h.SFItem=x,h.SFItemParams=S,h.SFHttpManager=d,h.SFStorageManager=k,h.SFSyncManager=w,h.SFAuthManager=p,h.SFMigrationManager=y,h.SFAlertManager=f,h.SFPredicate=C,h.SFHistorySession=R,h.SFSessionHistoryManager=m,h.SFItemHistory=E,h.SFItemHistoryEntry=F,h.SFPrivilegesManager=g,h.SFPrivileges=I,h.SFSingletonManager=b}catch(e){console.log("Exception while exporting window variables",e)}}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(t,n(3))},function(e,t){!function(t){"use strict";function n(e,t,n,r){var a=t&&t.prototype instanceof i?t:i,o=Object.create(a.prototype),s=new h(r||[]);return o._invoke=c(e,n,s),o}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function a(){}function o(){}function s(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function u(e){function t(n,i,a,o){var s=r(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&m.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},o)}o(s.arg)}function n(e,n){function r(){return new Promise(function(r,i){t(e,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function c(e,t,n){var i=C;return function(a,o){if(i===R)throw new Error("Generator is already running");if(i===E){if("throw"===a)throw o;return y()}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var u=l(s,n);if(u){if(u===F)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===C)throw i=E,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=R;var c=r(e,t,n);if("normal"===c.type){if(i=n.done?E:I,c.arg===F)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=E,n.method="throw",n.arg=c.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===v){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=v,l(e,t),"throw"===t.method))return F;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return F}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,F;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=v),t.delegate=null,F):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,F)}function f(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function p(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function h(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(f,this),this.reset(!0)}function d(e){if(e){var t=e[k];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=m.call(i,"catchLoc"),s=m.call(i,"finallyLoc");if(o&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&m.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),p(n),F}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;p(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=v),F}}}(function(){return this}()||Function("return this")())},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){function o(e){r(u,i,a,o,s,"next",e)}function s(e){r(u,i,a,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n=0?this.items[c]=u:this.items.push(u);case 15:r=!0,t.next=5;break;case 18:t.next=24;break;case 20:t.prev=20,t.t0=t.catch(3),i=!0,a=t.t0;case 24:t.prev=24,t.prev=25,r||null==o.return||o.return();case 27:if(t.prev=27,!i){t.next=30;break}throw a;case 30:return t.finish(27);case 31:return t.finish(24);case 32:this.notifyObserversOfEvent(e.BridgeEventReceivedItems);case 33:case"end":return t.stop()}},t,this,[[3,20,24,32],[25,,27,31]])}));return t}()},{key:"indexOfItem",value:function(e){for(var t in this.items)if(this.items[t].uuid==e.uuid)return t;return-1}},{key:"removeItemFromItems",value:function(e){this.items=this.items.filter(function(t){return t.uuid!==e.uuid})}},{key:"createItem",value:function(e,t){this.createItems([e],t)}},{key:"createItems",value:function(e,t){this.componentManager.createItems(e,function(e){t&&t(e.map(function(e){return new f.SFItem(e)}))})}},{key:"saveItem",value:function(){function e(e){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.saveItems([t]));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"saveItems",value:function(){function t(e){return n.apply(this,arguments)}var n=i(regeneratorRuntime.mark(function t(n){var r=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,i){r.componentManager.saveItems(n,function(n){t(n),r.notifyObserversOfEvent(e.BridgeEventSavedItem)})}));case 1:case"end":return t.stop()}},t)}));return t}()},{key:"indexOfItem",value:function(e){for(var t in this.items)if(this.items[t].uuid==e.uuid)return t;return-1}},{key:"deleteItem",value:function(e,t){this.deleteItems([e],t)}},{key:"deleteItems",value:function(e,t){this.componentManager.deleteItems(e,t)}},{key:"removeItemFromItems",value:function(e){this.items=this.items.filter(function(t){return t.uuid!==e.uuid})}}]),e}());u(p,"FileItemContentTypeKey","SN|FileSafe|File"),u(p,"FileSafeCredentialsContentType","SN|FileSafe|Credentials"),u(p,"FileDescriptorContentTypeKey","SN|FileSafe|FileMetadata"),u(p,"FileSafeIntegrationContentTypeKey","SN|FileSafe|Integration"),u(p,"BridgeEventLoadedCredentials","BridgeEventLoadedCredentials"),u(p,"BridgeEventReceivedItems","BridgeEventReceivedItems"),u(p,"BridgeEventSavedItem","BridgeEventSavedItem")},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){function o(e){r(u,i,a,o,s,"next",e)}function s(e){r(u,i,a,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;nt.length)n=e;else{n=t;var r=0,i=-1,a=-1,o=n.length;for(0>r&&(r=-r>o?0:o+r),i=i>o?o:i,0>i&&(i+=o),o=r>i?0:i-r>>>0,r>>>=0,i=Array(o);++aa?pt:o,a=1),t=Object(t);++is))return!1;if((u=a.get(e))&&a.get(t))return u==t;var u=-1,c=!0,l=2&n?new E:pt;for(a.set(e,t),a.set(t,e);++un&&(n=ln(r+n,0)),y(e,be(t,3),n)):-1}function Te(e){return(null==e?0:e.length)?L(e,1):[]}function Ne(e){var t=null==e?0:e.length;return t?e[t-1]:pt}function je(e,t){var n;if(e&&e.length&&t&&t.length){n=t;var r=v,i=-1,a=n.length;for(e===n&&(n=ue(n));++i=e}function We(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ve(e){return null!=e&&"object"==typeof e}function Je(e){return!(!Ve(e)||"[object Object]"!=z(e))&&(null===(e=Xt(e))||"function"==typeof(e=Kt.call(e,"constructor")&&e.constructor)&&e instanceof e&&zt.call(e)==Jt)}function qe(e){return"string"==typeof e||!Hn(e)&&Ve(e)&&"[object String]"==z(e)}function $e(e){return"symbol"==typeof e||Ve(e)&&"[object Symbol]"==z(e)}function Ge(e){return e?(e=Ye(e),e===ht||e===-ht?1.7976931348623157e308*(0>e?-1:1):e===e?e:0):0===e?e:0}function Qe(e){e=Ge(e);var t=e%1;return e===e?t?e-t:e:0}function Ye(e){if("number"==typeof e)return e;if($e(e))return dt;if(We(e)&&(e="function"==typeof e.valueOf?e.valueOf():e,e=We(e)?e+"":e),"string"!=typeof e)return 0===e?e:+e;e=e.replace(bt,"");var t=St.test(e);return t||Ct.test(e)?Pt(e.slice(2),t?2:8):xt.test(e)?dt:+e}function Xe(e){return ce(e,rt(e))}function Ze(e){return null==e?"":ne(e)}function et(e,t,n){return e=null==e?pt:H(e,t),e===pt?n:e}function tt(e,t){var n;if(n=null!=e){n=e;var r;r=ie(t,n);for(var i=-1,a=r.length,o=!1;++i(e=M(t,e))||(e==t.length-1?t.pop():tn.call(t,e,1),--this.size,0))},I.prototype.get=function(e){var t=this.__data__;return e=M(t,e),0>e?pt:t[e][1]},I.prototype.has=function(e){return-1r?(++this.size,n.push([e,t])):n[r][1]=t,this},R.prototype.clear=function(){this.size=0,this.__data__={hash:new C,map:new(dn||I),string:new C}},R.prototype.delete=function(e){return e=ke(this,e).delete(e),this.size-=e?1:0,e},R.prototype.get=function(e){return ke(this,e).get(e)},R.prototype.has=function(e){return ke(this,e).has(e)},R.prototype.set=function(e,t){var n=ke(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},E.prototype.add=E.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},E.prototype.has=function(e){return this.__data__.has(e)},F.prototype.clear=function(){this.__data__=new I,this.size=0},F.prototype.delete=function(e){var t=this.__data__;return e=t.delete(e),this.size=t.size,e},F.prototype.get=function(e){return this.__data__.get(e)},F.prototype.has=function(e){return this.__data__.has(e)},F.prototype.set=function(e,t){var n=this.__data__;if(n instanceof I){var r=n.__data__;if(!dn||199>r.length)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new R(r)}return n.set(e,t),this.size=n.size,this};var En=function(e,t){return function(t,n){if(null==t)return t;if(!He(t))return e(t,n);for(var r=t.length,i=-1,a=Object(t);++in&&(n=ln(r+n,0)),qe(e)?n<=r&&-10){var i=!0,a=!1,o=void 0;try{for(var s,u=t.integrations[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;if(c!=e){t.setIntegrationAsDefault(c);break}}}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}}})}},{key:"integrations",get:function(){return this.extensionBridge.filterItems(l.a.FileSafeIntegrationContentTypeKey)}}]),e}()},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){function o(e){r(u,i,a,o,s,"next",e)}function s(e){r(u,i,a,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&(e=n.credentials[0]),e}),u(this,"setCredentialAsDefault",function(e){var t=n.getDefaultCredentials();t&&(t.content.isDefault=!1),e.content.isDefault=!0,n.extensionBridge.saveItems([t,e])}),u(this,"deleteCredential",function(e){n.extensionBridge.deleteItem(e)}),this.extensionBridge=r,this.onCredentialLoad=i,this.credentials=[],this.extensionBridge.addEventHandler(function(e){e==f.a.BridgeEventReceivedItems&&n.reloadCredentials()})}return s(e,[{key:"reloadCredentials",value:function(){this.credentials=[];var e=this.extensionBridge.filterItems(f.a.FileSafeCredentialsContentType);if(0!=e.length){var t=!0,n=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;this.credentials.find(function(e){return e.uuid==o.uuid})||this.credentials.push(o)}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}this.onCredentialLoad(),this.credentials.length>0&&this.didLoadCredentials()}}},{key:"createNewCredentials",value:function(){function e(){return t.apply(this,arguments)}var t=i(regeneratorRuntime.mark(function e(){var t,n,r,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=256,e.next=3,SFJS.crypto.generateRandomKey(t);case 3:return n=e.sent,e.next=6,SFJS.crypto.generateRandomKey(t);case 6:return r=e.sent,e.next=9,SFJS.crypto.generateInitialKeysAndAuthParamsForUser(n,r);case 9:return i=e.sent,i.isDefault=0==this.credentials.length,a=new l.SFItem({content_type:f.a.FileSafeCredentialsContentType,content:i}),this.extensionBridge.saveItem(a),this.didLoadCredentials(),e.abrupt("return",a);case 15:case"end":return e.stop()}},e,this)}));return e}()},{key:"didLoadCredentials",value:function(){this.extensionBridge.notifyObserversOfEvent(f.a.BridgeEventLoadedCredentials)}},{key:"credentialForFileDescriptor",value:function(e){return this.credentials.find(function(t){return e.content.references.find(function(e){return e.uuid==t.uuid})})}},{key:"getAllCredentials",value:function(){return this.credentials}},{key:"saveCredential",value:function(e){this.extensionBridge.saveItem(e)}}]),e}()},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){function o(e){r(u,i,a,o,s,"next",e)}function s(e){r(u,i,a,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3],a=document.createElement("a");a.setAttribute("download",t);var o=this.tempUrlForData(e,n);a.href=o,a.setAttribute("target","_blank"),i?window.location.href=a.href:(document.body.appendChild(a),a.click(),a.remove()),setTimeout(function(){r.revokeTempUrl(o)},500)}},{key:"tempUrlForData",value:function(e,t){return window.URL.createObjectURL(new Blob([e],{type:t||"text/json"}))}},{key:"revokeTempUrl",value:function(e){window.URL.revokeObjectURL(e)}},{key:"copyTextToClipboard",value:function(e){if(window.clipboardData&&window.clipboardData.setData)return clipboardData.setData("Text",e);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var t;try{t=document.createElement("textarea"),t.setAttribute("readonly",!0),t.setAttribute("contenteditable",!0),t.style.position="fixed",t.value=e,document.body.appendChild(t),t.focus(),t.select();var n=document.createRange();n.selectNodeContents(t);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),t.setSelectionRange(0,t.value.length),document.execCommand("copy")}catch(e){console.error(e),null}finally{document.body.removeChild(t)}}}}]),e}()}])},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n0&&this.requestPermissions(this.initialPermissions);var t=!0,n=!1,r=void 0;try{for(var i,a=this.messageQueue[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;this.postMessage(o.action,o.data,o.callback)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}this.messageQueue=[],this.loggingEnabled&&console.log("onReadyData",e),this.activateThemes(e.activeThemeUrls||[]),this.onReadyCallback&&this.onReadyCallback()}},{key:"getSelfComponentUUID",value:function(){return this.uuid}},{key:"isRunningInDesktopApplication",value:function(){return"desktop"===this.environment}},{key:"setComponentDataValueForKey",value:function(e,t){this.componentData[e]=t,this.postMessage("set-component-data",{componentData:this.componentData},function(e){})}},{key:"clearComponentData",value:function(){this.componentData={},this.postMessage("set-component-data",{componentData:this.componentData},function(e){})}},{key:"componentDataValueForKey",value:function(e){return this.componentData[e]}},{key:"postMessage",value:function(e,t,n){if(!this.sessionKey)return void this.messageQueue.push({action:e,data:t,callback:n});var r={action:e,data:t,messageId:this.generateUUID(),sessionKey:this.sessionKey,api:"component"},i=JSON.parse(JSON.stringify(r));i.callback=n,this.sentMessages.push(i),this.isMobile&&(r=JSON.stringify(r)),this.loggingEnabled&&console.log("Posting message:",r),window.parent.postMessage(r,this.origin)}},{key:"setSize",value:function(e,t,n){this.postMessage("set-size",{type:e,width:t,height:n},function(e){})}},{key:"requestPermissions",value:function(e,t){this.postMessage("request-permissions",{permissions:e},function(e){t&&t()}.bind(this))}},{key:"streamItems",value:function(e,t){Array.isArray(e)||(e=[e]),this.postMessage("stream-items",{content_types:e},function(e){t(e.items)}.bind(this))}},{key:"streamContextItem",value:function(e){this.postMessage("stream-context-item",null,function(t){var n=t.item;e(n)})}},{key:"selectItem",value:function(e){this.postMessage("select-item",{item:this.jsonObjectForItem(e)})}},{key:"createItem",value:function(e,t){this.postMessage("create-item",{item:this.jsonObjectForItem(e)},function(e){var n=e.item;!n&&e.items&&e.items.length>0&&(n=e.items[0]),this.associateItem(n),t&&t(n)}.bind(this))}},{key:"createItems",value:function(e,t){var n=this,r=e.map(function(e){return n.jsonObjectForItem(e)});this.postMessage("create-items",{items:r},function(e){t&&t(e.items)}.bind(this))}},{key:"associateItem",value:function(e){this.postMessage("associate-item",{item:this.jsonObjectForItem(e)})}},{key:"deassociateItem",value:function(e){this.postMessage("deassociate-item",{item:this.jsonObjectForItem(e)})}},{key:"clearSelection",value:function(){this.postMessage("clear-selection",{content_type:"Tag"})}},{key:"deleteItem",value:function(e,t){this.deleteItems([e],t)}},{key:"deleteItems",value:function(e,t){var n={items:e.map(function(e){return this.jsonObjectForItem(e)}.bind(this))};this.postMessage("delete-items",n,function(e){t&&t(e)})}},{key:"sendCustomEvent",value:function(e,t,n){this.postMessage(e,t,function(e){n&&n(e)}.bind(this))}},{key:"saveItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.saveItems([e],t,n)}},{key:"saveItemWithPresave",value:function(e,t,n){this.saveItemsWithPresave([e],t,n)}},{key:"saveItemsWithPresave",value:function(e,t,n){this.saveItems(e,n,!1,t)}},{key:"saveItems",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments[3],a=function(e){i&&i();var r=[],a=[],o=!0,s=!1,u=void 0;try{for(var c,l=e[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;r.includes(f.uuid)||(r.push(f.uuid),f.updated_at=new Date,a.push(n.jsonObjectForItem(f)))}}catch(e){s=!0,u=e}finally{try{!o&&l.return&&l.return()}finally{if(s)throw u}}n.postMessage("save-items",{items:a},function(e){t&&t()})};this.pendingSaveItems||(this.pendingSaveItems=[]),1!=this.coallesedSaving||r?a(e):(this.pendingSave&&clearTimeout(this.pendingSave),this.pendingSaveItems=this.pendingSaveItems.concat(e),this.pendingSave=setTimeout(function(){a(n.pendingSaveItems),n.pendingSaveItems=[]},this.coallesedSavingDelay))}},{key:"jsonObjectForItem",value:function(e){var t=Object.assign({},e);return t.children=null,t.parent=null,t}},{key:"getItemAppDataValue",value:function(e,t){var n=e.content.appData&&e.content.appData["org.standardnotes.sn"];return n?n[t]:null}},{key:"activateThemes",value:function(e){if(this.loggingEnabled&&console.log("Incoming themes",e),this.activeThemes.sort().toString()!=e.sort().toString()){var t=e||[],n=[],r=!0,i=!1,a=void 0;try{for(var o,s=this.activeThemes[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;e.includes(u)?t=t.filter(function(e){return e!=u}):n.push(u)}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}this.loggingEnabled&&(console.log("Deactivating themes:",n),console.log("Activating themes:",t));var c=!0,l=!1,f=void 0;try{for(var p,h=n[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var d=p.value;this.deactivateTheme(d)}}catch(e){l=!0,f=e}finally{try{!c&&h.return&&h.return()}finally{if(l)throw f}}this.activeThemes=e;var y=!0,v=!1,g=void 0;try{for(var m,b=t[Symbol.iterator]();!(y=(m=b.next()).done);y=!0){var k=m.value;if(k){var w=document.createElement("link");w.id=btoa(k),w.href=k,w.type="text/css",w.rel="stylesheet",w.media="screen,print",w.className="custom-theme",document.getElementsByTagName("head")[0].appendChild(w)}}}catch(e){v=!0,g=e}finally{try{!y&&b.return&&b.return()}finally{if(v)throw g}}}}},{key:"themeElementForUrl",value:function(e){return Array.from(document.getElementsByClassName("custom-theme")).slice().find(function(t){return t.id==btoa(e)})}},{key:"deactivateTheme",value:function(e){var t=this.themeElementForUrl(e);t&&(t.disabled=!0,t.parentNode.removeChild(t))}},{key:"generateUUID",value:function(){var e=window.crypto||window.msCrypto;if(e){var t=new Uint32Array(4);e.getRandomValues(t);var n=-1;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){n++;var r=t[n>>3]>>n%8*4&15;return("x"==e?r:3&r|8).toString(16)})}var r=(new Date).getTime();return window.performance&&"function"==typeof window.performance.now&&(r+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"==e?t:3&t|8).toString(16)})}}]),e}();void 0!==e&&void 0!==e.exports&&(e.exports=a),window&&(window.ComponentManager=a)}]); \ No newline at end of file +var a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),c=1;cT.length&&T.push(e)}function p(e,t,n,a){var i=typeof e;if("undefined"!==i&&"boolean"!==i||(e=null),null===e||"string"===i||"number"===i||"object"===i&&e.$$typeof===P)return n(a,e,""===t?"."+d(e,0):t),1;var o=0;if(t=""===t?".":t+":",Array.isArray(e))for(var s=0;s=V(e.last.priorityLevel,t))n=e.last;else for(e=e.first;null!==e&&0>=V(e.priorityLevel,t);)n=e,e=e.next;return n}function G(e,t){var n=e.alternate,r=e.updateQueue;null===r&&(r=e.updateQueue=q()),null!==n?null===(e=n.updateQueue)&&(e=n.updateQueue=q()):e=null,Ar=r,Nr=e!==r?e:null;var a=Ar;n=Nr;var i=$(a,t),o=null!==i?i.next:a.first;return null===n?(J(a,t,i,o),null):(r=$(n,t),e=null!==r?r.next:n.first,J(a,t,i,o),o===e&&null!==o||i===r&&null!==i?(null===r&&(n.first=t),null===e&&(n.last=null),null):(t={priorityLevel:t.priorityLevel,partialState:t.partialState,callback:t.callback,isReplace:t.isReplace,isForced:t.isForced,isTopLevelUnmount:t.isTopLevelUnmount,next:null},J(n,t,r,e),t))}function Q(e,t,n,r){return e=e.partialState,"function"==typeof e?e.call(t,n,r):e}function Y(e,t,n){e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n}function X(e){return e.tag===zr&&null!=e.type.childContextTypes}function Z(e,t){var n=e.stateNode,a=e.type.childContextTypes;if("function"!=typeof n.getChildContext)return t;n=n.getChildContext();for(var i in n)i in a||r("108",p(e)||"Unknown",i);return mt({},t,n)}function ee(e,t,n){this.tag=e,this.key=t,this.stateNode=this.type=null,this.sibling=this.child=this.return=null,this.index=0,this.memoizedState=this.updateQueue=this.memoizedProps=this.pendingProps=this.ref=null,this.internalContextTag=n,this.effectTag=ca,this.lastEffect=this.firstEffect=this.nextEffect=null,this.pendingWorkPriority=sa,this.alternate=null}function te(e,t,n){var a=void 0;return"function"==typeof e?(a=e.prototype&&e.prototype.isReactComponent?new ee(Zr,t,n):new ee(Xr,t,n),a.type=e):"string"==typeof e?(a=new ee(ta,t,n),a.type=e):"object"==typeof e&&null!==e&&"number"==typeof e.tag?a=e:r("130",null==e?e:typeof e,""),a}function ne(e){return null===e||void 0===e?null:(e=Ha&&e[Ha]||e["@@iterator"],"function"==typeof e?e:null)}function re(e,t){var n=t.ref;if(null!==n&&"function"!=typeof n){if(t._owner){t=t._owner;var a=void 0;t&&("number"==typeof t.tag?(t.tag!==Ta&&r("110"),a=t.stateNode):a=t.getPublicInstance()),a||r("147",n);var i=""+n;return null!==e&&null!==e.ref&&e.ref._stringRef===i?e.ref:(e=function(e){var t=a.refs===kt?a.refs={}:a.refs;null===e?delete t[i]:t[i]=e},e._stringRef=i,e)}"string"!=typeof n&&r("148"),t._owner||r("149",n)}return n}function ae(e,t){"textarea"!==e.type&&r("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function ie(e,t){function n(n,r){if(t){if(!e){if(null===r.alternate)return;r=r.alternate}var a=n.lastEffect;null!==a?(a.nextEffect=r,n.lastEffect=r):n.firstEffect=n.lastEffect=r,r.nextEffect=null,r.effectTag=Ba}}function a(e,r){if(!t)return null;for(;null!==r;)n(e,r),r=r.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(t,n){return e?(t=xa(t,n),t.index=0,t.sibling=null,t):(t.pendingWorkPriority=n,t.effectTag=La,t.index=0,t.sibling=null,t)}function s(e,n,r){return e.index=r,t?null!==(r=e.alternate)?(r=r.index,rp?(d=f,f=null):d=f.sibling;var h=y(e,f,o[p],u);if(null===h){null===f&&(f=d);break}t&&f&&null===h.alternate&&n(e,f),r=s(h,r,p),null===l?c=h:l.sibling=h,l=h,f=d}if(p===o.length)return a(e,f),c;if(null===f){for(;pd?(h=p,p=null):h=p.sibling;var b=y(e,p,g.value,c);if(null===b){p||(p=h);break}t&&p&&null===b.alternate&&n(e,p),o=s(b,o,d),null===f?l=b:f.sibling=b,f=b,p=h}if(g.done)return a(e,p),l;if(null===p){for(;!g.done;d++,g=u.next())null!==(g=v(e,g.value,c))&&(o=s(g,o,d),null===f?l=g:f.sibling=g,f=g);return l}for(p=i(e,p);!g.done;d++,g=u.next())null!==(g=m(p,e,d,g.value,c))&&(t&&null!==g.alternate&&p.delete(null===g.key?d:g.key),o=s(g,o,d),null===f?l=g:f.sibling=g,f=g);return t&&p.forEach(function(t){return n(e,t)}),l}return function(e,t,i,s){var c="object"==typeof i&&null!==i;if(c)switch(i.$$typeof){case Ua:e:{var l=i.key;for(c=t;null!==c;){if(c.key===l){if(c.type===i.type){a(e,c.sibling),t=o(c,s),t.ref=re(c,i),t.pendingProps=i.props,t.return=e,e=t;break e}a(e,c);break}n(e,c),c=c.sibling}s=Sa(i,e.internalContextTag,s),s.ref=re(t,i),s.return=e,e=s}return u(e);case ba:e:{for(c=i.key;null!==t;){if(t.key===c){if(t.tag===Ma){a(e,t.sibling),t=o(t,s),t.pendingProps=i,t.return=e,e=t;break e}a(e,t);break}n(e,t),t=t.sibling}i=Ea(i,e.internalContextTag,s),i.return=e,e=i}return u(e);case ka:e:{if(null!==t){if(t.tag===Aa){a(e,t.sibling),t=o(t,s),t.type=i.value,t.return=e,e=t;break e}a(e,t)}t=Ia(i,e.internalContextTag,s),t.type=i.value,t.return=e,e=t}return u(e);case wa:e:{for(c=i.key;null!==t;){if(t.key===c){if(t.tag===Oa&&t.stateNode.containerInfo===i.containerInfo&&t.stateNode.implementation===i.implementation){a(e,t.sibling),t=o(t,s),t.pendingProps=i.children||[],t.return=e,e=t;break e}a(e,t);break}n(e,t),t=t.sibling}i=Ra(i,e.internalContextTag,s),i.return=e,e=i}return u(e)}if("string"==typeof i||"number"==typeof i)return i=""+i,null!==t&&t.tag===Da?(a(e,t.sibling),t=o(t,s),t.pendingProps=i,t.return=e,e=t):(a(e,t),i=_a(i,e.internalContextTag,s),i.return=e,e=i),u(e);if(Pa(i))return g(e,t,i,s);if(ne(i))return b(e,t,i,s);if(c&&ae(e,i),void 0===i)switch(e.tag){case Ta:case Fa:i=e.type,r("152",i.displayName||i.name||"Component")}return a(e,t)}}function oe(e,t,n,a){function i(e,t){t.updater=o,e.stateNode=t,$t.set(t,e)}var o={isMounted:ri,enqueueSetState:function(n,r,a){n=$t.get(n);var i=t(n,!1);Xa(n,r,void 0===a?null:a,i),e(n,i)},enqueueReplaceState:function(n,r,a){n=$t.get(n);var i=t(n,!1);Za(n,r,void 0===a?null:a,i),e(n,i)},enqueueForceUpdate:function(n,r){n=$t.get(n);var a=t(n,!1);ei(n,void 0===r?null:r,a),e(n,a)}};return{adoptClassInstance:i,constructClassInstance:function(e,t){var n=e.type,r=Qa(e),a=Ya(e),o=a?Ga(e,r):kt;return t=new n(t,o),i(e,t),a&&$a(e,r,o),t},mountClassInstance:function(e,t){var n=e.alternate,a=e.stateNode,i=a.state||null,s=e.pendingProps;s||r("158");var u=Qa(e);a.props=s,a.state=i,a.refs=kt,a.context=Ga(e,u),Ir.enableAsyncSubtreeAPI&&null!=e.type&&null!=e.type.prototype&&!0===e.type.prototype.unstable_isAsyncReactComponent&&(e.internalContextTag|=Ja),"function"==typeof a.componentWillMount&&(u=a.state,a.componentWillMount(),u!==a.state&&o.enqueueReplaceState(a,a.state,null),null!==(u=e.updateQueue)&&(a.state=ti(n,e,u,a,i,s,t))),"function"==typeof a.componentDidMount&&(e.effectTag|=qa)},updateClassInstance:function(e,t,i){var s=t.stateNode;s.props=t.memoizedProps,s.state=t.memoizedState;var u=t.memoizedProps,c=t.pendingProps;c||null==(c=u)&&r("159");var l=s.context,f=Qa(t);if(f=Ga(t,f),"function"!=typeof s.componentWillReceiveProps||u===c&&l===f||(l=s.state,s.componentWillReceiveProps(c,f),s.state!==l&&o.enqueueReplaceState(s,s.state,null)),l=t.memoizedState,i=null!==t.updateQueue?ti(e,t,t.updateQueue,s,l,c,i):l,!(u!==c||l!==i||ni()||null!==t.updateQueue&&t.updateQueue.hasForceUpdate))return"function"!=typeof s.componentDidUpdate||u===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=qa),!1;var p=c;if(null===u||null!==t.updateQueue&&t.updateQueue.hasForceUpdate)p=!0;else{var d=t.stateNode,h=t.type;p="function"==typeof d.shouldComponentUpdate?d.shouldComponentUpdate(p,i,f):!h.prototype||!h.prototype.isPureReactComponent||(!wt(u,p)||!wt(l,i))}return p?("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(c,i,f),"function"==typeof s.componentDidUpdate&&(t.effectTag|=qa)):("function"!=typeof s.componentDidUpdate||u===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=qa),n(t,c),a(t,i)),s.props=c,s.state=i,s.context=f,p}}}function se(e,t,n,a,i){function o(e,t,n){s(e,t,n,t.pendingWorkPriority)}function s(e,t,n,r){t.child=null===e?ai(t,t.child,n,r):e.child===t.child?ii(t,t.child,n,r):oi(t,t.child,n,r)}function u(e,t){var n=t.ref;null===n||e&&e.ref===n||(t.effectTag|=Di)}function c(e,t,n,r){if(u(e,t),!n)return r&&hi(t,!1),f(e,t);n=t.stateNode,Oi.current=t;var a=n.render();return t.effectTag|=Ri,o(e,t,a),t.memoizedState=n.state,t.memoizedProps=n.props,r&&hi(t,!0),t.child}function l(e){var t=e.stateNode;t.pendingContext?di(e,t.pendingContext,t.pendingContext!==t.context):t.context&&di(e,t.context,!1),m(e,t.containerInfo)}function f(e,t){return si(e,t),t.child}function p(e,t){switch(t.tag){case gi:l(t);break;case mi:pi(t);break;case wi:m(t,t.stateNode.containerInfo)}return null}var d=e.shouldSetTextContent,h=e.useSyncScheduling,v=e.shouldDeprioritizeSubtree,y=t.pushHostContext,m=t.pushHostContainer,g=n.enterHydrationState,b=n.resetHydrationState,k=n.tryToClaimNextHydratableInstance;e=oe(a,i,function(e,t){e.memoizedProps=t},function(e,t){e.memoizedState=t});var w=e.adoptClassInstance,x=e.constructClassInstance,S=e.mountClassInstance,C=e.updateClassInstance;return{beginWork:function(e,t,n){if(t.pendingWorkPriority===Ei||t.pendingWorkPriority>n)return p(e,t);switch(t.tag){case vi:null!==e&&r("155");var a=t.type,i=t.pendingProps,s=li(t);return s=ci(t,s),a=a(i,s),t.effectTag|=Ri,"object"==typeof a&&null!==a&&"function"==typeof a.render?(t.tag=mi,i=pi(t),w(t,a),S(t,n),t=c(e,t,!0,i)):(t.tag=yi,o(e,t,a),t.memoizedProps=i,t=t.child),t;case yi:e:{if(i=t.type,n=t.pendingProps,a=t.memoizedProps,fi())null===n&&(n=a);else if(null===n||a===n){t=f(e,t);break e}a=li(t),a=ci(t,a),i=i(n,a),t.effectTag|=Ri,o(e,t,i),t.memoizedProps=n,t=t.child}return t;case mi:return i=pi(t),a=void 0,null===e?t.stateNode?r("153"):(x(t,t.pendingProps),S(t,n),a=!0):a=C(e,t,n),c(e,t,a,i);case gi:return l(t),a=t.updateQueue,null!==a?(i=t.memoizedState,a=ui(e,t,a,null,i,null,n),i===a?(b(),t=f(e,t)):(i=a.element,null!==e&&null!==e.child||!g(t)?(b(),o(e,t,i)):(t.effectTag|=Pi,t.child=ai(t,t.child,i,n)),t.memoizedState=a,t=t.child)):(b(),t=f(e,t)),t;case bi:y(t),null===e&&k(t),i=t.type;var _=t.memoizedProps;return a=t.pendingProps,null===a&&null===(a=_)&&r("154"),s=null!==e?e.memoizedProps:null,fi()||null!==a&&_!==a?(_=a.children,d(i,a)?_=null:s&&d(i,s)&&(t.effectTag|=Fi),u(e,t),n!==Ii&&!h&&v(i,a)?(t.pendingWorkPriority=Ii,t=null):(o(e,t,_),t.memoizedProps=a,t=t.child)):t=f(e,t),t;case ki:return null===e&&k(t),e=t.pendingProps,null===e&&(e=t.memoizedProps),t.memoizedProps=e,null;case Si:t.tag=xi;case xi:return n=t.pendingProps,fi()?null===n&&null===(n=e&&e.memoizedProps)&&r("154"):null!==n&&t.memoizedProps!==n||(n=t.memoizedProps),i=n.children,a=t.pendingWorkPriority,t.stateNode=null===e?ai(t,t.stateNode,i,a):e.child===t.child?ii(t,t.stateNode,i,a):oi(t,t.stateNode,i,a),t.memoizedProps=n,t.stateNode;case Ci:return null;case wi:e:{if(m(t,t.stateNode.containerInfo),n=t.pendingWorkPriority,i=t.pendingProps,fi())null===i&&null==(i=e&&e.memoizedProps)&&r("154");else if(null===i||t.memoizedProps===i){t=f(e,t);break e}null===e?t.child=oi(t,t.child,i,n):o(e,t,i),t.memoizedProps=i,t=t.child}return t;case _i:e:{if(n=t.pendingProps,fi())null===n&&(n=t.memoizedProps);else if(null===n||t.memoizedProps===n){t=f(e,t);break e}o(e,t,n),t.memoizedProps=n,t=t.child}return t;default:r("156")}},beginFailedWork:function(e,t,n){switch(t.tag){case mi:pi(t);break;case gi:l(t);break;default:r("157")}return t.effectTag|=Ti,null===e?t.child=null:t.child!==e.child&&(t.child=e.child),t.pendingWorkPriority===Ei||t.pendingWorkPriority>n?p(e,t):(t.firstEffect=null,t.lastEffect=null,s(e,t,null,n),t.tag===mi&&(e=t.stateNode,t.memoizedProps=e.props,t.memoizedState=e.state),t.child)}}}function ue(e,t,n){var a=e.createInstance,i=e.createTextInstance,o=e.appendInitialChild,s=e.finalizeInitialChildren,u=e.prepareUpdate,c=t.getRootHostContainer,l=t.popHostContext,f=t.getHostContext,p=t.popHostContainer,d=n.prepareToHydrateHostInstance,h=n.prepareToHydrateHostTextInstance,v=n.popHydrationState;return{completeWork:function(e,t,n){var y=t.pendingProps;switch(null===y?y=t.memoizedProps:t.pendingWorkPriority===Yi&&n!==Yi||(t.pendingProps=null),t.tag){case ji:return null;case Bi:return Ai(t),null;case Hi:return p(t),Ni(t),y=t.stateNode,y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),null!==e&&null!==e.child||(v(t),t.effectTag&=~$i),null;case Ui:l(t),n=c();var m=t.type;if(null!==e&&null!=t.stateNode){var g=e.memoizedProps,b=t.stateNode,k=f();y=u(b,m,g,y,n,k),(t.updateQueue=y)&&(t.effectTag|=Qi),e.ref!==t.ref&&(t.effectTag|=Gi)}else{if(!y)return null===t.stateNode&&r("166"),null;if(e=f(),v(t))d(t,n,e)&&(t.effectTag|=Qi);else{e=a(m,y,n,e,t);e:for(g=t.child;null!==g;){if(g.tag===Ui||g.tag===zi)o(e,g.stateNode);else if(g.tag!==Wi&&null!==g.child){g=g.child;continue}if(g===t)break e;for(;null===g.sibling;){if(null===g.return||g.return===t)break e;g=g.return}g=g.sibling}s(e,m,y,n)&&(t.effectTag|=Qi),t.stateNode=e}null!==t.ref&&(t.effectTag|=Gi)}return null;case zi:if(e&&null!=t.stateNode)e.memoizedProps!==y&&(t.effectTag|=Qi);else{if("string"!=typeof y)return null===t.stateNode&&r("166"),null;e=c(),n=f(),v(t)?h(t)&&(t.effectTag|=Qi):t.stateNode=i(y,e,n,t)}return null;case Ki:(y=t.memoizedProps)||r("165"),t.tag=Vi,n=[];e:for((m=t.stateNode)&&(m.return=t);null!==m;){if(m.tag===Ui||m.tag===zi||m.tag===Wi)r("164");else if(m.tag===qi)n.push(m.type);else if(null!==m.child){m.child.return=m,m=m.child;continue}for(;null===m.sibling;){if(null===m.return||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}return m=y.handler,y=m(y.props,n),t.child=Mi(t,null!==e?e.child:null,y,t.pendingWorkPriority),t.child;case Vi:return t.tag=Ki,null;case qi:case Ji:return null;case Wi:return t.effectTag|=Qi,p(t),null;case Li:r("167");default:r("156")}}}}function ce(e){return function(t){try{return e(t)}catch(e){}}}function le(e,t){function n(e){var n=e.ref;if(null!==n)try{n(null)}catch(n){t(e,n)}}function a(e){return e.tag===ro||e.tag===no||e.tag===io}function i(e){for(var t=e;;)if(s(t),null!==t.child&&t.tag!==io)t.child.return=t,t=t.child;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}}function o(e){for(var t=e,n=!1,a=void 0,o=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&r("160"),n.tag){case ro:a=n.stateNode,o=!1;break e;case no:case io:a=n.stateNode.containerInfo,o=!0;break e}n=n.return}n=!0}if(t.tag===ro||t.tag===ao)i(t),o?m(a,t.stateNode):y(a,t.stateNode);else if(t.tag===io?a=t.stateNode.containerInfo:s(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return,t.tag===io&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function s(e){switch("function"==typeof uo&&uo(e),e.tag){case to:n(e);var r=e.stateNode;if("function"==typeof r.componentWillUnmount)try{r.props=e.memoizedProps,r.state=e.memoizedState,r.componentWillUnmount()}catch(n){t(e,n)}break;case ro:n(e);break;case oo:i(e.stateNode);break;case io:o(e)}}var u=e.commitMount,c=e.commitUpdate,l=e.resetTextContent,f=e.commitTextUpdate,p=e.appendChild,d=e.appendChildToContainer,h=e.insertBefore,v=e.insertInContainerBefore,y=e.removeChild,m=e.removeChildFromContainer,g=e.getPublicInstance;return{commitPlacement:function(e){e:{for(var t=e.return;null!==t;){if(a(t)){var n=t;break e}t=t.return}r("160"),n=void 0}var i=t=void 0;switch(n.tag){case ro:t=n.stateNode,i=!1;break;case no:case io:t=n.stateNode.containerInfo,i=!0;break;default:r("161")}n.effectTag&po&&(l(t),n.effectTag&=~po);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||a(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==ro&&n.tag!==ao;){if(n.effectTag&co)continue t;if(null===n.child||n.tag===io)continue t;n.child.return=n,n=n.child}if(!(n.effectTag&co)){n=n.stateNode;break e}}for(var o=e;;){if(o.tag===ro||o.tag===ao)n?i?v(t,o.stateNode,n):h(t,o.stateNode,n):i?d(t,o.stateNode):p(t,o.stateNode);else if(o.tag!==io&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===e)break;for(;null===o.sibling;){if(null===o.return||o.return===e)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},commitDeletion:function(e){o(e),e.return=null,e.child=null,e.alternate&&(e.alternate.child=null,e.alternate.return=null)},commitWork:function(e,t){switch(t.tag){case to:break;case ro:var n=t.stateNode;if(null!=n){var a=t.memoizedProps;e=null!==e?e.memoizedProps:a;var i=t.type,o=t.updateQueue;t.updateQueue=null,null!==o&&c(n,o,i,e,a,t)}break;case ao:null===t.stateNode&&r("162"),n=t.memoizedProps,f(t.stateNode,null!==e?e.memoizedProps:n,n);break;case no:case io:break;default:r("163")}},commitLifeCycles:function(e,t){switch(t.tag){case to:var n=t.stateNode;if(t.effectTag&lo)if(null===e)n.props=t.memoizedProps,n.state=t.memoizedState,n.componentDidMount();else{var a=e.memoizedProps;e=e.memoizedState,n.props=t.memoizedProps,n.state=t.memoizedState,n.componentDidUpdate(a,e)}t.effectTag&fo&&null!==t.updateQueue&&so(t,t.updateQueue,n);break;case no:e=t.updateQueue,null!==e&&so(t,e,t.child&&t.child.stateNode);break;case ro:n=t.stateNode,null===e&&t.effectTag&lo&&u(n,t.type,t.memoizedProps,t);break;case ao:case io:break;default:r("163")}},commitAttachRef:function(e){var t=e.ref;if(null!==t){var n=e.stateNode;switch(e.tag){case ro:t(g(n));break;default:t(n)}}},commitDetachRef:function(e){null!==(e=e.ref)&&e(null)}}}function fe(e){function t(e){return e===mo&&r("174"),e}var n=e.getChildHostContext,a=e.getRootHostContext,i=ho(mo),o=ho(mo),s=ho(mo);return{getHostContext:function(){return t(i.current)},getRootHostContainer:function(){return t(s.current)},popHostContainer:function(e){vo(i,e),vo(o,e),vo(s,e)},popHostContext:function(e){o.current===e&&(vo(i,e),vo(o,e))},pushHostContainer:function(e,t){yo(s,t,e),t=a(t),yo(o,e,e),yo(i,t,e)},pushHostContext:function(e){var r=t(s.current),a=t(i.current);r=n(a,e.type,r),a!==r&&(yo(o,e,e),yo(i,r,e))},resetHostContainer:function(){i.current=mo,s.current=mo}}}function pe(e){function t(e,t){var n=So();n.stateNode=t,n.return=e,n.effectTag=wo,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function n(e,t){switch(e.tag){case go:return o(t,e.type,e.pendingProps);case bo:return s(t,e.pendingProps);default:return!1}}function a(e){for(e=e.return;null!==e&&e.tag!==go&&e.tag!==ko;)e=e.return;h=e}var i=e.shouldSetTextContent,o=e.canHydrateInstance,s=e.canHydrateTextInstance,u=e.getNextHydratableSibling,c=e.getFirstHydratableChild,l=e.hydrateInstance,f=e.hydrateTextInstance,p=e.didNotHydrateInstance,d=e.didNotFindHydratableInstance;if(e=e.didNotFindHydratableTextInstance,!(o&&s&&u&&c&&l&&f&&p&&d&&e))return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){r("175")},prepareToHydrateHostTextInstance:function(){r("176")},popHydrationState:function(){return!1}};var h=null,v=null,y=!1;return{enterHydrationState:function(e){return v=c(e.stateNode.containerInfo),h=e,y=!0},resetHydrationState:function(){v=h=null,y=!1},tryToClaimNextHydratableInstance:function(e){if(y){var r=v;if(r){if(!n(e,r)){if(!(r=u(r))||!n(e,r))return e.effectTag|=xo,y=!1,void(h=e);t(h,v)}e.stateNode=r,h=e,v=c(r)}else e.effectTag|=xo,y=!1,h=e}},prepareToHydrateHostInstance:function(e,t,n){return t=l(e.stateNode,e.type,e.memoizedProps,t,n,e),e.updateQueue=t,null!==t},prepareToHydrateHostTextInstance:function(e){return f(e.stateNode,e.memoizedProps,e)},popHydrationState:function(e){if(e!==h)return!1;if(!y)return a(e),y=!0,!1;var n=e.type;if(e.tag!==go||"head"!==n&&"body"!==n&&!i(n,e.memoizedProps))for(n=v;n;)t(e,n),n=u(n);return a(e),v=h?u(e.stateNode):null,!0}}}function de(e){function t(){for(;null!==q&&q.current.pendingWorkPriority===Fo;){q.isScheduled=!1;var e=q.nextScheduledRoot;if(q.nextScheduledRoot=null,q===J)return J=q=null,W=Fo,null;q=e}e=q;for(var t=null,n=Fo;null!==e;)e.current.pendingWorkPriority!==Fo&&(n===Fo||n>e.current.pendingWorkPriority)&&(n=e.current.pendingWorkPriority,t=e),e=e.nextScheduledRoot;null!==t?(W=n,_o(),Yo(),x(),z=Io(t.current,n),t!==ae&&(re=0,ae=t)):(W=Fo,ae=z=null)}function n(n){ee=!0,V=null;var a=n.stateNode;if(a.current===n&&r("177"),W!==To&&W!==Do||re++,Eo.current=null,n.effectTag>Lo)if(null!==n.lastEffect){n.lastEffect.nextEffect=n;var i=n.firstEffect}else i=n;else i=n.firstEffect;for(A(),K=i;null!==K;){var o=!1,s=void 0;try{for(;null!==K;){var u=K.effectTag;if(u&zo&&e.resetTextContent(K.stateNode),u&Vo){var c=K.alternate;null!==c&&D(c)}switch(u&~(Wo|Ko|zo|Vo|Lo)){case jo:I(K),K.effectTag&=~jo;break;case Ho:I(K),K.effectTag&=~jo,P(K.alternate,K);break;case Bo:P(K.alternate,K);break;case Uo:te=!0,R(K),te=!1}K=K.nextEffect}}catch(e){o=!0,s=e}o&&(null===K&&r("178"),f(K,s),null!==K&&(K=K.nextEffect))}for(N(),a.current=n,K=i;null!==K;){a=!1,i=void 0;try{for(;null!==K;){var l=K.effectTag;if(l&(Bo|Wo)&&F(K.alternate,K),l&Vo&&T(K),l&Ko)switch(o=K,s=void 0,null!==G&&(s=G.get(o),G.delete(o),null==s&&null!==o.alternate&&(o=o.alternate,s=G.get(o),G.delete(o))),null==s&&r("184"),o.tag){case Go:o.stateNode.componentDidCatch(s.error,{componentStack:s.componentStack});break;case qo:null===X&&(X=s.error);break;default:r("157")}var p=K.nextEffect;K.nextEffect=null,K=p}}catch(e){a=!0,i=e}a&&(null===K&&r("178"),f(K,i),null!==K&&(K=K.nextEffect))}ee=!1,"function"==typeof Po&&Po(n.stateNode),Y&&(Y.forEach(m),Y=null),t()}function a(e){for(;;){var t=E(e.alternate,e,W),n=e.return,r=e.sibling,a=e;if(!(a.pendingWorkPriority!==Fo&&a.pendingWorkPriority>W)){for(var i=Qo(a),o=a.child;null!==o;)i=Ro(i,o.pendingWorkPriority),o=o.sibling;a.pendingWorkPriority=i}if(null!==t)return t;if(null!==n&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),e.effectTag>Lo&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e)),null!==r)return r;if(null===n){V=e;break}e=n}return null}function i(e){var t=C(e.alternate,e,W);return null===t&&(t=a(e)),Eo.current=null,t}function o(e){var t=_(e.alternate,e,W);return null===t&&(t=a(e)),Eo.current=null,t}function s(e){l(Ao,e)}function u(){if(null!==G&&0e)){L=W;e:for(;;){if(W<=Do)for(;null!==z&&!(null===(z=i(z))&&(null===V&&r("179"),L=Do,n(V),L=W,u(),W===Fo||W>e||W>Do)););else if(null!==a)for(;null!==z&&!B;)if(1e||WDo&&!$&&(O(s),$=!0),e=X,Z=B=j=!1,ae=Q=G=X=null,re=0,null!==e)throw e}function f(e,t){var n=Eo.current=null,r=!1,a=!1,i=null;if(e.tag===qo)n=e,d(e)&&(Z=!0);else for(var o=e.return;null!==o&&null===n;){if(o.tag===Go?"function"==typeof o.stateNode.componentDidCatch&&(r=!0,i=p(o),n=o,a=!0):o.tag===qo&&(n=o),d(o)){if(te||null!==Y&&(Y.has(o)||null!==o.alternate&&Y.has(o.alternate)))return null;n=null,a=!1}o=o.return}if(null!==n){null===Q&&(Q=new Set),Q.add(n);var s="";o=e;do{e:switch(o.tag){case pa:case da:case ha:case va:var u=o._debugOwner,c=o._debugSource,l=p(o),f=null;u&&(f=p(u)),u=c,l="\n in "+(l||"Unknown")+(u?" (at "+u.fileName.replace(/^.*[\\\/]/,"")+":"+u.lineNumber+")":f?" (created by "+f+")":"");break e;default:l=""}s+=l,o=o.return}while(o);o=s,e=p(e),null===G&&(G=new Map),t={componentName:e,componentStack:o,error:t,errorBoundary:r?n.stateNode:null,errorBoundaryFound:r,errorBoundaryName:i,willRetry:a},G.set(n,t);try{console.error(t.error)}catch(e){console.error(e)}return ee?(null===Y&&(Y=new Set),Y.add(n)):m(n),n}return null===X&&(X=t),null}function d(e){return null!==Q&&(Q.has(e)||null!==e.alternate&&Q.has(e.alternate))}function h(e,t){return v(e,t,!1)}function v(e,t){re>ne&&(Z=!0,r("185")),!j&&t<=W&&(z=null);for(var n=!0;null!==e&&n;){if(n=!1,(e.pendingWorkPriority===Fo||e.pendingWorkPriority>t)&&(n=!0,e.pendingWorkPriority=t),null!==e.alternate&&(e.alternate.pendingWorkPriority===Fo||e.alternate.pendingWorkPriority>t)&&(n=!0,e.alternate.pendingWorkPriority=t),null===e.return){if(e.tag!==qo)break;var a=e.stateNode;if(t===Fo||a.isScheduled||(a.isScheduled=!0,J?J.nextScheduledRoot=a:q=a,J=a),!j)switch(t){case To:U?l(To,null):l(Do,null);break;case Do:H||r("186");break;default:$||(O(s),$=!0)}}e=e.return}}function y(e,t){var n=L;return n===Fo&&(n=!M||e.internalContextTag&No||t?Mo:To),n===To&&(j||H)?Do:n}function m(e){v(e,Do,!0)}var g=fe(e),b=pe(e),k=g.popHostContainer,w=g.popHostContext,x=g.resetHostContainer,S=se(e,g,b,h,y),C=S.beginWork,_=S.beginFailedWork,E=ue(e,g,b).completeWork;g=le(e,f);var I=g.commitPlacement,R=g.commitDeletion,P=g.commitWork,F=g.commitLifeCycles,T=g.commitAttachRef,D=g.commitDetachRef,O=e.scheduleDeferredCallback,M=e.useSyncScheduling,A=e.prepareForCommit,N=e.resetAfterCommit,L=Fo,j=!1,B=!1,H=!1,U=!1,z=null,W=Fo,K=null,V=null,q=null,J=null,$=!1,G=null,Q=null,Y=null,X=null,Z=!1,ee=!1,te=!1,ne=1e3,re=0,ae=null;return{scheduleUpdate:h,getPriorityContext:y,batchedUpdates:function(e,t){var n=H;H=!0;try{return e(t)}finally{H=n,j||H||l(Do,null)}},unbatchedUpdates:function(e){var t=U,n=H;U=H,H=!1;try{return e()}finally{H=n,U=t}},flushSync:function(e){var t=H,n=L;H=!0,L=To;try{return e()}finally{H=t,L=n,j&&r("187"),l(Do,null)}},deferredUpdates:function(e){var t=L;L=Mo;try{return e()}finally{L=t}}}}function he(){r("196")}function ve(e){return e?(e=$t.get(e),"number"==typeof e.tag?he(e):e._processChildContext(e._context)):kt}function ye(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function me(e,t){var n=ye(e);e=0;for(var r;n;){if(n.nodeType===is){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ye(n)}}function ge(){return!os&&yt.canUseDOM&&(os="textContent"in document.documentElement?"textContent":"innerText"),os}function be(){r("211")}function ke(){r("212")}function we(e){if(null==e)return null;if(e.nodeType===fs)return e;var t=$t.get(e);if(t)return"number"==typeof t.tag?be(t):ke(t);"function"==typeof e.render?r("188"):r("213",Object.keys(e))}function xe(e){if(void 0!==e._hostParent)return e._hostParent;if("number"==typeof e.tag){do{e=e.return}while(e&&e.tag!==ps);if(e)return e}return null}function Se(e,t){for(var n=0,r=e;r;r=xe(r))n++;r=0;for(var a=t;a;a=xe(a))r++;for(;0this.eventPool.length&&this.eventPool.push(e)}function De(e){e.eventPool=[],e.getPooled=Fe,e.release=Te}function Oe(e,t,n,r){return Pe.call(this,e,t,n,r)}function Me(e,t,n,r){return Pe.call(this,e,t,n,r)}function Ae(e,t){switch(e){case"topKeyUp":return-1!==ws.indexOf(t.keyCode);case"topKeyDown":return 229!==t.keyCode;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function Ne(e){return e=e.detail,"object"==typeof e&&"data"in e?e.data:null}function Le(e,t){switch(e){case"topCompositionEnd":return Ne(t);case"topKeyPress":return 32!==t.which?null:(Fs=!0,Rs);case"topTextInput":return e=t.data,e===Rs&&Fs?null:e;default:return null}}function je(e,t){if(Ts)return"topCompositionEnd"===e||!xs&&Ae(e,t)?(e=gs.getData(),gs.reset(),Ts=!1,e):null;switch(e){case"topPaste":return null;case"topKeyPress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=u.hasBooleanValue+u.hasNumericValue+u.hasOverloadedBooleanValue||r("50",o),i.hasOwnProperty(o)&&(u.attributeName=i[o]),a.hasOwnProperty(o)&&(u.attributeNamespace=a[o]),e.hasOwnProperty(o)&&(u.mutationMethod=e[o]),Mt.properties[o]=u}}},Mt={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ATTRIBUTE_NAME_CHAR:":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},shouldSetAttribute:function(e,t){if(Mt.isReservedProp(e)||!("o"!==e[0]&&"O"!==e[0]||"n"!==e[1]&&"N"!==e[1]))return!1;if(null===t)return!0;switch(typeof t){case"boolean":return Mt.shouldAttributeAcceptBooleanValue(e);case"undefined":case"number":case"string":case"object":return!0;default:return!1}},getPropertyInfo:function(e){return Mt.properties.hasOwnProperty(e)?Mt.properties[e]:null},shouldAttributeAcceptBooleanValue:function(e){if(Mt.isReservedProp(e))return!0;var t=Mt.getPropertyInfo(e);return t?t.hasBooleanValue||t.hasStringBooleanValue||t.hasOverloadedBooleanValue:"data-"===(e=e.toLowerCase().slice(0,5))||"aria-"===e},isReservedProp:function(e){return Dt.hasOwnProperty(e)},injection:Ot},At=Mt,Nt={IndeterminateComponent:0,FunctionalComponent:1,ClassComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,CoroutineComponent:7,CoroutineHandlerPhase:8,YieldComponent:9,Fragment:10},Lt={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_FRAGMENT_NODE:11},jt=Nt.HostComponent,Bt=Nt.HostText,Ht=Lt.ELEMENT_NODE,Ut=Lt.COMMENT_NODE,zt=At.ID_ATTRIBUTE_NAME,Wt={hasCachedChildNodes:1},Kt=Math.random().toString(36).slice(2),Vt="__reactInternalInstance$"+Kt,qt="__reactEventHandlers$"+Kt,Jt={getClosestInstanceFromNode:f,getInstanceFromNode:function(e){var t=e[Vt];return t?t.tag===jt||t.tag===Bt?t:t._hostNode===e?t:null:(t=f(e),null!=t&&t._hostNode===e?t:null)},getNodeFromInstance:function(e){if(e.tag===jt||e.tag===Bt)return e.stateNode;if(void 0===e._hostNode&&r("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||r("34"),e=e._hostParent;for(;t.length;e=t.pop())l(e,e._hostNode);return e._hostNode},precacheChildNodes:l,precacheNode:c,uncacheNode:function(e){var t=e._hostNode;t&&(delete t[Vt],e._hostNode=null)},precacheFiberNode:function(e,t){t[Vt]=e},getFiberCurrentPropsFromNode:function(e){return e[qt]||null},updateFiberProps:function(e,t){e[qt]=t}},$t={remove:function(e){e._reactInternalFiber=void 0},get:function(e){return e._reactInternalFiber},has:function(e){return void 0!==e._reactInternalFiber},set:function(e,t){e._reactInternalFiber=t}},Gt={ReactCurrentOwner:vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner},Qt={NoEffect:0,PerformedWork:1,Placement:2,Update:4,PlacementAndUpdate:6,Deletion:8,ContentReset:16,Callback:32,Err:64,Ref:128},Yt=Nt.HostComponent,Xt=Nt.HostRoot,Zt=Nt.HostPortal,en=Nt.HostText,tn=Qt.NoEffect,nn=Qt.Placement,rn={isFiberMounted:function(e){return 2===d(e)},isMounted:function(e){return!!(e=$t.get(e))&&2===d(e)},findCurrentFiberUsingSlowPath:v,findCurrentHostFiber:function(e){if(!(e=v(e)))return null;for(var t=e;;){if(t.tag===Yt||t.tag===en)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null},findCurrentHostFiberWithNoPortals:function(e){if(!(e=v(e)))return null;for(var t=e;;){if(t.tag===Yt||t.tag===en)return t;if(t.child&&t.tag!==Zt)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}},an={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,injection:{injectErrorUtils:function(e){"function"!=typeof e.invokeGuardedCallback&&r("197"),y=e.invokeGuardedCallback}},invokeGuardedCallback:function(e,t,n,r,a,i,o,s,u){y.apply(an,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,a,i,o,s,u){if(an.invokeGuardedCallback.apply(this,arguments),an.hasCaughtError()){var c=an.clearCaughtError();an._hasRethrowError||(an._hasRethrowError=!0,an._rethrowError=c)}},rethrowCaughtError:function(){return m.apply(an,arguments)},hasCaughtError:function(){return an._hasCaughtError},clearCaughtError:function(){if(an._hasCaughtError){var e=an._caughtError;return an._caughtError=null,an._hasCaughtError=!1,e}r("198")}},on=an,sn={isEndish:function(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e},isMoveish:function(e){return"topMouseMove"===e||"topTouchMove"===e},isStartish:function(e){return"topMouseDown"===e||"topTouchStart"===e},executeDirectDispatch:function(e){var t=e._dispatchListeners,n=e._dispatchInstances;return Array.isArray(t)&&r("103"),e.currentTarget=t?sn.getNodeFromInstance(n):null,t=t?t(e):null,e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,t},executeDispatchesInOrder:function(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var a=0;amn.length&&mn.push(e)}}}},bn=gn,kn=null,wn={injection:{injectEventPluginOrder:Tt.injectEventPluginOrder,injectEventPluginsByName:Tt.injectEventPluginsByName},getListener:function(e,t){if("number"==typeof e.tag){var n=e.stateNode;if(!n)return null;var a=un.getFiberCurrentPropsFromNode(n);if(!a)return null;if(n=a[t],F(t,e.type,a))return null}else{if("string"==typeof(a=e._currentElement)||"number"==typeof a||!e._rootNodeID)return null;if(e=a.props,n=e[t],F(t,a.type,e))return null}return n&&"function"!=typeof n&&r("231",t,typeof n),n},extractEvents:function(e,t,n,r){for(var a,i=Tt.plugins,o=0;on||r.hasOverloadedBooleanValue&&!1===n?Un.deleteValueForProperty(e,t):r.mustUseProperty?e[r.propertyName]=n:(t=r.attributeName,(a=r.attributeNamespace)?e.setAttributeNS(a,t,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&!0===n?e.setAttribute(t,""):e.setAttribute(t,""+n))}else Un.setValueForAttribute(e,t,At.shouldSetAttribute(t,n)?n:null)},setValueForAttribute:function(e,t,n){A(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=At.getPropertyInfo(t);n?(t=n.mutationMethod)?t(e,void 0):n.mustUseProperty?e[n.propertyName]=!n.hasBooleanValue&&"":e.removeAttribute(n.attributeName):e.removeAttribute(t)}},zn=Un,Wn=Gt.ReactDebugCurrentFrame,Kn={current:null,phase:null,resetCurrentFiber:function(){Wn.getCurrentStack=null,Kn.current=null,Kn.phase=null},setCurrentFiber:function(e,t){Wn.getCurrentStack=N,Kn.current=e,Kn.phase=t},getCurrentFiberOwnerName:function(){return null},getCurrentFiberStackAddendum:N},Vn=Kn,qn={getHostProps:function(e,t){var n=t.value,r=t.checked;return mt({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked})},initWrapperState:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}},updateWrapper:function(e,t){var n=t.checked;null!=n&&zn.setValueForProperty(e,"checked",n||!1),n=t.value,null!=n?0===n&&""===e.value?e.value="0":"number"===t.type?(t=parseFloat(e.value)||0,(n!=t||n==t&&e.value!=n)&&(e.value=""+n)):e.value!==""+n&&(e.value=""+n):(null==t.value&&null!=t.defaultValue&&e.defaultValue!==""+t.defaultValue&&(e.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked))},postMountWrapper:function(e,t){switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":e.value="",e.value=e.defaultValue;break;default:e.value=e.value}t=e.name,""!==t&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!e.defaultChecked,""!==t&&(e.name=t)},restoreControlledState:function(e,t){qn.updateWrapper(e,t);var n=t.name;if("radio"===t.type&&null!=n){for(t=e;t.parentNode;)t=t.parentNode;for(n=t.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),t=0;t=t.length||r("93"),t=t[0]),n=""+t),null==n&&(n=""),a=n),e._wrapperState={initialValue:""+a}},updateWrapper:function(e,t){var n=t.value;null!=n&&(n=""+n,n!==e.value&&(e.value=n),null==t.defaultValue&&(e.defaultValue=n)),null!=t.defaultValue&&(e.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)},restoreControlledState:function(e,t){Qn.updateWrapper(e,t)}},Yn=Qn,Xn=mt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Zn={_getTrackerFromNode:function(e){return e._valueTracker},track:function(e){e._valueTracker||(e._valueTracker=U(e))},updateValueIfChanged:function(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=H(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)},stopTracking:function(e){(e=e._valueTracker)&&e.stopTracking()}},er=It.Namespaces,tr=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if(e.namespaceURI!==er.svg||"innerHTML"in e)e.innerHTML=t;else for(Nn=Nn||document.createElement("div"),Nn.innerHTML=""+t+"",t=Nn.firstChild;t.firstChild;)e.appendChild(t.firstChild)}),nr=/["'&<>]/,rr=Lt.TEXT_NODE;yt.canUseDOM&&("textContent"in document.documentElement||(W=function(e,t){if(e.nodeType===rr)e.nodeValue=t;else{if("boolean"==typeof t||"number"==typeof t)t=""+t;else{t=""+t;var n=nr.exec(t);if(n){var r,a="",i=0;for(r=n.index;r<\/script>",e=e.removeChild(e.firstChild)):e="string"==typeof t.is?n.createElement(e,{is:t.is}):n.createElement(e):e=n.createElementNS(r,e),e},createTextNode:function(e,t){return(t.nodeType===ir?t:t.ownerDocument).createTextNode(e)},setInitialProperties:function(e,t,n,r){var a=z(t,n);switch(t){case"iframe":case"object":Pn.trapBubbledEvent("topLoad","load",e);var i=n;break;case"video":case"audio":for(i in fr)fr.hasOwnProperty(i)&&Pn.trapBubbledEvent(i,fr[i],e);i=n;break;case"source":Pn.trapBubbledEvent("topError","error",e),i=n;break;case"img":case"image":Pn.trapBubbledEvent("topError","error",e),Pn.trapBubbledEvent("topLoad","load",e),i=n;break;case"form":Pn.trapBubbledEvent("topReset","reset",e),Pn.trapBubbledEvent("topSubmit","submit",e),i=n;break;case"details":Pn.trapBubbledEvent("topToggle","toggle",e),i=n;break;case"input":Jn.initWrapperState(e,n),i=Jn.getHostProps(e,n),Pn.trapBubbledEvent("topInvalid","invalid",e),K(r,"onChange");break;case"option":$n.validateProps(e,n),i=$n.getHostProps(e,n);break;case"select":Gn.initWrapperState(e,n),i=Gn.getHostProps(e,n),Pn.trapBubbledEvent("topInvalid","invalid",e),K(r,"onChange");break;case"textarea":Yn.initWrapperState(e,n),i=Yn.getHostProps(e,n),Pn.trapBubbledEvent("topInvalid","invalid",e),K(r,"onChange");break;default:i=n}B(t,i);var o,s=i;for(o in s)if(s.hasOwnProperty(o)){var u=s[o];"style"===o?Ln.setValueForStyles(e,u):"dangerouslySetInnerHTML"===o?null!=(u=u?u.__html:void 0)&&tr(e,u):"children"===o?"string"==typeof u?ar(e,u):"number"==typeof u&&ar(e,""+u):"suppressContentEditableWarning"!==o&&(ur.hasOwnProperty(o)?null!=u&&K(r,o):a?zn.setValueForAttribute(e,o,u):null!=u&&zn.setValueForProperty(e,o,u))}switch(t){case"input":Zn.track(e),Jn.postMountWrapper(e,n);break;case"textarea":Zn.track(e),Yn.postMountWrapper(e,n);break;case"option":$n.postMountWrapper(e,n);break;case"select":Gn.postMountWrapper(e,n);break;default:"function"==typeof i.onClick&&(e.onclick=bt)}},diffProperties:function(e,t,n,r,a){var i=null;switch(t){case"input":n=Jn.getHostProps(e,n),r=Jn.getHostProps(e,r),i=[];break;case"option":n=$n.getHostProps(e,n),r=$n.getHostProps(e,r),i=[];break;case"select":n=Gn.getHostProps(e,n),r=Gn.getHostProps(e,r),i=[];break;case"textarea":n=Yn.getHostProps(e,n),r=Yn.getHostProps(e,r),i=[];break;default:"function"!=typeof n.onClick&&"function"==typeof r.onClick&&(e.onclick=bt)}B(t,r);var o,s;e=null;for(o in n)if(!r.hasOwnProperty(o)&&n.hasOwnProperty(o)&&null!=n[o])if("style"===o)for(s in t=n[o])t.hasOwnProperty(s)&&(e||(e={}),e[s]="");else"dangerouslySetInnerHTML"!==o&&"children"!==o&&"suppressContentEditableWarning"!==o&&(ur.hasOwnProperty(o)?i||(i=[]):(i=i||[]).push(o,null));for(o in r){var u=r[o];if(t=null!=n?n[o]:void 0,r.hasOwnProperty(o)&&u!==t&&(null!=u||null!=t))if("style"===o)if(t){for(s in t)!t.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(e||(e={}),e[s]="");for(s in u)u.hasOwnProperty(s)&&t[s]!==u[s]&&(e||(e={}),e[s]=u[s])}else e||(i||(i=[]),i.push(o,e)),e=u;else"dangerouslySetInnerHTML"===o?(u=u?u.__html:void 0,t=t?t.__html:void 0,null!=u&&t!==u&&(i=i||[]).push(o,""+u)):"children"===o?t===u||"string"!=typeof u&&"number"!=typeof u||(i=i||[]).push(o,""+u):"suppressContentEditableWarning"!==o&&(ur.hasOwnProperty(o)?(null!=u&&K(a,o),i||t===u||(i=[])):(i=i||[]).push(o,u))}return e&&(i=i||[]).push("style",e),i},updateProperties:function(e,t,n,r,a){z(n,r),r=z(n,a);for(var i=0;it&&(t=8),kr=t=V(c.priorityLevel,o);){n.first=c.next,null===n.first&&(n.last=null);var l;c.isReplace?(a=Q(c,r,a,i),u=!0):(l=Q(c,r,a,i))&&(a=u?mt({},a,l):mt(a,l),u=!1),c.isForced&&(s=!0),null===c.callback||c.isTopLevelUnmount&&null!==c.next||(e=null!==e?e:[],e.push(c.callback),t.effectTag|=Pr),c=c.next}return n.callbackList=e,n.hasForceUpdate=s,null!==n.first||null!==e||s||(t.updateQueue=null),a},commitCallbacks:function(e,t,n){if(null!==(e=t.callbackList))for(t.callbackList=null,t=0;tBr||(e.current=jr[Br],jr[Br]=null,Br--)},push:function(e,t){Br++,jr[Br]=e.current,e.current=t},reset:function(){for(;-1e)?e:t}},fa=la.createHostRootFiber,pa=Nt.IndeterminateComponent,da=Nt.FunctionalComponent,ha=Nt.ClassComponent,va=Nt.HostComponent;"function"==typeof Symbol&&Symbol.for?(Cr=Symbol.for("react.coroutine"),_r=Symbol.for("react.yield")):(Cr=60104,_r=60105);var ya={createCoroutine:function(e,t,n){var r=3t&&(r=t,t=a,a=r),r=me(e,a),e=me(e,t),r&&e){var i=document.createRange();i.setStart(r.node,r.offset),n.removeAllRanges(),a>t?(n.addRange(i),n.extend(e.node,e.offset)):(i.setEnd(e.node,e.offset),n.addRange(i))}}}},us=Lt.ELEMENT_NODE,cs={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=Ct();return{focusedElem:e,selectionRange:cs.hasSelectionCapabilities(e)?cs.getSelection(e):null}},restoreSelection:function(e){var t=Ct(),n=e.focusedElem;if(e=e.selectionRange,t!==n&&xt(document.documentElement,n)){for(cs.hasSelectionCapabilities(n)&&cs.setSelection(n,e),t=[],e=n;e=e.parentNode;)e.nodeType===us&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(St(n),n=0;n=parseInt(_s.version(),10))}var Es=Cs,Is=yt.canUseDOM&&(!xs||Ss&&8=Ss),Rs=String.fromCharCode(32),Ps={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}},Fs=!1,Ts=!1,Ds={eventTypes:Ps,extractEvents:function(e,t,n,r){var a;if(xs)e:{switch(e){case"topCompositionStart":var i=Ps.compositionStart;break e;case"topCompositionEnd":i=Ps.compositionEnd;break e;case"topCompositionUpdate":i=Ps.compositionUpdate;break e}i=void 0}else Ts?Ae(e,n)&&(i=Ps.compositionEnd):"topKeyDown"===e&&229===n.keyCode&&(i=Ps.compositionStart);return i?(Is&&(Ts||i!==Ps.compositionStart?i===Ps.compositionEnd&&Ts&&(a=gs.getData()):Ts=gs.initialize(r)),i=Oe.getPooled(i,t,n,r),a?i.data=a:null!==(a=Ne(n))&&(i.data=a),vs.accumulateTwoPhaseDispatches(i),a=i):a=null,(e=Es?Le(e,n):je(e,n))?(t=Me.getPooled(Ps.beforeInput,t,n,r),t.data=e,vs.accumulateTwoPhaseDispatches(t)):t=null,[a,t]}},Os={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},Ms={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange".split(" ")}},As=null,Ns=null,Ls=!1;yt.canUseDOM&&(Ls=T("input")&&(!document.documentMode||9=document.documentMode,Ks={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}},Vs=null,qs=null,Js=null,$s=!1,Gs=Pn.isListeningToAllDependencies,Qs={eventTypes:Ks,extractEvents:function(e,t,n,r){var a=r.window===r?r.document:r.nodeType===zs?r:r.ownerDocument;if(!a||!Gs("onSelect",a))return null;switch(a=t?Jt.getNodeFromInstance(t):window,e){case"topFocus":(Be(a)||"true"===a.contentEditable)&&(Vs=a,qs=t,Js=null);break;case"topBlur":Js=qs=Vs=null;break;case"topMouseDown":$s=!0;break;case"topContextMenu":case"topMouseUp":return $s=!1,et(n,r);case"topSelectionChange":if(Ws)break;case"topKeyDown":case"topKeyUp":return et(n,r)}return null}};Pe.augmentClass(tt,{animationName:null,elapsedTime:null,pseudoElement:null}),Pe.augmentClass(nt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qe.augmentClass(rt,{relatedTarget:null});var Ys={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xs={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};Qe.augmentClass(it,{key:function(e){if(e.key){var t=Ys[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?(e=at(e),13===e?"Enter":String.fromCharCode(e)):"keydown"===e.type||"keyup"===e.type?Xs[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Xe,charCode:function(e){return"keypress"===e.type?at(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?at(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Ze.augmentClass(ot,{dataTransfer:null}),Qe.augmentClass(st,{touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Xe}),Pe.augmentClass(ut,{propertyName:null,elapsedTime:null,pseudoElement:null}),Ze.augmentClass(ct,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null});var Zs={},eu={};"abort animationEnd animationIteration animationStart blur cancel canPlay canPlayThrough click close contextMenu copy cut doubleClick drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error focus input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing progress rateChange reset scroll seeked seeking stalled submit suspend timeUpdate toggle touchCancel touchEnd touchMove touchStart transitionEnd volumeChange waiting wheel".split(" ").forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t;t="top"+t,n={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[t]},Zs[e]=n,eu[t]=n});var tu={eventTypes:Zs,extractEvents:function(e,t,n,a){var i=eu[e];if(!i)return null;switch(e){case"topAbort":case"topCancel":case"topCanPlay":case"topCanPlayThrough":case"topClose":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topToggle":case"topVolumeChange":case"topWaiting":var o=Pe;break;case"topKeyPress":if(0===at(n))return null;case"topKeyDown":case"topKeyUp":o=it;break;case"topBlur":case"topFocus":o=rt;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":o=Ze;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":o=ot;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":o=st;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":o=tt;break;case"topTransitionEnd":o=ut;break;case"topScroll":o=Qe;break;case"topWheel":o=ct;break;case"topCopy":case"topCut":case"topPaste":o=nt}return o||r("86",e),e=o.getPooled(i,t,n,a),vs.accumulateTwoPhaseDispatches(e),e}};bn.setHandleTopLevel(Pn.handleTopLevel),wn.injection.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin TapEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),un.injection.injectComponentTree(Jt),wn.injection.injectEventPluginsByName({SimpleEventPlugin:tu,EnterLeaveEventPlugin:Us,ChangeEventPlugin:js,SelectEventPlugin:Qs,BeforeInputEventPlugin:Ds});var nu=At.injection.MUST_USE_PROPERTY,ru=At.injection.HAS_BOOLEAN_VALUE,au=At.injection.HAS_NUMERIC_VALUE,iu=At.injection.HAS_POSITIVE_NUMERIC_VALUE,ou=At.injection.HAS_STRING_BOOLEAN_VALUE,su={Properties:{allowFullScreen:ru,allowTransparency:ou,async:ru,autoPlay:ru,capture:ru,checked:nu|ru,cols:iu,contentEditable:ou,controls:ru,default:ru,defer:ru,disabled:ru,download:At.injection.HAS_OVERLOADED_BOOLEAN_VALUE,draggable:ou,formNoValidate:ru,hidden:ru,loop:ru,multiple:nu|ru,muted:nu|ru,noValidate:ru,open:ru,playsInline:ru,readOnly:ru,required:ru,reversed:ru,rows:iu,rowSpan:au,scoped:ru,seamless:ru,selected:nu|ru,size:iu,start:au,span:iu,spellCheck:ou,style:0,itemScope:ru,acceptCharset:0,className:0,htmlFor:0,httpEquiv:0,value:ou},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}},uu=At.injection.HAS_STRING_BOOLEAN_VALUE,cu={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},lu={Properties:{autoReverse:uu,externalResourcesRequired:uu,preserveAlpha:uu},DOMAttributeNames:{autoReverse:"autoReverse",externalResourcesRequired:"externalResourcesRequired",preserveAlpha:"preserveAlpha"},DOMAttributeNamespaces:{xlinkActuate:cu.xlink,xlinkArcrole:cu.xlink,xlinkHref:cu.xlink,xlinkRole:cu.xlink,xlinkShow:cu.xlink,xlinkTitle:cu.xlink,xlinkType:cu.xlink,xmlBase:cu.xml,xmlLang:cu.xml,xmlSpace:cu.xml}},fu=/[\-\:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode x-height xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xmlns:xlink xml:lang xml:space".split(" ").forEach(function(e){var t=e.replace(fu,lt);lu.Properties[t]=0,lu.DOMAttributeNames[t]=e}),At.injection.injectDOMPropertyConfig(su),At.injection.injectDOMPropertyConfig(lu);var pu=eo.injectInternals,du=Lt.ELEMENT_NODE,hu=Lt.TEXT_NODE,vu=Lt.COMMENT_NODE,yu=Lt.DOCUMENT_NODE,mu=Lt.DOCUMENT_FRAGMENT_NODE,gu=At.ROOT_ATTRIBUTE_NAME,bu=It.getChildNamespace,ku=pr.createElement,wu=pr.createTextNode,xu=pr.setInitialProperties,Su=pr.diffProperties,Cu=pr.updateProperties,_u=pr.diffHydratedProperties,Eu=pr.diffHydratedText,Iu=pr.warnForDeletedHydratableElement,Ru=pr.warnForDeletedHydratableText,Pu=pr.warnForInsertedHydratedElement,Fu=pr.warnForInsertedHydratedText,Tu=Jt.precacheFiberNode,Du=Jt.updateFiberProps;pn.injection.injectFiberControlledHostComponent(pr),we._injectFiber(function(e){return Au.findHostInstance(e)});var Ou=null,Mu=null,Au=function(e){var t=e.getPublicInstance;e=de(e);var n=e.scheduleUpdate,r=e.getPriorityContext;return{createContainer:function(e){var t=fa();return e={current:t,containerInfo:e,isScheduled:!1,nextScheduledRoot:null,context:null,pendingContext:null},t.stateNode=e},updateContainer:function(e,t,a,i){var o=t.current;a=ve(a),null===t.context?t.context=a:t.pendingContext=a,t=i,i=r(o,Ir.enableAsyncSubtreeAPI&&null!=e&&null!=e.type&&null!=e.type.prototype&&!0===e.type.prototype.unstable_isAsyncReactComponent),e={element:e},Xo(o,e,void 0===t?null:t,i),n(o,i)},batchedUpdates:e.batchedUpdates,unbatchedUpdates:e.unbatchedUpdates,deferredUpdates:e.deferredUpdates,flushSync:e.flushSync,getPublicRootInstance:function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case ns:return t(e.child.stateNode);default:return e.child.stateNode}},findHostInstance:function(e){return e=rs(e),null===e?null:e.stateNode},findHostInstanceWithNoPortals:function(e){return e=as(e),null===e?null:e.stateNode}}}({getRootHostContext:function(e){if(e.nodeType===yu)e=(e=e.documentElement)?e.namespaceURI:bu(null,"");else{var t=e.nodeType===vu?e.parentNode:e;e=t.namespaceURI||null,t=t.tagName,e=bu(e,t)}return e},getChildHostContext:function(e,t){return bu(e,t)},getPublicInstance:function(e){return e},prepareForCommit:function(){Ou=Pn.isEnabled(),Mu=ls.getSelectionInformation(),Pn.setEnabled(!1)},resetAfterCommit:function(){ls.restoreSelection(Mu),Mu=null,Pn.setEnabled(Ou),Ou=null},createInstance:function(e,t,n,r,a){return e=ku(e,t,n,r),Tu(a,e),Du(e,t),e},appendInitialChild:function(e,t){e.appendChild(t)},finalizeInitialChildren:function(e,t,n,r){xu(e,t,n,r);e:{switch(t){case"button":case"input":case"select":case"textarea":e=!!n.autoFocus;break e}e=!1}return e},prepareUpdate:function(e,t,n,r,a){return Su(e,t,n,r,a)},commitMount:function(e){e.focus()},commitUpdate:function(e,t,n,r,a){Du(e,a),Cu(e,t,n,r,a)},shouldSetTextContent:function(e,t){return"textarea"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html},resetTextContent:function(e){e.textContent=""},shouldDeprioritizeSubtree:function(e,t){return!!t.hidden},createTextInstance:function(e,t,n,r){return e=wu(e,t),Tu(r,e),e},commitTextUpdate:function(e,t,n){e.nodeValue=n},appendChild:function(e,t){e.appendChild(t)},appendChildToContainer:function(e,t){e.nodeType===vu?e.parentNode.insertBefore(t,e):e.appendChild(t)},insertBefore:function(e,t,n){e.insertBefore(t,n)},insertInContainerBefore:function(e,t,n){e.nodeType===vu?e.parentNode.insertBefore(t,n):e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},removeChildFromContainer:function(e,t){e.nodeType===vu?e.parentNode.removeChild(t):e.removeChild(t)},canHydrateInstance:function(e,t){return e.nodeType===du&&t===e.nodeName.toLowerCase()},canHydrateTextInstance:function(e,t){return""!==t&&e.nodeType===hu},getNextHydratableSibling:function(e){for(e=e.nextSibling;e&&e.nodeType!==du&&e.nodeType!==hu;)e=e.nextSibling;return e},getFirstHydratableChild:function(e){for(e=e.firstChild;e&&e.nodeType!==du&&e.nodeType!==hu;)e=e.nextSibling;return e},hydrateInstance:function(e,t,n,r,a,i){return Tu(i,e),Du(e,n),_u(e,t,n,a,r)},hydrateTextInstance:function(e,t,n){return Tu(n,e),Eu(e,t)},didNotHydrateInstance:function(e,t){1===t.nodeType?Iu(e,t):Ru(e,t)},didNotFindHydratableInstance:function(e,t,n){Pu(e,t,n)},didNotFindHydratableTextInstance:function(e,t){Fu(e,t)},scheduleDeferredCallback:Er.rIC,useSyncScheduling:!0});hn.injection.injectFiberBatchedUpdates(Au.batchedUpdates);var Nu={createPortal:ht,hydrate:function(e,t,n){return dt(null,e,t,!0,n)},render:function(e,t,n){return dt(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,a){return null!=e&&$t.has(e)||r("38"),dt(e,t,n,!1,a)},unmountComponentAtNode:function(e){return ft(e)||r("40"),!!e._reactRootContainer&&(Au.unbatchedUpdates(function(){dt(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},findDOMNode:we,unstable_createPortal:ht,unstable_batchedUpdates:hn.batchedUpdates,unstable_deferredUpdates:Au.deferredUpdates,flushSync:Au.flushSync,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{EventPluginHub:wn,EventPluginRegistry:Tt,EventPropagators:vs,ReactControlledComponent:pn,ReactDOMComponentTree:Jt,ReactDOMEventListener:bn}};pu({findFiberByHostInstance:Jt.getClosestInstanceFromNode,findHostInstanceByFiber:Au.findHostInstance,bundleType:0,version:"16.0.1",rendererPackageName:"react-dom"}),e.exports=Nu},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),a={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=a},function(e,t,n){"use strict";var r=n(1),a={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=a},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function a(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(var o=0;o1&&!t.content.isDefault&&g.a.createElement("a",{className:"info",onClick:function(){e.setCredentialAsDefault(t)}},"Make Default"),g.a.createElement("a",{className:"info",onClick:function(){e.exportCredential(t)}},"Export"),g.a.createElement("a",{className:"danger",onClick:function(){e.deleteCredential(t)}},"Delete")))))})))}}]),t}(g.a.Component)},function(e,t,n){"use strict";n.d(t,"a",function(){return I});var r=n(9),a=n.n(r),i=n(10),o=n.n(i),s=n(0),u=n.n(s),c=n(1),l=n.n(c),f=n(3),p=n.n(f),d=n(4),h=n.n(d),v=n(7),y=n.n(v),m=n(5),g=n.n(m),b=n(8),k=n.n(b),w=n(2),x=n.n(w),S=n(21),C=n(22),_=n(12),E=n(6),I=function(e){function t(e){var n;return u()(this,t),n=p()(this,h()(t).call(this,e)),k()(y()(n),"event_preventDefaults",function(e){e.preventDefault(),e.stopPropagation()}),k()(y()(n),"event_highlight",function(e){n.event_preventDefaults(e),n.rootElement.classList.add("highlight")}),k()(y()(n),"event_unhighlight",function(e){n.event_preventDefaults(e),n.rootElement.classList.remove("highlight")}),k()(y()(n),"event_drop",function(e){n.event_unhighlight(e),n.event_preventDefaults(e);var t=e.dataTransfer,r=t.files;n.handleDroppedFiles(r)}),k()(y()(n),"handleDroppedFiles",function(){var e=o()(a.a.mark(function e(t){var r,i,o,s,u,c;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0!=E.a.get().filesafe.getAllIntegrations().length){e.next=3;break}return alert("Please set up at least one integration before attempting to upload a file. To do this, press Expand, and select Add New in the Integrations section."),e.abrupt("return");case 3:r=!0,i=!1,o=void 0,e.prev=6,s=t[Symbol.iterator]();case 8:if(r=(u=s.next()).done){e.next=17;break}if(c=u.value){e.next=12;break}return e.abrupt("continue",14);case 12:return e.next=14,n.readFile(c);case 14:r=!0,e.next=8;break;case 17:e.next=23;break;case 19:e.prev=19,e.t0=e.catch(6),i=!0,o=e.t0;case 23:e.prev=23,e.prev=24,r||null==s.return||s.return();case 26:if(e.prev=26,!i){e.next=29;break}throw o;case 29:return e.finish(26);case 30:return e.finish(23);case 31:setTimeout(function(){n.setState({status:null})},2e3);case 32:case"end":return e.stop()}},e,null,[[6,19,23,31],[24,,26,30]])}));return function(t){return e.apply(this,arguments)}}()),n.messagesManager=new S.a({credentialManager:E.a.get().filesafe.credentialManager,integrationManager:E.a.get().filesafe.integrationManager}),n.messagesManager.getMessages().then(function(e){n.setState({messages:e})}),n.state={noteFiles:E.a.get().filesafe.fileDescriptorsForCurrentNote(),messages:[]},E.a.get().addDataChangeObserver(function(){n.reload()}),E.a.get().addUnloadHandler(function(){window.removeEventListener("dragenter",n.event_highlight,!1),window.removeEventListener("dragover",n.event_highlight,!1),window.removeEventListener("dragleave",n.event_unhighlight,!1),window.removeEventListener("drop",n.event_drop,!1)}),n}return g()(t,e),l()(t,[{key:"reload",value:function(){function e(){return t.apply(this,arguments)}var t=o()(a.a.mark(function e(){var t;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.messagesManager.getMessages();case 2:t=e.sent,this.setState({noteFiles:E.a.get().filesafe.fileDescriptorsForCurrentNote(),messages:t});case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"componentDidMount",value:function(){this.configureFileForm(),window.addEventListener("dragenter",this.event_highlight,!1),window.addEventListener("dragover",this.event_highlight,!1),window.addEventListener("dragleave",this.event_unhighlight,!1),window.addEventListener("drop",this.event_drop,!1)}},{key:"configureFileForm",value:function(){var e=this,t=this.fileInput;this.dropContainer;t&&(t.onchange=function(t){var n=t.target.files;e.handledFiles||e.handleDroppedFiles(n)})}},{key:"reset",value:function(){this.setState({rawData:null,decryptedItems:null,requestPassword:!1})}},{key:"readFile",value:function(){function e(e){return t.apply(this,arguments)}var t=o()(a.a.mark(function e(t){var n,r,i,s=this;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=50,r=1e6,i=n*r,e.abrupt("return",new Promise(function(e,r){var u=new FileReader,c=!1;u.onload=function(){var r=o()(a.a.mark(function r(o){var u,l,f,p,d;return a.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(u=o.target.result,!c){r.next=7;break}u=JSON.parse(u),l=u.items[0],s.decryptDraggedFile(l).then(e),r.next=20;break;case 7:if(f=u,!((p=f.byteLength)>i)){r.next=14;break}return alert("The maximum upload size is ".concat(n," megabytes per file.")),s.setState({status:null}),e(),r.abrupt("return");case 14:return r.next=16,SFJS.crypto.arrayBufferToBase64(f);case 16:return d=r.sent,r.next=19,s.encryptFile(d,t.name,t.type);case 19:e();case 20:case"end":return r.stop()}},r)}));return function(e){return r.apply(this,arguments)}}(),s.setState({status:"Reading file..."}),t.name.endsWith(".sf")||t.name.endsWith(".json")?(c=!0,u.readAsText(t)):u.readAsArrayBuffer(t)}));case 4:case"end":return e.stop()}},e)}));return e}()},{key:"decryptDraggedFile",value:function(){function e(e){return t.apply(this,arguments)}var t=o()(a.a.mark(function e(t){var n,r,i,s,u,c,l,f,p,d=this;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({status:"Decrypting..."}),n=E.a.get().filesafe.getAllCredentials(),r=function(){var e=o()(a.a.mark(function e(n){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){E.a.get().filesafe.decryptFile({fileDescriptor:t,credential:n}).then(function(t){var n=t.decryptedItem;E.a.get().filesafe.downloadBase64Data({base64Data:t.decryptedData,fileName:n.content.fileName,fileType:n.content.fileType}),d.setState({status:null}),e(!0)}).catch(function(e){console.error("Error decrypting:",e),d.flashError("Error decrypting file."),r(!1)})}));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),i=!0,s=!1,u=void 0,e.prev=6,c=n[Symbol.iterator]();case 8:if(i=(l=c.next()).done){e.next=18;break}return f=l.value,e.next=12,r(f);case 12:if(!(p=e.sent)){e.next=15;break}return e.abrupt("return");case 15:i=!0,e.next=8;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(6),s=!0,u=e.t0;case 24:e.prev=24,e.prev=25,i||null==c.return||c.return();case 27:if(e.prev=27,!s){e.next=30;break}throw u;case 30:return e.finish(27);case 31:return e.finish(24);case 32:case"end":return e.stop()}},e,this,[[6,20,24,32],[25,,27,31]])}));return e}()},{key:"wait",value:function(){function e(e){return t.apply(this,arguments)}var t=o()(a.a.mark(function e(t){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){setTimeout(function(){e()},1e3*t)}));case 1:case"end":return e.stop()}},e)}));return e}()},{key:"encryptFile",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=o()(a.a.mark(function e(t,n,r){var i,s,u=this;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({status:"Encrypting..."}),i=E.a.get().filesafe.getDefaultCredentials(),s=E.a.get().filesafe.getDefaultIntegration(),e.abrupt("return",E.a.get().filesafe.encryptFile({data:t,inputFileName:n,fileType:r,credential:i}).then(function(){var e=o()(a.a.mark(function e(t){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.setState({status:"Uploading to ".concat(E.a.get().filesafe.displayStringForIntegration(s),"...")}),e.next=3,u.wait(.5);case 3:return e.abrupt("return",E.a.get().filesafe.uploadFile({fileItem:t,inputFileName:n,fileType:r,credential:i}).then(function(){u.setState({status:"Upload Success."})}).catch(function(e){console.error("fs-embed | error uploading file:",e),u.flashError("Error uploading file.")}));case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()));case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"flashError",value:function(e){var t=this;this.setState({status:e,statusClass:"danger"}),setTimeout(function(){t.setState({status:null,statusClass:null})},2500)}},{key:"render",value:function(){var e=this,t=this.state.statusClass?this.state.statusClass:"info",n="info"==t;return x.a.createElement("div",{className:"sn-component files-view"},x.a.createElement("div",{className:"sk-panel-row align-top"},x.a.createElement("div",{className:"files"},this.state.messages.length>0&&x.a.createElement("div",{id:"messages-container",className:"sk-panel-section"},x.a.createElement(C.a,{messages:this.state.messages})),this.state.status&&x.a.createElement("div",{id:"file-upload-status",className:"sk-horizontal-group"},n&&x.a.createElement("div",{className:"sk-spinner info small"}),x.a.createElement("div",{className:t},this.state.status)),x.a.createElement("div",{id:"add-file-button-container"},x.a.createElement("div",{className:"file sk-button info"},x.a.createElement("label",{className:"no-style"},x.a.createElement("input",{type:"file",style:{display:"none"},onChange:function(t){e.handleDroppedFiles(t.target.files)}}),x.a.createElement("div",{id:"attach-file-button-label",className:"sk-label"},"Attach File")))),x.a.createElement(_.a,{files:this.state.noteFiles}))))}},{key:"rootElement",get:function(){return document.getElementById("filesafe-embed")}},{key:"dropContainer",get:function(){return document.getElementById("files-view")}},{key:"fileInput",get:function(){return document.getElementById("file-input")}}]),t}(x.a.Component)},function(e,t,n){var r=function(e){"use strict";function t(e,t,n,a){var i=t&&t.prototype instanceof r?t:r,o=Object.create(i.prototype),s=new p(a||[]);return o._invoke=u(e,n,s),o}function n(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function r(){}function a(){}function i(){}function o(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function s(e){function t(r,a,i,o){var s=n(e[r],e,a);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&m.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,i,o)},function(e){t("throw",e,i,o)}):Promise.resolve(c).then(function(e){u.value=e,i(u)},function(e){return t("throw",e,i,o)})}o(s.arg)}function r(e,n){function r(){return new Promise(function(r,a){t(e,n,r,a)})}return a=a?a.then(r,r):r()}var a;this._invoke=r}function u(e,t,r){var a=x;return function(i,o){if(a===C)throw new Error("Generator is already running");if(a===_){if("throw"===i)throw o;return h()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var u=c(s,r);if(u){if(u===E)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===x)throw a=_,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=C;var l=n(e,t,r);if("normal"===l.type){if(a=r.done?_:S,l.arg===E)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(a=_,r.method="throw",r.arg=l.arg)}}}function c(e,t){var r=e.iterator[t.method];if(r===v){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=v,c(e,t),"throw"===t.method))return E;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return E}var a=n(r,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,E;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=v),t.delegate=null,E):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,E)}function l(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function p(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(l,this),this.reset(!0)}function d(e){if(e){var t=e[b];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var a=this.tryEntries[r],i=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var o=m.call(a,"catchLoc"),s=m.call(a,"finallyLoc");if(o&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&m.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),f(n),E}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;f(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=v),E}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var r=n(9),a=n.n(r),i=n(10),o=n.n(i),s=n(0),u=n.n(s),c=n(1),l=n.n(c),f=function(){function e(t){var n=t.credentialManager,r=t.integrationManager;u()(this,e),this.credentialManager=n,this.integrationManager=r}return l()(e,[{key:"getMessages",value:function(){function e(){return t.apply(this,arguments)}var t=o()(a.a.mark(function e(){var t,n,r;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],e.next=3,this.credentialManager.getDefaultCredentials();case 3:return n=e.sent,n||t.push({message:"Create keys by selecting Create New under Keys.",css:"sk-base"}),r=this.integrationManager.integrations,r&&0!=r.length||t.push({message:"Add a new integration by selecting Add New under Integrations",css:"sk-base"}),e.abrupt("return",t);case 8:case"end":return e.stop()}},e,this)}));return e}()}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var r=n(0),a=n.n(r),i=n(1),o=n.n(i),s=n(3),u=n.n(s),c=n(4),l=n.n(c),f=n(5),p=n.n(f),d=n(2),h=n.n(d),v=function(e){function t(e){var n;return a()(this,t),n=u()(this,l()(t).call(this,e)),n.state={},n}return p()(t,e),o()(t,[{key:"render",value:function(){return h.a.createElement("div",{id:"messages"},h.a.createElement("div",{className:"title"},"Complete the following steps before uploading your first file:"),h.a.createElement("ul",null,this.props.messages.map(function(e){return h.a.createElement("li",{dangerouslySetInnerHTML:{__html:e.message},className:e.css})})))}}]),t}(h.a.Component)},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var r=n(0),a=n.n(r),i=n(1),o=n.n(i),s=n(3),u=n.n(s),c=n(4),l=n.n(c),f=n(7),p=n.n(f),d=n(5),h=n.n(d),v=n(8),y=n.n(v),m=n(2),g=n.n(m),b=n(12),k=n(6),w=function(e){function t(e){var n;return a()(this,t),n=u()(this,l()(t).call(this,e)),y()(p()(n),"toggleVisibility",function(){n.setState({expanded:!n.state.expanded})}),n.state={expanded:!1,files:k.a.get().filesafe.getAllFileDescriptors()||[]},k.a.get().addDataChangeObserver(function(){n.setState({files:k.a.get().filesafe.getAllFileDescriptors()})}),n}return h()(t,e),o()(t,[{key:"render",value:function(){return g.a.createElement("div",{className:"files-view"},g.a.createElement("div",{className:"sk-panel-row justify-left"},g.a.createElement("div",{className:"sk-horizontal-group"},g.a.createElement("div",{className:"sk-panel-section-title"},"All Files ",g.a.createElement("span",{style:{fontWeight:"normal"}},"(",this.state.files.length,")")),g.a.createElement("a",{className:"info",onClick:this.toggleVisibility},this.state.expanded?"Hide":"Show"))),this.state.expanded&&g.a.createElement("div",{className:"sk-panel-row"},g.a.createElement("div",{className:"files"},g.a.createElement(b.a,{files:this.state.files}))))}}]),t}(g.a.Component)},function(e,t,n){"use strict";n.d(t,"a",function(){return k});var r=n(0),a=n.n(r),i=n(1),o=n.n(i),s=n(3),u=n.n(s),c=n(4),l=n.n(c),f=n(7),p=n.n(f),d=n(5),h=n.n(d),v=n(8),y=n.n(v),m=n(2),g=n.n(m),b=n(6),k=function(e){function t(e){var n;return a()(this,t),n=u()(this,l()(t).call(this,e)),y()(p()(n),"handleKeyPress",function(e){"Enter"===e.key&&n.submitIntegrationCode()}),y()(p()(n),"handleTextChange",function(e){var t=e.target.value;n.setState({integrationCode:t})}),y()(p()(n),"submitIntegrationCode",function(){var e=n.state.integrationCode;e&&0!=e.length&&(b.a.get().filesafe.saveIntegrationFromCode(e),n.setState({integrationCode:null,showInputForm:!1}),n.reloadIntegrations())}),y()(p()(n),"addNewIntegrationClicked",function(){window.open(b.a.get().defaultRelayServerUrl(),"_blank"),n.setState({showInputForm:!0})}),y()(p()(n),"cancelIntegrationForm",function(){n.setState({showInputForm:!1})}),y()(p()(n),"deleteIntegration",function(e){b.a.get().filesafe.deleteIntegration(e)}),y()(p()(n),"setIntegrationAsDefaultUploadSource",function(e){b.a.get().filesafe.setIntegrationAsDefault(e)}),n.state={integrations:b.a.get().filesafe.getAllIntegrations()||[]},b.a.get().addDataChangeObserver(function(){n.reloadIntegrations()}),n}return h()(t,e),o()(t,[{key:"reloadIntegrations",value:function(){var e=b.a.get().filesafe.getAllIntegrations();this.setState({integrations:e})}},{key:"componentDidMount",value:function(){}},{key:"componentWillUnmount",value:function(){}},{key:"displayStringForIntegration",value:function(e){return b.a.get().filesafe.displayStringForIntegration(e)}},{key:"render",value:function(){var e=this,t=this.state.integrations.length>1;return g.a.createElement("div",null,g.a.createElement("div",{className:"sk-panel-row"},g.a.createElement("div",{className:"sk-h2 sk-bold"},"Integrations"),!this.state.showInputForm&&g.a.createElement("div",{className:"sk-button info no-border",onClick:this.addNewIntegrationClicked},g.a.createElement("div",{className:"sk-label"},"Add New"))),g.a.createElement("div",{id:"integrations"},this.state.showInputForm&&g.a.createElement("div",{className:"sk-notification info"},g.a.createElement("strong",null,"New Integration"),g.a.createElement("p",{className:"sk-p"},"A new tab has opened. After you complete the authentication flow, enter the code you receive below."),g.a.createElement("div",{className:"sk-panel-row"}),g.a.createElement("input",{className:"title sk-input contrast",type:"text",placeholder:"Enter integration code",value:this.state.integrationCode,onChange:this.handleTextChange,onKeyPress:this.handleKeyPress}),g.a.createElement("div",{className:"sk-button-group",style:{marginTop:10}},g.a.createElement("div",{className:"sk-button neutral",onClick:this.cancelIntegrationForm},g.a.createElement("a",{className:"sk-label"},"Cancel")),g.a.createElement("div",{className:"sk-button sk-base",onClick:this.submitIntegrationCode},g.a.createElement("a",{className:"sk-label"},"Submit"))))),g.a.createElement("div",{className:"list-container"},this.state.integrations.map(function(n){return g.a.createElement("div",{className:"list-item sk-horizontal-group top"},g.a.createElement("div",{className:"sk-circle x-small "+(n.content.isDefaultUploadSource?"info":"sk-secondary-contrast")}),g.a.createElement("div",null,g.a.createElement("div",{className:"sk-panel-row condensed sk-bold"},e.displayStringForIntegration(n)),g.a.createElement("div",{className:"sk-panel-row condensed"},g.a.createElement("div",{className:"sk-horizontal-group"},t&&!n.content.isDefaultUploadSource&&g.a.createElement("a",{className:"info",onClick:function(){e.setIntegrationAsDefaultUploadSource(n)}},"Make Default"),g.a.createElement("a",{className:"danger",onClick:function(){e.deleteIntegration(n)}},"Delete")))))})))}}]),t}(g.a.Component)}])},function(e,t){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){(function(t){var n,n;!function(t){e.exports=t()}(function(){return function(){function e(t,r,a){function i(s,u){if(!r[s]){if(!t[s]){var c="function"==typeof n&&n;if(!u&&c)return n(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var f=r[s]={exports:{}};t[s][0].call(f.exports,function(e){return i(t[s][1][e]||e)},f,f.exports,e,t,r,a)}return r[s].exports}for(var o="function"==typeof n&&n,s=0;s>>2]|=(n[a>>>2]>>>24-a%4*8&255)<<24-(r+a)%4*8;else if(65535>>2]=n[a>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,a=n.sigBytes,i=this.blockSize,s=a/(4*i),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*i,a=e.min(4*t,a),t){for(var u=0;u>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,o=0;4>o&&a+.75*o>>6*(3-o)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map,a=r.charAt(64);a&&-1!=(a=e.indexOf(a))&&(n=a);for(var a=[],i=0,o=0;o>>6-o%4*2;a[i>>>2]|=(s|u)<<24-i%4*8,i++}return t.create(a,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,n,r,a,i,o){return((e=e+(t&n|~t&r)+a+o)<>>32-i)+t}function n(e,t,n,r,a,i,o){return((e=e+(t&r|n&~r)+a+o)<>>32-i)+t}function r(e,t,n,r,a,i,o){return((e=e+(t^n^r)+a+o)<>>32-i)+t}function a(e,t,n,r,a,i,o){return((e=e+(n^(t|~r))+a+o)<>>32-i)+t}for(var i=o,s=i.lib,u=s.WordArray,c=s.Hasher,s=i.algo,l=[],f=0;64>f;f++)l[f]=4294967296*e.abs(e.sin(f+1))|0;s=s.MD5=c.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,i){for(var o=0;16>o;o++){var s=i+o,u=e[s];e[s]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}var o=this._hash.words,s=e[i+0],u=e[i+1],c=e[i+2],f=e[i+3],p=e[i+4],d=e[i+5],h=e[i+6],v=e[i+7],y=e[i+8],m=e[i+9],g=e[i+10],b=e[i+11],k=e[i+12],w=e[i+13],x=e[i+14],S=e[i+15],C=o[0],_=o[1],E=o[2],I=o[3],C=t(C,_,E,I,s,7,l[0]),I=t(I,C,_,E,u,12,l[1]),E=t(E,I,C,_,c,17,l[2]),_=t(_,E,I,C,f,22,l[3]),C=t(C,_,E,I,p,7,l[4]),I=t(I,C,_,E,d,12,l[5]),E=t(E,I,C,_,h,17,l[6]),_=t(_,E,I,C,v,22,l[7]),C=t(C,_,E,I,y,7,l[8]),I=t(I,C,_,E,m,12,l[9]),E=t(E,I,C,_,g,17,l[10]),_=t(_,E,I,C,b,22,l[11]),C=t(C,_,E,I,k,7,l[12]),I=t(I,C,_,E,w,12,l[13]),E=t(E,I,C,_,x,17,l[14]),_=t(_,E,I,C,S,22,l[15]),C=n(C,_,E,I,u,5,l[16]),I=n(I,C,_,E,h,9,l[17]),E=n(E,I,C,_,b,14,l[18]),_=n(_,E,I,C,s,20,l[19]),C=n(C,_,E,I,d,5,l[20]),I=n(I,C,_,E,g,9,l[21]),E=n(E,I,C,_,S,14,l[22]),_=n(_,E,I,C,p,20,l[23]),C=n(C,_,E,I,m,5,l[24]),I=n(I,C,_,E,x,9,l[25]),E=n(E,I,C,_,f,14,l[26]),_=n(_,E,I,C,y,20,l[27]),C=n(C,_,E,I,w,5,l[28]),I=n(I,C,_,E,c,9,l[29]),E=n(E,I,C,_,v,14,l[30]),_=n(_,E,I,C,k,20,l[31]),C=r(C,_,E,I,d,4,l[32]),I=r(I,C,_,E,y,11,l[33]),E=r(E,I,C,_,b,16,l[34]),_=r(_,E,I,C,x,23,l[35]),C=r(C,_,E,I,u,4,l[36]),I=r(I,C,_,E,p,11,l[37]),E=r(E,I,C,_,v,16,l[38]),_=r(_,E,I,C,g,23,l[39]),C=r(C,_,E,I,w,4,l[40]),I=r(I,C,_,E,s,11,l[41]),E=r(E,I,C,_,f,16,l[42]),_=r(_,E,I,C,h,23,l[43]),C=r(C,_,E,I,m,4,l[44]),I=r(I,C,_,E,k,11,l[45]),E=r(E,I,C,_,S,16,l[46]),_=r(_,E,I,C,c,23,l[47]),C=a(C,_,E,I,s,6,l[48]),I=a(I,C,_,E,v,10,l[49]),E=a(E,I,C,_,x,15,l[50]),_=a(_,E,I,C,d,21,l[51]),C=a(C,_,E,I,k,6,l[52]),I=a(I,C,_,E,f,10,l[53]),E=a(E,I,C,_,g,15,l[54]),_=a(_,E,I,C,u,21,l[55]),C=a(C,_,E,I,y,6,l[56]),I=a(I,C,_,E,S,10,l[57]),E=a(E,I,C,_,h,15,l[58]),_=a(_,E,I,C,w,21,l[59]),C=a(C,_,E,I,p,6,l[60]),I=a(I,C,_,E,b,10,l[61]),E=a(E,I,C,_,c,15,l[62]),_=a(_,E,I,C,m,21,l[63]);o[0]=o[0]+C|0,o[1]=o[1]+_|0,o[2]=o[2]+E|0,o[3]=o[3]+I|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,a=8*t.sigBytes;n[a>>>5]|=128<<24-a%32;var i=e.floor(r/4294967296);for(n[15+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(a+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),t=this._hash,n=t.words,r=0;4>r;r++)a=n[r],n[r]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8);return t},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}}),i.MD5=c._createHelper(s),i.HmacMD5=c._createHmacHelper(s)}(Math),function(){var e=o,t=e.lib,n=t.Base,r=t.WordArray,t=e.algo,a=t.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,a=n.hasher.create(),i=r.create(),o=i.words,s=n.keySize,n=n.iterations;o.length>>2]}},n.BlockCipher=c.extend({cfg:c.cfg.extend({mode:l,padding:p}),reset:function(){c.reset.call(this);var e=this.cfg,t=e.iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var d=n.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),l=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return e=e.salt,(e?a.create([1398893684,1701076831]).concat(e).concat(t):t).toString(s)},parse:function(e){e=s.parse(e);var t=e.words;if(1398893684==t[0]&&1701076831==t[1]){var n=a.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return d.create({ciphertext:e,salt:n})}},h=n.SerializableCipher=r.extend({cfg:r.extend({format:l}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var a=e.createEncryptor(n,r);return t=a.finalize(t),a=a.cfg,d.create({ciphertext:t,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),t=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){return r||(r=a.random(8)),e=u.create({keySize:t+n}).compute(e,r),n=a.create(e.words.slice(t),4*n),e.sigBytes=4*t,d.create({key:e,iv:n,salt:r})}},v=n.PasswordBasedCipher=h.extend({cfg:h.cfg.extend({kdf:t}),encrypt:function(e,t,n,r){return r=this.cfg.extend(r),n=r.kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,e=h.encrypt.call(this,e,t,n.key,r),e.mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,h.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=o,t=e.lib.BlockCipher,n=e.algo,r=[],a=[],i=[],s=[],u=[],c=[],l=[],f=[],p=[],d=[],h=[],v=0;256>v;v++)h[v]=128>v?v<<1:v<<1^283;for(var y=0,m=0,v=0;256>v;v++){var g=m^m<<1^m<<2^m<<3^m<<4,g=g>>>8^255&g^99;r[y]=g,a[g]=y;var b=h[y],k=h[b],w=h[k],x=257*h[g]^16843008*g;i[y]=x<<24|x>>>8,s[y]=x<<16|x>>>16,u[y]=x<<8|x>>>24,c[y]=x,x=16843009*w^65537*k^257*b^16843008*y,l[g]=x<<24|x>>>8,f[g]=x<<16|x>>>16,p[g]=x<<8|x>>>24,d[g]=x,y?(y=b^h[h[h[w^b]]],m^=h[h[m]]):y=m=1}var S=[0,1,2,4,8,16,32,64,128,27,54],n=n.AES=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes/4,e=4*((this._nRounds=n+6)+1),a=this._keySchedule=[],i=0;i>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o]):(o=o<<8|o>>>24,o=r[o>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o],o^=S[i/n|0]<<24),a[i]=a[i-n]^o}for(t=this._invKeySchedule=[],n=0;nn||4>=i?o:l[r[o>>>24]]^f[r[o>>>16&255]]^p[r[o>>>8&255]]^d[r[255&o]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,i,s,u,c,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,f,p,d,a),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,a,i,o,s){for(var u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],f=e[t+2]^n[2],p=e[t+3]^n[3],d=4,h=1;h>>24]^a[l>>>16&255]^i[f>>>8&255]^o[255&p]^n[d++],y=r[l>>>24]^a[f>>>16&255]^i[p>>>8&255]^o[255&c]^n[d++],m=r[f>>>24]^a[p>>>16&255]^i[c>>>8&255]^o[255&l]^n[d++],p=r[p>>>24]^a[c>>>16&255]^i[l>>>8&255]^o[255&f]^n[d++],c=v,l=y,f=m;v=(s[c>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^n[d++],y=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&c])^n[d++],m=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^n[d++],p=(s[p>>>24]<<24|s[c>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^n[d++],e[t]=v,e[t+1]=y,e[t+2]=m,e[t+3]=p},keySize:8});e.AES=t._createHelper(n)}();var o=o||function(e,t){var n={},r=n.lib={},a=function(){},i=r.Base={extend:function(e){a.prototype=this;var t=new a;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=r.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes;if(e=e.sigBytes,this.clamp(),r%4)for(var a=0;a>>2]|=(n[a>>>2]>>>24-a%4*8&255)<<24-(r+a)%4*8;else if(65535>>2]=n[a>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,a=n.sigBytes,i=this.blockSize,s=a/(4*i),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*i,a=e.min(4*t,a),t){for(var u=0;ul;){var f;e:{f=c;for(var p=e.sqrt(f),d=2;d<=p;d++)if(!(f%d)){f=!1;break e}f=!0}f&&(8>l&&(i[l]=u(e.pow(c,.5))),s[l]=u(e.pow(c,1/3)),l++),c++}var h=[],n=n.SHA256=a.extend({_doReset:function(){this._hash=new r.init(i.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],a=n[1],i=n[2],o=n[3],u=n[4],c=n[5],l=n[6],f=n[7],p=0;64>p;p++){if(16>p)h[p]=0|e[t+p];else{var d=h[p-15],v=h[p-2];h[p]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+h[p-7]+((v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10)+h[p-16]}d=f+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+s[p]+h[p],v=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&a^r&i^a&i),f=l,l=c,c=u,u=o+d|0,o=i,i=a,a=r,r=d+v|0}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+i|0,n[3]=n[3]+o|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,a=8*t.sigBytes;return n[a>>>5]|=128<<24-a%32,n[14+(a+64>>>9<<4)]=e.floor(r/4294967296),n[15+(a+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(n),t.HmacSHA256=a._createHmacHelper(n)}(Math),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,a=4*r;n.sigBytes>a&&(n=e.finalize(n)),n.clamp();for(var i=this._oKey=n.clone(),o=this._iKey=n.clone(),s=i.words,u=o.words,c=0;c>>2]|=(n[a>>>2]>>>24-a%4*8&255)<<24-(r+a)%4*8;else if(65535>>2]=n[a>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,a=n.sigBytes,i=this.blockSize,s=a/(4*i),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*i,a=e.min(4*t,a),t){for(var u=0;uc;c++)u[c]=e();r=r.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],a=n[1],i=n[2],o=n[3],c=n[4],l=n[5],f=n[6],n=n[7],p=r.high,d=r.low,h=a.high,v=a.low,y=i.high,m=i.low,g=o.high,b=o.low,k=c.high,w=c.low,x=l.high,S=l.low,C=f.high,_=f.low,E=n.high,I=n.low,R=p,P=d,F=h,T=v,D=y,O=m,M=g,A=b,N=k,L=w,j=x,B=S,H=C,U=_,z=E,W=I,K=0;80>K;K++){var V=u[K];if(16>K)var q=V.high=0|e[t+2*K],J=V.low=0|e[t+2*K+1];else{var q=u[K-15],J=q.high,$=q.low,q=(J>>>1|$<<31)^(J>>>8|$<<24)^J>>>7,$=($>>>1|J<<31)^($>>>8|J<<24)^($>>>7|J<<25),G=u[K-2],J=G.high,Q=G.low,G=(J>>>19|Q<<13)^(J<<3|Q>>>29)^J>>>6,Q=(Q>>>19|J<<13)^(Q<<3|J>>>29)^(Q>>>6|J<<26),J=u[K-7],Y=J.high,X=u[K-16],Z=X.high,X=X.low,J=$+J.low,q=q+Y+(J>>>0<$>>>0?1:0),J=J+Q,q=q+G+(J>>>0>>0?1:0),J=J+X,q=q+Z+(J>>>0>>0?1:0);V.high=q,V.low=J}var Y=N&j^~N&H,X=L&B^~L&U,V=R&F^R&D^F&D,ee=P&T^P&O^T&O,$=(R>>>28|P<<4)^(R<<30|P>>>2)^(R<<25|P>>>7),G=(P>>>28|R<<4)^(P<<30|R>>>2)^(P<<25|R>>>7),Q=s[K],te=Q.high,ne=Q.low,Q=W+((L>>>14|N<<18)^(L>>>18|N<<14)^(L<<23|N>>>9)),Z=z+((N>>>14|L<<18)^(N>>>18|L<<14)^(N<<23|L>>>9))+(Q>>>0>>0?1:0),Q=Q+X,Z=Z+Y+(Q>>>0>>0?1:0),Q=Q+ne,Z=Z+te+(Q>>>0>>0?1:0),Q=Q+J,Z=Z+q+(Q>>>0>>0?1:0),J=G+ee,V=$+V+(J>>>0>>0?1:0),z=H,W=U,H=j,U=B,j=N,B=L,L=A+Q|0,N=M+Z+(L>>>0>>0?1:0)|0,M=D,A=O,D=F,O=T,F=R,T=P,P=Q+J|0,R=Z+V+(P>>>0>>0?1:0)|0}d=r.low=d+P,r.high=p+R+(d>>>0

>>0?1:0),v=a.low=v+T,a.high=h+F+(v>>>0>>0?1:0),m=i.low=m+O,i.high=y+D+(m>>>0>>0?1:0),b=o.low=b+A,o.high=g+M+(b>>>0>>0?1:0),w=c.low=w+L,c.high=k+N+(w>>>0>>0?1:0),S=l.low=S+B,l.high=x+j+(S>>>0>>0?1:0),_=f.low=_+U,f.high=C+H+(_>>>0>>0?1:0),I=n.low=I+W,n.high=E+z+(I>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=n._createHelper(r),t.HmacSHA512=n._createHmacHelper(r)}(),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,a=4*r;n.sigBytes>a&&(n=e.finalize(n)),n.clamp();for(var i=this._oKey=n.clone(),o=this._iKey=n.clone(),s=i.words,u=o.words,c=0;c>>2]|=(n[a>>>2]>>>24-a%4*8&255)<<24-(r+a)%4*8;else if(65535>>2]=n[a>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,a=n.sigBytes,i=this.blockSize,s=a/(4*i),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*i,a=e.min(4*t,a),t){for(var u=0;uc;c++){if(16>c)a[c]=0|e[t+c];else{var l=a[c-3]^a[c-8]^a[c-14]^a[c-16];a[c]=l<<1|l>>>31}l=(r<<5|r>>>27)+u+a[c],l=20>c?l+(1518500249+(i&o|~i&s)):40>c?l+(1859775393+(i^o^s)):60>c?l+((i&o|i&s|o&s)-1894007588):l+((i^o^s)-899497514),u=s,s=o,o=i<<30|i>>>2,i=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(t),e.HmacSHA1=r._createHmacHelper(t)}(),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,a=4*r;n.sigBytes>a&&(n=e.finalize(n)),n.clamp();for(var i=this._oKey=n.clone(),o=this._iKey=n.clone(),s=i.words,u=o.words,c=0;c>>2]|=(n[a>>>2]>>>24-a%4*8&255)<<24-(r+a)%4*8;else if(65535>>2]=n[a>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,a=n.sigBytes,i=this.blockSize,s=a/(4*i),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*i,a=e.min(4*t,a),t){for(var u=0;uc;c++){if(16>c)a[c]=0|e[t+c];else{var l=a[c-3]^a[c-8]^a[c-14]^a[c-16];a[c]=l<<1|l>>>31}l=(r<<5|r>>>27)+u+a[c],l=20>c?l+(1518500249+(i&o|~i&s)):40>c?l+(1859775393+(i^o^s)):60>c?l+((i&o|i&s|o&s)-1894007588):l+((i^o^s)-899497514),u=s,s=o,o=i<<30|i>>>2,i=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(t),e.HmacSHA1=r._createHmacHelper(t)}(),Object.defineProperty(r,"__esModule",{value:!0});var s,u=function(){function e(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n=200&&c.status<=299?s.$timeout(function(){i(e),a(e)}):(console.error("Request error:",e),s.$timeout(function(){o(e,c.status),u(e)}))}},"get"==t&&Object.keys(r).length>0&&(n+=s.formatParams(r)),c.open(t,n,!0),e.next=6,s.setAuthHeadersForRequest(c);case 6:c.setRequestHeader("Content-type","application/json"),"post"==t||"patch"==t?c.send(JSON.stringify(r)):c.send();case 8:case"end":return e.stop()}},e,s)}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"formatParams",value:function(e){return"?"+Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}}]),e}(),v=r.SFMigrationManager=function(){function e(t,n,r,o){var s=this;i(this,e),this.modelManager=t,this.syncManager=n,this.storageManager=r,this.completionHandlers=[],this.loadMigrations();var u=!1,c=o.addEventHandler(function(e){e==p.DidSignInEvent&&(u=!0)});this.syncManager.addEventHandler(function(){var e=a(regeneratorRuntime.mark(function e(t,n){var r,a,i,l,f,p,d,h,v,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r="local-data-loaded"==t,a="sync:completed"==t,!r&&!a){e.next=40;break}if(r?s.receivedLocalDataEvent=!0:a&&(s.receivedSyncCompletedEvent=!0),!s.receivedLocalDataEvent||!s.receivedSyncCompletedEvent){e.next=40;break}if(!u){e.next=39;break}return u=!1,o.removeEventHandler(c),e.next=10,s.getCompletedMigrations();case 10:i=e.sent.slice(),l=!0,f=!1,p=void 0,e.prev=14,d=i[Symbol.iterator]();case 16:if(l=(h=d.next()).done){e.next=25;break}return v=h.value,e.next=20,s.migrationForEncodedName(v);case 20:y=e.sent,y.runOnlyOnce||_.pull(s._completed,v);case 22:l=!0,e.next=16;break;case 25:e.next=31;break;case 27:e.prev=27,e.t0=e.catch(14),f=!0,p=e.t0;case 31:e.prev=31,e.prev=32,!l&&d.return&&d.return();case 34:if(e.prev=34,!f){e.next=37;break}throw p;case 37:return e.finish(34);case 38:return e.finish(31);case 39:s.runPendingMigrations();case 40:case"end":return e.stop()}},e,s,[[14,27,31,39],[32,,34,38]])}));return function(t,n){return e.apply(this,arguments)}}())}return l(e,[{key:"addCompletionHandler",value:function(e){this.completionHandlers.push(e)}},{key:"removeCompletionHandler",value:function(e){_.pull(this.completionHandlers,e)}},{key:"migrationForEncodedName",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decode(t);case 2:return n=e.sent,e.abrupt("return",this.migrations.find(function(e){return e.name==n}));case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"loadMigrations",value:function(){this.migrations=this.registeredMigrations()}},{key:"registeredMigrations",value:function(){}},{key:"runPendingMigrations",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r,a,i,o,s,u,c,l,f,p,d,h,v,y,m,g,b,k,w,x,S,C,_,E,I,R,P;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPendingMigrations();case 2:for(t=e.sent,n=!0,r=!1,a=void 0,e.prev=6,i=t[Symbol.iterator]();!(n=(o=i.next()).done);n=!0)s=o.value,s.items=[];e.next=14;break;case 10:e.prev=10,e.t0=e.catch(6),r=!0,a=e.t0;case 14:e.prev=14,e.prev=15,!n&&i.return&&i.return();case 17:if(e.prev=17,!r){e.next=20;break}throw a;case 20:return e.finish(17);case 21:return e.finish(14);case 22:u=!0,c=!1,l=void 0,e.prev=25,f=this.modelManager.allNondummyItems[Symbol.iterator]();case 27:if(u=(p=f.next()).done){e.next=51;break}for(d=p.value,h=!0,v=!1,y=void 0,e.prev=32,m=t[Symbol.iterator]();!(h=(g=m.next()).done);h=!0)s=g.value,d.content_type==s.content_type&&s.items.push(d);e.next=40;break;case 36:e.prev=36,e.t1=e.catch(32),v=!0,y=e.t1;case 40:e.prev=40,e.prev=41,!h&&m.return&&m.return();case 43:if(e.prev=43,!v){e.next=46;break}throw y;case 46:return e.finish(43);case 47:return e.finish(40);case 48:u=!0,e.next=27;break;case 51:e.next=57;break;case 53:e.prev=53,e.t2=e.catch(25),c=!0,l=e.t2;case 57:e.prev=57,e.prev=58,!u&&f.return&&f.return();case 60:if(e.prev=60,!c){e.next=63;break}throw l;case 63:return e.finish(60);case 64:return e.finish(57);case 65:b=!0,k=!1,w=void 0,e.prev=68,x=t[Symbol.iterator]();case 70:if(b=(S=x.next()).done){e.next=81;break}if(s=S.value,!(s.items&&s.items.length>0||s.customHandler)){e.next=77;break}return e.next=75,this.runMigration(s,s.items);case 75:e.next=78;break;case 77:this.markMigrationCompleted(s);case 78:b=!0,e.next=70;break;case 81:e.next=87;break;case 83:e.prev=83,e.t3=e.catch(68),k=!0,w=e.t3;case 87:e.prev=87,e.prev=88,!b&&x.return&&x.return();case 90:if(e.prev=90,!k){e.next=93;break}throw w;case 93:return e.finish(90);case 94:return e.finish(87);case 95:for(C=!0,_=!1,E=void 0,e.prev=98,I=this.completionHandlers[Symbol.iterator]();!(C=(R=I.next()).done);C=!0)(P=R.value)();e.next=106;break;case 102:e.prev=102,e.t4=e.catch(98),_=!0,E=e.t4;case 106:e.prev=106,e.prev=107,!C&&I.return&&I.return();case 109:if(e.prev=109,!_){e.next=112;break}throw E;case 112:return e.finish(109);case 113:return e.finish(106);case 114:case"end":return e.stop()}},e,this,[[6,10,14,22],[15,,17,21],[25,53,57,65],[32,36,40,48],[41,,43,47],[58,,60,64],[68,83,87,95],[88,,90,94],[98,102,106,114],[107,,109,113]])}));return e}()},{key:"encode",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.btoa(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"decode",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.atob(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"getCompletedMigrations",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._completed){e.next=5;break}return e.next=3,this.storageManager.getItem("migrations");case 3:t=e.sent,this._completed=t?JSON.parse(t):[];case 5:return e.abrupt("return",this._completed);case 6:case"end":return e.stop()}},e,this)}));return e}()},{key:"getPendingMigrations",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r,a,i,o,s,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCompletedMigrations();case 2:t=e.sent,n=[],r=!0,a=!1,i=void 0,e.prev=7,o=this.migrations[Symbol.iterator]();case 9:if(r=(s=o.next()).done){e.next=22;break}return u=s.value,e.t0=t,e.next=14,this.encode(u.name);case 14:if(e.t1=e.sent,e.t2=e.t0.indexOf.call(e.t0,e.t1),e.t3=-1,e.t2!=e.t3){e.next=19;break}n.push(u);case 19:r=!0,e.next=9;break;case 22:e.next=28;break;case 24:e.prev=24,e.t4=e.catch(7),a=!0,i=e.t4;case 28:e.prev=28,e.prev=29,!r&&o.return&&o.return();case 31:if(e.prev=31,!a){e.next=34;break}throw i;case 34:return e.finish(31);case 35:return e.finish(28);case 36:return e.abrupt("return",n);case 37:case"end":return e.stop()}},e,this,[[7,24,28,36],[29,,31,35]])}));return e}()},{key:"markMigrationCompleted",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCompletedMigrations();case 2:return n=e.sent,e.t0=n,e.next=6,this.encode(t.name);case 6:e.t1=e.sent,e.t0.push.call(e.t0,e.t1),this.storageManager.setItem("migrations",JSON.stringify(n)),t.running=!1;case 10:case"end":return e.stop()}},e,this)}));return e}()},{key:"runMigration",value:function(){function e(e,n){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n){var r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.running){e.next=2;break}return e.abrupt("return");case 2:if(console.log("Running migration:",t.name),t.running=!0,!t.customHandler){e.next=8;break}return e.abrupt("return",t.customHandler().then(function(){r.markMigrationCompleted(t)}));case 8:return e.abrupt("return",t.handler(n).then(function(){r.markMigrationCompleted(t)}));case 9:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),y=r.SFModelManager=function(){function e(t){i(this,e),e.MappingSourceRemoteRetrieved="MappingSourceRemoteRetrieved",e.MappingSourceRemoteSaved="MappingSourceRemoteSaved",e.MappingSourceLocalSaved="MappingSourceLocalSaved",e.MappingSourceLocalRetrieved="MappingSourceLocalRetrieved",e.MappingSourceComponentRetrieved="MappingSourceComponentRetrieved",e.MappingSourceDesktopInstalled="MappingSourceDesktopInstalled",e.MappingSourceRemoteActionRetrieved="MappingSourceRemoteActionRetrieved",e.MappingSourceFileImport="MappingSourceFileImport",e.isMappingSourceRetrieved=function(t){return[e.MappingSourceRemoteRetrieved,e.MappingSourceComponentRetrieved,e.MappingSourceRemoteActionRetrieved].includes(t)},this.$timeout=t||setTimeout.bind(window),this.itemSyncObservers=[],this.itemsPendingRemoval=[],this.items=[],this.itemsHash={},this.missedReferences={},this.uuidChangeObservers=[]}return l(e,[{key:"handleSignout",value:function(){this.items.length=0,this.itemsHash={},this.itemsPendingRemoval.length=0,this.missedReferences={}}},{key:"addModelUuidChangeObserver",value:function(e,t){this.uuidChangeObservers.push({id:e,callback:t})}},{key:"notifyObserversOfUuidChange",value:function(e,t){var n=!0,r=!1,a=void 0;try{for(var i,o=this.uuidChangeObservers[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){i.value.callback(e,t)}}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}}},{key:"alternateUUIDForItem",value:function(){function t(e){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(n){var r,a,i,o,s,u,c;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.createItem(n,!0),t.next=3,SFJS.crypto.generateUUID();case 3:for(r.uuid=t.sent,r.informReferencesOfUUIDChange(n.uuid,r.uuid),this.informModelsOfUUIDChangeForItem(r,n.uuid,r.uuid),a=!0,i=!1,o=void 0,t.prev=9,s=n.referencingObjects[Symbol.iterator]();!(a=(u=s.next()).done);a=!0)c=u.value,c.setIsNoLongerBeingReferencedBy(n),n.setIsNoLongerBeingReferencedBy(c),c.addItemAsRelationship(r),c.setDirty(!0);t.next=17;break;case 13:t.prev=13,t.t0=t.catch(9),i=!0,o=t.t0;case 17:t.prev=17,t.prev=18,!a&&s.return&&s.return();case 20:if(t.prev=20,!i){t.next=23;break}throw o;case 23:return t.finish(20);case 24:return t.finish(17);case 25:return this.resolveReferencesForItem(r),console.log(n.uuid,"--\x3e",r.uuid),n.deleted=!0,n.content.references=[],n.setDirty(!1),this.mapResponseItemsToLocalModels([n],e.MappingSourceLocalSaved),this.addItem(r),r.setDirty(!0),this.notifyObserversOfUuidChange(n,r),t.abrupt("return",r);case 35:case"end":return t.stop()}},t,this,[[9,13,17,25],[18,,20,24]])}));return t}()},{key:"informModelsOfUUIDChangeForItem",value:function(e,t,n){var r=!0,a=!1,i=void 0;try{for(var o,s=this.items[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){o.value.potentialItemOfInterestHasChangedItsUUID(e,t,n)}}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}}},{key:"didSyncModelsOffline",value:function(t){this.notifySyncObserversOfModels(t,e.MappingSourceLocalSaved)}},{key:"mapResponseItemsToLocalModels",value:function(e,t,n){return this.mapResponseItemsToLocalModelsWithOptions({items:e,source:t,sourceKey:n})}},{key:"mapResponseItemsToLocalModelsOmittingFields",value:function(e,t,n,r){return this.mapResponseItemsToLocalModelsWithOptions({items:e,omitFields:t,source:n,sourceKey:r})}},{key:"mapResponseItemsToLocalModelsWithOptions",value:function(e){var t=e.items,n=e.omitFields,r=e.source,a=e.sourceKey,i=(e.options,[]),o=[],s=[],c=!0,l=!1,f=void 0;try{for(var p,d=t[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var h=p.value;if(h){var v=!h.content&&!h.errorDecrypting;if(!(!h.content_type||!h.uuid)&&!v||h.deleted){if(Array.isArray(n)){var y=!0,m=!1,g=void 0;try{for(var b,k=n[Symbol.iterator]();!(y=(b=k.next()).done);y=!0){delete h[b.value]}}catch(e){m=!0,g=e}finally{try{!y&&k.return&&k.return()}finally{if(m)throw g}}}var w=this.findItem(h.uuid);if(w&&(w.updateFromJSON(h),w.dummy=!1),this.itemsPendingRemoval.includes(h.uuid))_.pull(this.itemsPendingRemoval,h.uuid);else{var x=h.content_type||w&&w.content_type;if(!(this.acceptableContentTypes&&!this.acceptableContentTypes.includes(x))){var S=!1;if(1==h.deleted){if(!h.dirty){w&&(s.push(w),this.removeItemLocally(w));continue}S=!0}w||(w=this.createItem(h,!0)),this.addItem(w,S),w.errorDecrypting||s.push(w),i.push(w),o.push(h)}}}else console.error("Server response item is corrupt:",h)}}}catch(e){l=!0,f=e}finally{try{!c&&d.return&&d.return()}finally{if(l)throw f}}var C=!0,E=!1,I=void 0;try{for(var R,P=o.entries()[Symbol.iterator]();!(C=(R=P.next()).done);C=!0){var F=R.value,T=u(F,2),D=T[0],O=T[1],M=i[D];O.content&&this.resolveReferencesForItem(M),M.didFinishSyncing()}}catch(e){E=!0,I=e}finally{try{!C&&P.return&&P.return()}finally{if(E)throw I}}var A=this.popMissedReferenceStructsForObjects(o),N=!0,L=!1,j=void 0;try{for(var B,H=A[Symbol.iterator]();!(N=(B=H.next()).done);N=!0){var U=B.value;!function(e){var t=i.find(function(t){return t.uuid==e.reference_uuid});if(t){e.for_item.addItemAsRelationship(t)}}(U)}}catch(e){L=!0,j=e}finally{try{!N&&H.return&&H.return()}finally{if(L)throw j}}return this.notifySyncObserversOfModels(s,r,a),i}},{key:"missedReferenceBuildKey",value:function(e,t){return e+":"+t}},{key:"popMissedReferenceStructsForObjects",value:function(e){if(!e||0==e.length)return[];var t=[],n=[],r=e.map(function(e){return e.uuid}),a=r[0].length,i=Object.keys(this.missedReferences),o=!0,s=!1,u=void 0;try{for(var c,l=i[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;r.includes(f.substring(0,a))&&(t.push(this.missedReferences[f]),n.push(f))}}catch(e){s=!0,u=e}finally{try{!o&&l.return&&l.return()}finally{if(s)throw u}}var p=!0,d=!1,h=void 0;try{for(var v,y=n[Symbol.iterator]();!(p=(v=y.next()).done);p=!0){var m=v.value;delete this.missedReferences[m]}}catch(e){d=!0,h=e}finally{try{!p&&y.return&&y.return()}finally{if(d)throw h}}return t}},{key:"resolveReferencesForItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.errorDecrypting){var n=e.contentObject;if(e.updateLocalRelationships(),n.references){var r=n.references.slice(),a=r.map(function(e){return e.uuid}),i=this.findItems(a,!0),o=!0,s=!1,c=void 0;try{for(var l,f=i.entries()[Symbol.iterator]();!(o=(l=f.next()).done);o=!0){var p=l.value,d=u(p,2),h=d[0],v=d[1];if(v)e.addItemAsRelationship(v),t&&v.setDirty(!0);else{var y=a[h],m=this.missedReferenceBuildKey(y,e.uuid);if(!this.missedReferences[m]){var g={reference_uuid:y,for_item:e};this.missedReferences[m]=g}}}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}}}}},{key:"notifySyncObserversOfModels",value:function(e,t,n){var r=this,a=this.itemSyncObservers.sort(function(e,t){return e.priority0&&r._callSyncObserverCallbackWithTimeout(a,i,o,s,t,n)}(l)}}catch(e){o=!0,s=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw s}}}},{key:"_callSyncObserverCallbackWithTimeout",value:function(e,t,n,r,a,i){this.$timeout(function(){e.callback(t,n,r,a,i)})}},{key:"createItem",value:function(t,n){var r=e.ContentTypeClassMapping&&e.ContentTypeClassMapping[t.content_type];r||(r=x);var a=new r(t);return n||this.notifySyncObserversOfModels([a],e.MappingSourceLocalSaved),a}},{key:"createConflictedItem",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){var n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,SFJS.crypto.generateUUID();case 2:return n=e.sent,t=_.merge(t,{uuid:n}),r=this.createItem(t,!0),e.abrupt("return",r);case 6:case"end":return e.stop()}},e,this)}));return e}()},{key:"addConflictedItem",value:function(e,t){this.addItem(e);var n=!0,r=!1,a=void 0;try{for(var i,o=t.referencingObjects[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){var s=i.value;s.addItemAsRelationship(e),s.setDirty(!0)}}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}this.resolveReferencesForItem(e),e.content.conflict_of=t.uuid,e.setDirty(!0)}},{key:"duplicateItem",value:function(e){var t=new e.constructor({content:e.content});t.created_at=e.created_at,t.content_type=e.content_type,this.addItem(t);var n=!0,r=!1,a=void 0;try{for(var i,o=e.referencingObjects[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){var s=i.value;s.addItemAsRelationship(t),s.setDirty(!0)}}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}return this.resolveReferencesForItem(t),t.setDirty(!0),t}},{key:"addItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.addItems([e],t)}},{key:"addItems",value:function(e){var t=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.forEach(function(e){t.itemsHash[e.uuid]||(t.itemsHash[e.uuid]=e,t.items.push(e))})}},{key:"addItemSyncObserver",value:function(e,t,n){this.addItemSyncObserverWithPriority({id:e,types:t,callback:n,priority:1})}},{key:"addItemSyncObserverWithPriority",value:function(e){var t=e.id,n=e.priority,r=e.types,a=e.callback;Array.isArray(r)||(r=[r]),this.itemSyncObservers.push({id:t,types:r,priority:n,callback:a})}},{key:"removeItemSyncObserver",value:function(e){_.remove(this.itemSyncObservers,_.find(this.itemSyncObservers,{id:e}))}},{key:"getDirtyItems",value:function(){return this.items.filter(function(e){return 1==e.dirty&&!e.dummy&&(!e.errorDecrypting||e.deleted)})}},{key:"clearDirtyItems",value:function(e){var t=!0,n=!1,r=void 0;try{for(var a,i=e[Symbol.iterator]();!(t=(a=i.next()).done);t=!0){a.value.setDirty(!1)}}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}}},{key:"setItemToBeDeleted",value:function(e){e.deleted=!0,e.dummy||e.setDirty(!0),this.removeAndDirtyAllRelationshipsForItem(e)}},{key:"removeAndDirtyAllRelationshipsForItem",value:function(e){if(!e.errorDecrypting){var t=!0,n=!1,r=void 0;try{for(var a,i=e.content.references[Symbol.iterator]();!(t=(a=i.next()).done);t=!0){var o=a.value,s=this.findItem(o.uuid);s&&(e.removeItemAsRelationship(s),s.hasRelationshipWithItem(e)&&(s.removeItemAsRelationship(e),s.setDirty(!0)))}}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}}var u=!0,c=!1,l=void 0;try{for(var f,p=e.referencingObjects[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var d=f.value;d.removeItemAsRelationship(e),d.setDirty(!0)}}catch(e){c=!0,l=e}finally{try{!u&&p.return&&p.return()}finally{if(c)throw l}}e.referencingObjects=[]}},{key:"setAllItemsDirty",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.allItems,n=!0,r=!1,a=void 0;try{for(var i,o=t[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){i.value.setDirty(!0,e)}}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}}},{key:"removeItemLocally",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:_.remove(this.items,{uuid:t.uuid}),delete this.itemsHash[t.uuid],t.isBeingRemovedLocally(),this.itemsPendingRemoval.push(t.uuid);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"allItemsMatchingTypes",value:function(e){return this.allItems.filter(function(t){return(_.includes(e,t.content_type)||_.includes(e,"*"))&&!t.dummy})}},{key:"invalidItems",value:function(){return this.allItems.filter(function(e){return e.errorDecrypting})}},{key:"validItemsForContentType",value:function(e){return this.allItems.filter(function(t){return t.content_type==e&&!t.errorDecrypting})}},{key:"findItem",value:function(e){return this.itemsHash[e]}},{key:"findItems",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value,c=this.itemsHash[u];(c||t)&&n.push(c)}}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}return n}},{key:"itemsMatchingPredicate",value:function(e){return this.itemsMatchingPredicates([e])}},{key:"itemsMatchingPredicates",value:function(e){return this.filterItemsWithPredicates(this.allItems,e)}},{key:"filterItemsWithPredicates",value:function(e,t){return e.filter(function(e){var n=!0,r=!1,a=void 0;try{for(var i,o=t[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){var s=i.value;if(!e.satisfiesPredicate(s))return!1}}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}return!0})}},{key:"importItems",value:function(){function t(e){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(n){var r,a,i,o,s,u,c,l,f,p,d,h,v,y,m,g;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=[],a=!0,i=!1,o=void 0,t.prev=4,s=n[Symbol.iterator]();case 6:if(a=(u=s.next()).done){t.next=21;break}if(c=u.value,!(l=this.findItem(c.uuid))||l.errorDecrypting){t.next=16;break}return t.next=12,this.createConflictedItem(c);case 12:f=t.sent,c.deleted||l.isItemContentEqualWith(f)||(this.addConflictedItem(f,l),r.push(f)),t.next=18;break;case 16:r.push(c),l&&l.errorDecrypting&&(l.errorDecrypting=!1);case 18:a=!0,t.next=6;break;case 21:t.next=27;break;case 23:t.prev=23,t.t0=t.catch(4),i=!0,o=t.t0;case 27:t.prev=27,t.prev=28,!a&&s.return&&s.return();case 30:if(t.prev=30,!i){t.next=33;break}throw o;case 33:return t.finish(30);case 34:return t.finish(27);case 35:for(p=this.mapResponseItemsToLocalModels(r,e.MappingSourceFileImport),d=!0,h=!1,v=void 0,t.prev=39,y=p[Symbol.iterator]();!(d=(m=y.next()).done);d=!0)g=m.value,g.setDirty(!0,!0),g.deleted=!1;t.next=47;break;case 43:t.prev=43,t.t1=t.catch(39),h=!0,v=t.t1;case 47:t.prev=47,t.prev=48,!d&&y.return&&y.return();case 50:if(t.prev=50,!h){t.next=53;break}throw v;case 53:return t.finish(50);case 54:return t.finish(47);case 55:return t.abrupt("return",p);case 56:case"end":return t.stop()}},t,this,[[4,23,27,35],[28,,30,34],[39,43,47,55],[48,,50,54]])}));return t}()},{key:"getAllItemsJSONData",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.getJSONDataForItems(this.allItems,t,n,r));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"getJSONDataForItems",value:function(){function e(e,n,r,a){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r,a){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(t.map(function(e){return new S(e,n,r).paramsForExportFile()})).then(function(e){if(a&&0==e.length)return null;var t={items:e};return n&&(t.auth_params=r),JSON.stringify(t,null,2)}));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"computeDataIntegrityHash",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=this.allNondummyItems.sort(function(e,t){return t.updated_at-e.updated_at}),n=t.map(function(e){return e.updatedAtTimestamp()}),r=n.join(","),e.next=6,SFJS.crypto.sha256(r);case 6:return a=e.sent,e.abrupt("return",a);case 10:return e.prev=10,e.t0=e.catch(0),console.error("Error computing data integrity hash",e.t0),e.abrupt("return",null);case 14:case"end":return e.stop()}},e,this,[[0,10]])}));return e}()},{key:"allItems",get:function(){return this.items.slice()}},{key:"allNondummyItems",get:function(){return this.items.filter(function(e){return!e.dummy})}}]),e}(),m=r.SFPrivilegesManager=function(){function e(t,n,r){i(this,e),this.modelManager=t,this.syncManager=n,this.singletonManager=r,this.loadPrivileges(),e.CredentialAccountPassword="CredentialAccountPassword",e.CredentialLocalPasscode="CredentialLocalPasscode",e.ActionManageExtensions="ActionManageExtensions",e.ActionManageBackups="ActionManageBackups",e.ActionViewProtectedNotes="ActionViewProtectedNotes",e.ActionManagePrivileges="ActionManagePrivileges",e.ActionManagePasscode="ActionManagePasscode",e.ActionDeleteNote="ActionDeleteNote",e.SessionExpiresAtKey="SessionExpiresAtKey",e.SessionLengthKey="SessionLengthKey",e.SessionLengthNone=0,e.SessionLengthFiveMinutes=300,e.SessionLengthOneHour=3600,e.SessionLengthOneWeek=604800,this.availableActions=[e.ActionViewProtectedNotes,e.ActionDeleteNote,e.ActionManagePasscode,e.ActionManageBackups,e.ActionManageExtensions,e.ActionManagePrivileges],this.availableCredentials=[e.CredentialAccountPassword,e.CredentialLocalPasscode],this.sessionLengths=[e.SessionLengthNone,e.SessionLengthFiveMinutes,e.SessionLengthOneHour,e.SessionLengthOneWeek,e.SessionLengthIndefinite]}return l(e,[{key:"setDelegate",value:function(e){this.delegate=e}},{key:"getAvailableActions",value:function(){return this.availableActions}},{key:"getAvailableCredentials",value:function(){return this.availableCredentials}},{key:"netCredentialsForAction",value:function(){function t(e){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(n){var r,a,i,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getPrivileges();case 2:t.t0=n,r=t.sent.getCredentialsForAction(t.t0),a=[],i=!0,o=!1,s=void 0,t.prev=8,u=r[Symbol.iterator]();case 10:if(i=(c=u.next()).done){t.next=27;break}if((l=c.value)!=e.CredentialAccountPassword){t.next=19;break}return t.next=15,this.delegate.isOffline();case 15:f=t.sent,f||a.push(l),t.next=24;break;case 19:if(l!=e.CredentialLocalPasscode){t.next=24;break}return t.next=22,this.delegate.hasLocalPasscode();case 22:p=t.sent,p&&a.push(l);case 24:i=!0,t.next=10;break;case 27:t.next=33;break;case 29:t.prev=29,t.t1=t.catch(8),o=!0,s=t.t1;case 33:t.prev=33,t.prev=34,!i&&u.return&&u.return();case 36:if(t.prev=36,!o){t.next=39;break}throw s;case 39:return t.finish(36);case 40:return t.finish(33);case 41:return t.abrupt("return",a);case 42:case"end":return t.stop()}},t,this,[[8,29,33,41],[34,,36,40]])}));return t}()},{key:"loadPrivileges",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.loadPromise){e.next=2;break}return e.abrupt("return",this.loadPromise);case 2:return this.loadPromise=new Promise(function(e,n){var r=E.contentType(),i=new C("content_type","=",r);t.singletonManager.registerSingleton([i],function(n){t.privileges=n,e(n)},function(){var n=a(regeneratorRuntime.mark(function n(a){var i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(i=new E({content_type:r}),SFJS.crypto.generateUUIDSync){n.next=4;break}return n.next=4,i.initUUID();case 4:t.modelManager.addItem(i),i.setDirty(!0),t.syncManager.sync(),a(i),e(i);case 9:case"end":return n.stop()}},n,t)}));return function(e){return n.apply(this,arguments)}}())}),e.abrupt("return",this.loadPromise);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"getPrivileges",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.privileges){e.next=4;break}return e.abrupt("return",this.privileges);case 4:return e.abrupt("return",this.loadPrivileges());case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"displayInfoForCredential",value:function(t){var n={};return n[e.CredentialAccountPassword]={label:"Account Password",prompt:"Please enter your account password."},n[e.CredentialLocalPasscode]={label:"Local Passcode",prompt:"Please enter your local passcode."},n[t]}},{key:"displayInfoForAction",value:function(t){var n={};return n[e.ActionManageExtensions]={label:"Manage Extensions"},n[e.ActionManageBackups]={label:"Download/Import Backups"},n[e.ActionViewProtectedNotes]={label:"View Protected Notes"},n[e.ActionManagePrivileges]={label:"Manage Privileges"},n[e.ActionManagePasscode]={label:"Manage Passcode"},n[e.ActionDeleteNote]={label:"Delete Notes"},n[t]}},{key:"getSessionLengthOptions",value:function(){return[{value:e.SessionLengthNone,label:"Don't Remember"},{value:e.SessionLengthFiveMinutes,label:"5 Minutes"},{value:e.SessionLengthOneHour,label:"1 Hour"},{value:e.SessionLengthOneWeek,label:"1 Week"}]}},{key:"setSessionLength",value:function(){function t(e){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(n){var r,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=function(e){var t=new Date;return t.setSeconds(t.getSeconds()+e),t},a=r(n),t.abrupt("return",Promise.all([this.delegate.saveToStorage(e.SessionExpiresAtKey,JSON.stringify(a)),this.delegate.saveToStorage(e.SessionLengthKey,JSON.stringify(n))]));case 3:case"end":return t.stop()}},t,this)}));return t}()},{key:"clearSession",value:function(){function t(){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.setSessionLength(e.SessionLengthNone));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"getSelectedSessionLength",value:function(){function t(){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.delegate.getFromStorage(e.SessionLengthKey);case 2:if(!(n=t.sent)){t.next=7;break}return t.abrupt("return",JSON.parse(n));case 7:return t.abrupt("return",e.SessionLengthNone);case 8:case"end":return t.stop()}},t,this)}));return t}()},{key:"getSessionExpirey",value:function(){function t(){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.delegate.getFromStorage(e.SessionExpiresAtKey);case 2:if(!(n=t.sent)){t.next=7;break}return t.abrupt("return",new Date(JSON.parse(n)));case 7:return t.abrupt("return",new Date);case 8:case"end":return t.stop()}},t,this)}));return t}()},{key:"actionHasPrivilegesConfigured",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.netCredentialsForAction(t);case 2:return e.t0=e.sent.length,e.abrupt("return",e.t0>0);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"actionRequiresPrivilege",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){var n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSessionExpirey();case 2:if(!((n=e.sent)>new Date)){e.next=5;break}return e.abrupt("return",!1);case 5:return e.next=7,this.netCredentialsForAction(t);case 7:return r=e.sent,e.abrupt("return",r.length>0);case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"savePrivileges",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPrivileges();case 2:t=e.sent,t.setDirty(!0),this.syncManager.sync();case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"authenticateAction",value:function(){function e(e,n){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n){var r,a,i,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.netCredentialsForAction(t);case 2:r=e.sent,a=[],i=[],o=!0,s=!1,u=void 0,e.prev=7,c=r[Symbol.iterator]();case 9:if(o=(l=c.next()).done){e.next=18;break}return f=l.value,e.next=13,this._verifyAuthenticationParameters(f,n[f]);case 13:p=e.sent,p?a.push(f):i.push(f);case 15:o=!0,e.next=9;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(7),s=!0,u=e.t0;case 24:e.prev=24,e.prev=25,!o&&c.return&&c.return();case 27:if(e.prev=27,!s){e.next=30;break}throw u;case 30:return e.finish(27);case 31:return e.finish(24);case 32:return e.abrupt("return",{success:0==i.length,successfulCredentials:a,failedCredentials:i});case 33:case"end":return e.stop()}},e,this,[[7,20,24,32],[25,,27,31]])}));return e}()},{key:"_verifyAuthenticationParameters",value:function(){function t(e,t){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(n,r){var i,o,s=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=function(){var e=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s.delegate.verifyAccountPassword(t));case 1:case"end":return e.stop()}},e,s)}));return function(t){return e.apply(this,arguments)}}(),o=function(){var e=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s.delegate.verifyLocalPasscode(t));case 1:case"end":return e.stop()}},e,s)}));return function(t){return e.apply(this,arguments)}}(),n!=e.CredentialAccountPassword){t.next=6;break}return t.abrupt("return",i(r));case 6:if(n!=e.CredentialLocalPasscode){t.next=8;break}return t.abrupt("return",o(r));case 8:case"end":return t.stop()}},t,this)}));return t}()}]),e}(),g=r.SFSessionHistoryManager=function(){function e(t,n,r,a,o){var s=this;i(this,e),this.modelManager=t,this.storageManager=n,this.$timeout=o||setTimeout.bind(window),this.keyRequestHandler=r,this.loadFromDisk().then(function(){s.modelManager.addItemSyncObserver("session-history",a,function(e,t,n,r,a){var i=!0,o=!1,u=void 0;try{for(var c,l=e[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var f=c.value;try{s.addHistoryEntryForItem(f)}catch(e){console.log("Caught exception while trying to add item history entry",e)}}}catch(e){o=!0,u=e}finally{try{!i&&l.return&&l.return()}finally{if(o)throw u}}})})}return l(e,[{key:"encryptionParams",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.keyRequestHandler());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"addHistoryEntryForItem",value:function(e){var t=this,n={uuid:e.uuid,content_type:e.content_type,updated_at:e.updated_at,content:e.content},r=this.historySession.addEntryForItem(n);this.autoOptimize&&this.historySession.optimizeHistoryForItem(e),r&&this.diskEnabled&&(this.diskTimeout&&(this.$timeout.hasOwnProperty("cancel")?this.$timeout.cancel(this.diskTimeout):clearTimeout(this.diskTimeout)),this.diskTimeout=this.$timeout(function(){t.saveToDisk()},2e3))}},{key:"historyForItem",value:function(e){return this.historySession.historyForItem(e)}},{key:"clearHistoryForItem",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.historySession.clearItemHistory(t),e.abrupt("return",this.saveToDisk());case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"clearAllHistory",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.historySession.clearAllHistory(),e.abrupt("return",this.storageManager.removeItem("sessionHistory_revisions"));case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"toggleDiskSaving",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.diskEnabled=!this.diskEnabled,!this.diskEnabled){e.next=6;break}this.storageManager.setItem("sessionHistory_persist",JSON.stringify(!0)),this.saveToDisk(),e.next=8;break;case 6:return this.storageManager.setItem("sessionHistory_persist",JSON.stringify(!1)),e.abrupt("return",this.storageManager.removeItem("sessionHistory_revisions"));case 8:case"end":return e.stop()}},e,this)}));return e}()},{key:"saveToDisk",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.diskEnabled){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.encryptionParams();case 4:t=e.sent,n=new S(this.historySession,t.keys,t.auth_params),n.paramsForSync().then(function(e){r.storageManager.setItem("sessionHistory_revisions",JSON.stringify(e))});case 7:case"end":return e.stop()}},e,this)}));return e}()},{key:"loadFromDisk",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r,a,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.storageManager.getItem("sessionHistory_persist");case 2:return t=e.sent,t&&(this.diskEnabled=JSON.parse(t)),e.next=6,this.storageManager.getItem("sessionHistory_revisions");case 6:if(!(n=e.sent)){e.next=18;break}return n=JSON.parse(n),e.next=11,this.encryptionParams();case 11:return r=e.sent,e.next=14,SFJS.itemTransformer.decryptItem(n,r.keys);case 14:a=new I(n),this.historySession=a,e.next=19;break;case 18:this.historySession=new I;case 19:return e.next=21,this.storageManager.getItem("sessionHistory_autoOptimize");case 21:i=e.sent,this.autoOptimize=!i||JSON.parse(i);case 23:case"end":return e.stop()}},e,this)}));return e}()},{key:"toggleAutoOptimize",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.autoOptimize=!this.autoOptimize,this.autoOptimize?this.storageManager.setItem("sessionHistory_autoOptimize",JSON.stringify(!0)):this.storageManager.setItem("sessionHistory_autoOptimize",JSON.stringify(!1));case 2:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),b=r.SFSingletonManager=function(){function e(t,n){var r=this;i(this,e),this.syncManager=n,this.modelManager=t,this.singletonHandlers=[],t.addItemSyncObserverWithPriority({id:"sf-singleton-manager",types:"*",priority:-1,callback:function(){r.resolveSingletons(t.allNondummyItems,null,!0)}}),n.addEventHandler(function(e,n){if("local-data-loaded"==e)r.resolveSingletons(t.allNondummyItems,null,!0),r.initialDataLoaded=!0;else if("sync:completed"==e){if(!r.initialDataLoaded)return;r.resolveSingletons(n.retrievedItems,n.savedItems)}}),t.addModelUuidChangeObserver("singleton-manager",function(e,t){var n=!0,a=!1,i=void 0;try{for(var o,s=r.singletonHandlers[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;u.singleton&&C.ItemSatisfiesPredicates(t,u.predicates)&&(u.singleton=null,r.resolveSingletons([t]))}}catch(e){a=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}})}return l(e,[{key:"registerSingleton",value:function(e,t,n){this.singletonHandlers.push({predicates:e,resolutionCallback:t,createBlock:n})}},{key:"resolveSingletons",value:function(e,t,n){var r=this;e=e||[],t=t||[];var a=!0,i=!1,o=void 0;try{for(var s,u=this.singletonHandlers[Symbol.iterator]();!(a=(s=u.next()).done);a=!0){var c=s.value;!function(a){var i=a.predicates.slice(),o=r.modelManager.filterItemsWithPredicates(e,i),s=function(){a.createBlock&&(a.pendingCreateBlockCallback=!0,a.createBlock(function(e){a.singleton=e,a.pendingCreateBlockCallback=!1,a.resolutionCallback&&a.resolutionCallback(e)}))},u=r.modelManager.filterItemsWithPredicates(t,i).length;if(o.length>0||u>0){var c=r.modelManager.itemsMatchingPredicates(i);if(c.length>=2){var l=c.sort(function(e,t){return e.errorDecrypting?1:t.errorDecrypting?-1:e.created_at=this.MaxDiscordanceBeforeOutOfSync&&(this.outOfSync||(this.outOfSync=!0,this.notifyEvent("enter-out-of-sync"))),e.abrupt("return",!1);case 13:return this.outOfSync&&(this.outOfSync=!1,this.notifyEvent("exit-out-of-sync")),this.syncDiscordance=0,e.abrupt("return",!0);case 16:case"end":return e.stop()}},e,this)}));return e}()},{key:"isOutOfSync",value:function(){return this.outOfSync}},{key:"getServerURL",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.storageManager.getItem("server");case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0=window._default_sf_server;case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}},e,this)}));return e}()},{key:"getSyncURL",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getServerURL();case 2:return e.t0=e.sent,e.abrupt("return",e.t0+"/items/sync");case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"registerSyncStatusObserver",value:function(e){var t={key:new Date,callback:e};return this.syncStatusObservers.push(t),t}},{key:"removeSyncStatusObserver",value:function(e){_.pull(this.syncStatusObservers,e)}},{key:"syncStatusDidChange",value:function(){var e=this;this.syncStatusObservers.forEach(function(t){t.callback(e.syncStatus)})}},{key:"addEventHandler",value:function(e){return this.eventHandlers.push(e),e}},{key:"removeEventHandler",value:function(e){_.pull(this.eventHandlers,e)}},{key:"notifyEvent",value:function(e,t){var n=!0,r=!1,a=void 0;try{for(var i,o=this.eventHandlers[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){(0,i.value)(e,t||{})}}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}}},{key:"setKeyRequestHandler",value:function(e){this.keyRequestHandler=e}},{key:"getActiveKeyInfo",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.keyRequestHandler(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"initialDataLoaded",value:function(){return this._initialDataLoaded}},{key:"loadLocalItems",value:function(){function t(e){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.storageManager.getAllModels().then(function(t){t=t.sort(function(e,t){var n=new Date(t.updated_at)-new Date(e.updated_at),a=r.contentTypeLoadPriority,i=0,o=0;return a&&(i=a.indexOf(e.content_type),o=a.indexOf(t.content_type),-1==i&&(i=a.length),-1==o&&(o=a.length)),i==o?n:i5&&(this.notifyEvent("sync:taking-too-long"),this.stopCheckingIfSyncIsTakingTooLong())}.bind(this),500)}},{key:"stopCheckingIfSyncIsTakingTooLong",value:function(){this.$interval.hasOwnProperty("cancel")?this.$interval.cancel(this.syncStatus.checker):clearInterval(this.syncStatus.checker),this.syncStatus.checker=null}},{key:"lockSyncing",value:function(){this.syncLocked=!0}},{key:"unlockSyncing",value:function(){this.syncLocked=!1}},{key:"sync",value:function(){function t(){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=a(regeneratorRuntime.mark(function t(a,i){var o,s,u,c,l,f,p,d,h,v,y,m,g;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.syncLocked){t.next=4;break}return console.log("Sync Locked, Returning;"),a(),t.abrupt("return");case 4:if(r||(r={}),o=n.modelManager.getDirtyItems(),s=o.filter(function(e){return e.dirtyCount>0&&(e.dirtyCount=0,!0)}),!n.syncStatus.syncOpInProgress||r.force){t.next=14;break}return n.repeatOnCompletion=!0,n.queuedCallbacks.push(a),t.next=12,n.writeItemsToLocalStorage(s,!1);case 12:return console.log("Sync op in progress; returning."),t.abrupt("return");case 14:return t.next=16,n.getActiveKeyInfo(e.KeyRequestLoadSaveAccount);case 16:if(u=t.sent,!u.offline){t.next=20;break}return n.syncOffline(o).then(function(e){n.modelManager.clearDirtyItems(o),a(e)}).catch(function(e){n.notifyEvent("sync-exception",e)}),t.abrupt("return");case 20:return c=n.syncStatus.needsMoreSync,n.syncStatus.syncOpInProgress=!0,n.syncStatus.syncStart=new Date,n.beginCheckingIfSyncIsTakingTooLong(),l=n.PerSyncItemUploadLimit,f=o.slice(0,l),f.lengthn.syncStatus.total&&(n.syncStatus.total=n.syncStatus.current),n.syncStatusDidChange(),t.next=32,n.writeItemsToLocalStorage(s,!1);case 32:return r.onPreSyncSave&&r.onPreSyncSave(),n.allRetreivedItems||(n.allRetreivedItems=[]),n.allSavedItems||(n.allSavedItems=[]),p={},p.limit=150,r.performIntegrityCheck&&(p.compute_integrity=!0),t.prev=38,t.next=41,Promise.all(f.map(function(e){var t=new S(e,u.keys,u.auth_params);return t.additionalFields=r.additionalFields,t.paramsForSync()})).then(function(e){p.items=e});case 41:t.next=46;break;case 43:t.prev=43,t.t0=t.catch(38),n.notifyEvent("sync-exception",t.t0);case 46:for(d=!0,h=!1,v=void 0,t.prev=49,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0)g=m.value,g.dirtyCount=0;t.next=57;break;case 53:t.prev=53,t.t1=t.catch(49),h=!0,v=t.t1;case 57:t.prev=57,t.prev=58,!d&&y.return&&y.return();case 60:if(t.prev=60,!h){t.next=63;break}throw v;case 63:return t.finish(60);case 64:return t.finish(57);case 65:return t.next=67,n.getSyncToken();case 67:return p.sync_token=t.sent,t.next=70,n.getCursorToken();case 70:return p.cursor_token=t.sent,t.prev=71,t.t2=n.httpManager,t.next=75,n.getSyncURL();case 75:t.t3=t.sent,t.t4=p,t.t5=function(e){n.handleSyncSuccess(f,e,r).then(function(){a(e)}).catch(function(e){console.log("Caught sync success exception:",e),n.handleSyncError(null,null,o).then(function(e){a(e)})})},t.t6=function(e,t){n.handleSyncError(e,t,o).then(function(e){a(e)})},t.t2.postAbsolute.call(t.t2,t.t3,t.t4,t.t5,t.t6),t.next=85;break;case 82:t.prev=82,t.t7=t.catch(71),console.log("Sync exception caught:",t.t7);case 85:case"end":return t.stop()}},t,n,[[38,43],[49,53,57,65],[58,,60,64],[71,82]])}));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"handleSyncSuccess",value:function(){function t(e,t,r){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(n,r,a){var i,o,s,u,c,l,f,p,d,h,v,m,g,b,k=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(i=[],o=!0,s=!1,u=void 0,t.prev=4,c=n[Symbol.iterator]();!(o=(l=c.next()).done);o=!0)f=l.value,0==f.dirtyCount&&i.push(f);t.next=12;break;case 8:t.prev=8,t.t0=t.catch(4),s=!0,u=t.t0;case 12:t.prev=12,t.prev=13,!o&&c.return&&c.return();case 15:if(t.prev=15,!s){t.next=18;break}throw u;case 18:return t.finish(15);case 19:return t.finish(12);case 20:return this.modelManager.clearDirtyItems(i),this.syncStatus.error=null,p=this.allSavedItems.map(function(e){return e.uuid}),r.retrieved_items=r.retrieved_items.filter(function(e){return!p.includes(e.uuid)}),t.next=26,this.handleItemsResponse(r.retrieved_items,null,y.MappingSourceRemoteRetrieved,e.KeyRequestLoadSaveAccount);case 26:return d=t.sent,this.allRetreivedItems=this.allRetreivedItems.concat(d),this.syncStatus.retrievedCount=this.allRetreivedItems.length,h=["content","auth_hash"],t.next=32,this.handleItemsResponse(r.saved_items,h,y.MappingSourceRemoteSaved,e.KeyRequestLoadSaveAccount);case 32:return v=t.sent,this.allSavedItems=this.allSavedItems.concat(v),m=r.unsaved,t.next=37,this.handleUnsavedItemsResponse(m);case 37:return t.next=39,this.writeItemsToLocalStorage(v,!1);case 39:return t.next=41,this.writeItemsToLocalStorage(d,!1);case 41:if(this.syncStatus.syncOpInProgress=!1,this.syncStatus.current+=n.length,this.syncStatusDidChange(),this.setSyncToken(r.sync_token),this.setCursorToken(r.cursor_token),this.stopCheckingIfSyncIsTakingTooLong(),!r.integrity_hash||r.cursor_token){t.next=52;break}return t.next=50,this.handleServerIntegrityHash(r.integrity_hash);case 50:g=t.sent,g||this.syncDiscordance=this.majorDataChangeThreshold||v.length>=this.majorDataChangeThreshold||m.length>=this.majorDataChangeThreshold)&&this.notifyEvent("major-data-change"),this.callQueuedCallbacks(r),this.notifyEvent("sync:completed",{retrievedItems:this.allRetreivedItems,savedItems:this.allSavedItems,unsavedItems:m}),this.allRetreivedItems=[],this.allSavedItems=[],t.abrupt("return",r);case 72:case"end":return t.stop()}},t,this,[[4,8,12,20],[13,,15,19]])}));return t}()},{key:"handleSyncError",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("Sync error: ",t),401==n&&this.notifyEvent("sync-session-invalid"),t?"string"==typeof t&&(t={error:{message:t}}):t={error:{message:"Could not connect to server."}},this.syncStatus.syncOpInProgress=!1,this.syncStatus.error=t.error,this.syncStatusDidChange(),this.writeItemsToLocalStorage(r,!1),this.modelManager.didSyncModelsOffline(r),this.stopCheckingIfSyncIsTakingTooLong(),this.notifyEvent("sync:error",t.error),this.callQueuedCallbacks({error:"Sync error"}),e.abrupt("return",t);case 12:case"end":return e.stop()}},e,this)}));return e}()},{key:"handleItemsResponse",value:function(){function e(e,n,r,a){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r,a){var i,o,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getActiveKeyInfo(a);case 2:return i=e.sent.keys,e.next=5,SFJS.itemTransformer.decryptMultipleItems(t,i);case 5:return o=this.modelManager.mapResponseItemsToLocalModelsOmittingFields(t,n,r),s=o.filter(function(e){var t=e.errorDecryptingValueChanged;return e.errorDecryptingValueChanged=!1,t}),s.length>0&&this.writeItemsToLocalStorage(s,!1),e.abrupt("return",o);case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"refreshErroredItems",value:function(){function t(){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.modelManager.allNondummyItems.filter(function(e){return 1==e.errorDecrypting}),!(n.length>0)){t.next=3;break}return t.abrupt("return",this.handleItemsResponse(n,null,y.MappingSourceLocalRetrieved,e.KeyRequestLoadSaveAccount));case 3:case"end":return t.stop()}},t,this)}));return t}()},{key:"handleUnsavedItemsResponse",value:function(){function t(e){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(n){var r,a,i,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=n.length){t.next=2;break}return t.abrupt("return");case 2:console.log("Handle Conflicted Items:",n),r=!0,a=!1,i=void 0,t.prev=6,o=n[Symbol.iterator]();case 8:if(r=(s=o.next()).done){t.next=35;break}return u=s.value,c=u.item,t.t0=SFJS.itemTransformer,t.t1=[c],t.next=15,this.getActiveKeyInfo(e.KeyRequestLoadSaveAccount);case 15:return t.t2=t.sent.keys,t.next=18,t.t0.decryptMultipleItems.call(t.t0,t.t1,t.t2);case 18:if(l=this.modelManager.findItem(c.uuid)){t.next=21;break}return t.abrupt("continue",32);case 21:if(f=u.error,"uuid_conflict"!==f.tag){t.next=27;break}return t.next=25,this.modelManager.alternateUUIDForItem(l);case 25:t.next=32;break;case 27:if("sync_conflict"!==f.tag){t.next=32;break}return t.next=30,this.modelManager.createConflictedItem(c);case 30:p=t.sent,c.deleted||l.isItemContentEqualWith(p)||this.modelManager.addConflictedItem(p,l);case 32:r=!0,t.next=8;break;case 35:t.next=41;break;case 37:t.prev=37,t.t3=t.catch(6),a=!0,i=t.t3;case 41:t.prev=41,t.prev=42,!r&&o.return&&o.return();case 44:if(t.prev=44,!a){t.next=47;break}throw i;case 47:return t.finish(44);case 48:return t.finish(41);case 49:this.sync(null,{additionalFields:["created_at","updated_at"]});case 50:case"end":return t.stop()}},t,this,[[6,37,41,49],[42,,44,48]])}));return t}()},{key:"stateless_downloadAllItems",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var r=a(regeneratorRuntime.mark(function r(i,o){var s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return s={limit:n.limit||500,sync_token:n.syncToken,cursor_token:n.cursorToken,content_type:n.contentType,event:n.event},r.prev=1,r.t0=t.httpManager,r.next=5,t.getSyncURL();case 5:r.t1=r.sent,r.t2=s,r.t3=function(){var r=a(regeneratorRuntime.mark(function r(a){var o,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n.retrievedItems||(n.retrievedItems=[]),o=a.retrieved_items,r.next=4,t.getActiveKeyInfo(e.KeyRequestLoadSaveAccount);case 4:return s=r.sent.keys,r.next=7,SFJS.itemTransformer.decryptMultipleItems(o,s);case 7:n.retrievedItems=n.retrievedItems.concat(o.map(function(e){return t.modelManager.createItem(e,!0)})),n.syncToken=a.sync_token,n.cursorToken=a.cursor_token,n.cursorToken?t.stateless_downloadAllItems(n).then(i):i(n.retrievedItems);case 11:case"end":return r.stop()}},r,t)}));return function(e){return r.apply(this,arguments)}}(),r.t4=function(e,t){o(e)},r.t0.postAbsolute.call(r.t0,r.t1,r.t2,r.t3,r.t4),r.next=16;break;case 12:r.prev=12,r.t5=r.catch(1),console.log("Download all items exception caught:",r.t5),o(r.t5);case 16:case"end":return r.stop()}},r,t,[[1,12]])}));return function(e,t){return r.apply(this,arguments)}}())}},{key:"resolveOutOfSync",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stateless_downloadAllItems({event:"resolve-out-of-sync"}).then(function(){var e=a(regeneratorRuntime.mark(function e(n){var r,a,i,o,s,u,c,l,f,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=[],a=!0,i=!1,o=void 0,e.prev=4,s=n[Symbol.iterator]();case 6:if(a=(u=s.next()).done){e.next=20;break}if(c=u.value,!(l=t.modelManager.findItem(c.uuid))){e.next=16;break}if(!(f=!c.isItemContentEqualWith(l))){e.next=16;break}return e.next=14,t.modelManager.createConflictedItem(l,l);case 14:p=e.sent,t.modelManager.addConflictedItem(p,l);case 16:r.push(c);case 17:a=!0,e.next=6;break;case 20:e.next=26;break;case 22:e.prev=22,e.t0=e.catch(4),i=!0,o=e.t0;case 26:e.prev=26,e.prev=27,!a&&s.return&&s.return();case 29:if(e.prev=29,!i){e.next=32;break}throw o;case 32:return e.finish(29);case 33:return e.finish(26);case 34:return t.modelManager.mapResponseItemsToLocalModelsWithOptions({items:r,source:y.MappingSourceRemoteRetrieved}),e.next=37,t.writeItemsToLocalStorage(t.modelManager.allNondummyItems);case 37:return e.abrupt("return",t.sync({performIntegrityCheck:!0}));case 38:case"end":return e.stop()}},e,t,[[4,22,26,34],[27,,29,33]])}));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"handleSignout",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this._syncToken=null,this._cursorToken=null,this._queuedCallbacks=[],this.syncStatus={};case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"clearSyncToken",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this._syncToken=null,this._cursorToken=null,e.abrupt("return",this.storageManager.removeItem("syncToken"));case 3:case"end":return e.stop()}},e,this)}));return e}()},{key:"queuedCallbacks",get:function(){return this._queuedCallbacks||(this._queuedCallbacks=[]),this._queuedCallbacks}}]),e}(),x=r.SFItem=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.content={},this.referencingObjects=[],this.updateFromJSON(t),this.uuid||"undefined"!=typeof SFJS&&SFJS.crypto.generateUUIDSync&&(this.uuid=SFJS.crypto.generateUUIDSync()),"object"!==c(this.content)||this.content.references||(this.content.references=[])}return l(e,[{key:"initUUID",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.uuid){e.next=4;break}return e.next=3,SFJS.crypto.generateUUID();case 3:this.uuid=e.sent;case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"updateFromJSON",value:function(t){if(t){this.created_at=t.created_at,this.updated_at=t.updated_at,this.deleted=t.deleted,this.uuid=t.uuid,this.enc_item_key=t.enc_item_key,this.auth_hash=t.auth_hash,this.auth_params=t.auth_params;var n=["errorDecrypting","dirty","dirtyCount","dummy"],r=!0,a=!1,i=void 0;try{for(var o,s=n[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;void 0!==t[u]&&(this[u]=t[u])}}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}if(this.content_type||(this.content_type=t.content_type),t.errorDecrypting)this.content=t.content;else try{var c="string"==typeof t.content?JSON.parse(t.content):t.content;e.deepMerge(this.contentObject,c)}catch(e){console.log("Error while updating item from json",e)}this.created_at?(this.created_at=new Date(this.created_at),this.updated_at=new Date(this.updated_at)):(this.created_at=new Date,this.updated_at=new Date),this._client_updated_at=null,t.content?this.mapContentToLocalProperties(this.contentObject):1==t.deleted&&this.handleDeletedContent()}}},{key:"mapContentToLocalProperties",value:function(e){}},{key:"createContentJSONFromProperties",value:function(){var t=this.structureParams();return e.deepMerge(this.contentObject,t),t}},{key:"structureParams",value:function(){return this.getContentCopy()}},{key:"handleDeletedContent",value:function(){}},{key:"setDirty",value:function(e,t){this.dirty=e,this.dirtyCount||(this.dirtyCount=0),e?this.dirtyCount++:this.dirtyCount=0,e&&!t?this.client_updated_at=new Date:this.hasRawClientUpdatedAtValue()||(this.client_updated_at=new Date(this.updated_at))}},{key:"updateLocalRelationships",value:function(){}},{key:"addItemAsRelationship",value:function(e){if(e.setIsBeingReferencedBy(this),!this.hasRelationshipWithItem(e)){var t=this.content.references||[];t.push({uuid:e.uuid,content_type:e.content_type}),this.content.references=t}}},{key:"removeItemAsRelationship",value:function(e){e.setIsNoLongerBeingReferencedBy(this),this.removeReferenceWithUuid(e.uuid)}},{key:"setIsBeingReferencedBy",value:function(e){_.find(this.referencingObjects,{uuid:e.uuid})||this.referencingObjects.push(e)}},{key:"setIsNoLongerBeingReferencedBy",value:function(e){_.remove(this.referencingObjects,{uuid:e.uuid}),this.hasRelationshipWithItem(e)&&(this.removeReferenceWithUuid(e.uuid),this.setDirty(!0))}},{key:"removeReferenceWithUuid",value:function(e){var t=this.content.references||[];t=t.filter(function(t){return t.uuid!=e}),this.content.references=t}},{key:"hasRelationshipWithItem",value:function(e){return null!=this.content.references.find(function(t){return t.uuid==e.uuid})}},{key:"isBeingRemovedLocally",value:function(){}},{key:"didFinishSyncing",value:function(){}},{key:"informReferencesOfUUIDChange",value:function(e,t){}},{key:"potentialItemOfInterestHasChangedItsUUID",value:function(e,t,n){var r=!0,a=!1,i=void 0;try{for(var o,s=this.content.references[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;u.uuid==t&&(u.uuid=n,this.setDirty(!0))}}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}}},{key:"doNotEncrypt",value:function(){return!1}},{key:"setDomainDataItem",value:function(e,t,n){if(!n)return void console.error("SFItem.AppDomain needs to be set.");if(!this.errorDecrypting){this.content.appData||(this.content.appData={});var r=this.content.appData[n];r||(r={}),r[e]=t,this.content.appData[n]=r}}},{key:"getDomainDataItem",value:function(e,t){if(!t)return void console.error("SFItem.AppDomain needs to be set.");if(!this.errorDecrypting){this.content.appData||(this.content.appData={});var n=this.content.appData[t];return n?n[e]:null}}},{key:"setAppDataItem",value:function(t,n){this.setDomainDataItem(t,n,e.AppDomain)}},{key:"getAppDataItem",value:function(t){return this.getDomainDataItem(t,e.AppDomain)}},{key:"hasRawClientUpdatedAtValue",value:function(){return null!=this.getAppDataItem("client_updated_at")}},{key:"keysToIgnoreWhenCheckingContentEquality",value:function(){return[]}},{key:"appDataKeysToIgnoreWhenCheckingContentEquality",value:function(){return["client_updated_at"]}},{key:"getContentCopy",value:function(){return JSON.parse(JSON.stringify(this.content))}},{key:"isItemContentEqualWith",value:function(t){var n=function(e,t){if(!e)return e;var n=!0,r=!1,a=void 0;try{for(var i,o=t[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){delete e[i.value]}}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}return e},r=this.getContentCopy();r.appData&&n(r.appData[e.AppDomain],this.appDataKeysToIgnoreWhenCheckingContentEquality()),r=n(r,this.keysToIgnoreWhenCheckingContentEquality());var a=t.getContentCopy();return a.appData&&n(a.appData[e.AppDomain],t.appDataKeysToIgnoreWhenCheckingContentEquality()),a=n(a,t.keysToIgnoreWhenCheckingContentEquality()),JSON.stringify(r)===JSON.stringify(a)}},{key:"satisfiesPredicate",value:function(e){return C.ItemSatisfiesPredicate(this,e)}},{key:"createdAtString",value:function(){return this.dateToLocalizedString(this.created_at)}},{key:"updatedAtString",value:function(){return this.dateToLocalizedString(this.client_updated_at)}},{key:"updatedAtTimestamp",value:function(){return this.updated_at.getTime()}},{key:"dateToLocalizedString",value:function(e){if("undefined"!=typeof Intl&&Intl.DateTimeFormat){if(!s){var t=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;s=new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"})}return s.format(e)}return e.toDateString()+" "+e.toLocaleTimeString()}},{key:"contentObject",get:function(){if(this.errorDecrypting)return this.content;if(!this.content)return this.content={},this.content;if(null!==this.content&&"object"===c(this.content))return this.content;try{var e=JSON.parse(this.content);return this.content=e,this.content}catch(e){return console.log("Error parsing json",e,this),this.content={},this.content}}},{key:"pinned",get:function(){return this.getAppDataItem("pinned")}},{key:"archived",get:function(){return this.getAppDataItem("archived")}},{key:"locked",get:function(){return this.getAppDataItem("locked")}},{key:"displayName",get:function(){return"Item"}},{key:"client_updated_at",get:function(){if(!this._client_updated_at){var e=this.getAppDataItem("client_updated_at");this._client_updated_at=e?new Date(e):new Date(this.updated_at)}return this._client_updated_at},set:function(e){this._client_updated_at=e,this.setAppDataItem("client_updated_at",e)}}],[{key:"deepMerge",value:function(e,t){function n(e,t){if(_.isArray(e))return t}return _.mergeWith(e,t,n),e}}]),e}(),S=r.SFItemParams=function(){function e(t,n,r){if(i(this,e),this.item=t,this.keys=n,this.auth_params=r,this.keys&&!this.auth_params)throw"SFItemParams.auth_params must be supplied if supplying keys.";if(this.auth_params&&!this.auth_params.version)throw"SFItemParams.auth_params is missing version"}return l(e,[{key:"paramsForExportFile",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.additionalFields=["updated_at"],this.forExportFile=!0,!t){e.next=6;break}return e.abrupt("return",this.__params());case 6:return e.next=8,this.__params();case 8:return n=e.sent,e.abrupt("return",_.omit(n,["deleted"]));case 10:case"end":return e.stop()}},e,this)}));return e}()},{key:"paramsForExtension",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.paramsForExportFile());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"paramsForLocalStorage",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.additionalFields=["updated_at","dirty","errorDecrypting"],this.forExportFile=!0,e.abrupt("return",this.__params());case 3:case"end":return e.stop()}},e,this)}));return e}()},{key:"paramsForSync",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.__params());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"__params",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t={uuid:this.item.uuid,content_type:this.item.content_type,deleted:this.item.deleted,created_at:this.item.created_at},this.item.errorDecrypting){e.next=23;break}if(n=this.item.doNotEncrypt()&&!this.forExportFile,!this.keys||n){e.next=11;break}return e.next=6,SFJS.itemTransformer.encryptItem(this.item,this.keys,this.auth_params);case 6:r=e.sent,_.merge(t,r),"001"!==this.auth_params.version&&(t.auth_hash=null),e.next=21;break;case 11:if(!this.forExportFile){e.next=15;break}e.t0=this.item.createContentJSONFromProperties(),e.next=19;break;case 15:return e.next=17,SFJS.crypto.base64(JSON.stringify(this.item.createContentJSONFromProperties()));case 17:e.t1=e.sent,e.t0="000"+e.t1;case 19:t.content=e.t0,this.forExportFile||(t.enc_item_key=null,t.auth_hash=null);case 21:e.next=26;break;case 23:t.content=this.item.content,t.enc_item_key=this.item.enc_item_key,t.auth_hash=this.item.auth_hash;case 26:return this.additionalFields&&_.merge(t,_.pick(this.item,this.additionalFields)),e.abrupt("return",t);case 28:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),C=r.SFPredicate=function(){function e(t,n,r){i(this,e),this.keypath=t,this.operator=n,this.value=r,e.IsRecursiveOperator(this.operator)&&(this.value=this.value.map(e.fromArray))}return l(e,null,[{key:"fromArray",value:function(t){return new e(t[0],t[1],t[2])}},{key:"ObjectSatisfiesPredicate",value:function(t,n){if(Array.isArray(n)&&(n=this.fromArray(n)),e.IsRecursiveOperator(n.operator)){if("and"===n.operator){var r=!0,a=!1,i=void 0;try{for(var o,s=n.value[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(!this.ObjectSatisfiesPredicate(t,u))return!1}}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}return!0}if("or"===n.operator){var c=!0,l=!1,f=void 0;try{for(var p,d=n.value[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var u=p.value;if(this.ObjectSatisfiesPredicate(t,u))return!0}}catch(e){l=!0,f=e}finally{try{!c&&d.return&&d.return()}finally{if(l)throw f}}return!1}}var h=n.value;"string"==typeof h&&h.includes(".ago")&&(h=this.DateFromString(h));var v=n.keypath.split(".").reduce(function(e,t){return e&&e[t]},t),y=[!1,"",null,void 0,NaN];if(void 0==v)return"!="==n.operator?!y.includes(n.value):y.includes(n.value);if("="==n.operator)return Array.isArray(v)?JSON.stringify(v)==JSON.stringify(h):v==h;if("!="==n.operator)return Array.isArray(v)?JSON.stringify(v)!=JSON.stringify(h):v!==h;if("<"==n.operator)return v"==n.operator)return v>h;if("<="==n.operator)return v<=h;if(">="==n.operator)return v>=h;if("startsWith"==n.operator)return v.startsWith(h);if("in"==n.operator)return-1!=h.indexOf(v);if("includes"==n.operator)return this.resolveIncludesPredicate(v,h);if("matches"==n.operator){return new RegExp(h).test(v)}return!1}},{key:"resolveIncludesPredicate",value:function(t,n){if("string"==typeof n)return t.includes(n);var r;r=Array.isArray(n)?e.fromArray(n):n;var a=!0,i=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(a=(s=u.next()).done);a=!0){var c=s.value;if(this.ObjectSatisfiesPredicate(c,r))return!0}}catch(e){i=!0,o=e}finally{try{!a&&u.return&&u.return()}finally{if(i)throw o}}return!1}},{key:"ItemSatisfiesPredicate",value:function(t,n){return Array.isArray(n)&&(n=e.fromArray(n)),this.ObjectSatisfiesPredicate(t,n)}},{key:"ItemSatisfiesPredicates",value:function(e,t){var n=!0,r=!1,a=void 0;try{for(var i,o=t[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){var s=i.value;if(!this.ItemSatisfiesPredicate(e,s))return!1}}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}return!0}},{key:"DateFromString",value:function(e){var t=e.split("."),n=t[1],r=new Date,a=parseInt(t[0]);return"days"==n?r.setDate(r.getDate()-a):"hours"==n&&r.setHours(r.getHours()-a),r}},{key:"IsRecursiveOperator",value:function(e){return["and","or"].includes(e)}}]),e}(),E=r.SFPrivileges=function(e){function r(e){i(this,r);var n=t(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return n.content.desktopPrivileges||(n.content.desktopPrivileges={}),n}return n(r,e),l(r,null,[{key:"contentType",value:function(){return"SN|Privileges"}}]),l(r,[{key:"setCredentialsForAction",value:function(e,t){this.content.desktopPrivileges[e]=t}},{key:"getCredentialsForAction",value:function(e){return this.content.desktopPrivileges[e]||[]}},{key:"toggleCredentialForAction",value:function(e,t){this.isCredentialRequiredForAction(e,t)?this.removeCredentialForAction(e,t):this.addCredentialForAction(e,t)}},{key:"removeCredentialForAction",value:function(e,t){_.pull(this.content.desktopPrivileges[e],t)}},{key:"addCredentialForAction",value:function(e,t){var n=this.getCredentialsForAction(e);n.push(t),this.setCredentialsForAction(e,n)}},{key:"isCredentialRequiredForAction",value:function(e,t){return this.getCredentialsForAction(e).includes(t)}}]),r}(x),I=r.SFHistorySession=function(e){function r(e){i(this,r);var n=t(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return n.content.itemUUIDToItemHistoryMapping||(n.content.itemUUIDToItemHistoryMapping={}),Object.keys(n.content.itemUUIDToItemHistoryMapping).forEach(function(e){var t=n.content.itemUUIDToItemHistoryMapping[e];n.content.itemUUIDToItemHistoryMapping[e]=new R(t)}),n}return n(r,e),l(r,[{key:"addEntryForItem",value:function(e){return this.historyForItem(e).addHistoryEntryForItem(e)}},{key:"historyForItem",value:function(e){var t=this.content.itemUUIDToItemHistoryMapping[e.uuid];return t||(t=this.content.itemUUIDToItemHistoryMapping[e.uuid]=new R),t}},{key:"clearItemHistory",value:function(e){this.historyForItem(e).clear()}},{key:"clearAllHistory",value:function(){this.content.itemUUIDToItemHistoryMapping={}}},{key:"optimizeHistoryForItem",value:function(e){var t=this.historyForItem(e);t.entries.length>r.LargeItemEntryAmountThreshold&&t.optimize()}}]),r}(x);I.LargeItemEntryAmountThreshold=60;var R=r.SFItemHistory=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(i(this,e),this.entries||(this.entries=[]),t.entries){var n=!0,r=!1,a=void 0;try{for(var o,s=t.entries[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,c=this.createEntryForItem(u.item);c.setPreviousEntry(this.getLastEntry()),this.entries.push(c)}}catch(e){r=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw a}}}}return l(e,[{key:"createEntryForItem",value:function(t){var n=e.HistoryEntryClassMapping&&e.HistoryEntryClassMapping[t.content_type];return n||(n=P),new n(t)}},{key:"getLastEntry",value:function(){return this.entries[this.entries.length-1]}},{key:"addHistoryEntryForItem",value:function(e){var t=this.createEntryForItem(e),n=this.getLastEntry();if(t.setPreviousEntry(n),!t.isSameAsEntry(n))return this.entries.push(t),t}},{key:"clear",value:function(){this.entries.length=0}},{key:"optimize",value:function(){var t=this,n=[],r=function(t){return t.deltaSize()>e.LargeEntryDeltaThreshold},a=function(e,a,i){if(i)n.push(e);else{var a=n.indexOf(e);-1!==a&&n.splice(a,1)}if(i&&r(e)&&-1==e.operationVector()){var o=t.entries[a-1];o&&n.push(o)}};this.entries.forEach(function(e,n){if(0==n||n==t.entries.length-1)a(e,n,!0);else{var i=r(e);a(e,n,i)}}),this.entries=this.entries.filter(function(e,t){return-1!==n.indexOf(e)})}}]),e}();R.LargeEntryDeltaThreshold=15;var P=r.SFItemHistoryEntry=function(){function e(t){i(this,e),this.item=x.deepMerge({},t),this.defaultContentKeyToDiffOn="text",this.textCharDiffLength=0,"string"==typeof this.item.updated_at&&(this.item.updated_at=new Date(this.item.updated_at))}return l(e,[{key:"setPreviousEntry",value:function(e){this.hasPreviousEntry=null!=e,this.item.content[this.defaultContentKeyToDiffOn]&&(this.textCharDiffLength=e?this.item.content[this.defaultContentKeyToDiffOn].length-e.item.content[this.defaultContentKeyToDiffOn].length:this.item.content[this.defaultContentKeyToDiffOn].length)}},{key:"operationVector",value:function(){return void 0!=this.textCharDiffLength?this.hasPreviousEntry&&0!=this.textCharDiffLength?this.textCharDiffLength<0?-1:1:0:1}},{key:"deltaSize",value:function(){return void 0!=this.textCharDiffLength?Math.abs(this.textCharDiffLength):1}},{key:"isSameAsEntry",value:function(e){if(!e)return!1;var t=new x(this.item),n=new x(e.item);return t.isItemContentEqualWith(n)}}]),e}(),d="undefined"!=typeof window?window:void 0!==e?e:null,F=r.SFAbstractCrypto=function(){function e(){i(this,e),this.DefaultPBKDF2Length=768}return l(e,[{key:"generateUUIDSync",value:function(){var e=d.crypto||d.msCrypto;if(e){var t=new Uint32Array(4);e.getRandomValues(t);var n=-1;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){n++;var r=t[n>>3]>>n%8*4&15;return("x"==e?r:3&r|8).toString(16)})}var r=(new Date).getTime();return d.performance&&"function"==typeof d.performance.now&&(r+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"==e?t:3&t|8).toString(16)})}},{key:"generateUUID",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.generateUUIDSync());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"decryptText",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r,a,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=i.ciphertextToAuth,u=i.contentCiphertext,c=i.encryptionKey,l=i.iv,f=i.authHash,p=i.authKey,d=arguments[1];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!d||f){e.next=3;break}return console.error("Auth hash is required."),e.abrupt("return");case 3:if(!f){e.next=10;break}return e.next=6,this.hmac256(s,p);case 6:if(t=e.sent,f===t){e.next=10;break}return console.error("Auth hash does not match, returning null."),e.abrupt("return",null);case 10:return n=o.enc.Hex.parse(c),r=o.enc.Hex.parse(l||""),a=o.AES.decrypt(u,n,{iv:r,mode:o.mode.CBC,padding:o.pad.Pkcs7}),e.abrupt("return",a.toString(o.enc.Utf8));case 14:case"end":return e.stop()}},e,this)}));return e}()},{key:"encryptText",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r){var a,i,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=o.enc.Hex.parse(n),i=o.enc.Hex.parse(r||""),s=o.AES.encrypt(t,a,{iv:i,mode:o.mode.CBC,padding:o.pad.Pkcs7}),e.abrupt("return",s.toString());case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateRandomKey",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o.lib.WordArray.random(t/8).toString());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateItemEncryptionKey",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=512,n=1,e.next=4,this.generateRandomKey(t);case 4:return r=e.sent,e.next=7,this.generateRandomKey(t);case 7:return a=e.sent,e.abrupt("return",this.pbkdf2(a,r,n,t));case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"firstHalfOfKey",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.substring(0,t.length/2));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"secondHalfOfKey",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.substring(t.length/2,t.length));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"base64",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",d.btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)})));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"base64Decode",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",d.atob(t));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"sha256",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o.SHA256(t).toString());case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"hmac256",value:function(){function e(e,n){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n){var r,a,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.enc.Hex.parse(n),a=o.enc.Utf8.parse(t),i=o.HmacSHA256(a,r).toString(),e.abrupt("return",i);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateSalt",value:function(){function e(e,n,r,a){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r,a){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sha256([t,"SF",n,r,a].join(":"));case 2:return i=e.sent,e.abrupt("return",i);case 4:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateSymmetricKeyPair",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r,a,i,o,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=s.password,c=s.pw_salt,l=s.pw_cost;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pbkdf2(u,c,l,this.DefaultPBKDF2Length);case 2:return t=e.sent,n=t.length,r=n/3,a=t.slice(0,r),i=t.slice(r,2*r),o=t.slice(2*r,3*r),e.abrupt("return",[a,i,o]);case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"computeEncryptionKeysForUser",value:function(){function e(e,n){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("003"!=n.version){e.next=9;break}if(n.identifier){e.next=4;break}return console.error("authParams is missing identifier."),e.abrupt("return");case 4:return e.next=6,this.generateSalt(n.identifier,n.version,n.pw_cost,n.pw_nonce);case 6:r=e.sent,e.next=10;break;case 9:r=n.pw_salt;case 10:return e.abrupt("return",this.generateSymmetricKeyPair({password:t,pw_salt:r,pw_cost:n.pw_cost}).then(function(e){return{pw:e[0],mk:e[1],ak:e[2]}}));case 11:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateInitialKeysAndAuthParamsForUser",value:function(){function e(e,n){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n){var r,a,i,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.SFJS.version,a=this.SFJS.defaultPasswordGenerationCost,e.next=4,this.generateRandomKey(256);case 4:return i=e.sent,e.next=7,this.generateSalt(t,r,a,i);case 7:return o=e.sent,e.abrupt("return",this.generateSymmetricKeyPair({password:n,pw_salt:o,pw_cost:a}).then(function(e){var n={pw_nonce:i,pw_cost:a,identifier:t,version:r};return{keys:{pw:e[0],mk:e[1],ak:e[2]},authParams:n}}));case 9:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),T=r.SFCryptoJS=function(e){function r(){return i(this,r),t(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return n(r,e),l(r,[{key:"pbkdf2",value:function(){function e(e,n,r,a){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r,a){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i={keySize:a/32,hasher:o.algo.SHA512,iterations:r},e.abrupt("return",o.PBKDF2(t,n,i).toString());case 2:case"end":return e.stop()}},e,this)}));return e}()}]),r}(F),d="undefined"!=typeof window?window:void 0!==e?e:null,D=d.crypto?d.crypto.subtle:null,O=r.SFCryptoWeb=function(e){function r(){return i(this,r),t(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return n(r,e),l(r,[{key:"pbkdf2",value:function(){function e(e,n,r,a){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r,a){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.webCryptoImportKey(t,"PBKDF2",["deriveBits"]);case 2:if(i=e.sent){e.next=6;break}return console.log("Key is null, unable to continue"),e.abrupt("return",null);case 6:return e.abrupt("return",this.webCryptoDeriveBits(i,n,r,a));case 7:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateRandomKey",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){var n,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=!0,e.abrupt("return",D.generateKey({name:"AES-CBC",length:t},n,["encrypt","decrypt"]).then(function(e){return D.exportKey("raw",e).then(function(){var e=a(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.arrayBufferToHexString(new Uint8Array(t));case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,r)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.error("Error exporting key",e)})}).catch(function(e){console.error("Error generating key",e)}));case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"generateItemEncryptionKey",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=256,e.abrupt("return",Promise.all([this.generateRandomKey(t),this.generateRandomKey(t)]).then(function(e){return e.join("")}));case 2:case"end":return e.stop()}},e,this)}));return e}()},{key:"encryptText",value:function(){function e(e,n,r){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r){var i,o,s,u,c,l=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,this.hexStringToArrayBuffer(r);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=new ArrayBuffer(16);case 7:return i=e.t0,o={name:"AES-CBC",iv:i},e.next=11,this.hexStringToArrayBuffer(n);case 11:return s=e.sent,e.next=14,this.webCryptoImportKey(s,o.name,["encrypt"]);case 14:return u=e.sent,e.next=17,this.stringToArrayBuffer(t);case 17:return c=e.sent,e.abrupt("return",crypto.subtle.encrypt(o,u,c).then(function(){var e=a(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.arrayBufferToBase64(t);case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,l)}));return function(t){return e.apply(this,arguments)}}()));case 19:case"end":return e.stop()}},e,this)}));return e}()},{key:"decryptText",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r,i,o,s,u=this,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=c.ciphertextToAuth,f=c.contentCiphertext,p=c.encryptionKey,d=c.iv,h=c.authHash,v=c.authKey,y=arguments[1];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!y||h){e.next=3;break}return console.error("Auth hash is required."),e.abrupt("return");case 3:if(!h){e.next=10;break}return e.next=6,this.hmac256(l,v);case 6:if(t=e.sent,h===t){e.next=10;break}return console.error("Auth hash does not match, returning null. "+h+" != "+t),e.abrupt("return",null);case 10:if(!d){e.next=16;break}return e.next=13,this.hexStringToArrayBuffer(d);case 13:e.t0=e.sent,e.next=17;break;case 16:e.t0=new ArrayBuffer(16);case 17:return n=e.t0,r={name:"AES-CBC",iv:n},e.next=21,this.hexStringToArrayBuffer(p);case 21:return i=e.sent,e.next=24,this.webCryptoImportKey(i,r.name,["decrypt"]);case 24:return o=e.sent,e.next=27,this.base64ToArrayBuffer(f);case 27:return s=e.sent,e.abrupt("return",crypto.subtle.decrypt(r,o,s).then(function(){var e=a(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.arrayBufferToString(t);case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,u)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){console.error("Error decrypting:",e)}));case 29:case"end":return e.stop()}},e,this)}));return e}()},{key:"webCryptoImportKey",value:function(){function e(e,n,r,a){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r,a){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=6;break}return e.next=3,this.stringToArrayBuffer(t);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=t;case 7:return i=e.t0,e.abrupt("return",D.importKey("raw",i,{name:n,hash:a},!1,r).then(function(e){return e}).catch(function(e){return console.error(e),null}));case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"webCryptoDeriveBits",value:function(){function e(e,n,r,a){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t,n,r,i){var o,s=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stringToArrayBuffer(n);case 2:return e.t0=e.sent,e.t1=r,e.t2={name:"SHA-512"},o={name:"PBKDF2",salt:e.t0,iterations:e.t1,hash:e.t2},e.abrupt("return",D.deriveBits(o,t,i).then(function(){var e=a(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.arrayBufferToHexString(new Uint8Array(t));case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e,s)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){return console.error(e),null}));case 7:case"end":return e.stop()}},e,this)}));return e}()},{key:"stringToArrayBuffer",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=new Blob([t]),a=new FileReader;a.onload=function(t){e(t.target.result)},a.readAsArrayBuffer(r)}));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"arrayBufferToString",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=new Blob([t]),a=new FileReader;a.onload=function(t){e(t.target.result)},a.readAsText(r)}));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"arrayBufferToHexString",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){var n,r,a,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(n=new Uint8Array(t),r="",i=0;i5e3)||this.crypto instanceof O}},{key:"supportedVersions",value:function(){return["001","002","003"]}},{key:"isVersionNewerThanLibraryVersion",value:function(e){var t=this.version();return parseInt(e)>parseInt(t)}},{key:"isProtocolVersionOutdated",value:function(e){var t={"001":Date.parse("2018-01-01"),"002":Date.parse("2020-01-01")},n=t[e];return!!n&&new Date>n}},{key:"costMinimumForVersion",value:function(e){return{"001":3e3,"002":3e3,"003":11e4}[e]}},{key:"defaultPasswordGenerationCost",value:function(){return this.costMinimumForVersion(this.version())}}]),e}();if(d)try{d.StandardFile=A,d.SFJS=new A,d.SFCryptoWeb=O,d.SFCryptoJS=T,d.SFItemTransformer=M,d.SFModelManager=y,d.SFItem=x,d.SFItemParams=S,d.SFHttpManager=h,d.SFStorageManager=k,d.SFSyncManager=w,d.SFAuthManager=p,d.SFMigrationManager=v,d.SFAlertManager=f,d.SFPredicate=C,d.SFHistorySession=I,d.SFSessionHistoryManager=g,d.SFItemHistory=R,d.SFItemHistoryEntry=P,d.SFPrivilegesManager=m,d.SFPrivileges=E,d.SFSingletonManager=b}catch(e){console.log("Exception while exporting window variables",e)}}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(t,n(3))},function(e,t){!function(t){"use strict";function n(e,t,n,r){var i=t&&t.prototype instanceof a?t:a,o=Object.create(i.prototype),s=new d(r||[]);return o._invoke=c(e,n,s),o}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function a(){}function i(){}function o(){}function s(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function u(e){function t(n,a,i,o){var s=r(e[n],e,a);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&g.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,i,o)},function(e){t("throw",e,i,o)}):Promise.resolve(c).then(function(e){u.value=e,i(u)},o)}o(s.arg)}function n(e,n){function r(){return new Promise(function(r,a){t(e,n,r,a)})}return a=a?a.then(r,r):r()}var a;this._invoke=n}function c(e,t,n){var a=_;return function(i,o){if(a===I)throw new Error("Generator is already running");if(a===R){if("throw"===i)throw o;return v()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var u=l(s,n);if(u){if(u===P)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===_)throw a=R,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=I;var c=r(e,t,n);if("normal"===c.type){if(a=n.done?R:E,c.arg===P)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=R,n.method="throw",n.arg=c.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===y){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=y,l(e,t),"throw"===t.method))return P;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var a=r(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,P;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=y),t.delegate=null,P):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,P)}function f(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function p(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(f,this),this.reset(!0)}function h(e){if(e){var t=e[k];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var a=this.tryEntries[r],i=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var o=g.call(a,"catchLoc"),s=g.call(a,"finallyLoc");if(o&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),p(n),P}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;p(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:h(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=y),P}}}(function(){return this}()||Function("return this")())},function(e,t,n){"use strict";function r(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(a,i){function o(e){r(u,a,i,o,s,"next",e)}function s(e){r(u,a,i,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n=0?this.items[c]=u:this.items.push(u);case 15:r=!0,t.next=5;break;case 18:t.next=24;break;case 20:t.prev=20,t.t0=t.catch(3),a=!0,i=t.t0;case 24:t.prev=24,t.prev=25,r||null==o.return||o.return();case 27:if(t.prev=27,!a){t.next=30;break}throw i;case 30:return t.finish(27);case 31:return t.finish(24);case 32:this.notifyObserversOfEvent(e.BridgeEventReceivedItems);case 33:case"end":return t.stop()}},t,this,[[3,20,24,32],[25,,27,31]])}));return t}()},{key:"indexOfItem",value:function(e){for(var t in this.items)if(this.items[t].uuid==e.uuid)return t;return-1}},{key:"removeItemFromItems",value:function(e){this.items=this.items.filter(function(t){return t.uuid!==e.uuid})}},{key:"createItem",value:function(e,t){this.createItems([e],t)}},{key:"createItems",value:function(e,t){this.componentManager.createItems(e,function(e){t&&t(e.map(function(e){return new f.SFItem(e)}))})}},{key:"saveItem",value:function(){function e(e){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.saveItems([t]));case 1:case"end":return e.stop()}},e,this)}));return e}()},{key:"saveItems",value:function(){function t(e){return n.apply(this,arguments)}var n=a(regeneratorRuntime.mark(function t(n){var r=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,a){r.componentManager.saveItems(n,function(n){t(n),r.notifyObserversOfEvent(e.BridgeEventSavedItem)})}));case 1:case"end":return t.stop()}},t)}));return t}()},{key:"indexOfItem",value:function(e){for(var t in this.items)if(this.items[t].uuid==e.uuid)return t;return-1}},{key:"deleteItem",value:function(e,t){this.deleteItems([e],t)}},{key:"deleteItems",value:function(e,t){this.componentManager.deleteItems(e,t)}},{key:"removeItemFromItems",value:function(e){this.items=this.items.filter(function(t){return t.uuid!==e.uuid})}}]),e}());u(p,"FileItemContentTypeKey","SN|FileSafe|File"),u(p,"FileSafeCredentialsContentType","SN|FileSafe|Credentials"),u(p,"FileDescriptorContentTypeKey","SN|FileSafe|FileMetadata"),u(p,"FileSafeIntegrationContentTypeKey","SN|FileSafe|Integration"),u(p,"BridgeEventLoadedCredentials","BridgeEventLoadedCredentials"),u(p,"BridgeEventReceivedItems","BridgeEventReceivedItems"),u(p,"BridgeEventSavedItem","BridgeEventSavedItem")},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(a,i){function o(e){r(u,a,i,o,s,"next",e)}function s(e){r(u,a,i,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;nt.length)n=e;else{n=t;var r=0,a=-1,i=-1,o=n.length;for(0>r&&(r=-r>o?0:o+r),a=a>o?o:a,0>a&&(a+=o),o=r>a?0:a-r>>>0,r>>>=0,a=Array(o);++ii?pt:o,i=1),t=Object(t);++as))return!1;if((u=i.get(e))&&i.get(t))return u==t;var u=-1,c=!0,l=2&n?new R:pt;for(i.set(e,t),i.set(t,e);++un&&(n=ln(r+n,0)),v(e,be(t,3),n)):-1}function Ae(e){return(null==e?0:e.length)?B(e,1):[]}function Ne(e){var t=null==e?0:e.length;return t?e[t-1]:pt}function Le(e,t){var n;if(e&&e.length&&t&&t.length){n=t;var r=y,a=-1,i=n.length;for(e===n&&(n=ue(n));++a=e}function Ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ve(e){return null!=e&&"object"==typeof e}function qe(e){return!(!Ve(e)||"[object Object]"!=z(e))&&(null===(e=Xt(e))||"function"==typeof(e=Wt.call(e,"constructor")&&e.constructor)&&e instanceof e&&zt.call(e)==qt)}function Je(e){return"string"==typeof e||!Hn(e)&&Ve(e)&&"[object String]"==z(e)}function $e(e){return"symbol"==typeof e||Ve(e)&&"[object Symbol]"==z(e)}function Ge(e){return e?(e=Ye(e),e===dt||e===-dt?1.7976931348623157e308*(0>e?-1:1):e===e?e:0):0===e?e:0}function Qe(e){e=Ge(e);var t=e%1;return e===e?t?e-t:e:0}function Ye(e){if("number"==typeof e)return e;if($e(e))return ht;if(Ke(e)&&(e="function"==typeof e.valueOf?e.valueOf():e,e=Ke(e)?e+"":e),"string"!=typeof e)return 0===e?e:+e;e=e.replace(bt,"");var t=St.test(e);return t||_t.test(e)?Ft(e.slice(2),t?2:8):xt.test(e)?ht:+e}function Xe(e){return ce(e,rt(e))}function Ze(e){return null==e?"":ne(e)}function et(e,t,n){return e=null==e?pt:H(e,t),e===pt?n:e}function tt(e,t){var n;if(n=null!=e){n=e;var r;r=ae(t,n);for(var a=-1,i=r.length,o=!1;++a(e=O(t,e))||(e==t.length-1?t.pop():tn.call(t,e,1),--this.size,0))},E.prototype.get=function(e){var t=this.__data__;return e=O(t,e),0>e?pt:t[e][1]},E.prototype.has=function(e){return-1r?(++this.size,n.push([e,t])):n[r][1]=t,this},I.prototype.clear=function(){this.size=0,this.__data__={hash:new _,map:new(hn||E),string:new _}},I.prototype.delete=function(e){return e=ke(this,e).delete(e),this.size-=e?1:0,e},I.prototype.get=function(e){return ke(this,e).get(e)},I.prototype.has=function(e){return ke(this,e).has(e)},I.prototype.set=function(e,t){var n=ke(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},R.prototype.add=R.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},R.prototype.has=function(e){return this.__data__.has(e)},P.prototype.clear=function(){this.__data__=new E,this.size=0},P.prototype.delete=function(e){var t=this.__data__;return e=t.delete(e),this.size=t.size,e},P.prototype.get=function(e){return this.__data__.get(e)},P.prototype.has=function(e){return this.__data__.has(e)},P.prototype.set=function(e,t){var n=this.__data__;if(n instanceof E){var r=n.__data__;if(!hn||199>r.length)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new I(r)}return n.set(e,t),this.size=n.size,this};var Rn=function(e,t){return function(t,n){if(null==t)return t;if(!He(t))return e(t,n);for(var r=t.length,a=-1,i=Object(t);++an&&(n=ln(r+n,0)),Je(e)?n<=r&&-10){var a=!0,i=!1,o=void 0;try{for(var s,u=t.integrations[Symbol.iterator]();!(a=(s=u.next()).done);a=!0){var c=s.value;if(c!=e){t.setIntegrationAsDefault(c);break}}}catch(e){i=!0,o=e}finally{try{a||null==u.return||u.return()}finally{if(i)throw o}}}})}},{key:"integrations",get:function(){return this.extensionBridge.filterItems(l.a.FileSafeIntegrationContentTypeKey)}}]),e}()},function(e,t,n){"use strict";function r(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(a,i){function o(e){r(u,a,i,o,s,"next",e)}function s(e){r(u,a,i,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n0&&(e=n.credentials[0]),e}),u(this,"setCredentialAsDefault",function(e){var t=n.getDefaultCredentials();t&&(t.content.isDefault=!1),e.content.isDefault=!0,n.extensionBridge.saveItems([t,e])}),u(this,"deleteCredential",function(e){n.extensionBridge.deleteItem(e)}),this.extensionBridge=r,this.onCredentialLoad=a,this.credentials=[],this.extensionBridge.addEventHandler(function(e){e==f.a.BridgeEventReceivedItems&&n.reloadCredentials()})}return s(e,[{key:"reloadCredentials",value:function(){this.credentials=[];var e=this.extensionBridge.filterItems(f.a.FileSafeCredentialsContentType);if(0!=e.length){var t=!0,n=!1,r=void 0;try{for(var a,i=e[Symbol.iterator]();!(t=(a=i.next()).done);t=!0){var o=a.value;this.credentials.find(function(e){return e.uuid==o.uuid})||this.credentials.push(o)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}this.onCredentialLoad(),this.credentials.length>0&&this.didLoadCredentials()}}},{key:"createNewCredentials",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,n,r,a,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=256,e.next=3,SFJS.crypto.generateRandomKey(t);case 3:return n=e.sent,e.next=6,SFJS.crypto.generateRandomKey(t);case 6:return r=e.sent,e.next=9,SFJS.crypto.generateInitialKeysAndAuthParamsForUser(n,r);case 9:return a=e.sent,a.isDefault=0==this.credentials.length,i=new l.SFItem({content_type:f.a.FileSafeCredentialsContentType,content:a}),this.extensionBridge.saveItem(i),this.didLoadCredentials(),e.abrupt("return",i);case 15:case"end":return e.stop()}},e,this)}));return e}()},{key:"didLoadCredentials",value:function(){this.extensionBridge.notifyObserversOfEvent(f.a.BridgeEventLoadedCredentials)}},{key:"credentialForFileDescriptor",value:function(e){return this.credentials.find(function(t){return e.content.references.find(function(e){return e.uuid==t.uuid})})}},{key:"getAllCredentials",value:function(){return this.credentials}},{key:"saveCredential",value:function(e){this.extensionBridge.saveItem(e)}}]),e}()},function(e,t,n){"use strict";function r(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(a,i){function o(e){r(u,a,i,o,s,"next",e)}function s(e){r(u,a,i,o,s,"throw",e)}var u=e.apply(t,n);o(void 0)})}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3],i=document.createElement("a");i.setAttribute("download",t);var o=this.tempUrlForData(e,n);i.href=o,i.setAttribute("target","_blank"),a?window.location.href=i.href:(document.body.appendChild(i),i.click(),i.remove()),setTimeout(function(){r.revokeTempUrl(o)},500)}},{key:"tempUrlForData",value:function(e,t){return window.URL.createObjectURL(new Blob([e],{type:t||"text/json"}))}},{key:"revokeTempUrl",value:function(e){window.URL.revokeObjectURL(e)}},{key:"copyTextToClipboard",value:function(e){if(window.clipboardData&&window.clipboardData.setData)return clipboardData.setData("Text",e);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var t;try{t=document.createElement("textarea"),t.setAttribute("readonly",!0),t.setAttribute("contenteditable",!0),t.style.position="fixed",t.value=e,document.body.appendChild(t),t.focus(),t.select();var n=document.createRange();n.selectNodeContents(t);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),t.setSelectionRange(0,t.value.length),document.execCommand("copy")}catch(e){console.error(e),null}finally{document.body.removeChild(t)}}}}]),e}()}])},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var n=0;n0&&this.requestPermissions(this.initialPermissions);var t=!0,n=!1,r=void 0;try{for(var a,i=this.messageQueue[Symbol.iterator]();!(t=(a=i.next()).done);t=!0){var o=a.value;this.postMessage(o.action,o.data,o.callback)}}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}this.messageQueue=[],this.loggingEnabled&&console.log("onReadyData",e),this.activateThemes(e.activeThemeUrls||[]),this.onReadyCallback&&this.onReadyCallback()}},{key:"getSelfComponentUUID",value:function(){return this.uuid}},{key:"isRunningInDesktopApplication",value:function(){return"desktop"===this.environment}},{key:"setComponentDataValueForKey",value:function(e,t){this.componentData[e]=t,this.postMessage("set-component-data",{componentData:this.componentData},function(e){})}},{key:"clearComponentData",value:function(){this.componentData={},this.postMessage("set-component-data",{componentData:this.componentData},function(e){})}},{key:"componentDataValueForKey",value:function(e){return this.componentData[e]}},{key:"postMessage",value:function(e,t,n){if(!this.sessionKey)return void this.messageQueue.push({action:e,data:t,callback:n});var r={action:e,data:t,messageId:this.generateUUID(),sessionKey:this.sessionKey,api:"component"},a=JSON.parse(JSON.stringify(r));a.callback=n,this.sentMessages.push(a),this.isMobile&&(r=JSON.stringify(r)),this.loggingEnabled&&console.log("Posting message:",r),window.parent.postMessage(r,this.origin)}},{key:"setSize",value:function(e,t,n){this.postMessage("set-size",{type:e,width:t,height:n},function(e){})}},{key:"requestPermissions",value:function(e,t){this.postMessage("request-permissions",{permissions:e},function(e){t&&t()}.bind(this))}},{key:"streamItems",value:function(e,t){Array.isArray(e)||(e=[e]),this.postMessage("stream-items",{content_types:e},function(e){t(e.items)}.bind(this))}},{key:"streamContextItem",value:function(e){this.postMessage("stream-context-item",null,function(t){var n=t.item;e(n)})}},{key:"selectItem",value:function(e){this.postMessage("select-item",{item:this.jsonObjectForItem(e)})}},{key:"createItem",value:function(e,t){this.postMessage("create-item",{item:this.jsonObjectForItem(e)},function(e){var n=e.item;!n&&e.items&&e.items.length>0&&(n=e.items[0]),this.associateItem(n),t&&t(n)}.bind(this))}},{key:"createItems",value:function(e,t){var n=this,r=e.map(function(e){return n.jsonObjectForItem(e)});this.postMessage("create-items",{items:r},function(e){t&&t(e.items)}.bind(this))}},{key:"associateItem",value:function(e){this.postMessage("associate-item",{item:this.jsonObjectForItem(e)})}},{key:"deassociateItem",value:function(e){this.postMessage("deassociate-item",{item:this.jsonObjectForItem(e)})}},{key:"clearSelection",value:function(){this.postMessage("clear-selection",{content_type:"Tag"})}},{key:"deleteItem",value:function(e,t){this.deleteItems([e],t)}},{key:"deleteItems",value:function(e,t){var n={items:e.map(function(e){return this.jsonObjectForItem(e)}.bind(this))};this.postMessage("delete-items",n,function(e){t&&t(e)})}},{key:"sendCustomEvent",value:function(e,t,n){this.postMessage(e,t,function(e){n&&n(e)}.bind(this))}},{key:"saveItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.saveItems([e],t,n)}},{key:"saveItemWithPresave",value:function(e,t,n){this.saveItemsWithPresave([e],t,n)}},{key:"saveItemsWithPresave",value:function(e,t,n){this.saveItems(e,n,!1,t)}},{key:"saveItems",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments[3],i=function(e){a&&a();var r=[],i=[],o=!0,s=!1,u=void 0;try{for(var c,l=e[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;r.includes(f.uuid)||(r.push(f.uuid),f.updated_at=new Date,i.push(n.jsonObjectForItem(f)))}}catch(e){s=!0,u=e}finally{try{!o&&l.return&&l.return()}finally{if(s)throw u}}n.postMessage("save-items",{items:i},function(e){t&&t()})};this.pendingSaveItems||(this.pendingSaveItems=[]),1!=this.coallesedSaving||r?i(e):(this.pendingSave&&clearTimeout(this.pendingSave),this.pendingSaveItems=this.pendingSaveItems.concat(e),this.pendingSave=setTimeout(function(){i(n.pendingSaveItems),n.pendingSaveItems=[]},this.coallesedSavingDelay))}},{key:"jsonObjectForItem",value:function(e){var t=Object.assign({},e);return t.children=null,t.parent=null,t}},{key:"getItemAppDataValue",value:function(e,t){var n=e.content.appData&&e.content.appData["org.standardnotes.sn"];return n?n[t]:null}},{key:"activateThemes",value:function(e){if(this.loggingEnabled&&console.log("Incoming themes",e),this.activeThemes.sort().toString()!=e.sort().toString()){var t=e||[],n=[],r=!0,a=!1,i=void 0;try{for(var o,s=this.activeThemes[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;e.includes(u)?t=t.filter(function(e){return e!=u}):n.push(u)}}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}this.loggingEnabled&&(console.log("Deactivating themes:",n),console.log("Activating themes:",t));var c=!0,l=!1,f=void 0;try{for(var p,d=n[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var h=p.value;this.deactivateTheme(h)}}catch(e){l=!0,f=e}finally{try{!c&&d.return&&d.return()}finally{if(l)throw f}}this.activeThemes=e;var v=!0,y=!1,m=void 0;try{for(var g,b=t[Symbol.iterator]();!(v=(g=b.next()).done);v=!0){var k=g.value;if(k){var w=document.createElement("link");w.id=btoa(k),w.href=k,w.type="text/css",w.rel="stylesheet",w.media="screen,print",w.className="custom-theme",document.getElementsByTagName("head")[0].appendChild(w)}}}catch(e){y=!0,m=e}finally{try{!v&&b.return&&b.return()}finally{if(y)throw m}}}}},{key:"themeElementForUrl",value:function(e){return Array.from(document.getElementsByClassName("custom-theme")).slice().find(function(t){return t.id==btoa(e)})}},{key:"deactivateTheme",value:function(e){var t=this.themeElementForUrl(e);t&&(t.disabled=!0,t.parentNode.removeChild(t))}},{key:"generateUUID",value:function(){var e=window.crypto||window.msCrypto;if(e){var t=new Uint32Array(4);e.getRandomValues(t);var n=-1;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){n++;var r=t[n>>3]>>n%8*4&15;return("x"==e?r:3&r|8).toString(16)})}var r=(new Date).getTime();return window.performance&&"function"==typeof window.performance.now&&(r+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"==e?t:3&t|8).toString(16)})}}]),e}();void 0!==e&&void 0!==e.exports&&(e.exports=i),window&&(window.ComponentManager=i)}]); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 414cf4d..c156dad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,1486 +1,1405 @@ { "name": "sn-filesafe", - "version": "2.0.4", + "version": "2.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0" + } }, - "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "@babel/core": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.4.tgz", + "integrity": "sha512-lQgGX3FPRgbz2SKmhMtYgJvVzGZrmjaF4apZ2bLwofAKiSjxU0drPh4S/VasyYXwaTs+A1gvQ45BN8SQJzHsQQ==", "dev": true, "requires": { - "mime-types": "2.1.21", - "negotiator": "0.6.1" + "@babel/code-frame": "7.0.0", + "@babel/generator": "7.4.4", + "@babel/helpers": "7.4.4", + "@babel/parser": "7.4.4", + "@babel/template": "7.4.4", + "@babel/traverse": "7.4.4", + "@babel/types": "7.4.4", + "convert-source-map": "1.6.0", + "debug": "4.1.1", + "json5": "2.1.0", + "lodash": "4.17.11", + "resolve": "1.11.0", + "semver": "5.7.0", + "source-map": "0.5.7" } }, - "acorn-dynamic-import": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", - "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=", + "@babel/generator": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", + "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", "dev": true, "requires": { - "acorn": "4.0.13" - }, - "dependencies": { - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", - "dev": true - } + "@babel/types": "7.4.4", + "jsesc": "2.5.2", + "lodash": "4.17.11", + "source-map": "0.5.7", + "trim-right": "1.0.1" } }, - "ajv": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.1.tgz", - "integrity": "sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww==", + "@babel/helper-annotate-as-pure": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz", + "integrity": "sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==", "dev": true, "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" + "@babel/types": "7.4.4" } }, - "ajv-keywords": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", - "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", - "dev": true + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz", + "integrity": "sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w==", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "7.1.0", + "@babel/types": "7.4.4" + } }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "@babel/helper-builder-react-jsx": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.3.0.tgz", + "integrity": "sha512-MjA9KgwCuPEkQd9ncSXvSyJ5y+j2sICHyrI0M3L+6fnS4wMSNDc1ARXsbTfbb2cXHn17VisSnU/sHFTCxVxSMw==", "dev": true, "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "@babel/types": "7.4.4", + "esutils": "2.0.2" } }, - "alphanum-sort": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", - "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", - "dev": true + "@babel/helper-call-delegate": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz", + "integrity": "sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "7.4.4", + "@babel/traverse": "7.4.4", + "@babel/types": "7.4.4" + } }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true + "@babel/helper-define-map": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz", + "integrity": "sha512-IX3Ln8gLhZpSuqHJSnTNBWGDE9kdkTEWl21A/K7PQ00tseBwbqCHTvNLHSBd9M0R5rER4h5Rsvj9vw0R5SieBg==", + "dev": true, + "requires": { + "@babel/helper-function-name": "7.1.0", + "@babel/types": "7.4.4", + "lodash": "4.17.11" + } }, - "ansi-html": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", - "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=", - "dev": true + "@babel/helper-explode-assignable-expression": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz", + "integrity": "sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA==", + "dev": true, + "requires": { + "@babel/traverse": "7.4.4", + "@babel/types": "7.4.4" + } }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0", + "@babel/template": "7.4.4", + "@babel/types": "7.4.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "7.4.4" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz", + "integrity": "sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w==", + "dev": true, + "requires": { + "@babel/types": "7.4.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz", + "integrity": "sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg==", + "dev": true, + "requires": { + "@babel/types": "7.4.4" + } + }, + "@babel/helper-module-imports": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", + "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", + "dev": true, + "requires": { + "@babel/types": "7.4.4" + } + }, + "@babel/helper-module-transforms": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz", + "integrity": "sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "7.0.0", + "@babel/helper-simple-access": "7.1.0", + "@babel/helper-split-export-declaration": "7.4.4", + "@babel/template": "7.4.4", + "@babel/types": "7.4.4", + "lodash": "4.17.11" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz", + "integrity": "sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g==", + "dev": true, + "requires": { + "@babel/types": "7.4.4" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", + "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", "dev": true }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "@babel/helper-regex": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.4.4.tgz", + "integrity": "sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q==", + "dev": true, + "requires": { + "lodash": "4.17.11" + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz", + "integrity": "sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "7.0.0", + "@babel/helper-wrap-function": "7.2.0", + "@babel/template": "7.4.4", + "@babel/traverse": "7.4.4", + "@babel/types": "7.4.4" + } + }, + "@babel/helper-replace-supers": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.4.4.tgz", + "integrity": "sha512-04xGEnd+s01nY1l15EuMS1rfKktNF+1CkKmHoErDppjAAZL+IUBZpzT748x262HF7fibaQPhbvWUl5HeSt1EXg==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "7.0.0", + "@babel/helper-optimise-call-expression": "7.0.0", + "@babel/traverse": "7.4.4", + "@babel/types": "7.4.4" + } + }, + "@babel/helper-simple-access": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz", + "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==", + "dev": true, + "requires": { + "@babel/template": "7.4.4", + "@babel/types": "7.4.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "7.4.4" + } + }, + "@babel/helper-wrap-function": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz", + "integrity": "sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "7.1.0", + "@babel/template": "7.4.4", + "@babel/traverse": "7.4.4", + "@babel/types": "7.4.4" + } + }, + "@babel/helpers": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.4.tgz", + "integrity": "sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A==", + "dev": true, + "requires": { + "@babel/template": "7.4.4", + "@babel/traverse": "7.4.4", + "@babel/types": "7.4.4" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "2.4.2", + "esutils": "2.0.2", + "js-tokens": "4.0.0" + } + }, + "@babel/parser": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz", + "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==", "dev": true }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz", + "integrity": "sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==", "dev": true, "requires": { - "micromatch": "3.1.10", - "normalize-path": "2.1.1" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.3", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.13", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - } + "@babel/helper-plugin-utils": "7.0.0", + "@babel/helper-remap-async-to-generator": "7.1.0", + "@babel/plugin-syntax-async-generators": "7.2.0" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "@babel/plugin-proposal-json-strings": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz", + "integrity": "sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg==", "dev": true, "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/plugin-syntax-json-strings": "7.2.0" } }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.4.tgz", + "integrity": "sha512-dMBG6cSPBbHeEBdFXeQ2QLc5gUpg4Vkaz8octD4aoW/ISO+jBOcsuxYL7bsb5WSu8RLP6boxrBIALEHgoHtO9g==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/plugin-syntax-object-rest-spread": "7.2.0" } }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz", + "integrity": "sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g==", "dev": true, "requires": { - "arr-flatten": "1.1.0" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/plugin-syntax-optional-catch-binding": "7.2.0" } }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, - "array-flatten": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", - "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", - "dev": true - }, - "array-includes": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", - "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz", + "integrity": "sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA==", "dev": true, "requires": { - "define-properties": "1.1.3", - "es-abstract": "1.12.0" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/helper-regex": "7.4.4", + "regexpu-core": "4.5.4" } }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "@babel/plugin-syntax-async-generators": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz", + "integrity": "sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==", "dev": true, "requires": { - "array-uniq": "1.0.3" + "@babel/helper-plugin-utils": "7.0.0" } }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "@babel/plugin-syntax-json-strings": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz", + "integrity": "sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg==", "dev": true, "requires": { - "safer-buffer": "2.1.2" + "@babel/helper-plugin-utils": "7.0.0" } }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "@babel/plugin-syntax-jsx": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz", + "integrity": "sha512-VyN4QANJkRW6lDBmENzRszvZf3/4AXaj9YR7GwrWeeN9tEBPuXbmDYVU9bYBN0D70zCWVwUy0HWq2553VCb6Hw==", "dev": true, "requires": { - "bn.js": "4.11.8", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" + "@babel/helper-plugin-utils": "7.0.0" } }, - "assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz", + "integrity": "sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==", "dev": true, "requires": { - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } + "@babel/helper-plugin-utils": "7.0.0" } }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz", + "integrity": "sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w==", "dev": true, "requires": { - "lodash": "4.17.11" + "@babel/helper-plugin-utils": "7.0.0" } }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true - }, - "async-foreach": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", - "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "autoprefixer": { - "version": "6.7.7", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-6.7.7.tgz", - "integrity": "sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ=", + "@babel/plugin-transform-arrow-functions": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz", + "integrity": "sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg==", "dev": true, "requires": { - "browserslist": "1.7.7", - "caniuse-db": "1.0.30000914", - "normalize-range": "0.1.2", - "num2fraction": "1.2.2", - "postcss": "5.2.18", - "postcss-value-parser": "3.3.1" + "@babel/helper-plugin-utils": "7.0.0" } }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "dev": true - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "@babel/plugin-transform-async-to-generator": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.4.4.tgz", + "integrity": "sha512-YiqW2Li8TXmzgbXw+STsSqPBPFnGviiaSp6CYOq55X8GQ2SGVLrXB6pNid8HkqkZAzOH6knbai3snhP7v0fNwA==", "dev": true, "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "@babel/helper-module-imports": "7.0.0", + "@babel/helper-plugin-utils": "7.0.0", + "@babel/helper-remap-async-to-generator": "7.1.0" } }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz", + "integrity": "sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w==", "dev": true, "requires": { - "babel-code-frame": "6.26.0", - "babel-generator": "6.26.1", - "babel-helpers": "6.24.1", - "babel-messages": "6.23.0", - "babel-register": "6.26.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "convert-source-map": "1.6.0", - "debug": "2.6.9", - "json5": "0.5.1", - "lodash": "4.17.11", - "minimatch": "3.0.4", - "path-is-absolute": "1.0.1", - "private": "0.1.8", - "slash": "1.0.0", - "source-map": "0.5.7" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-eslint": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-7.2.3.tgz", - "integrity": "sha1-sv4tgBJkcPXBlELcdXJTqJdxCCc=", + "@babel/plugin-transform-block-scoping": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.4.tgz", + "integrity": "sha512-jkTUyWZcTrwxu5DD4rWz6rDB5Cjdmgz6z7M7RLXOJyCUkFBawssDGcGh8M/0FTSB87avyJI1HsTwUXp9nKA1PA==", "dev": true, "requires": { - "babel-code-frame": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0" + "@babel/helper-plugin-utils": "7.0.0", + "lodash": "4.17.11" } }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "@babel/plugin-transform-classes": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.4.tgz", + "integrity": "sha512-/e44eFLImEGIpL9qPxSRat13I5QNRgBLu2hOQJCF7VLy/otSM/sypV1+XaIw5+502RX/+6YaSAPmldk+nhHDPw==", "dev": true, "requires": { - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "detect-indent": "4.0.0", - "jsesc": "1.3.0", - "lodash": "4.17.11", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "@babel/helper-annotate-as-pure": "7.0.0", + "@babel/helper-define-map": "7.4.4", + "@babel/helper-function-name": "7.1.0", + "@babel/helper-optimise-call-expression": "7.0.0", + "@babel/helper-plugin-utils": "7.0.0", + "@babel/helper-replace-supers": "7.4.4", + "@babel/helper-split-export-declaration": "7.4.4", + "globals": "11.12.0" } }, - "babel-helper-bindify-decorators": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz", - "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=", + "@babel/plugin-transform-computed-properties": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz", + "integrity": "sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", - "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "@babel/plugin-transform-destructuring": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.4.tgz", + "integrity": "sha512-/aOx+nW0w8eHiEHm+BTERB2oJn5D127iye/SUQl7NjHy0lf+j7h4MKMMSOwdazGq9OxgiNADncE+SRJkCxjZpQ==", "dev": true, "requires": { - "babel-helper-explode-assignable-expression": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-builder-react-jsx": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz", - "integrity": "sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA=", + "@babel/plugin-transform-dotall-regex": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz", + "integrity": "sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "esutils": "2.0.2" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/helper-regex": "7.4.4", + "regexpu-core": "4.5.4" } }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "@babel/plugin-transform-duplicate-keys": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.2.0.tgz", + "integrity": "sha512-q+yuxW4DsTjNceUiTzK0L+AfQ0zD9rWaTLiUqHA8p0gxx7lu1EylenfzjeIWNkPy6e/0VG/Wjw9uf9LueQwLOw==", "dev": true, "requires": { - "babel-helper-hoist-variables": "6.24.1", - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-define-map": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz", + "integrity": "sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A==", "dev": true, "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.11" + "@babel/helper-builder-binary-assignment-operator-visitor": "7.1.0", + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", - "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "@babel/plugin-transform-for-of": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz", + "integrity": "sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-explode-class": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz", - "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=", + "@babel/plugin-transform-function-name": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz", + "integrity": "sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA==", "dev": true, "requires": { - "babel-helper-bindify-decorators": "6.24.1", - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-function-name": "7.1.0", + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "@babel/plugin-transform-literals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz", + "integrity": "sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg==", "dev": true, "requires": { - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "@babel/plugin-transform-member-expression-literals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz", + "integrity": "sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "@babel/plugin-transform-modules-amd": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz", + "integrity": "sha512-mK2A8ucqz1qhrdqjS9VMIDfIvvT2thrEsIQzbaTdc5QFzhDjQv2CkJJ5f6BXIkgbmaoax3zBr2RyvV/8zeoUZw==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-module-transforms": "7.4.4", + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "@babel/plugin-transform-modules-commonjs": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.4.4.tgz", + "integrity": "sha512-4sfBOJt58sEo9a2BQXnZq+Q3ZTSAUXyK3E30o36BOGnJ+tvJ6YSxF0PG6kERvbeISgProodWuI9UVG3/FMY6iw==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-module-transforms": "7.4.4", + "@babel/helper-plugin-utils": "7.0.0", + "@babel/helper-simple-access": "7.1.0" } }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "@babel/plugin-transform-modules-systemjs": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.4.4.tgz", + "integrity": "sha512-MSiModfILQc3/oqnG7NrP1jHaSPryO6tA2kOMmAQApz5dayPxWiHqmq4sWH2xF5LcQK56LlbKByCd8Aah/OIkQ==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.11" + "@babel/helper-hoist-variables": "7.4.4", + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "@babel/plugin-transform-modules-umd": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz", + "integrity": "sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw==", "dev": true, "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-module-transforms": "7.4.4", + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.4.tgz", + "integrity": "sha512-Ki+Y9nXBlKfhD+LXaRS7v95TtTGYRAf9Y1rTDiE75zf8YQz4GDaWRXosMfJBXxnk88mGFjWdCRIeqDbon7spYA==", "dev": true, "requires": { - "babel-helper-optimise-call-expression": "6.24.1", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "regexp-tree": "0.1.6" } }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "@babel/plugin-transform-new-target": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz", + "integrity": "sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-loader": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-6.4.1.tgz", - "integrity": "sha1-CzQRLVsHSKjc2/Uaz2+b1C1QuMo=", + "@babel/plugin-transform-object-super": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz", + "integrity": "sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg==", "dev": true, "requires": { - "find-cache-dir": "0.1.1", - "loader-utils": "0.2.17", - "mkdirp": "0.5.1", - "object-assign": "4.1.1" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/helper-replace-supers": "7.4.4" } }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "@babel/plugin-transform-parameters": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz", + "integrity": "sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw==", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "@babel/helper-call-delegate": "7.4.4", + "@babel/helper-get-function-arity": "7.0.0", + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "@babel/plugin-transform-property-literals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz", + "integrity": "sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ==", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", - "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", - "dev": true - }, - "babel-plugin-syntax-async-generators": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz", - "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=", - "dev": true - }, - "babel-plugin-syntax-class-constructor-call": { - "version": "6.18.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz", - "integrity": "sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY=", - "dev": true - }, - "babel-plugin-syntax-class-properties": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", - "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", - "dev": true - }, - "babel-plugin-syntax-decorators": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz", - "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=", - "dev": true - }, - "babel-plugin-syntax-do-expressions": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz", - "integrity": "sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0=", - "dev": true - }, - "babel-plugin-syntax-dynamic-import": { - "version": "6.18.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", - "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=", - "dev": true - }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", - "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", - "dev": true - }, - "babel-plugin-syntax-export-extensions": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz", - "integrity": "sha1-cKFITw+QiaToStRLrDU8lbmxJyE=", - "dev": true - }, - "babel-plugin-syntax-flow": { - "version": "6.18.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", - "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=", - "dev": true - }, - "babel-plugin-syntax-function-bind": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz", - "integrity": "sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y=", - "dev": true - }, - "babel-plugin-syntax-jsx": { - "version": "6.18.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", - "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=", - "dev": true - }, - "babel-plugin-syntax-object-rest-spread": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", - "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", - "dev": true - }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", - "dev": true - }, - "babel-plugin-transform-async-generator-functions": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz", - "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=", + "@babel/plugin-transform-react-display-name": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz", + "integrity": "sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A==", "dev": true, "requires": { - "babel-helper-remap-async-to-generator": "6.24.1", - "babel-plugin-syntax-async-generators": "6.13.0", - "babel-runtime": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", - "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "@babel/plugin-transform-react-jsx": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.3.0.tgz", + "integrity": "sha512-a/+aRb7R06WcKvQLOu4/TpjKOdvVEKRLWFpKcNuHhiREPgGRB4TQJxq07+EZLS8LFVYpfq1a5lDUnuMdcCpBKg==", "dev": true, "requires": { - "babel-helper-remap-async-to-generator": "6.24.1", - "babel-plugin-syntax-async-functions": "6.13.0", - "babel-runtime": "6.26.0" + "@babel/helper-builder-react-jsx": "7.3.0", + "@babel/helper-plugin-utils": "7.0.0", + "@babel/plugin-syntax-jsx": "7.2.0" } }, - "babel-plugin-transform-class-constructor-call": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz", - "integrity": "sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk=", + "@babel/plugin-transform-react-jsx-self": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.2.0.tgz", + "integrity": "sha512-v6S5L/myicZEy+jr6ielB0OR8h+EH/1QFx/YJ7c7Ua+7lqsjj/vW6fD5FR9hB/6y7mGbfT4vAURn3xqBxsUcdg==", "dev": true, "requires": { - "babel-plugin-syntax-class-constructor-call": "6.18.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/plugin-syntax-jsx": "7.2.0" } }, - "babel-plugin-transform-class-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", - "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", + "@babel/plugin-transform-react-jsx-source": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.2.0.tgz", + "integrity": "sha512-A32OkKTp4i5U6aE88GwwcuV4HAprUgHcTq0sSafLxjr6AW0QahrCRCjxogkbbcdtpbXkuTOlgpjophCxb6sh5g==", "dev": true, "requires": { - "babel-helper-function-name": "6.24.1", - "babel-plugin-syntax-class-properties": "6.13.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/plugin-syntax-jsx": "7.2.0" } }, - "babel-plugin-transform-decorators": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz", - "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=", + "@babel/plugin-transform-regenerator": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.4.tgz", + "integrity": "sha512-Zz3w+pX1SI0KMIiqshFZkwnVGUhDZzpX2vtPzfJBKQQq8WsP/Xy9DNdELWivxcKOCX/Pywge4SiEaPaLtoDT4g==", "dev": true, "requires": { - "babel-helper-explode-class": "6.24.1", - "babel-plugin-syntax-decorators": "6.13.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-types": "6.26.0" + "regenerator-transform": "0.13.4" } }, - "babel-plugin-transform-do-expressions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz", - "integrity": "sha1-KMyvkoEtlJws0SgfaQyP3EaK6bs=", + "@babel/plugin-transform-reserved-words": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz", + "integrity": "sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw==", "dev": true, "requires": { - "babel-plugin-syntax-do-expressions": "6.13.0", - "babel-runtime": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "@babel/plugin-transform-shorthand-properties": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz", + "integrity": "sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg==", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "@babel/plugin-transform-spread": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz", + "integrity": "sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w==", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "@babel/plugin-transform-sticky-regex": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz", + "integrity": "sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.11" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/helper-regex": "7.4.4" } }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "@babel/plugin-transform-template-literals": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz", + "integrity": "sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g==", "dev": true, "requires": { - "babel-helper-define-map": "6.26.0", - "babel-helper-function-name": "6.24.1", - "babel-helper-optimise-call-expression": "6.24.1", - "babel-helper-replace-supers": "6.24.1", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-annotate-as-pure": "7.0.0", + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "@babel/plugin-transform-typeof-symbol": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz", + "integrity": "sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0" } }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "@babel/plugin-transform-unicode-regex": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz", + "integrity": "sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA==", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/helper-regex": "7.4.4", + "regexpu-core": "4.5.4" } }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", - "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "@babel/preset-env": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.4.4.tgz", + "integrity": "sha512-FU1H+ACWqZZqfw1x2G1tgtSSYSfxJLkpaUQL37CenULFARDo+h4xJoVHzRoHbK+85ViLciuI7ME4WTIhFRBBlw==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "@babel/helper-module-imports": "7.0.0", + "@babel/helper-plugin-utils": "7.0.0", + "@babel/plugin-proposal-async-generator-functions": "7.2.0", + "@babel/plugin-proposal-json-strings": "7.2.0", + "@babel/plugin-proposal-object-rest-spread": "7.4.4", + "@babel/plugin-proposal-optional-catch-binding": "7.2.0", + "@babel/plugin-proposal-unicode-property-regex": "7.4.4", + "@babel/plugin-syntax-async-generators": "7.2.0", + "@babel/plugin-syntax-json-strings": "7.2.0", + "@babel/plugin-syntax-object-rest-spread": "7.2.0", + "@babel/plugin-syntax-optional-catch-binding": "7.2.0", + "@babel/plugin-transform-arrow-functions": "7.2.0", + "@babel/plugin-transform-async-to-generator": "7.4.4", + "@babel/plugin-transform-block-scoped-functions": "7.2.0", + "@babel/plugin-transform-block-scoping": "7.4.4", + "@babel/plugin-transform-classes": "7.4.4", + "@babel/plugin-transform-computed-properties": "7.2.0", + "@babel/plugin-transform-destructuring": "7.4.4", + "@babel/plugin-transform-dotall-regex": "7.4.4", + "@babel/plugin-transform-duplicate-keys": "7.2.0", + "@babel/plugin-transform-exponentiation-operator": "7.2.0", + "@babel/plugin-transform-for-of": "7.4.4", + "@babel/plugin-transform-function-name": "7.4.4", + "@babel/plugin-transform-literals": "7.2.0", + "@babel/plugin-transform-member-expression-literals": "7.2.0", + "@babel/plugin-transform-modules-amd": "7.2.0", + "@babel/plugin-transform-modules-commonjs": "7.4.4", + "@babel/plugin-transform-modules-systemjs": "7.4.4", + "@babel/plugin-transform-modules-umd": "7.2.0", + "@babel/plugin-transform-named-capturing-groups-regex": "7.4.4", + "@babel/plugin-transform-new-target": "7.4.4", + "@babel/plugin-transform-object-super": "7.2.0", + "@babel/plugin-transform-parameters": "7.4.4", + "@babel/plugin-transform-property-literals": "7.2.0", + "@babel/plugin-transform-regenerator": "7.4.4", + "@babel/plugin-transform-reserved-words": "7.2.0", + "@babel/plugin-transform-shorthand-properties": "7.2.0", + "@babel/plugin-transform-spread": "7.2.2", + "@babel/plugin-transform-sticky-regex": "7.2.0", + "@babel/plugin-transform-template-literals": "7.4.4", + "@babel/plugin-transform-typeof-symbol": "7.2.0", + "@babel/plugin-transform-unicode-regex": "7.4.4", + "@babel/types": "7.4.4", + "browserslist": "4.6.0", + "core-js-compat": "3.0.1", + "invariant": "2.2.4", + "js-levenshtein": "1.1.6", + "semver": "5.7.0" } }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "@babel/preset-react": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.0.0.tgz", + "integrity": "sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w==", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "@babel/helper-plugin-utils": "7.0.0", + "@babel/plugin-transform-react-display-name": "7.2.0", + "@babel/plugin-transform-react-jsx": "7.3.0", + "@babel/plugin-transform-react-jsx-self": "7.2.0", + "@babel/plugin-transform-react-jsx-source": "7.2.0" } }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "@babel/preset-stage-0": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/preset-stage-0/-/preset-stage-0-7.0.0.tgz", + "integrity": "sha512-FBMd0IiARPtH5aaOFUVki6evHiJQiY0pFy7fizyRF7dtwc+el3nwpzvhb9qBNzceG1OIJModG1xpE0DDFjPXwA==", + "dev": true + }, + "@babel/runtime": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.4.tgz", + "integrity": "sha512-w0+uT71b6Yi7i5SE0co4NioIpSYS6lLiXvCzWzGSKvpK5vdQtCbICHMj+gbAKAOtxiV6HsVh/MBdaF9EQ6faSg==", "dev": true, "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "regenerator-runtime": "0.13.2" } }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "@babel/template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", + "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "@babel/code-frame": "7.0.0", + "@babel/parser": "7.4.4", + "@babel/types": "7.4.4" } }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", - "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "@babel/traverse": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz", + "integrity": "sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A==", "dev": true, "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "@babel/code-frame": "7.0.0", + "@babel/generator": "7.4.4", + "@babel/helper-function-name": "7.1.0", + "@babel/helper-split-export-declaration": "7.4.4", + "@babel/parser": "7.4.4", + "@babel/types": "7.4.4", + "debug": "4.1.1", + "globals": "11.12.0", + "lodash": "4.17.11" } }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "@babel/types": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", + "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", "dev": true, "requires": { - "babel-plugin-transform-strict-mode": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-types": "6.26.0" + "esutils": "2.0.2", + "lodash": "4.17.11", + "to-fast-properties": "2.0.0" } }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", - "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" - } + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", - "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", "dev": true, "requires": { - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "mime-types": "2.1.24", + "negotiator": "0.6.2" } }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", - "dev": true, - "requires": { - "babel-helper-replace-supers": "6.24.1", - "babel-runtime": "6.26.0" - } + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "acorn-dynamic-import": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", + "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=", "dev": true, "requires": { - "babel-helper-call-delegate": "6.24.1", - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "acorn": "4.0.13" + }, + "dependencies": { + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + } } }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" } }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } + "ajv-keywords": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.0.tgz", + "integrity": "sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw==", + "dev": true }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, "requires": { - "babel-helper-regex": "6.26.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" } }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } + "alphanum-sort": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", + "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", + "dev": true }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", - "dev": true, - "requires": { - "babel-helper-regex": "6.26.0", - "babel-runtime": "6.26.0", - "regexpu-core": "2.0.0" - } + "ansi-html": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", + "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=", + "dev": true }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", - "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", - "dev": true, - "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "6.24.1", - "babel-plugin-syntax-exponentiation-operator": "6.13.0", - "babel-runtime": "6.26.0" - } + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true }, - "babel-plugin-transform-export-extensions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz", - "integrity": "sha1-U3OLR+deghhYnuqUbLvTkQm75lM=", + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "babel-plugin-syntax-export-extensions": "6.13.0", - "babel-runtime": "6.26.0" + "color-convert": "1.9.3" } }, - "babel-plugin-transform-flow-strip-types": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", - "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", "dev": true, + "optional": true, "requires": { - "babel-plugin-syntax-flow": "6.18.0", - "babel-runtime": "6.26.0" + "micromatch": "2.3.11", + "normalize-path": "2.1.1" } }, - "babel-plugin-transform-function-bind": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz", - "integrity": "sha1-xvuOlqwpajELjPjqQBRiQH3fapc=", - "dev": true, - "requires": { - "babel-plugin-syntax-function-bind": "6.13.0", - "babel-runtime": "6.26.0" - } + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true }, - "babel-plugin-transform-object-rest-spread": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", - "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "requires": { - "babel-plugin-syntax-object-rest-spread": "6.13.0", - "babel-runtime": "6.26.0" + "delegates": "1.0.0", + "readable-stream": "2.3.6" } }, - "babel-plugin-transform-react-display-name": { - "version": "6.25.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz", - "integrity": "sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE=", + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "sprintf-js": "1.0.3" } }, - "babel-plugin-transform-react-jsx": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz", - "integrity": "sha1-hAoCjn30YN/DotKfDA2R9jduZqM=", + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "dev": true, + "optional": true, "requires": { - "babel-helper-builder-react-jsx": "6.26.0", - "babel-plugin-syntax-jsx": "6.18.0", - "babel-runtime": "6.26.0" + "arr-flatten": "1.1.0" } }, - "babel-plugin-transform-react-jsx-self": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz", - "integrity": "sha1-322AqdomEqEh5t3XVYvL7PBuY24=", - "dev": true, - "requires": { - "babel-plugin-syntax-jsx": "6.18.0", - "babel-runtime": "6.26.0" - } + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true }, - "babel-plugin-transform-react-jsx-source": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz", - "integrity": "sha1-ZqwSFT9c0tF7PBkmj0vwGX9E7NY=", - "dev": true, - "requires": { - "babel-plugin-syntax-jsx": "6.18.0", - "babel-runtime": "6.26.0" - } + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true }, - "babel-plugin-transform-regenerator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", - "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", - "dev": true, - "requires": { - "regenerator-transform": "0.10.1" - } + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true }, - "babel-plugin-transform-runtime": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz", - "integrity": "sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } + "array-flatten": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", + "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", + "dev": true }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "define-properties": "1.1.3", + "es-abstract": "1.13.0" } }, - "babel-preset-es2015": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", - "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoping": "6.26.0", - "babel-plugin-transform-es2015-classes": "6.24.1", - "babel-plugin-transform-es2015-computed-properties": "6.24.1", - "babel-plugin-transform-es2015-destructuring": "6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", - "babel-plugin-transform-es2015-for-of": "6.23.0", - "babel-plugin-transform-es2015-function-name": "6.24.1", - "babel-plugin-transform-es2015-literals": "6.22.0", - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", - "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", - "babel-plugin-transform-es2015-modules-umd": "6.24.1", - "babel-plugin-transform-es2015-object-super": "6.24.1", - "babel-plugin-transform-es2015-parameters": "6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", - "babel-plugin-transform-es2015-spread": "6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "6.24.1", - "babel-plugin-transform-es2015-template-literals": "6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "6.24.1", - "babel-plugin-transform-regenerator": "6.26.0" - } - }, - "babel-preset-flow": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz", - "integrity": "sha1-5xIYiHCFrpoktb5Baa/7WZgWxJ0=", + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { - "babel-plugin-transform-flow-strip-types": "6.22.0" + "array-uniq": "1.0.3" } }, - "babel-preset-react": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.24.1.tgz", - "integrity": "sha1-umnfrqRfw+xjm2pOzqbhdwLJE4A=", - "dev": true, - "requires": { - "babel-plugin-syntax-jsx": "6.18.0", - "babel-plugin-transform-react-display-name": "6.25.0", - "babel-plugin-transform-react-jsx": "6.24.1", - "babel-plugin-transform-react-jsx-self": "6.22.0", - "babel-plugin-transform-react-jsx-source": "6.22.0", - "babel-preset-flow": "6.23.0" - } + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true }, - "babel-preset-stage-0": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz", - "integrity": "sha1-VkLRUEL5E4TX5a+LyIsduVsDnmo=", + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", "dev": true, - "requires": { - "babel-plugin-transform-do-expressions": "6.22.0", - "babel-plugin-transform-function-bind": "6.22.0", - "babel-preset-stage-1": "6.24.1" - } + "optional": true }, - "babel-preset-stage-1": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz", - "integrity": "sha1-dpLNfc1oSZB+auSgqFWJz7niv7A=", + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "dev": true, "requires": { - "babel-plugin-transform-class-constructor-call": "6.24.1", - "babel-plugin-transform-export-extensions": "6.22.0", - "babel-preset-stage-2": "6.24.1" + "safer-buffer": "2.1.2" } }, - "babel-preset-stage-2": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz", - "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=", + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "requires": { - "babel-plugin-syntax-dynamic-import": "6.18.0", - "babel-plugin-transform-class-properties": "6.24.1", - "babel-plugin-transform-decorators": "6.24.1", - "babel-preset-stage-3": "6.24.1" + "bn.js": "4.11.8", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" } }, - "babel-preset-stage-3": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz", - "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=", + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", "dev": true, "requires": { - "babel-plugin-syntax-trailing-function-commas": "6.22.0", - "babel-plugin-transform-async-generator-functions": "6.24.1", - "babel-plugin-transform-async-to-generator": "6.24.1", - "babel-plugin-transform-exponentiation-operator": "6.24.1", - "babel-plugin-transform-object-rest-spread": "6.26.0" + "object-assign": "4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } } }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "dev": true, + "requires": { + "lodash": "4.17.11" + } + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "async-foreach": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", + "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "autoprefixer": { + "version": "6.7.7", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-6.7.7.tgz", + "integrity": "sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ=", + "dev": true, + "requires": { + "browserslist": "1.7.7", + "caniuse-db": "1.0.30000969", + "normalize-range": "0.1.2", + "num2fraction": "1.2.2", + "postcss": "5.2.18", + "postcss-value-parser": "3.3.1" + }, + "dependencies": { + "browserslist": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "1.0.30000969", + "electron-to-chromium": "1.3.134" + } + } + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "babel-cli": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", + "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", + "dev": true, + "requires": { + "babel-core": "6.26.3", + "babel-polyfill": "6.26.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "chokidar": "1.7.0", + "commander": "2.20.0", + "convert-source-map": "1.6.0", + "fs-readdir-recursive": "1.1.0", + "glob": "7.1.4", + "lodash": "4.17.11", + "output-file-sync": "1.1.2", + "path-is-absolute": "1.0.1", + "slash": "1.0.0", + "source-map": "0.5.7", + "v8flags": "2.1.1" + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-generator": "6.26.1", + "babel-helpers": "6.24.1", + "babel-messages": "6.23.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "convert-source-map": "1.6.0", + "debug": "2.6.9", + "json5": "0.5.1", + "lodash": "4.17.11", + "minimatch": "3.0.4", + "path-is-absolute": "1.0.1", + "private": "0.1.8", + "slash": "1.0.0", + "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.11", + "source-map": "0.5.7", + "trim-right": "1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + } + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-loader": { + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.6.tgz", + "integrity": "sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw==", + "dev": true, + "requires": { + "find-cache-dir": "2.1.0", + "loader-utils": "1.2.3", + "mkdirp": "0.5.1", + "pify": "4.0.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "core-js": "2.6.5", + "regenerator-runtime": "0.10.5" + }, + "dependencies": { + "core-js": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", + "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + } + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", "dev": true, "requires": { "babel-core": "6.26.3", "babel-runtime": "6.26.0", - "core-js": "2.6.0", + "core-js": "2.6.5", "home-or-tmp": "2.0.0", "lodash": "4.17.11", "mkdirp": "0.5.1", "source-map-support": "0.4.18" + }, + "dependencies": { + "core-js": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", + "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", + "dev": true + } } }, "babel-runtime": { @@ -1489,8 +1408,22 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "2.6.0", + "core-js": "2.6.5", "regenerator-runtime": "0.11.1" + }, + "dependencies": { + "core-js": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", + "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + } } }, "babel-template": { @@ -1521,6 +1454,29 @@ "globals": "9.18.0", "invariant": "2.2.4", "lodash": "4.17.11" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "babel-types": { @@ -1533,10 +1489,18 @@ "esutils": "2.0.2", "lodash": "4.17.11", "to-fast-properties": "1.0.3" - } - }, - "babylon": { - "version": "6.18.0", + }, + "dependencies": { + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + } + } + }, + "babylon": { + "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "dev": true @@ -1555,7 +1519,7 @@ "requires": { "cache-base": "1.0.1", "class-utils": "0.3.6", - "component-emitter": "1.2.1", + "component-emitter": "1.3.0", "define-property": "1.0.0", "isobject": "3.0.1", "mixin-deep": "1.3.1", @@ -1636,15 +1600,15 @@ } }, "big.js": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, "binary-extensions": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", - "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", "dev": true }, "block-stream": { @@ -1683,9 +1647,18 @@ "on-finished": "2.3.0", "qs": "6.5.2", "raw-body": "2.3.3", - "type-is": "1.6.16" + "type-is": "1.6.18" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "iconv-lite": { "version": "0.4.23", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", @@ -1694,6 +1667,12 @@ "requires": { "safer-buffer": "2.1.2" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -1726,6 +1705,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "dev": true, + "optional": true, "requires": { "expand-range": "1.8.2", "preserve": "0.2.0", @@ -1740,7 +1720,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -1777,12 +1757,12 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { "bn.js": "4.11.8", - "randombytes": "2.0.6" + "randombytes": "2.1.0" } }, "browserify-sign": { @@ -1797,7 +1777,7 @@ "create-hmac": "1.1.7", "elliptic": "6.4.1", "inherits": "2.0.3", - "parse-asn1": "5.1.1" + "parse-asn1": "5.1.4" } }, "browserify-zlib": { @@ -1806,27 +1786,28 @@ "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, "requires": { - "pako": "1.0.7" + "pako": "1.0.10" } }, "browserslist": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", - "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.0.tgz", + "integrity": "sha512-Jk0YFwXBuMOOol8n6FhgkDzn3mY9PYLYGk29zybF05SbRTsMgPqmTNeQQhOghCxq5oFqAXE3u4sYddr4C0uRhg==", "dev": true, "requires": { - "caniuse-db": "1.0.30000914", - "electron-to-chromium": "1.3.88" + "caniuse-lite": "1.0.30000969", + "electron-to-chromium": "1.3.134", + "node-releases": "1.1.19" } }, "buffer": { "version": "4.9.1", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { "base64-js": "1.3.0", - "ieee754": "1.1.12", + "ieee754": "1.1.13", "isarray": "1.0.0" } }, @@ -1848,12 +1829,6 @@ "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", "dev": true }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, "builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", @@ -1881,26 +1856,10 @@ "mkdirp": "0.5.1", "move-concurrently": "1.0.1", "promise-inflight": "1.0.1", - "rimraf": "2.6.2", + "rimraf": "2.6.3", "ssri": "5.3.0", "unique-filename": "1.1.1", "y18n": "4.0.0" - }, - "dependencies": { - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - } } }, "cache-base": { @@ -1910,7 +1869,7 @@ "dev": true, "requires": { "collection-visit": "1.0.0", - "component-emitter": "1.2.1", + "component-emitter": "1.3.0", "get-value": "2.0.6", "has-value": "1.0.0", "isobject": "3.0.1", @@ -1929,11 +1888,21 @@ } }, "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", "dev": true }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "2.1.1", + "map-obj": "1.0.1" + } + }, "caniuse-api": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-1.6.1.tgz", @@ -1941,15 +1910,33 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000914", + "caniuse-db": "1.0.30000969", "lodash.memoize": "4.1.2", "lodash.uniq": "4.5.0" + }, + "dependencies": { + "browserslist": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "1.0.30000969", + "electron-to-chromium": "1.3.134" + } + } } }, "caniuse-db": { - "version": "1.0.30000914", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000914.tgz", - "integrity": "sha512-UbjlrZOQowyqrPwFKFPZ4M7LngssN5FyWpvzuFKYiQoZD8J+bPYU4s0rSiKPTzFzDYNEP9w5E5+MQj3+TqW+gA==", + "version": "1.0.30000969", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000969.tgz", + "integrity": "sha512-ttrmwpIXvEL/kg0JSg6Q+xEbMxAEcjZOOgZMGPcMe5JMYgi20Nvs9bqMRGfyIOQtd1jYa6yRWODIR6apj3xPQw==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30000969", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000969.tgz", + "integrity": "sha512-Kus0yxkoAJgVc0bax7S4gLSlFifCa7MnSZL9p9VuS/HIKEL4seaqh28KIQAAO50cD/rJ5CiJkJFapkdDAlhFxQ==", "dev": true }, "caseless": { @@ -1969,135 +1956,32 @@ } }, "chalk": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { - "ansi-styles": "2.2.1", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "supports-color": "5.5.0" } }, "chokidar": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz", - "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", "dev": true, + "optional": true, "requires": { - "anymatch": "2.0.0", - "async-each": "1.0.1", - "braces": "2.3.2", - "fsevents": "1.2.4", - "glob-parent": "3.1.0", + "anymatch": "1.3.2", + "async-each": "1.0.3", + "fsevents": "1.2.9", + "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", - "is-glob": "4.0.0", - "lodash.debounce": "4.0.8", - "normalize-path": "2.1.1", + "is-glob": "2.0.1", "path-is-absolute": "1.0.1", - "readdirp": "2.2.1", - "upath": "1.1.0" - }, - "dependencies": { - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.3", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - } - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } + "readdirp": "2.2.1" } }, "chownr": { @@ -2129,6 +2013,33 @@ "dev": true, "requires": { "chalk": "1.1.3" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } } }, "class-utils": { @@ -2239,7 +2150,7 @@ }, "color": { "version": "0.11.4", - "resolved": "http://registry.npmjs.org/color/-/color-0.11.4.tgz", + "resolved": "https://registry.npmjs.org/color/-/color-0.11.4.tgz", "integrity": "sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q=", "dev": true, "requires": { @@ -2265,7 +2176,7 @@ }, "color-string": { "version": "0.3.0", - "resolved": "http://registry.npmjs.org/color-string/-/color-string-0.3.0.tgz", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-0.3.0.tgz", "integrity": "sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE=", "dev": true, "requires": { @@ -2285,19 +2196,25 @@ }, "colors": { "version": "1.1.2", - "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", "dev": true }, "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { "delayed-stream": "1.0.0" } }, + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -2311,33 +2228,50 @@ "dev": true }, "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "compressible": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.15.tgz", - "integrity": "sha512-4aE67DL33dSW9gw4CI2H/yTxqHLNcxp0yS6jB+4h+wr3e43+1z7vm0HU9qXOH8j+qjKuL8+UtkOxYQSMq60Ylw==", + "version": "2.0.17", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz", + "integrity": "sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw==", "dev": true, "requires": { - "mime-db": "1.37.0" + "mime-db": "1.40.0" } }, "compression": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz", - "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", "dev": true, "requires": { - "accepts": "1.3.5", + "accepts": "1.3.7", "bytes": "3.0.0", - "compressible": "2.0.15", + "compressible": "2.0.17", "debug": "2.6.9", - "on-headers": "1.0.1", + "on-headers": "1.0.2", "safe-buffer": "5.1.2", "vary": "1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "concat-map": { @@ -2359,9 +2293,9 @@ } }, "connect-history-api-fallback": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz", - "integrity": "sha1-sGhzk0vF40T+9hGhlqb6rgruAVo=", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", + "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", "dev": true }, "console-browserify": { @@ -2428,7 +2362,7 @@ "fs-write-stream-atomic": "1.0.10", "iferr": "0.1.5", "mkdirp": "0.5.1", - "rimraf": "2.6.2", + "rimraf": "2.6.3", "run-queue": "1.0.3" } }, @@ -2454,12 +2388,6 @@ "serialize-javascript": "1.7.0" }, "dependencies": { - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, "find-cache-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", @@ -2495,30 +2423,53 @@ "is-extglob": "2.1.1" } }, - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "minimist": "1.2.0" + "p-locate": "2.0.0", + "path-exists": "3.0.0" } }, - "loader-utils": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", - "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { - "big.js": "5.2.2", - "emojis-list": "2.1.0", - "json5": "1.0.1" + "pify": "3.0.0" } }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.3.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, "pkg-dir": { @@ -2533,9 +2484,35 @@ } }, "core-js": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.0.tgz", - "integrity": "sha512-kLRC6ncVpuEW/1kwrOXYX6KQASCVtrh1gQr/UiaVgFlf9WE5Vp+lNe5+h3LuMr5PAucWnnEXwH0nQHRH/gpGtw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.0.1.tgz", + "integrity": "sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew==", + "dev": true + }, + "core-js-compat": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.0.1.tgz", + "integrity": "sha512-2pC3e+Ht/1/gD7Sim/sqzvRplMiRnFQVlPpDVaHtY9l7zZP7knamr3VRD6NyGfHd84MrDC0tAM9ulNxYMW0T3g==", + "dev": true, + "requires": { + "browserslist": "4.6.0", + "core-js": "3.0.1", + "core-js-pure": "3.0.1", + "semver": "6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==", + "dev": true + } + } + }, + "core-js-pure": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.0.1.tgz", + "integrity": "sha512-mSxeQ6IghKW3MoyF4cz19GJ1cMm7761ON+WObSyLfTu/Jn3x7w4NwNFnrZxgl4MTSvYYepVLNuRtlB4loMwJ5g==", "dev": true }, "core-util-is": { @@ -2556,7 +2533,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -2569,7 +2546,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -2581,6 +2558,16 @@ "sha.js": "2.4.11" } }, + "cross-spawn": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", + "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", + "dev": true, + "requires": { + "lru-cache": "4.1.5", + "which": "1.3.1" + } + }, "crypto-browserify": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", @@ -2596,19 +2583,19 @@ "inherits": "2.0.3", "pbkdf2": "3.0.17", "public-encrypt": "4.0.3", - "randombytes": "2.0.6", + "randombytes": "2.1.0", "randomfill": "1.0.4" } }, "css-color-names": { "version": "0.0.4", - "resolved": "http://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", "dev": true }, "css-loader": { "version": "0.28.11", - "resolved": "http://registry.npmjs.org/css-loader/-/css-loader-0.28.11.tgz", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.28.11.tgz", "integrity": "sha512-wovHgjAx8ZIMGSL8pTys7edA1ClmzxHeY6n/d97gg5odgsxEgKjULPR0viqyC+FWMCL9sfqoC/QCUBo62tLvPg==", "dev": true, "requires": { @@ -2616,7 +2603,7 @@ "css-selector-tokenizer": "0.7.1", "cssnano": "3.10.0", "icss-utils": "2.1.0", - "loader-utils": "1.1.0", + "loader-utils": "1.2.3", "lodash.camelcase": "4.3.0", "object-assign": "4.1.1", "postcss": "5.2.18", @@ -2626,19 +2613,6 @@ "postcss-modules-values": "1.3.0", "postcss-value-parser": "3.3.1", "source-list-map": "2.0.1" - }, - "dependencies": { - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" - } - } } }, "css-selector-tokenizer": { @@ -2652,9 +2626,15 @@ "regexpu-core": "1.0.0" }, "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, "regexpu-core": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", "dev": true, "requires": { @@ -2662,18 +2642,33 @@ "regjsgen": "0.2.0", "regjsparser": "0.1.5" } - } - } - }, - "cssesc": { - "version": "0.1.0", + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "0.5.0" + } + } + } + }, + "cssesc": { + "version": "0.1.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-0.1.0.tgz", "integrity": "sha1-yBSQPkViM3GgR3tAEJqq++6t27Q=", "dev": true }, "cssnano": { "version": "3.10.0", - "resolved": "http://registry.npmjs.org/cssnano/-/cssnano-3.10.0.tgz", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-3.10.0.tgz", "integrity": "sha1-Tzj2zqK5sX+gFJDyPx3GjqZcHDg=", "dev": true, "requires": { @@ -2738,11 +2733,11 @@ }, "d": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/d/-/d-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { - "es5-ext": "0.10.46" + "es5-ext": "0.10.50" } }, "dashdash": { @@ -2761,12 +2756,12 @@ "dev": true }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "2.1.1" } }, "decamelize": { @@ -2793,7 +2788,7 @@ "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { - "object-keys": "1.0.12" + "object-keys": "1.1.1" } }, "define-property": { @@ -2866,17 +2861,17 @@ "is-path-in-cwd": "1.0.1", "p-map": "1.2.0", "pify": "3.0.0", - "rimraf": "2.6.2" + "rimraf": "2.6.3" }, "dependencies": { "globby": { "version": "6.1.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { "array-union": "1.0.2", - "glob": "7.1.1", + "glob": "7.1.4", "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1" @@ -2884,11 +2879,17 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true } } }, @@ -2943,13 +2944,13 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { "bn.js": "4.11.8", "miller-rabin": "4.0.1", - "randombytes": "2.0.6" + "randombytes": "2.1.0" } }, "dir-glob": { @@ -3021,9 +3022,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.88", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.88.tgz", - "integrity": "sha512-UPV4NuQMKeUh1S0OWRvwg0PI8ASHN9kBC8yDTk1ROXLC85W5GnhTRu/MZu3Teqx3JjlQYuckuHYXSUSgtb3J+A==", + "version": "1.3.134", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.134.tgz", + "integrity": "sha512-C3uK2SrtWg/gSWaluLHWSHjyebVZCe4ZC0NVgTAoTq8tCR9FareRK5T7R7AS/nPZShtlEcjVMX1kQ8wi4nU68w==", "dev": true }, "elliptic": { @@ -3102,16 +3103,17 @@ } }, "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", "dev": true, "requires": { "es-to-primitive": "1.2.0", "function-bind": "1.1.1", "has": "1.0.3", "is-callable": "1.1.4", - "is-regex": "1.0.4" + "is-regex": "1.0.4", + "object-keys": "1.1.1" } }, "es-to-primitive": { @@ -3126,9 +3128,9 @@ } }, "es5-ext": { - "version": "0.10.46", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.46.tgz", - "integrity": "sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw==", + "version": "0.10.50", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", + "integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", "dev": true, "requires": { "es6-iterator": "2.0.3", @@ -3143,7 +3145,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.46", + "es5-ext": "0.10.50", "es6-symbol": "3.1.1" } }, @@ -3154,7 +3156,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.46", + "es5-ext": "0.10.50", "es6-iterator": "2.0.3", "es6-set": "0.1.5", "es6-symbol": "3.1.1", @@ -3168,7 +3170,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.46", + "es5-ext": "0.10.50", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1", "event-emitter": "0.3.5" @@ -3181,7 +3183,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.46" + "es5-ext": "0.10.50" } }, "es6-weak-map": { @@ -3191,7 +3193,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.46", + "es5-ext": "0.10.50", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1" } @@ -3260,19 +3262,19 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.46" + "es5-ext": "0.10.50" } }, "eventemitter3": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", - "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", "dev": true }, "events": { - "version": "1.1.1", - "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", + "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==", "dev": true }, "eventsource": { @@ -3327,15 +3329,17 @@ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "dev": true, + "optional": true, "requires": { "is-posix-bracket": "0.1.1" } }, "expand-range": { "version": "1.8.2", - "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, + "optional": true, "requires": { "fill-range": "2.2.4" } @@ -3346,7 +3350,7 @@ "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", "dev": true, "requires": { - "accepts": "1.3.5", + "accepts": "1.3.7", "array-flatten": "1.1.1", "body-parser": "1.18.3", "content-disposition": "0.5.2", @@ -3363,26 +3367,41 @@ "merge-descriptors": "1.0.1", "methods": "1.1.2", "on-finished": "2.3.0", - "parseurl": "1.3.2", + "parseurl": "1.3.3", "path-to-regexp": "0.1.7", - "proxy-addr": "2.0.4", + "proxy-addr": "2.0.5", "qs": "6.5.2", - "range-parser": "1.2.0", + "range-parser": "1.2.1", "safe-buffer": "5.1.2", "send": "0.16.2", "serve-static": "1.13.2", "setprototypeof": "1.1.0", "statuses": "1.4.0", - "type-is": "1.6.16", + "type-is": "1.6.18", "utils-merge": "1.0.1", "vary": "1.1.2" }, "dependencies": { "array-flatten": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -3418,6 +3437,7 @@ "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "dev": true, + "optional": true, "requires": { "is-extglob": "1.0.0" } @@ -3428,23 +3448,10 @@ "integrity": "sha512-bt/LZ4m5Rqt/Crl2HiKuAl/oqg0psx1tsTLkvWbJen1CtD+fftkZhMaQ9HOtY2gWsl2Wq+sABmMVi9z3DhKWQQ==", "dev": true, "requires": { - "async": "2.6.1", - "loader-utils": "1.1.0", + "async": "2.6.2", + "loader-utils": "1.2.3", "schema-utils": "0.3.0", "webpack-sources": "1.3.0" - }, - "dependencies": { - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" - } - } } }, "extsprintf": { @@ -3454,9 +3461,9 @@ "dev": true }, "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", "dev": true }, "fast-json-stable-stringify": { @@ -3497,7 +3504,7 @@ "dependencies": { "core-js": { "version": "1.2.7", - "resolved": "http://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=", "dev": true } @@ -3507,16 +3514,14 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true + "dev": true, + "optional": true }, "filesafe-embed": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/filesafe-embed/-/filesafe-embed-1.0.2.tgz", - "integrity": "sha512-9ggAyALIUokTBTH1+UWvyi37QiLAQ08P9PjYzXV3LbE2um2GrxXtnS9myL+kh4qcffWH9nxWNHf26050Rwg3mg==", - "dev": true, - "requires": { - "filesafe-js": "1.0.3" - } + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filesafe-embed/-/filesafe-embed-1.0.4.tgz", + "integrity": "sha512-qCCm4qbaf08MiXL/GeyS0Q+GMB5mil7TJrkH044QoD2SiPLhNY6YKT0/UJxuvtcgwnbzP+r+sNFtjLtj5k6HEQ==", + "dev": true }, "filesafe-js": { "version": "1.0.3", @@ -3529,6 +3534,7 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", "dev": true, + "optional": true, "requires": { "is-number": "2.1.0", "isobject": "2.1.0", @@ -3539,7 +3545,7 @@ }, "finalhandler": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "dev": true, "requires": { @@ -3547,20 +3553,37 @@ "encodeurl": "1.0.2", "escape-html": "1.0.3", "on-finished": "2.3.0", - "parseurl": "1.3.2", + "parseurl": "1.3.3", "statuses": "1.4.0", "unpipe": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "find-cache-dir": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", - "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", "dev": true, "requires": { "commondir": "1.0.1", - "mkdirp": "0.5.1", - "pkg-dir": "1.0.0" + "make-dir": "2.1.0", + "pkg-dir": "3.0.0" } }, "find-parent-dir": { @@ -3570,13 +3593,12 @@ "dev": true }, "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "locate-path": "3.0.0" } }, "flatten": { @@ -3596,21 +3618,21 @@ } }, "follow-redirects": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz", + "integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==", "dev": true, "requires": { - "debug": "3.1.0" + "debug": "3.2.6" }, "dependencies": { "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "2.1.1" } } } @@ -3626,6 +3648,7 @@ "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "dev": true, + "optional": true, "requires": { "for-in": "1.0.2" } @@ -3643,8 +3666,8 @@ "dev": true, "requires": { "asynckit": "0.4.0", - "combined-stream": "1.0.7", - "mime-types": "2.1.21" + "combined-stream": "1.0.8", + "mime-types": "2.1.24" } }, "forwarded": { @@ -3678,6 +3701,12 @@ "readable-stream": "2.3.6" } }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, "fs-write-stream-atomic": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", @@ -3697,14 +3726,14 @@ "dev": true }, "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", "dev": true, "optional": true, "requires": { - "nan": "2.11.1", - "node-pre-gyp": "0.10.0" + "nan": "2.14.0", + "node-pre-gyp": "0.12.0" }, "dependencies": { "abbrev": { @@ -3725,7 +3754,7 @@ "optional": true }, "are-we-there-yet": { - "version": "1.1.4", + "version": "1.1.5", "bundled": true, "dev": true, "optional": true, @@ -3749,7 +3778,7 @@ } }, "chownr": { - "version": "1.0.1", + "version": "1.1.1", "bundled": true, "dev": true, "optional": true @@ -3776,16 +3805,16 @@ "optional": true }, "debug": { - "version": "2.6.9", + "version": "4.1.1", "bundled": true, "dev": true, "optional": true, "requires": { - "ms": "2.0.0" + "ms": "2.1.1" } }, "deep-extend": { - "version": "0.5.1", + "version": "0.6.0", "bundled": true, "dev": true, "optional": true @@ -3808,7 +3837,7 @@ "dev": true, "optional": true, "requires": { - "minipass": "2.2.4" + "minipass": "2.3.5" } }, "fs.realpath": { @@ -3830,11 +3859,11 @@ "signal-exit": "3.0.2", "string-width": "1.0.2", "strip-ansi": "3.0.1", - "wide-align": "1.1.2" + "wide-align": "1.1.3" } }, "glob": { - "version": "7.1.2", + "version": "7.1.3", "bundled": true, "dev": true, "optional": true, @@ -3854,7 +3883,7 @@ "optional": true }, "iconv-lite": { - "version": "0.4.21", + "version": "0.4.24", "bundled": true, "dev": true, "optional": true, @@ -3920,21 +3949,21 @@ "dev": true }, "minipass": { - "version": "2.2.4", + "version": "2.3.5", "bundled": true, "dev": true, "requires": { - "safe-buffer": "5.1.1", - "yallist": "3.0.2" + "safe-buffer": "5.1.2", + "yallist": "3.0.3" } }, "minizlib": { - "version": "1.1.0", + "version": "1.2.1", "bundled": true, "dev": true, "optional": true, "requires": { - "minipass": "2.2.4" + "minipass": "2.3.5" } }, "mkdirp": { @@ -3946,38 +3975,38 @@ } }, "ms": { - "version": "2.0.0", + "version": "2.1.1", "bundled": true, "dev": true, "optional": true }, "needle": { - "version": "2.2.0", + "version": "2.3.0", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "2.6.9", - "iconv-lite": "0.4.21", + "debug": "4.1.1", + "iconv-lite": "0.4.24", "sax": "1.2.4" } }, "node-pre-gyp": { - "version": "0.10.0", + "version": "0.12.0", "bundled": true, "dev": true, "optional": true, "requires": { "detect-libc": "1.0.3", "mkdirp": "0.5.1", - "needle": "2.2.0", + "needle": "2.3.0", "nopt": "4.0.1", - "npm-packlist": "1.1.10", + "npm-packlist": "1.4.1", "npmlog": "4.1.2", - "rc": "1.2.7", - "rimraf": "2.6.2", - "semver": "5.5.0", - "tar": "4.4.1" + "rc": "1.2.8", + "rimraf": "2.6.3", + "semver": "5.7.0", + "tar": "4.4.8" } }, "nopt": { @@ -3991,19 +4020,19 @@ } }, "npm-bundled": { - "version": "1.0.3", + "version": "1.0.6", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.1.10", + "version": "1.4.1", "bundled": true, "dev": true, "optional": true, "requires": { "ignore-walk": "3.0.1", - "npm-bundled": "1.0.3" + "npm-bundled": "1.0.6" } }, "npmlog": { @@ -4012,7 +4041,7 @@ "dev": true, "optional": true, "requires": { - "are-we-there-yet": "1.1.4", + "are-we-there-yet": "1.1.5", "console-control-strings": "1.1.0", "gauge": "2.7.4", "set-blocking": "2.0.0" @@ -4072,12 +4101,12 @@ "optional": true }, "rc": { - "version": "1.2.7", + "version": "1.2.8", "bundled": true, "dev": true, "optional": true, "requires": { - "deep-extend": "0.5.1", + "deep-extend": "0.6.0", "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" @@ -4101,22 +4130,22 @@ "inherits": "2.0.3", "isarray": "1.0.0", "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", + "safe-buffer": "5.1.2", "string_decoder": "1.1.1", "util-deprecate": "1.0.2" } }, "rimraf": { - "version": "2.6.2", + "version": "2.6.3", "bundled": true, "dev": true, "optional": true, "requires": { - "glob": "7.1.2" + "glob": "7.1.3" } }, "safe-buffer": { - "version": "5.1.1", + "version": "5.1.2", "bundled": true, "dev": true }, @@ -4133,7 +4162,7 @@ "optional": true }, "semver": { - "version": "5.5.0", + "version": "5.7.0", "bundled": true, "dev": true, "optional": true @@ -4166,7 +4195,7 @@ "dev": true, "optional": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "strip-ansi": { @@ -4184,18 +4213,18 @@ "optional": true }, "tar": { - "version": "4.4.1", + "version": "4.4.8", "bundled": true, "dev": true, "optional": true, "requires": { - "chownr": "1.0.1", + "chownr": "1.1.1", "fs-minipass": "1.2.5", - "minipass": "2.2.4", - "minizlib": "1.1.0", + "minipass": "2.3.5", + "minizlib": "1.2.1", "mkdirp": "0.5.1", - "safe-buffer": "5.1.1", - "yallist": "3.0.2" + "safe-buffer": "5.1.2", + "yallist": "3.0.3" } }, "util-deprecate": { @@ -4205,7 +4234,7 @@ "optional": true }, "wide-align": { - "version": "1.1.2", + "version": "1.1.3", "bundled": true, "dev": true, "optional": true, @@ -4219,22 +4248,22 @@ "dev": true }, "yallist": { - "version": "3.0.2", + "version": "3.0.3", "bundled": true, "dev": true } } }, "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", "dev": true, "requires": { "graceful-fs": "4.1.15", "inherits": "2.0.3", "mkdirp": "0.5.1", - "rimraf": "2.6.2" + "rimraf": "2.6.3" } }, "function-bind": { @@ -4282,7 +4311,7 @@ }, "get-stream": { "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, @@ -4302,9 +4331,9 @@ } }, "glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "dev": true, "requires": { "fs.realpath": "1.0.0", @@ -4320,6 +4349,7 @@ "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", "dev": true, + "optional": true, "requires": { "glob-parent": "2.0.0", "is-glob": "2.0.1" @@ -4335,9 +4365,9 @@ } }, "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, "globby": { @@ -4354,19 +4384,11 @@ "slash": "1.0.0" }, "dependencies": { - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true } } }, @@ -4376,7 +4398,7 @@ "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", "dev": true, "requires": { - "glob": "7.1.1", + "glob": "7.1.4", "lodash": "4.17.11", "minimatch": "3.0.4" } @@ -4388,9 +4410,9 @@ "dev": true }, "handle-thing": { - "version": "1.2.5", - "resolved": "http://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", - "integrity": "sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.0.tgz", + "integrity": "sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ==", "dev": true }, "har-schema": { @@ -4405,8 +4427,34 @@ "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "dev": true, "requires": { - "ajv": "6.6.1", + "ajv": "6.10.0", "har-schema": "2.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "dev": true, + "requires": { + "fast-deep-equal": "2.0.1", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.4.1", + "uri-js": "4.2.2" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + } } }, "has": { @@ -4428,9 +4476,9 @@ } }, "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "has-symbols": { @@ -4584,7 +4632,7 @@ }, "http-errors": { "version": "1.6.3", - "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "dev": true, "requires": { @@ -4606,482 +4654,690 @@ "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", "dev": true, "requires": { - "eventemitter3": "3.1.0", - "follow-redirects": "1.5.10", + "eventemitter3": "3.1.2", + "follow-redirects": "1.7.0", "requires-port": "1.0.0" } }, "http-proxy-middleware": { - "version": "0.17.4", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.4.tgz", - "integrity": "sha1-ZC6ISIUdZvCdTxJJEoRtuutBuDM=", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", + "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", "dev": true, "requires": { "http-proxy": "1.17.0", - "is-glob": "3.1.0", + "is-glob": "4.0.1", "lodash": "4.17.11", - "micromatch": "2.3.11" + "micromatch": "3.1.10" }, "dependencies": { - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", "dev": true }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - } - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.15.2" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "husky": { - "version": "0.12.0", - "resolved": "http://registry.npmjs.org/husky/-/husky-0.12.0.tgz", - "integrity": "sha1-OkSSL86AcYAyQsPHUiplgsUFJdw=", - "dev": true, - "requires": { - "find-parent-dir": "0.3.0", - "is-ci": "1.2.1", - "normalize-path": "1.0.0" - }, - "dependencies": { - "normalize-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-1.0.0.tgz", - "integrity": "sha1-MtDkcvkf80VwHBWoMRAY07CpA3k=", + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true - } - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": "2.1.2" - } - }, - "icss-replace-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", - "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", - "dev": true - }, - "icss-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-2.1.0.tgz", - "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", - "dev": true, - "requires": { - "postcss": "6.0.23" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "color-convert": "1.9.3" + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.3", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.5.0" + "ms": "2.0.0" } }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "chalk": "2.4.1", - "source-map": "0.6.1", - "supports-color": "5.5.0" + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } } }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, - "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", - "dev": true - }, - "import-local": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", - "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", - "dev": true, - "requires": { - "pkg-dir": "2.0.0", - "resolve-cwd": "2.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "locate-path": "2.0.0" + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "find-up": "2.1.0" + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } - } - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "in-publish": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", - "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=", - "dev": true - }, - "indexes-of": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", - "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", - "dev": true - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "internal-ip": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-1.2.0.tgz", - "integrity": "sha1-rp+/k7mEh4eF1QqN4bNWlWBYz1w=", - "dev": true, - "requires": { - "meow": "3.7.0" - }, - "dependencies": { - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" + "kind-of": "6.0.2" } }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "repeating": "2.0.1" + "kind-of": "6.0.2" } }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - }, - "meow": { - "version": "3.7.0", - "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.4.0", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" } }, - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" + "is-extglob": "2.1.1" } }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "get-stdin": "4.0.1" + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } } }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.13", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } } }, - "interpret": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", - "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", - "dev": true - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "1.4.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", - "dev": true - }, - "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=", - "dev": true - }, - "is-absolute-url": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", - "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, "requires": { - "binary-extensions": "1.12.0" + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.16.1" } }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-builtin-module": { + "https-browserify": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "1.1.1" - } - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, - "is-ci": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", - "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "husky": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-0.12.0.tgz", + "integrity": "sha1-OkSSL86AcYAyQsPHUiplgsUFJdw=", "dev": true, "requires": { - "ci-info": "1.6.0" + "find-parent-dir": "0.3.0", + "is-ci": "1.2.1", + "normalize-path": "1.0.0" + }, + "dependencies": { + "normalize-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-1.0.0.tgz", + "integrity": "sha1-MtDkcvkf80VwHBWoMRAY07CpA3k=", + "dev": true + } } }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { - "kind-of": "3.2.2" + "safer-buffer": "2.1.2" } }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "icss-replace-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", + "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", "dev": true }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "icss-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-2.1.0.tgz", + "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", "dev": true, "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "postcss": "6.0.23" }, "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "2.4.2", + "source-map": "0.6.1", + "supports-color": "5.5.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", "dev": true }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "2.0.0" - } + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true }, - "is-extglob": { + "import-local": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", + "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", + "dev": true, + "requires": { + "pkg-dir": "2.0.0", + "resolve-cwd": "2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.3.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "2.1.0" + } + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "in-publish": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", + "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "internal-ip": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-1.2.0.tgz", + "integrity": "sha1-rp+/k7mEh4eF1QqN4bNWlWBYz1w=", + "dev": true, + "requires": { + "meow": "3.7.0" + } + }, + "interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", + "dev": true + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "1.4.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "ipaddr.js": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==", + "dev": true + }, + "is-absolute-url": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", + "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "1.13.1" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-ci": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "dev": true, + "requires": { + "ci-info": "1.6.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true, + "optional": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "optional": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", @@ -5119,6 +5375,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "dev": true, + "optional": true, "requires": { "kind-of": "3.2.2" } @@ -5174,13 +5431,15 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true + "dev": true, + "optional": true }, "is-primitive": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true + "dev": true, + "optional": true }, "is-regex": { "version": "1.0.4", @@ -5227,6 +5486,12 @@ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, "is-wsl": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", @@ -5250,6 +5515,7 @@ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", "dev": true, + "optional": true, "requires": { "isarray": "1.0.0" } @@ -5260,7 +5526,7 @@ "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", "dev": true, "requires": { - "node-fetch": "1.6.3", + "node-fetch": "1.7.3", "whatwg-fetch": "3.0.0" } }, @@ -5271,15 +5537,21 @@ "dev": true }, "js-base64": { - "version": "2.4.9", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.9.tgz", - "integrity": "sha512-xcinL3AuDJk7VSzsHgb9DvvIXayBbadtMZ4HFPx8rUszbW1MuNMlwYVC4zzCZ6e1sqZpnNS5ZFYOhXqA39T7LQ==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", + "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==", + "dev": true + }, + "js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", "dev": true }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { @@ -5299,9 +5571,9 @@ "dev": true }, "jsesc": { - "version": "1.3.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, "json-loader": { @@ -5317,9 +5589,9 @@ "dev": true }, "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", "dev": true }, "json-stringify-safe": { @@ -5335,10 +5607,13 @@ "dev": true }, "json5": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", + "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "dev": true, + "requires": { + "minimist": "1.2.0" + } }, "jsprim": { "version": "1.4.1", @@ -5382,40 +5657,63 @@ "invert-kv": "1.0.0" } }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.15", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, "loader-runner": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.1.tgz", - "integrity": "sha512-By6ZFY7ETWOc9RFaAIb23IjJVcM4dvJC/N57nmdz9RSkMXvAXGI7SyVlAw3v8vjtDRlqThgVDVmTnr9fqMlxkw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", "dev": true }, "loader-utils": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", - "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", + "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", "dev": true, "requires": { - "big.js": "3.2.0", + "big.js": "5.2.2", "emojis-list": "2.1.0", - "json5": "0.5.1", - "object-assign": "4.1.1" + "json5": "1.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "1.2.0" + } + } } }, "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { - "p-locate": "2.0.0", + "p-locate": "3.0.0", "path-exists": "3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } } }, "lodash": { @@ -5424,42 +5722,18 @@ "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", - "dev": true - }, "lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", "dev": true }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, - "lodash.mergewith": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", - "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", - "dev": true - }, "lodash.tail": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.tail/-/lodash.tail-4.1.1.tgz", @@ -5490,7 +5764,7 @@ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, "requires": { - "js-tokens": "3.0.2" + "js-tokens": "4.0.0" } }, "loud-rejection": { @@ -5514,12 +5788,13 @@ } }, "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, "requires": { - "pify": "3.0.0" + "pify": "4.0.1", + "semver": "5.7.0" } }, "map-cache": { @@ -5528,6 +5803,12 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -5544,10 +5825,11 @@ "dev": true }, "math-random": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", - "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", - "dev": true + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", + "dev": true, + "optional": true }, "md5.js": { "version": "1.3.5", @@ -5562,7 +5844,7 @@ }, "media-typer": { "version": "0.3.0", - "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, @@ -5585,6 +5867,24 @@ "readable-stream": "2.3.6" } }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "2.1.0", + "decamelize": "1.2.0", + "loud-rejection": "1.6.0", + "map-obj": "1.0.1", + "minimist": "1.2.0", + "normalize-package-data": "2.5.0", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "redent": "1.0.0", + "trim-newlines": "1.0.0" + } + }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -5602,6 +5902,7 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "dev": true, + "optional": true, "requires": { "arr-diff": "2.0.0", "array-unique": "0.2.1", @@ -5635,18 +5936,18 @@ "dev": true }, "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", "dev": true }, "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "dev": true, "requires": { - "mime-db": "1.37.0" + "mime-db": "1.40.0" } }, "mimic-fn": { @@ -5677,9 +5978,9 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "mississippi": { @@ -5741,11 +6042,19 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } } }, "move-concurrently": { @@ -5758,14 +6067,14 @@ "copy-concurrently": "1.0.5", "fs-write-stream-atomic": "1.0.10", "mkdirp": "0.5.1", - "rimraf": "2.6.2", + "rimraf": "2.6.3", "run-queue": "1.0.3" } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, "multicast-dns": { @@ -5785,9 +6094,9 @@ "dev": true }, "nan": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", - "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", "dev": true }, "nanomatch": { @@ -5821,12 +6130,6 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -5836,27 +6139,27 @@ } }, "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", "dev": true }, "neo-async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", - "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, "next-tick": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "dev": true }, "node-fetch": { - "version": "1.6.3", - "resolved": "http://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz", - "integrity": "sha1-3CNO3WSJmC1Y6PDbT2lQKavNjAQ=", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", "dev": true, "requires": { "encoding": "0.1.12", @@ -5875,42 +6178,42 @@ "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", "dev": true, "requires": { - "fstream": "1.0.11", - "glob": "7.1.1", + "fstream": "1.0.12", + "glob": "7.1.4", "graceful-fs": "4.1.15", "mkdirp": "0.5.1", "nopt": "3.0.6", "npmlog": "4.1.2", "osenv": "0.1.5", "request": "2.88.0", - "rimraf": "2.6.2", + "rimraf": "2.6.3", "semver": "5.3.0", - "tar": "2.2.1", + "tar": "2.2.2", "which": "1.3.1" }, "dependencies": { "semver": { "version": "5.3.0", - "resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", "dev": true } } }, "node-libs-browser": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", - "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.0.tgz", + "integrity": "sha512-5MQunG/oyOaBdttrL40dA7bUfPORLRWMUJLQtMg7nluxUvk5XwnLdL9twQHFAjRx/y7mIMkLKT9++qPbbk6BZA==", "dev": true, "requires": { - "assert": "1.4.1", + "assert": "1.5.0", "browserify-zlib": "0.2.0", "buffer": "4.9.1", "console-browserify": "1.1.0", "constants-browserify": "1.0.0", "crypto-browserify": "3.12.0", "domain-browser": "1.2.0", - "events": "1.1.1", + "events": "3.0.0", "https-browserify": "1.0.0", "os-browserify": "0.3.0", "path-browserify": "0.0.0", @@ -5918,13 +6221,13 @@ "punycode": "1.4.1", "querystring-es3": "0.2.1", "readable-stream": "2.3.6", - "stream-browserify": "2.0.1", + "stream-browserify": "2.0.2", "stream-http": "2.8.3", "string_decoder": "1.1.1", "timers-browserify": "2.0.10", "tty-browserify": "0.0.0", "url": "0.11.0", - "util": "0.10.4", + "util": "0.11.1", "vm-browserify": "0.0.4" }, "dependencies": { @@ -5936,10 +6239,19 @@ } } }, + "node-releases": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.19.tgz", + "integrity": "sha512-SH/B4WwovHbulIALsQllAVwqZZD1kPmKCqrhGfR29dXjLAVZMHvBjD3S6nL9D/J9QkmZ1R92/0wCMDKXUUvyyA==", + "dev": true, + "requires": { + "semver": "5.7.0" + } + }, "node-sass": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.10.0.tgz", - "integrity": "sha512-fDQJfXszw6vek63Fe/ldkYXmRYK/QS6NbvM3i5oEo9ntPDy4XX7BcKZyTKv+/kSSxRtXXc7l+MSwEmYc0CSy6Q==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz", + "integrity": "sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==", "dev": true, "requires": { "async-foreach": "0.1.3", @@ -5947,14 +6259,12 @@ "cross-spawn": "3.0.1", "gaze": "1.1.3", "get-stdin": "4.0.1", - "glob": "7.1.1", + "glob": "7.1.4", "in-publish": "2.0.0", - "lodash.assign": "4.2.0", - "lodash.clonedeep": "4.5.0", - "lodash.mergewith": "4.6.1", + "lodash": "4.17.11", "meow": "3.7.0", "mkdirp": "0.5.1", - "nan": "2.11.1", + "nan": "2.14.0", "node-gyp": "3.8.0", "npmlog": "4.1.2", "request": "2.88.0", @@ -5963,94 +6273,29 @@ "true-case-path": "1.0.3" }, "dependencies": { - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "dev": true, - "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" - } - }, - "cross-spawn": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", - "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", - "dev": true, - "requires": { - "lru-cache": "4.1.5", - "which": "1.3.1" - } - }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "2.0.1" - } - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - }, - "meow": { - "version": "3.7.0", - "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.4.0", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" - } - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "get-stdin": "4.0.1" + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" } }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true } } @@ -6065,14 +6310,14 @@ } }, "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { "hosted-git-info": "2.7.1", - "is-builtin-module": "1.0.0", - "semver": "5.6.0", + "resolve": "1.11.0", + "semver": "5.7.0", "validate-npm-package-license": "3.0.4" } }, @@ -6171,9 +6416,9 @@ } }, "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, "object-visit": { @@ -6198,6 +6443,7 @@ "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", "dev": true, + "optional": true, "requires": { "for-own": "0.1.5", "is-extendable": "0.1.1" @@ -6236,9 +6482,9 @@ } }, "on-headers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", - "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "dev": true }, "once": { @@ -6265,13 +6511,22 @@ "open": "0.0.5" } }, + "opn": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", + "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", + "dev": true, + "requires": { + "is-wsl": "1.1.0" + } + }, "original": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", "integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==", "dev": true, "requires": { - "url-parse": "1.4.4" + "url-parse": "1.4.7" } }, "os-browserify": { @@ -6282,13 +6537,13 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, "os-locale": { "version": "1.4.0", - "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "dev": true, "requires": { @@ -6297,7 +6552,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -6311,6 +6566,17 @@ "os-tmpdir": "1.0.2" } }, + "output-file-sync": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", + "dev": true, + "requires": { + "graceful-fs": "4.1.15", + "mkdirp": "0.5.1", + "object-assign": "4.1.1" + } + }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", @@ -6318,21 +6584,21 @@ "dev": true }, "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { - "p-try": "1.0.0" + "p-try": "2.2.0" } }, "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { - "p-limit": "1.3.0" + "p-limit": "2.2.0" } }, "p-map": { @@ -6342,15 +6608,15 @@ "dev": true }, "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "pako": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.7.tgz", - "integrity": "sha512-3HNK5tW4x8o5mO8RuHZp3Ydw9icZXx0RANAOMzlMzx7LVXhMJ4mo3MOBpzyd7r/+RUu8BmndP47LXT+vzjtWcQ==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", "dev": true }, "parallel-transform": { @@ -6365,16 +6631,17 @@ } }, "parse-asn1": { - "version": "5.1.1", - "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", - "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", + "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", "dev": true, "requires": { "asn1.js": "4.10.1", "browserify-aes": "1.2.0", "create-hash": "1.2.0", "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.17" + "pbkdf2": "3.0.17", + "safe-buffer": "5.1.2" } }, "parse-glob": { @@ -6382,6 +6649,7 @@ "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "dev": true, + "optional": true, "requires": { "glob-base": "0.3.0", "is-dotfile": "1.0.3", @@ -6389,10 +6657,19 @@ "is-glob": "2.0.1" } }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.2" + } + }, "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true }, "pascalcase": { @@ -6414,17 +6691,14 @@ "dev": true }, "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "2.0.1" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true }, "path-is-absolute": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, @@ -6440,6 +6714,12 @@ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -6453,6 +6733,14 @@ "dev": true, "requires": { "pify": "3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "pbkdf2": { @@ -6475,9 +6763,9 @@ "dev": true }, "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, "pinkie": { @@ -6496,12 +6784,12 @@ } }, "pkg-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", - "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", "dev": true, "requires": { - "find-up": "1.1.2" + "find-up": "3.0.0" } }, "portfinder": { @@ -6517,9 +6805,24 @@ "dependencies": { "async": { "version": "1.5.2", - "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -6536,11 +6839,44 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.9", + "js-base64": "2.5.1", "source-map": "0.5.7", "supports-color": "3.2.3" }, "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + }, + "dependencies": { + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, "supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", @@ -6554,7 +6890,7 @@ }, "postcss-calc": { "version": "5.3.1", - "resolved": "http://registry.npmjs.org/postcss-calc/-/postcss-calc-5.3.1.tgz", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-5.3.1.tgz", "integrity": "sha1-d7rnypKK2FcW4v2kLyYb98HWW14=", "dev": true, "requires": { @@ -6586,7 +6922,7 @@ }, "postcss-discard-comments": { "version": "2.0.4", - "resolved": "http://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz", "integrity": "sha1-vv6J+v1bPazlzM5Rt2uBUUvgDj0=", "dev": true, "requires": { @@ -6604,7 +6940,7 @@ }, "postcss-discard-empty": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz", "integrity": "sha1-0rS9nVztXr2Nyt52QMfXzX9PkrU=", "dev": true, "requires": { @@ -6613,7 +6949,7 @@ }, "postcss-discard-overridden": { "version": "0.1.1", - "resolved": "http://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz", "integrity": "sha1-ix6vVU9ob7KIzYdMVWZ7CqNmjVg=", "dev": true, "requires": { @@ -6622,7 +6958,7 @@ }, "postcss-discard-unused": { "version": "2.2.3", - "resolved": "http://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz", + "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz", "integrity": "sha1-vOMLLMWR/8Y0Mitfs0ZLbZNPRDM=", "dev": true, "requires": { @@ -6641,7 +6977,7 @@ }, "postcss-merge-idents": { "version": "2.1.7", - "resolved": "http://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz", + "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz", "integrity": "sha1-TFUwMTwI4dWzu/PSu8dH4njuonA=", "dev": true, "requires": { @@ -6669,7 +7005,19 @@ "caniuse-api": "1.6.1", "postcss": "5.2.18", "postcss-selector-parser": "2.2.3", - "vendors": "1.0.2" + "vendors": "1.0.3" + }, + "dependencies": { + "browserslist": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "1.0.30000969", + "electron-to-chromium": "1.3.134" + } + } } }, "postcss-message-helpers": { @@ -6680,7 +7028,7 @@ }, "postcss-minify-font-values": { "version": "1.0.5", - "resolved": "http://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz", "integrity": "sha1-S1jttWZB66fIR0qzUmyv17vey2k=", "dev": true, "requires": { @@ -6691,7 +7039,7 @@ }, "postcss-minify-gradients": { "version": "1.0.5", - "resolved": "http://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz", "integrity": "sha1-Xb2hE3NwP4PPtKPqOIHY11/15uE=", "dev": true, "requires": { @@ -6701,7 +7049,7 @@ }, "postcss-minify-params": { "version": "1.2.2", - "resolved": "http://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz", "integrity": "sha1-rSzgcTc7lDs9kwo/pZo1jCjW8fM=", "dev": true, "requires": { @@ -6713,7 +7061,7 @@ }, "postcss-minify-selectors": { "version": "2.1.1", - "resolved": "http://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-2.1.1.tgz", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-2.1.1.tgz", "integrity": "sha1-ssapjAByz5G5MtGkllCBFDEXNb8=", "dev": true, "requires": { @@ -6732,39 +7080,13 @@ "postcss": "6.0.23" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.3" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.5.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, "postcss": { "version": "6.0.23", "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { - "chalk": "2.4.1", + "chalk": "2.4.2", "source-map": "0.6.1", "supports-color": "5.5.0" } @@ -6774,15 +7096,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } } } }, @@ -6796,39 +7109,13 @@ "postcss": "6.0.23" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.3" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.5.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, "postcss": { "version": "6.0.23", "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { - "chalk": "2.4.1", + "chalk": "2.4.2", "source-map": "0.6.1", "supports-color": "5.5.0" } @@ -6838,15 +7125,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } } } }, @@ -6860,39 +7138,13 @@ "postcss": "6.0.23" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.3" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.5.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, "postcss": { "version": "6.0.23", "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { - "chalk": "2.4.1", + "chalk": "2.4.2", "source-map": "0.6.1", "supports-color": "5.5.0" } @@ -6902,15 +7154,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } } } }, @@ -6924,39 +7167,13 @@ "postcss": "6.0.23" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.3" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.5.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, "postcss": { "version": "6.0.23", "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { - "chalk": "2.4.1", + "chalk": "2.4.2", "source-map": "0.6.1", "supports-color": "5.5.0" } @@ -6966,21 +7183,12 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } } } }, "postcss-normalize-charset": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz", "integrity": "sha1-757nEhLX/nWceO0WL2HtYrXLk/E=", "dev": true, "requires": { @@ -6989,7 +7197,7 @@ }, "postcss-normalize-url": { "version": "3.0.8", - "resolved": "http://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-3.0.8.tgz", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-3.0.8.tgz", "integrity": "sha1-EI90s/L82viRov+j6kWSJ5/HgiI=", "dev": true, "requires": { @@ -7011,7 +7219,7 @@ }, "postcss-reduce-idents": { "version": "2.4.0", - "resolved": "http://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz", + "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz", "integrity": "sha1-wsbSDMlYKE9qv75j92Cb9AkFmtM=", "dev": true, "requires": { @@ -7021,7 +7229,7 @@ }, "postcss-reduce-initial": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz", "integrity": "sha1-aPgGlfBF0IJjqHmtJA343WT2ROo=", "dev": true, "requires": { @@ -7030,7 +7238,7 @@ }, "postcss-reduce-transforms": { "version": "1.0.4", - "resolved": "http://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz", "integrity": "sha1-/3b02CEkN7McKYpC0uFEQCV3GuE=", "dev": true, "requires": { @@ -7052,7 +7260,7 @@ }, "postcss-svgo": { "version": "2.1.6", - "resolved": "http://registry.npmjs.org/postcss-svgo/-/postcss-svgo-2.1.6.tgz", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-2.1.6.tgz", "integrity": "sha1-tt8YqmE7Zm4TPwittSGcJoSsEI0=", "dev": true, "requires": { @@ -7064,7 +7272,7 @@ }, "postcss-unique-selectors": { "version": "2.0.2", - "resolved": "http://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz", "integrity": "sha1-mB1X0p3csz57Hf4f1DuGSfkzyh0=", "dev": true, "requires": { @@ -7081,7 +7289,7 @@ }, "postcss-zindex": { "version": "2.2.0", - "resolved": "http://registry.npmjs.org/postcss-zindex/-/postcss-zindex-2.2.0.tgz", + "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-2.2.0.tgz", "integrity": "sha1-0hCd3AVbka9n/EyzsCWUZjnSryI=", "dev": true, "requires": { @@ -7100,7 +7308,8 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true + "dev": true, + "optional": true }, "private": { "version": "0.1.8", @@ -7136,23 +7345,24 @@ "dev": true }, "prop-types": { - "version": "15.6.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz", - "integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==", + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", "dev": true, "requires": { "loose-envify": "1.4.0", - "object-assign": "4.1.1" + "object-assign": "4.1.1", + "react-is": "16.8.6" } }, "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "dev": true, "requires": { "forwarded": "0.1.2", - "ipaddr.js": "1.8.0" + "ipaddr.js": "1.9.0" } }, "prr": { @@ -7168,9 +7378,9 @@ "dev": true }, "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", "dev": true }, "public-encrypt": { @@ -7182,8 +7392,8 @@ "bn.js": "4.11.8", "browserify-rsa": "4.0.1", "create-hash": "1.2.0", - "parse-asn1": "5.1.1", - "randombytes": "2.0.6", + "parse-asn1": "5.1.4", + "randombytes": "2.1.0", "safe-buffer": "5.1.2" } }, @@ -7249,9 +7459,9 @@ "dev": true }, "querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", "dev": true }, "randomatic": { @@ -7259,30 +7469,33 @@ "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", "dev": true, + "optional": true, "requires": { "is-number": "4.0.0", "kind-of": "6.0.2", - "math-random": "1.0.1" + "math-random": "1.0.4" }, "dependencies": { "is-number": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true + "dev": true, + "optional": true }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true + "dev": true, + "optional": true } } }, "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "requires": { "safe-buffer": "5.1.2" @@ -7294,14 +7507,14 @@ "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { - "randombytes": "2.0.6", + "randombytes": "2.1.0", "safe-buffer": "5.1.2" } }, "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true }, "raw-body": { @@ -7336,7 +7549,7 @@ "fbjs": "0.8.17", "loose-envify": "1.4.0", "object-assign": "4.1.1", - "prop-types": "15.6.2" + "prop-types": "15.7.2" } }, "react-dom": { @@ -7348,9 +7561,15 @@ "fbjs": "0.8.17", "loose-envify": "1.4.0", "object-assign": "4.1.1", - "prop-types": "15.6.2" + "prop-types": "15.7.2" } }, + "react-is": { + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", + "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==", + "dev": true + }, "read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", @@ -7358,32 +7577,10 @@ "dev": true, "requires": { "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", + "normalize-package-data": "2.5.0", "path-type": "1.1.0" }, "dependencies": { - "load-json-file": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "4.1.15", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "1.3.2" - } - }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", @@ -7397,18 +7594,9 @@ }, "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } } } }, @@ -7420,11 +7608,32 @@ "requires": { "find-up": "1.1.2", "read-pkg": "1.1.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + } } }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -7489,6 +7698,15 @@ } } }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -7721,12 +7939,28 @@ "snapdragon": "0.8.2", "to-regex": "3.0.2" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "2.1.0", + "strip-indent": "1.0.1" + } + }, "reduce-css-calc": { "version": "1.3.0", - "resolved": "http://registry.npmjs.org/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz", + "resolved": "https://registry.npmjs.org/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz", "integrity": "sha1-dHyRTgSWFKTJz7umKYca0dKSdxY=", "dev": true, "requires": { @@ -7766,20 +8000,27 @@ "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", "dev": true }, + "regenerate-unicode-properties": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz", + "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==", + "dev": true, + "requires": { + "regenerate": "1.4.0" + } + }, "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==", "dev": true }, "regenerator-transform": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.4.tgz", + "integrity": "sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A==", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", "private": "0.1.8" } }, @@ -7788,6 +8029,7 @@ "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "dev": true, + "optional": true, "requires": { "is-equal-shallow": "0.1.3" } @@ -7802,27 +8044,36 @@ "safe-regex": "1.1.0" } }, + "regexp-tree": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.6.tgz", + "integrity": "sha512-LFrA98Dw/heXqDojz7qKFdygZmFoiVlvE1Zp7Cq2cvF+ZA+03Gmhy0k0PQlsC1jvHPiTUSs+pDHEuSWv6+6D7w==", + "dev": true + }, "regexpu-core": { - "version": "2.0.0", - "resolved": "http://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", "dev": true, "requires": { "regenerate": "1.4.0", - "regjsgen": "0.2.0", - "regjsparser": "0.1.5" + "regenerate-unicode-properties": "8.1.0", + "regjsgen": "0.5.0", + "regjsparser": "0.6.0", + "unicode-match-property-ecmascript": "1.0.4", + "unicode-match-property-value-ecmascript": "1.1.0" } }, "regjsgen": { - "version": "0.2.0", - "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", + "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==", "dev": true }, "regjsparser": { - "version": "0.1.5", - "resolved": "http://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", + "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", "dev": true, "requires": { "jsesc": "0.5.0" @@ -7830,7 +8081,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -7872,7 +8123,7 @@ "aws-sign2": "0.7.0", "aws4": "1.8.0", "caseless": "0.12.0", - "combined-stream": "1.0.7", + "combined-stream": "1.0.8", "extend": "3.0.2", "forever-agent": "0.6.1", "form-data": "2.3.3", @@ -7881,7 +8132,7 @@ "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.21", + "mime-types": "2.1.24", "oauth-sign": "0.9.0", "performance-now": "2.1.0", "qs": "6.5.2", @@ -7889,14 +8140,6 @@ "tough-cookie": "2.4.3", "tunnel-agent": "0.6.0", "uuid": "3.3.2" - }, - "dependencies": { - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - } } }, "require-directory": { @@ -7917,6 +8160,15 @@ "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "dev": true }, + "resolve": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", + "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", + "dev": true, + "requires": { + "path-parse": "1.0.6" + } + }, "resolve-cwd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", @@ -7924,16 +8176,14 @@ "dev": true, "requires": { "resolve-from": "3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } } }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -7956,12 +8206,12 @@ } }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { - "glob": "7.1.1" + "glob": "7.1.4" } }, "ripemd160": { @@ -7991,7 +8241,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -8010,7 +8260,7 @@ "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", "dev": true, "requires": { - "glob": "7.1.1", + "glob": "7.1.4", "lodash": "4.17.11", "scss-tokenizer": "0.2.3", "yargs": "7.1.0" @@ -8023,22 +8273,17 @@ "dev": true, "requires": { "clone-deep": "2.0.2", - "loader-utils": "1.1.0", + "loader-utils": "1.2.3", "lodash.tail": "4.1.1", - "neo-async": "2.6.0", + "neo-async": "2.6.1", "pify": "3.0.0" }, "dependencies": { - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" - } + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true } } }, @@ -8055,32 +8300,6 @@ "dev": true, "requires": { "ajv": "5.5.2" - }, - "dependencies": { - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "dev": true, - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" - } - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true - } } }, "scss-tokenizer": { @@ -8089,13 +8308,13 @@ "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", "dev": true, "requires": { - "js-base64": "2.4.9", + "js-base64": "2.5.1", "source-map": "0.4.4" }, "dependencies": { "source-map": { "version": "0.4.4", - "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { @@ -8120,9 +8339,9 @@ } }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true }, "send": { @@ -8142,8 +8361,25 @@ "mime": "1.4.1", "ms": "2.0.0", "on-finished": "2.3.0", - "range-parser": "1.2.0", + "range-parser": "1.2.1", "statuses": "1.4.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "serialize-javascript": { @@ -8158,13 +8394,30 @@ "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", "dev": true, "requires": { - "accepts": "1.3.5", + "accepts": "1.3.7", "batch": "0.6.1", "debug": "2.6.9", "escape-html": "1.0.3", "http-errors": "1.6.3", - "mime-types": "2.1.21", - "parseurl": "1.3.2" + "mime-types": "2.1.24", + "parseurl": "1.3.3" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "serve-static": { @@ -8175,7 +8428,7 @@ "requires": { "encodeurl": "1.0.2", "escape-html": "1.0.3", - "parseurl": "1.3.2", + "parseurl": "1.3.3", "send": "0.16.2" } }, @@ -8222,7 +8475,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -8298,6 +8551,15 @@ "use": "3.1.1" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", @@ -8315,6 +8577,12 @@ "requires": { "is-extendable": "0.1.1" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -8398,14 +8666,6 @@ "requires": { "faye-websocket": "0.10.0", "uuid": "3.3.2" - }, - "dependencies": { - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - } } }, "sockjs-client": { @@ -8419,9 +8679,18 @@ "faye-websocket": "0.11.1", "inherits": "2.0.3", "json3": "3.3.2", - "url-parse": "1.4.4" + "url-parse": "1.4.7" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "faye-websocket": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", @@ -8430,6 +8699,12 @@ "requires": { "websocket-driver": "0.7.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -8483,13 +8758,13 @@ "dev": true }, "spdx-correct": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz", - "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "dev": true, "requires": { "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.2" + "spdx-license-ids": "3.0.4" } }, "spdx-exceptions": { @@ -8505,42 +8780,53 @@ "dev": true, "requires": { "spdx-exceptions": "2.2.0", - "spdx-license-ids": "3.0.2" + "spdx-license-ids": "3.0.4" } }, "spdx-license-ids": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz", - "integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", "dev": true }, "spdy": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-3.4.7.tgz", - "integrity": "sha1-Qv9B7OXMD5mjpsKKq7c/XDsDrLw=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.0.tgz", + "integrity": "sha512-ot0oEGT/PGUpzf/6uk4AWLqkq+irlqHXkrdbk51oWONh3bxQmBuljxPNl66zlRRcIJStWq0QkLUCPOPjgjvU0Q==", "dev": true, "requires": { - "debug": "2.6.9", - "handle-thing": "1.2.5", + "debug": "4.1.1", + "handle-thing": "2.0.0", "http-deceiver": "1.2.7", - "safe-buffer": "5.1.2", "select-hose": "2.0.0", - "spdy-transport": "2.1.1" + "spdy-transport": "3.0.0" } }, "spdy-transport": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-2.1.1.tgz", - "integrity": "sha512-q7D8c148escoB3Z7ySCASadkegMmUZW8Wb/Q1u0/XBgDKMO880rLQDj8Twiew/tYi7ghemKUi/whSYOwE17f5Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", + "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", "dev": true, "requires": { - "debug": "2.6.9", + "debug": "4.1.1", "detect-node": "2.0.4", "hpack.js": "2.1.6", "obuf": "1.1.2", - "readable-stream": "2.3.6", - "safe-buffer": "5.1.2", + "readable-stream": "3.3.0", "wbuf": "1.7.3" + }, + "dependencies": { + "readable-stream": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + } } }, "split-string": { @@ -8559,9 +8845,9 @@ "dev": true }, "sshpk": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", - "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "dev": true, "requires": { "asn1": "0.2.4", @@ -8621,9 +8907,9 @@ } }, "stream-browserify": { - "version": "2.0.1", - "resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", "dev": true, "requires": { "inherits": "2.0.3", @@ -8678,7 +8964,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { @@ -8687,7 +8973,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -8695,44 +8981,46 @@ } }, "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } }, "strip-eof": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "4.0.1" + } + }, "style-loader": { "version": "0.13.2", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.13.2.tgz", "integrity": "sha1-dFMzhM9pjHEEx5URULSXF63C87s=", "dev": true, "requires": { - "loader-utils": "1.1.0" - }, - "dependencies": { - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" - } - } + "loader-utils": "1.2.3" } }, "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } }, "svgo": { "version": "0.7.2", @@ -8756,13 +9044,13 @@ "dev": true }, "tar": { - "version": "2.2.1", - "resolved": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", "dev": true, "requires": { "block-stream": "0.0.9", - "fstream": "1.0.11", + "fstream": "1.0.12", "inherits": "2.0.3" } }, @@ -8804,9 +9092,9 @@ "dev": true }, "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, "to-object-path": { @@ -8857,7 +9145,7 @@ "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "requires": { - "psl": "1.1.29", + "psl": "1.1.31", "punycode": "1.4.1" }, "dependencies": { @@ -8869,6 +9157,12 @@ } } }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -8881,23 +9175,7 @@ "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", "dev": true, "requires": { - "glob": "7.1.3" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - } + "glob": "7.1.4" } }, "tty-browserify": { @@ -8922,13 +9200,13 @@ "dev": true }, "type-is": { - "version": "1.6.16", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, "requires": { "media-typer": "0.3.0", - "mime-types": "2.1.21" + "mime-types": "2.1.24" } }, "typedarray": { @@ -8943,22 +9221,15 @@ "integrity": "sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ==", "dev": true }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, - "optional": true - }, - "uglifyjs-webpack-plugin": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz", - "integrity": "sha1-uVH0q7a9YX5m9j64kUmOORdj4wk=", + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", "dev": true, "requires": { "source-map": "0.5.7", - "uglify-js": "2.8.29", - "webpack-sources": "1.3.0" + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" }, "dependencies": { "camelcase": { @@ -8978,281 +9249,705 @@ "wordwrap": "0.0.2" } }, - "uglify-js": { - "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "uglifyjs-webpack-plugin": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz", + "integrity": "sha1-uVH0q7a9YX5m9j64kUmOORdj4wk=", + "dev": true, + "requires": { + "source-map": "0.5.7", + "uglify-js": "2.8.29", + "webpack-sources": "1.3.0" + } + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "1.0.4", + "unicode-property-aliases-ecmascript": "1.0.5" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", + "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", + "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", + "dev": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } + } + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, + "uniqs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", + "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", + "dev": true + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "2.0.1" + } + }, + "unique-slug": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.1.tgz", + "integrity": "sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg==", + "dev": true, + "requires": { + "imurmurhash": "0.1.4" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } } }, - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true }, - "yargs": { - "version": "3.10.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "upath": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "2.1.1" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "url-parse": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", + "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "dev": true, + "requires": { + "querystringify": "2.1.1", + "requires-port": "1.0.0" + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", + "dev": true + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "dev": true, + "requires": { + "user-home": "1.1.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "3.1.0", + "spdx-expression-parse": "3.0.0" + } + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, + "vendors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.3.tgz", + "integrity": "sha512-fOi47nsJP5Wqefa43kyWSg80qF+Q3XA6MUkgi7Hp1HQaKDQW4cQrK2D0P7mmbFtsV1N89am55Yru/nyEwRubcw==", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + } + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "watchpack": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "dev": true, + "requires": { + "chokidar": "2.1.6", + "graceful-fs": "4.1.15", + "neo-async": "2.6.1" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "3.1.10", + "normalize-path": "2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + } + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.3", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "chokidar": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", + "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", + "dev": true, + "requires": { + "anymatch": "2.0.0", + "async-each": "1.0.3", + "braces": "2.3.2", + "fsevents": "1.2.9", + "glob-parent": "3.1.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "4.0.1", + "normalize-path": "3.0.0", + "path-is-absolute": "1.0.1", + "readdirp": "2.2.1", + "upath": "1.1.2" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + } + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", - "window-size": "0.1.0" + "kind-of": "6.0.2" } - } - } - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "dev": true, - "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" } }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" + "is-extglob": "2.1.1" } - } - } - }, - "uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", - "dev": true - }, - "uniqs": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", - "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", - "dev": true - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "2.0.1" - } - }, - "unique-slug": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.1.tgz", - "integrity": "sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg==", - "dev": true, - "requires": { - "imurmurhash": "0.1.4" - } - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" + "kind-of": "3.2.2" }, "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "isarray": "1.0.0" + "is-buffer": "1.1.6" } } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "upath": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", - "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", - "dev": true - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "2.1.1" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "url-parse": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.4.tgz", - "integrity": "sha512-/92DTTorg4JjktLNLe6GPS2/RvAd/RGr6LuktmWSMLEOa6rjnlrFXNgSbSmkNvCoL2T028A0a1JaJLzRMlFoHg==", - "dev": true, - "requires": { - "querystringify": "2.1.0", - "requires-port": "1.0.0" - } - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "3.0.2", - "spdx-expression-parse": "3.0.0" - } - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", - "dev": true - }, - "vendors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.2.tgz", - "integrity": "sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ==", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "1.3.0" - } - }, - "vm-browserify": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", - "dev": true, - "requires": { - "indexof": "0.0.1" - } - }, - "watchpack": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", - "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", - "dev": true, - "requires": { - "chokidar": "2.0.4", - "graceful-fs": "4.1.15", - "neo-async": "2.6.0" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.13", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + } } }, "wbuf": { @@ -9272,19 +9967,19 @@ "requires": { "acorn": "5.7.3", "acorn-dynamic-import": "2.0.2", - "ajv": "6.6.1", - "ajv-keywords": "3.2.0", - "async": "2.6.1", + "ajv": "6.10.0", + "ajv-keywords": "3.4.0", + "async": "2.6.2", "enhanced-resolve": "3.4.1", "escope": "3.6.0", - "interpret": "1.1.0", + "interpret": "1.2.0", "json-loader": "0.5.7", "json5": "0.5.1", - "loader-runner": "2.3.1", - "loader-utils": "1.1.0", + "loader-runner": "2.4.0", + "loader-utils": "1.2.3", "memory-fs": "0.4.1", "mkdirp": "0.5.1", - "node-libs-browser": "2.1.0", + "node-libs-browser": "2.2.0", "source-map": "0.5.7", "supports-color": "4.5.0", "tapable": "0.2.9", @@ -9294,290 +9989,690 @@ "yargs": "8.0.2" }, "dependencies": { - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "dev": true, + "requires": { + "fast-deep-equal": "2.0.1", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.4.1", + "uri-js": "4.2.2" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.15", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.3.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.5.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yargs": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", + "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=", + "dev": true, + "requires": { + "camelcase": "4.1.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.3", + "os-locale": "2.1.0", + "read-pkg-up": "2.0.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "7.0.0" + } + }, + "yargs-parser": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", + "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=", + "dev": true, + "requires": { + "camelcase": "4.1.0" + } + } + } + }, + "webpack-dev-middleware": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-1.12.2.tgz", + "integrity": "sha512-FCrqPy1yy/sN6U/SaEZcHKRXGlqU0DUaEBL45jkUYoB8foVb6wCnbIJ1HKIx+qUFTW+3JpVcCJCxZ8VATL4e+A==", + "dev": true, + "requires": { + "memory-fs": "0.4.1", + "mime": "1.6.0", + "path-is-absolute": "1.0.1", + "range-parser": "1.2.1", + "time-stamp": "2.2.0" + }, + "dependencies": { + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + } + } + }, + "webpack-dev-server": { + "version": "2.11.5", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-2.11.5.tgz", + "integrity": "sha512-7TdOKKt7G3sWEhPKV0zP+nD0c4V9YKUJ3wDdBwQsZNo58oZIRoVIu66pg7PYkBW8A74msP9C2kLwmxGHndz/pw==", + "dev": true, + "requires": { + "ansi-html": "0.0.7", + "array-includes": "3.0.3", + "bonjour": "3.5.0", + "chokidar": "2.1.6", + "compression": "1.7.4", + "connect-history-api-fallback": "1.6.0", + "debug": "3.2.6", + "del": "3.0.0", + "express": "4.16.4", + "html-entities": "1.2.1", + "http-proxy-middleware": "0.19.1", + "import-local": "1.0.0", + "internal-ip": "1.2.0", + "ip": "1.1.5", + "killable": "1.0.1", + "loglevel": "1.6.1", + "opn": "5.5.0", + "portfinder": "1.0.20", + "selfsigned": "1.10.4", + "serve-index": "1.9.1", + "sockjs": "0.3.19", + "sockjs-client": "1.1.5", + "spdy": "4.0.0", + "strip-ansi": "3.0.1", + "supports-color": "5.5.0", + "webpack-dev-middleware": "1.12.2", + "yargs": "6.6.0" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "dev": true, "requires": { - "locate-path": "2.0.0" + "micromatch": "3.1.10", + "normalize-path": "2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + } } }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, - "load-json-file": { - "version": "2.0.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "parse-json": "2.2.0", - "pify": "2.3.0", - "strip-bom": "3.0.0" + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.3", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "chokidar": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", + "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", "dev": true, "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" + "anymatch": "2.0.0", + "async-each": "1.0.3", + "braces": "2.3.2", + "fsevents": "1.2.9", + "glob-parent": "3.1.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "4.0.1", + "normalize-path": "3.0.0", + "path-is-absolute": "1.0.1", + "readdirp": "2.2.1", + "upath": "1.1.2" } }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "ms": "2.1.1" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } } }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "error-ex": "1.3.2" + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } } }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "pify": "2.3.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "load-json-file": "2.0.0", - "normalize-package-data": "2.4.0", - "path-type": "2.0.0" + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { - "find-up": "2.1.0", - "read-pkg": "2.0.0" + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + } } }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "kind-of": "6.0.2" } }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "kind-of": "6.0.2" } }, - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "yargs": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", - "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=", + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, "requires": { - "camelcase": "4.1.0", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "get-caller-file": "1.0.3", - "os-locale": "2.1.0", - "read-pkg-up": "2.0.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "7.0.0" + "is-extglob": "2.1.1" } }, - "yargs-parser": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", - "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=", - "dev": true, - "requires": { - "camelcase": "4.1.0" - } - } - } - }, - "webpack-dev-middleware": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-1.12.2.tgz", - "integrity": "sha512-FCrqPy1yy/sN6U/SaEZcHKRXGlqU0DUaEBL45jkUYoB8foVb6wCnbIJ1HKIx+qUFTW+3JpVcCJCxZ8VATL4e+A==", - "dev": true, - "requires": { - "memory-fs": "0.4.1", - "mime": "1.6.0", - "path-is-absolute": "1.0.1", - "range-parser": "1.2.0", - "time-stamp": "2.2.0" - }, - "dependencies": { - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true - } - } - }, - "webpack-dev-server": { - "version": "2.11.3", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-2.11.3.tgz", - "integrity": "sha512-Qz22YEFhWx+M2vvJ+rQppRv39JA0h5NNbOOdODApdX6iZ52Diz7vTPXjF7kJlfn+Uc24Qr48I3SZ9yncQwRycg==", - "dev": true, - "requires": { - "ansi-html": "0.0.7", - "array-includes": "3.0.3", - "bonjour": "3.5.0", - "chokidar": "2.0.4", - "compression": "1.7.3", - "connect-history-api-fallback": "1.5.0", - "debug": "3.2.6", - "del": "3.0.0", - "express": "4.16.4", - "html-entities": "1.2.1", - "http-proxy-middleware": "0.17.4", - "import-local": "1.0.0", - "internal-ip": "1.2.0", - "ip": "1.1.5", - "killable": "1.0.1", - "loglevel": "1.6.1", - "opn": "5.4.0", - "portfinder": "1.0.20", - "selfsigned": "1.10.4", - "serve-index": "1.9.1", - "sockjs": "0.3.19", - "sockjs-client": "1.1.5", - "spdy": "3.4.7", - "strip-ansi": "3.0.1", - "supports-color": "5.5.0", - "webpack-dev-middleware": "1.12.2", - "yargs": "6.6.0" - }, - "dependencies": { - "camelcase": { + "is-number": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "ms": "2.1.1" + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } } }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true }, - "opn": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.4.0.tgz", - "integrity": "sha512-YF9MNdVy/0qvJvDtunAOzFw9iasOQHpVthTCvGzxt61Il64AYSGdK+rYwld7NAfk9qJ7dt+hymBNSc9LNYS+Sw==", + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { - "is-wsl": "1.1.0" + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.13", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" } }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true }, "y18n": { "version": "3.2.1", @@ -9587,7 +10682,7 @@ }, "yargs": { "version": "6.6.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=", "dev": true, "requires": { @@ -9608,7 +10703,7 @@ }, "yargs-parser": { "version": "4.2.1", - "resolved": "http://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", "dev": true, "requires": { @@ -9693,42 +10788,61 @@ "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", "dev": true }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + }, "worker-loader": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-2.0.0.tgz", "integrity": "sha512-tnvNp4K3KQOpfRnD20m8xltE3eWh89Ye+5oj7wXEEHKac1P4oZ6p9oTj8/8ExqoSBnk9nu5Pr4nKfQ1hn2APJw==", "dev": true, "requires": { - "loader-utils": "1.1.0", + "loader-utils": "1.2.3", "schema-utils": "0.4.7" }, "dependencies": { - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "dev": true, "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" + "fast-deep-equal": "2.0.1", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.4.1", + "uri-js": "4.2.2" } }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "schema-utils": { "version": "0.4.7", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", "dev": true, "requires": { - "ajv": "6.6.1", - "ajv-keywords": "3.2.0" + "ajv": "6.10.0", + "ajv-keywords": "3.4.0" } } } }, "wrap-ansi": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { diff --git a/package.json b/package.json index c91035f..481bfb9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sn-filesafe", - "version": "2.0.5", + "version": "2.0.6", "main": "dist/dist.js", "scripts": { "lint": "eslint --cache --ignore-path .gitignore --ext .jsx,.js --format=node_modules/eslint-formatter-pretty .", @@ -13,18 +13,20 @@ "main": "dist/index.html" }, "devDependencies": { - "babel-core": "6.x", - "babel-eslint": "7.x", - "babel-loader": "6.x", - "babel-plugin-transform-runtime": "6.x", - "babel-preset-es2015": "6.x", - "babel-preset-react": "6.x", - "babel-preset-stage-0": "6.x", - "babel-runtime": "6.x", + "@babel/core": "^7.4.3", + "@babel/preset-env": "^7.4.3", + "@babel/preset-react": "^7.0.0", + "@babel/preset-stage-0": "^7.0.0", + "@babel/runtime": "^7.4.4", + "babel-cli": "^6.26.0", + "babel-loader": "^8.0.5", + "babel-register": "^6.26.0", "compare-versions": "^3.1.0", "copy-webpack-plugin": "4.6.0", "css-loader": "~0.28.7", "extract-text-webpack-plugin": "^3.0.2", + "filesafe-embed": "1.0.4", + "filesafe-js": "1.0.3", "husky": "^0.12.0", "node-sass": "^4.9.3", "open-browser-webpack-plugin": "0.0.3", @@ -33,8 +35,6 @@ "sass-loader": "^6.0.6", "sn-components-api": "1.2.5", "style-loader": "~0.13.1", - "filesafe-embed": "1.0.2", - "filesafe-js": "1.0.3", "webpack": "^3.8.1", "webpack-dev-server": "^2.9.7", "worker-loader": "^2.0.0"