From 55d943a57e1ed376fe1e23e3f327842c2c473686 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Tue, 29 Aug 2017 11:41:17 -0600 Subject: [PATCH] Upgraded NPM packages --- .eslintrc.json | 4 +- dist/proxy-storage.js | 7 +- dist/proxy-storage.min.js | 2 +- dist/proxy-storage.min.map | 2 +- package.json | 10 +- src/cookie-storage.js | 3 + yarn.lock | 500 +++++++++++++++++++++++++------------ 7 files changed, 359 insertions(+), 169 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 36b0ad7..1bc38b4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -46,8 +46,10 @@ "one-var-declaration-per-line": [2, "initializations"], "max-len": 0, "no-param-reassign": 0, - "no-use-before-define": 0, "no-underscore-dangle": 0, + "no-use-before-define": ["error", { + "functions": false + }], "object-curly-spacing": [2, "never"], "import/no-mutable-exports": 1, "import/prefer-default-export": 0, diff --git a/dist/proxy-storage.js b/dist/proxy-storage.js index 00066f3..5df00cd 100644 --- a/dist/proxy-storage.js +++ b/dist/proxy-storage.js @@ -1,4 +1,4 @@ -/*! proxyStorage@v2.3.0. Jherax 2017. Visit https://github.com/jherax/proxy-storage */ +/*! proxyStorage@v2.3.1. Jherax 2017. Visit https://github.com/jherax/proxy-storage */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); @@ -761,6 +761,11 @@ function cookieStorage() { if (value === null) delete $cookie.data[key]; return value; }, + + + // TODO: Add the method getAll() to get all cookies + // https://github.com/jherax/proxy-storage/issues/6 + removeItem: function removeItem(key, options) { var metadata = Object.assign({}, $cookie.data[key], options); metadata.expires = { days: -1 }; diff --git a/dist/proxy-storage.min.js b/dist/proxy-storage.min.js index 5afcf9e..eaaefb5 100644 --- a/dist/proxy-storage.min.js +++ b/dist/proxy-storage.min.js @@ -1,3 +1,3 @@ -/*! proxyStorage@v2.3.0. Jherax 2017. Visit https://github.com/jherax/proxy-storage */ +/*! proxyStorage@v2.3.1. Jherax 2017. Visit https://github.com/jherax/proxy-storage */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.proxyStorage=t():e.proxyStorage=t()}(this,function(){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){"use strict";function o(e){return"[object Object]"===Object.prototype.toString.call(e)}function n(e){if(null==e||""===e)throw new Error("The key provided can not be empty")}function i(e,t,r){var o={configurable:!1,enumerable:!1,writable:!1};void 0!==r&&(o.value=r),Object.defineProperty(e,t,o)}function a(e){var t=void 0;try{t=JSON.parse(e)}catch(r){t=e}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=o,t.checkEmpty=n,t.setProperty=i,t.tryParse=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isAvailable={localStorage:!1,cookieStorage:!1,sessionStorage:!1,memoryStorage:!0}},function(e,t,r){"use strict";function o(e){var t=i.proxy[e],r="__proxy-storage__";try{t.setItem(r,r),t.removeItem(r)}catch(e){return!1}return!0}function n(e){return u.isAvailable[e]&&(i.webStorageSettings.default=e,c.set(e)),u.isAvailable[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.isAvailable=t.configStorage=t.WebStorage=t.default=void 0;var i=r(3),a=function(e){return e&&e.__esModule?e:{default:e}}(i),u=r(1),s=null,c={get:function(){return s.__storage__},set:function(e){t.default=s=new a.default(e)}};!function(){u.isAvailable.localStorage=o("localStorage"),u.isAvailable.cookieStorage=o("cookieStorage"),u.isAvailable.sessionStorage=o("sessionStorage"),i.webStorageSettings.isAvailable=u.isAvailable,Object.keys(u.isAvailable).some(n)}(),t.default=s,t.WebStorage=a.default,t.configStorage=c,t.isAvailable=u.isAvailable},function(e,t,r){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return Object.keys(t).forEach(function(r){e[r]=(0,c.tryParse)(t[r])}),e}function i(e){if(p.isAvailable[e])return e;var t="sessionStorage"===e?"memoryStorage":p.default,r=e+" is not available. Falling back to "+t;return console.warn(r),t}Object.defineProperty(t,"__esModule",{value:!0}),t.proxy=t.webStorageSettings=t.default=void 0;var a=function(){function e(e,t){for(var r=0;r1?t-1:0),o=1;o-1&&(t=o.substring(0,r),e.removeItem(t.trim()))})}};return a(e)}function a(e){for(var t in e)(0,u.setProperty)(e,t);return d.get().split(";").forEach(function(t){var r=t.indexOf("="),o=t.substring(0,r).trim(),n=t.substring(r+1).trim();o&&(e[o]=decodeURIComponent(n))}),e}Object.defineProperty(t,"__esModule",{value:!0});var u=r(0),s=r(7),c=o(s),l=r(8),f=o(l),d={get:function(){return document.cookie},set:function(e){document.cookie=e},data:{}};t.default=i},function(e,t,r){"use strict";function o(e,t){return t[e]?";"+e+"="+t[e]:""}function n(e){return""+o("expires",e)+o("domain",e)+o("path",e)+(e.secure?";secure":"")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},e),r=t.date instanceof Date?t.date:new Date;return+t.minutes&&r.setMinutes(r.getMinutes()+t.minutes),+t.hours&&r.setHours(r.getHours()+t.hours),+t.days&&r.setDate(r.getDate()+t.days),+t.months&&r.setMonth(r.getMonth()+t.months),+t.years&&r.setFullYear(r.getFullYear()+t.years),r}function n(e){return o(e instanceof Date?{date:e}:e).toUTCString()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";function o(){var e=void 0;try{e=JSON.parse(window.self.name)}catch(e){return{}}return e&&"object"===(void 0===e?"undefined":u(e))?e:{}}function n(e){var t=JSON.stringify(e);window.self.name=t}function i(){var e=o();return a({setItem:function(t,r){e[t]=r,n(e)},getItem:function(t){var r=e[t];return void 0===r?null:r},removeItem:function(t){delete e[t],n(e)},clear:function(){Object.keys(e).forEach(function(t){return delete e[t]}),n(e)}},e)}function a(e,t){for(var r in e)(0,s.setProperty)(e,r);return Object.assign(e,t),e}Object.defineProperty(t,"__esModule",{value:!0});var u="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};t.default=i;var s=r(0)}])}); //# sourceMappingURL=proxy-storage.min.map \ No newline at end of file diff --git a/dist/proxy-storage.min.map b/dist/proxy-storage.min.map index a9ec957..74fdef0 100644 --- a/dist/proxy-storage.min.map +++ b/dist/proxy-storage.min.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///proxy-storage.min.js","webpack:///webpack/bootstrap bee05f68f5d068a0697e","webpack:///./src/utils.js","webpack:///./src/is-available.js","webpack:///./src/proxy-storage.js","webpack:///./src/web-storage.js","webpack:///./src/interceptors.js","webpack:///./src/proxy-mechanism.js","webpack:///./src/cookie-storage.js","webpack:///./src/format-metadata.js","webpack:///./src/expiration-date.js","webpack:///./src/memory-storage.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","isObject","value","toString","checkEmpty","key","Error","setProperty","obj","descriptor","writable","tryParse","parsed","JSON","parse","e","isAvailable","localStorage","cookieStorage","sessionStorage","memoryStorage","isStorageAvailable","storageType","storageObj","_webStorage","proxy","data","setItem","removeItem","storageAvailable","_isAvailable","webStorageSettings","default","configStorage","set","WebStorage","undefined","_webStorage2","storage","__storage__","keys","some","_classCallCheck","instance","Constructor","TypeError","copyKeys","forEach","_utils","fallback","msg","console","warn","_createClass","defineProperties","target","props","length","protoProps","staticProps","_interceptors","_interceptors2","_proxyMechanism","INSTANCES","BANNED_KEYS","cachedInstance","options","test","v","stringify","getItem","_this","clear","command","action","INTERCEPTORS","push","executeInterceptors","_len","arguments","args","Array","_key","shift","_typeof","reduce","val","transformed","concat","Symbol","iterator","constructor","_interopRequireDefault","_cookieStorage","_cookieStorage2","_memoryStorage","_memoryStorage2","window","findCookie","cookie","nameEQ","trim","indexOf","api","assign","path","$cookie","metadata","expires","Date","_expirationDate2","domain","secure","encodeURIComponent","_formatMetadata2","split","find","substring","decodeURIComponent","days","indexEQ","initialize","prop","index","_formatMetadata","_expirationDate","document","buildMetadataFor","formatMetadata","alterDate","opt","date","minutes","setMinutes","getMinutes","hours","setHours","getHours","setDate","getDate","months","setMonth","getMonth","years","setFullYear","getFullYear","buildExpiration","toUTCString","getStoreFromWindow","store","self","setStoreToWindow","hashtable"],"mappings":";CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,aAAAD,IAEAD,EAAA,aAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAA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BvD,QAAOqD,KAAKrK,KAAOoK,EAYN,QAASjI,KACtB,GAAMoI,GAAYJ,GAwBlB,OAAO3B,IArBL9F,QAFU,SAEFtB,EAAKH,GACXsJ,EAAUnJ,GAAOH,EACjBqJ,EAAiBC,IAGnBlF,QAPU,SAOFjE,GACN,GAAMH,GAAQsJ,EAAUnJ,EACxB,YAAiB+B,KAAVlC,EAAsB,KAAOA,GAGtC0B,WAZU,SAYCvB,SACFmJ,GAAUnJ,GACjBkJ,EAAiBC,IAGnBhF,MAjBU,WAkBRpF,OAAOoD,KAAKgH,GAAWzG,QAAQ,SAAA1C,GAAA,aAAcmJ,GAAUnJ,KACvDkJ,EAAiBC,KAIEA,GAYzB,QAAS/B,GAAWlB,EAAKiD,GAEvB,IAAK,GAAI9B,KAAQnB,IACf,EAAAvD,EAAAzC,aAAYgG,EAAKmB,EAInB,OADAtI,QAAOoH,OAAOD,EAAKiD,GACZjD,EXwzBTnH,OAAOC,eAAenB,EAAS,cAC7BgC,OAAO,GAGT,IAAIkF,GAA4B,kBAAXK,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUlF,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXiF,SAAyBjF,EAAImF,cAAgBF,QAAUjF,IAAQiF,OAAO5F,UAAY,eAAkBW,GAEtQtC,GAAQ8D,QW12BgBZ,CA1CxB,IAAA4B,GAAAxE,EAAA","file":"proxy-storage.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isObject = isObject;\nexports.checkEmpty = checkEmpty;\nexports.setProperty = setProperty;\nexports.tryParse = tryParse;\n/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined or empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nfunction checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nfunction setProperty(obj, name, value) {\n var descriptor = {\n configurable: false,\n enumerable: false,\n writable: false\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Try to parse a value from JSON.\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nfunction tryParse(value) {\n var parsed = void 0;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nvar isAvailable = exports.isAvailable = {\n localStorage: false,\n cookieStorage: false,\n sessionStorage: false,\n memoryStorage: true // fallback storage\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isAvailable = exports.configStorage = exports.WebStorage = exports.default = undefined;\n\nvar _webStorage = __webpack_require__(3);\n\nvar _webStorage2 = _interopRequireDefault(_webStorage);\n\nvar _isAvailable = __webpack_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\n/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nvar storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nvar configStorage = {\n get: function get() {\n return storage.__storage__;\n },\n\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set: function set(storageType) {\n exports.default = storage = new _webStorage2.default(storageType);\n }\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n var storageObj = _webStorage.proxy[storageType];\n var data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (_isAvailable.isAvailable[storageType]) {\n _webStorage.webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return _isAvailable.isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n _isAvailable.isAvailable.localStorage = isStorageAvailable('localStorage');\n _isAvailable.isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n _isAvailable.isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n _webStorage.webStorageSettings.isAvailable = _isAvailable.isAvailable;\n // sets the default storage mechanism available\n Object.keys(_isAvailable.isAvailable).some(storageAvailable);\n}\n\ninit();\n\n/**\n * @public API\n */\nexports.default = storage;\nexports.WebStorage = _webStorage2.default;\nexports.configStorage = configStorage;\nexports.isAvailable = _isAvailable.isAvailable;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = exports.webStorageSettings = exports.default = undefined;\n\nvar _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; }; }();\n\nvar _interceptors = __webpack_require__(4);\n\nvar _interceptors2 = _interopRequireDefault(_interceptors);\n\nvar _utils = __webpack_require__(0);\n\nvar _isAvailable = __webpack_require__(1);\n\nvar _proxyMechanism = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nvar INSTANCES = {};\n\n/**\n * @private\n *\n * Keys not allowed for cookies.\n *\n * @type {RegExp}\n */\nvar BANNED_KEYS = /^(?:expires|max-age|path|domain|secure)$/i;\n\n/**\n * @private\n *\n * Copies all existing keys in the storage.\n *\n * @param {CookieStorage} instance: the object to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {object}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach(function (key) {\n instance[key] = (0, _utils.tryParse)(storage[key]);\n });\n return instance;\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nvar webStorageSettings = {\n default: null,\n isAvailable: _isAvailable.isAvailable\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n var fallback = storageType === 'sessionStorage' ? 'memoryStorage' : webStorageSettings.default;\n var msg = storageType + ' is not available. Falling back to ' + fallback;\n console.warn(msg); // eslint-disable-line\n return fallback;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\n\nvar WebStorage = function () {\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n function WebStorage(storageType) {\n _classCallCheck(this, WebStorage);\n\n if (!Object.prototype.hasOwnProperty.call(_proxyMechanism.proxy, storageType)) {\n throw new Error('Storage type \"' + storageType + '\" is not valid');\n }\n // gets the requested storage mechanism\n var storage = _proxyMechanism.proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n var cachedInstance = INSTANCES[storageType];\n if (cachedInstance) {\n return copyKeys(cachedInstance, storage);\n }\n (0, _utils.setProperty)(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n INSTANCES[storageType] = copyKeys(this, storage);\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n\n _createClass(WebStorage, [{\n key: 'setItem',\n value: function setItem(key, value, options) {\n (0, _utils.checkEmpty)(key);\n var storageType = this.__storage__;\n if (storageType === 'cookieStorage' && BANNED_KEYS.test(key)) {\n throw new Error('The key is a reserved word, therefore not allowed');\n }\n var v = (0, _interceptors2.default)('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n _proxyMechanism.proxy[storageType].setItem(key, value, options);\n // checks if the cookie was created, or delete it if the domain or path are not valid\n if (storageType === 'cookieStorage' && _proxyMechanism.proxy[storageType].getItem(key) === null) {\n delete this[key];\n }\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'getItem',\n value: function getItem(key) {\n (0, _utils.checkEmpty)(key);\n var value = _proxyMechanism.proxy[this.__storage__].getItem(key);\n if (value == null) {\n // null or undefined\n delete this[key];\n value = null;\n } else {\n value = (0, _utils.tryParse)(value);\n this[key] = value;\n }\n var v = (0, _interceptors2.default)('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'removeItem',\n value: function removeItem(key, options) {\n (0, _utils.checkEmpty)(key);\n (0, _interceptors2.default)('removeItem', key, options);\n delete this[key];\n _proxyMechanism.proxy[this.__storage__].removeItem(key, options);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'clear',\n value: function clear() {\n var _this = this;\n\n (0, _interceptors2.default)('clear');\n Object.keys(this).forEach(function (key) {\n delete _this[key];\n }, this);\n _proxyMechanism.proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'length',\n get: function get() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }], [{\n key: 'interceptors',\n value: function interceptors(command, action) {\n if (command in _interceptors.INTERCEPTORS && typeof action === 'function') {\n _interceptors.INTERCEPTORS[command].push(action);\n }\n }\n }]);\n\n return WebStorage;\n}();\n\n/**\n * @public API\n */\n\n\nexports.default = WebStorage;\nexports.webStorageSettings = webStorageSettings;\nexports.proxy = _proxyMechanism.proxy;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nexports.default = executeInterceptors;\n/**\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nvar INTERCEPTORS = exports.INTERCEPTORS = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: []\n};\n\n/**\n * Executes the interceptors for a WebStorage method and allows\n * the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nfunction executeInterceptors(command) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var key = args.shift();\n var value = args.shift();\n if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return INTERCEPTORS[command].reduce(function (val, action) {\n var transformed = action.apply(undefined, [key, val].concat(args));\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = undefined;\n\nvar _cookieStorage = __webpack_require__(6);\n\nvar _cookieStorage2 = _interopRequireDefault(_cookieStorage);\n\nvar _memoryStorage = __webpack_require__(9);\n\nvar _memoryStorage2 = _interopRequireDefault(_memoryStorage);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @public\n *\n * Proxy for the storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nvar proxy = exports.proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: (0, _cookieStorage2.default)(),\n memoryStorage: (0, _memoryStorage2.default)()\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _utils = __webpack_require__(0);\n\nvar _formatMetadata = __webpack_require__(7);\n\nvar _formatMetadata2 = _interopRequireDefault(_formatMetadata);\n\nvar _expirationDate = __webpack_require__(8);\n\nvar _expirationDate2 = _interopRequireDefault(_expirationDate);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @private\n *\n * Proxy for document.cookie\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nvar $cookie = {\n get: function get() {\n return document.cookie;\n },\n set: function set(value) {\n document.cookie = value;\n },\n data: {} // metadata associated to the cookies\n};\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n var nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document.cookie,\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nfunction cookieStorage() {\n var api = {\n setItem: function setItem(key, value, options) {\n options = Object.assign({ path: '/' }, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = { path: options.path };\n var metadata = $cookie.data[key];\n if ((0, _utils.isObject)(options.expires) || options.expires instanceof Date) {\n metadata.expires = (0, _expirationDate2.default)(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n if (options.secure === true) metadata.secure = true;\n var cookie = key + '=' + encodeURIComponent(value) + (0, _formatMetadata2.default)(metadata);\n // TODO: should encodeURIComponent(key) ?\n $cookie.set(cookie);\n },\n getItem: function getItem(key) {\n var value = null;\n var nameEQ = key + '=';\n var cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n removeItem: function removeItem(key, options) {\n var metadata = Object.assign({}, $cookie.data[key], options);\n metadata.expires = { days: -1 };\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n clear: function clear() {\n var key = void 0,\n indexEQ = void 0;\n $cookie.get().split(';').forEach(function (cookie) {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n }\n };\n\n return initialize(api);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initialize(api) {\n // sets API members to read-only and non-enumerable\n for (var prop in api) {\n // eslint-disable-line\n (0, _utils.setProperty)(api, prop);\n }\n // copies all existing elements in the storage\n $cookie.get().split(';').forEach(function (cookie) {\n var index = cookie.indexOf('=');\n var key = cookie.substring(0, index).trim();\n var value = cookie.substring(index + 1).trim();\n if (key) api[key] = decodeURIComponent(value);\n });\n return api;\n}\n\n/**\n * @public API\n */\nexports.default = cookieStorage;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = formatMetadata;\n/**\n * @private\n *\n * Builds the string for the cookie metadata.\n *\n * @param {string} key: name of the metadata\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction buildMetadataFor(key, data) {\n if (!data[key]) return '';\n return ';' + key + '=' + data[key];\n}\n\n/**\n * Builds the whole string for the cookie metadata.\n *\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction formatMetadata(data) {\n var expires = buildMetadataFor('expires', data);\n var domain = buildMetadataFor('domain', data);\n var path = buildMetadataFor('path', data);\n var secure = data.secure ? ';secure' : '';\n return '' + expires + domain + path + secure;\n}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = buildExpiration;\n/**\n * @private\n *\n * Adds or subtracts date portions to the given date and returns the new date.\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nfunction alterDate() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var opt = Object.assign({}, options);\n var d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Builds the expiration for the cookie.\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\nfunction buildExpiration(date) {\n var expires = date instanceof Date ? alterDate({ date: date }) : alterDate(date);\n return expires.toUTCString();\n}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nexports.default = memoryStorage;\n\nvar _utils = __webpack_require__(0);\n\n/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() {\n var store = void 0;\n try {\n store = JSON.parse(window.self.name);\n } catch (e) {\n return {};\n }\n if (store && (typeof store === 'undefined' ? 'undefined' : _typeof(store)) === 'object') return store;\n return {};\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n var store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory, and implements\n * the Web Storage interface. It also adds a hack to persist\n * the storage in the session for the current tab (browser).\n *\n * @return {object}\n */\nfunction memoryStorage() {\n var hashtable = getStoreFromWindow();\n var api = {\n setItem: function setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n getItem: function getItem(key) {\n var value = hashtable[key];\n return value === undefined ? null : value;\n },\n removeItem: function removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n clear: function clear() {\n Object.keys(hashtable).forEach(function (key) {\n return delete hashtable[key];\n });\n setStoreToWindow(hashtable);\n }\n };\n\n return initialize(api, hashtable);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @param {object} hashtable: store from the window tab\n * @return {object}\n */\nfunction initialize(api, hashtable) {\n // sets API members to read-only and non-enumerable\n for (var prop in api) {\n // eslint-disable-line\n (0, _utils.setProperty)(api, prop);\n }\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n return api;\n}\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// proxy-storage.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap bee05f68f5d068a0697e","/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nexport function isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined or empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nexport function checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nexport function setProperty(obj, name, value) {\n const descriptor = {\n configurable: false,\n enumerable: false,\n writable: false,\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Try to parse a value from JSON.\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nexport function tryParse(value) {\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nexport const isAvailable = {\n localStorage: false,\n cookieStorage: false,\n sessionStorage: false,\n memoryStorage: true, // fallback storage\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/is-available.js","/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nimport WebStorage, {proxy, webStorageSettings} from './web-storage';\nimport {isAvailable} from './is-available';\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\nlet storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nconst configStorage = {\n get() {\n return storage.__storage__;\n },\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set(storageType) {\n storage = new WebStorage(storageType);\n },\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n const storageObj = proxy[storageType];\n const data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (isAvailable[storageType]) {\n webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n isAvailable.localStorage = isStorageAvailable('localStorage');\n isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n webStorageSettings.isAvailable = isAvailable;\n // sets the default storage mechanism available\n Object.keys(isAvailable).some(storageAvailable);\n}\n\ninit();\n\n/**\n * @public API\n */\nexport {storage as default, WebStorage, configStorage, isAvailable};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-storage.js","import executeInterceptors, {INTERCEPTORS} from './interceptors';\nimport {setProperty, checkEmpty, tryParse} from './utils';\nimport {isAvailable} from './is-available';\nimport {proxy} from './proxy-mechanism';\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nconst INSTANCES = {};\n\n/**\n * @private\n *\n * Keys not allowed for cookies.\n *\n * @type {RegExp}\n */\nconst BANNED_KEYS = /^(?:expires|max-age|path|domain|secure)$/i;\n\n/**\n * @private\n *\n * Copies all existing keys in the storage.\n *\n * @param {CookieStorage} instance: the object to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {object}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach((key) => {\n instance[key] = tryParse(storage[key]);\n });\n return instance;\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nconst webStorageSettings = {\n default: null,\n isAvailable,\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n const fallback =\n storageType === 'sessionStorage' ? 'memoryStorage' : webStorageSettings.default;\n const msg = `${storageType} is not available. Falling back to ${fallback}`;\n console.warn(msg); // eslint-disable-line\n return fallback;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\nclass WebStorage {\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n constructor(storageType) {\n if (!Object.prototype.hasOwnProperty.call(proxy, storageType)) {\n throw new Error(`Storage type \"${storageType}\" is not valid`);\n }\n // gets the requested storage mechanism\n const storage = proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n const cachedInstance = INSTANCES[storageType];\n if (cachedInstance) {\n return copyKeys(cachedInstance, storage);\n }\n setProperty(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n INSTANCES[storageType] = copyKeys(this, storage);\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n setItem(key, value, options) {\n checkEmpty(key);\n const storageType = this.__storage__;\n if (storageType === 'cookieStorage' && BANNED_KEYS.test(key)) {\n throw new Error('The key is a reserved word, therefore not allowed');\n }\n const v = executeInterceptors('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n proxy[storageType].setItem(key, value, options);\n // checks if the cookie was created, or delete it if the domain or path are not valid\n if (storageType === 'cookieStorage' && proxy[storageType].getItem(key) === null) {\n delete this[key];\n }\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n getItem(key) {\n checkEmpty(key);\n let value = proxy[this.__storage__].getItem(key);\n if (value == null) { // null or undefined\n delete this[key];\n value = null;\n } else {\n value = tryParse(value);\n this[key] = value;\n }\n const v = executeInterceptors('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n removeItem(key, options) {\n checkEmpty(key);\n executeInterceptors('removeItem', key, options);\n delete this[key];\n proxy[this.__storage__].removeItem(key, options);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n clear() {\n executeInterceptors('clear');\n Object.keys(this).forEach((key) => {\n delete this[key];\n }, this);\n proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n get length() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n static interceptors(command, action) {\n if (command in INTERCEPTORS && typeof action === 'function') {\n INTERCEPTORS[command].push(action);\n }\n }\n}\n\n/**\n * @public API\n */\nexport {WebStorage as default, webStorageSettings, proxy};\n\n\n\n// WEBPACK FOOTER //\n// ./src/web-storage.js","/**\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nexport const INTERCEPTORS = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: [],\n};\n\n/**\n * Executes the interceptors for a WebStorage method and allows\n * the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nexport default function executeInterceptors(command, ...args) {\n const key = args.shift();\n let value = args.shift();\n if (value && typeof value === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return INTERCEPTORS[command].reduce((val, action) => {\n const transformed = action(key, val, ...args);\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/interceptors.js","import cookieStorage from './cookie-storage';\nimport memoryStorage from './memory-storage';\n\n/**\n * @public\n *\n * Proxy for the storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nexport const proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: cookieStorage(),\n memoryStorage: memoryStorage(),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-mechanism.js","import {isObject, setProperty} from './utils';\nimport formatMetadata from './format-metadata';\nimport buildExpiration from './expiration-date';\n\n/**\n * @private\n *\n * Proxy for document.cookie\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nconst $cookie = {\n get: () => document.cookie,\n set: (value) => {\n document.cookie = value;\n },\n data: {}, // metadata associated to the cookies\n};\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n const nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document.cookie,\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nfunction cookieStorage() {\n const api = {\n\n setItem(key, value, options) {\n options = Object.assign({path: '/'}, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = {path: options.path};\n const metadata = $cookie.data[key];\n if (isObject(options.expires) || options.expires instanceof Date) {\n metadata.expires = buildExpiration(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n if (options.secure === true) metadata.secure = true;\n const cookie = `${key}=${encodeURIComponent(value)}${formatMetadata(metadata)}`;\n // TODO: should encodeURIComponent(key) ?\n $cookie.set(cookie);\n },\n\n getItem(key) {\n let value = null;\n const nameEQ = `${key}=`;\n const cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n\n removeItem(key, options) {\n const metadata = Object.assign({}, $cookie.data[key], options);\n metadata.expires = {days: -1};\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n\n clear() {\n let key, indexEQ;\n $cookie.get().split(';').forEach((cookie) => {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n },\n };\n\n return initialize(api);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initialize(api) {\n // sets API members to read-only and non-enumerable\n for (let prop in api) { // eslint-disable-line\n setProperty(api, prop);\n }\n // copies all existing elements in the storage\n $cookie.get().split(';').forEach((cookie) => {\n const index = cookie.indexOf('=');\n const key = cookie.substring(0, index).trim();\n const value = cookie.substring(index + 1).trim();\n if (key) api[key] = decodeURIComponent(value);\n });\n return api;\n}\n\n/**\n * @public API\n */\nexport default cookieStorage;\n\n\n\n// WEBPACK FOOTER //\n// ./src/cookie-storage.js","/**\n * @private\n *\n * Builds the string for the cookie metadata.\n *\n * @param {string} key: name of the metadata\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction buildMetadataFor(key, data) {\n if (!data[key]) return '';\n return `;${key}=${data[key]}`;\n}\n\n/**\n * Builds the whole string for the cookie metadata.\n *\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nexport default function formatMetadata(data) {\n const expires = buildMetadataFor('expires', data);\n const domain = buildMetadataFor('domain', data);\n const path = buildMetadataFor('path', data);\n const secure = data.secure ? ';secure' : '';\n return `${expires}${domain}${path}${secure}`;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/format-metadata.js","/**\n * @private\n *\n * Adds or subtracts date portions to the given date and returns the new date.\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nfunction alterDate(options = {}) {\n const opt = Object.assign({}, options);\n const d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Builds the expiration for the cookie.\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\nexport default function buildExpiration(date) {\n const expires = (date instanceof Date ?\n alterDate({date}) :\n alterDate(date));\n return expires.toUTCString();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/expiration-date.js","import {setProperty} from './utils';\n\n/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() {\n let store;\n try {\n store = JSON.parse(window.self.name);\n } catch (e) {\n return {};\n }\n if (store && typeof store === 'object') return store;\n return {};\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n const store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory, and implements\n * the Web Storage interface. It also adds a hack to persist\n * the storage in the session for the current tab (browser).\n *\n * @return {object}\n */\nexport default function memoryStorage() {\n const hashtable = getStoreFromWindow();\n const api = {\n\n setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n\n getItem(key) {\n const value = hashtable[key];\n return value === undefined ? null : value;\n },\n\n removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n\n clear() {\n Object.keys(hashtable).forEach(key => delete hashtable[key]);\n setStoreToWindow(hashtable);\n },\n };\n\n return initialize(api, hashtable);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @param {object} hashtable: store from the window tab\n * @return {object}\n */\nfunction initialize(api, hashtable) {\n // sets API members to read-only and non-enumerable\n for (let prop in api) { // eslint-disable-line\n setProperty(api, prop);\n }\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n return api;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/memory-storage.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///proxy-storage.min.js","webpack:///webpack/bootstrap fd32f1307368e64ca7b0","webpack:///./src/utils.js","webpack:///./src/is-available.js","webpack:///./src/proxy-storage.js","webpack:///./src/web-storage.js","webpack:///./src/interceptors.js","webpack:///./src/proxy-mechanism.js","webpack:///./src/cookie-storage.js","webpack:///./src/format-metadata.js","webpack:///./src/expiration-date.js","webpack:///./src/memory-storage.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","isObject","value","toString","checkEmpty","key","Error","setProperty","obj","descriptor","writable","tryParse","parsed","JSON","parse","e","isAvailable","localStorage","cookieStorage","sessionStorage","memoryStorage","isStorageAvailable","storageType","storageObj","_webStorage","proxy","data","setItem","removeItem","storageAvailable","_isAvailable","webStorageSettings","default","configStorage","set","WebStorage","undefined","_webStorage2","storage","__storage__","keys","some","_classCallCheck","instance","Constructor","TypeError","copyKeys","forEach","_utils","fallback","msg","console","warn","_createClass","defineProperties","target","props","length","protoProps","staticProps","_interceptors","_interceptors2","_proxyMechanism","INSTANCES","BANNED_KEYS","cachedInstance","options","test","v","stringify","getItem","_this","clear","command","action","INTERCEPTORS","push","executeInterceptors","_len","arguments","args","Array","_key","shift","_typeof","reduce","val","transformed","concat","Symbol","iterator","constructor","_interopRequireDefault","_cookieStorage","_cookieStorage2","_memoryStorage","_memoryStorage2","window","findCookie","cookie","nameEQ","trim","indexOf","api","assign","path","$cookie","metadata","expires","Date","_expirationDate2","domain","secure","encodeURIComponent","_formatMetadata2","split","find","substring","decodeURIComponent","days","indexEQ","initialize","prop","index","_formatMetadata","_expirationDate","document","buildMetadataFor","formatMetadata","alterDate","opt","date","minutes","setMinutes","getMinutes","hours","setHours","getHours","setDate","getDate","months","setMonth","getMonth","years","setFullYear","getFullYear","buildExpiration","toUTCString","getStoreFromWindow","store","self","setStoreToWindow","hashtable"],"mappings":";CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,aAAAD,IAEAD,EAAA,aAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAtB,GACA,GAAAe,GAAAf,KAAAuB,WACA,WAA2B,MAAAvB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAK,GAAAQ,EAAAE,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BC,IAGnBlF,QAPU,SAOFjE,GACN,GAAMH,GAAQsJ,EAAUnJ,EACxB,YAAiB+B,KAAVlC,EAAsB,KAAOA,GAGtC0B,WAZU,SAYCvB,SACFmJ,GAAUnJ,GACjBkJ,EAAiBC,IAGnBhF,MAjBU,WAkBRpF,OAAOoD,KAAKgH,GAAWzG,QAAQ,SAAA1C,GAAA,aAAcmJ,GAAUnJ,KACvDkJ,EAAiBC,KAIEA,GAYzB,QAAS/B,GAAWlB,EAAKiD,GAEvB,IAAK,GAAI9B,KAAQnB,IACf,EAAAvD,EAAAzC,aAAYgG,EAAKmB,EAInB,OADAtI,QAAOoH,OAAOD,EAAKiD,GACZjD,EX6zBTnH,OAAOC,eAAenB,EAAS,cAC7BgC,OAAO,GAGT,IAAIkF,GAA4B,kBAAXK,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUlF,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXiF,SAAyBjF,EAAImF,cAAgBF,QAAUjF,IAAQiF,OAAO5F,UAAY,eAAkBW,GAEtQtC,GAAQ8D,QW/2BgBZ,CA1CxB,IAAA4B,GAAAxE,EAAA","file":"proxy-storage.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isObject = isObject;\nexports.checkEmpty = checkEmpty;\nexports.setProperty = setProperty;\nexports.tryParse = tryParse;\n/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined or empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nfunction checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nfunction setProperty(obj, name, value) {\n var descriptor = {\n configurable: false,\n enumerable: false,\n writable: false\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Try to parse a value from JSON.\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nfunction tryParse(value) {\n var parsed = void 0;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nvar isAvailable = exports.isAvailable = {\n localStorage: false,\n cookieStorage: false,\n sessionStorage: false,\n memoryStorage: true // fallback storage\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isAvailable = exports.configStorage = exports.WebStorage = exports.default = undefined;\n\nvar _webStorage = __webpack_require__(3);\n\nvar _webStorage2 = _interopRequireDefault(_webStorage);\n\nvar _isAvailable = __webpack_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\n/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nvar storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nvar configStorage = {\n get: function get() {\n return storage.__storage__;\n },\n\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set: function set(storageType) {\n exports.default = storage = new _webStorage2.default(storageType);\n }\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n var storageObj = _webStorage.proxy[storageType];\n var data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (_isAvailable.isAvailable[storageType]) {\n _webStorage.webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return _isAvailable.isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n _isAvailable.isAvailable.localStorage = isStorageAvailable('localStorage');\n _isAvailable.isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n _isAvailable.isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n _webStorage.webStorageSettings.isAvailable = _isAvailable.isAvailable;\n // sets the default storage mechanism available\n Object.keys(_isAvailable.isAvailable).some(storageAvailable);\n}\n\ninit();\n\n/**\n * @public API\n */\nexports.default = storage;\nexports.WebStorage = _webStorage2.default;\nexports.configStorage = configStorage;\nexports.isAvailable = _isAvailable.isAvailable;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = exports.webStorageSettings = exports.default = undefined;\n\nvar _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; }; }();\n\nvar _interceptors = __webpack_require__(4);\n\nvar _interceptors2 = _interopRequireDefault(_interceptors);\n\nvar _utils = __webpack_require__(0);\n\nvar _isAvailable = __webpack_require__(1);\n\nvar _proxyMechanism = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nvar INSTANCES = {};\n\n/**\n * @private\n *\n * Keys not allowed for cookies.\n *\n * @type {RegExp}\n */\nvar BANNED_KEYS = /^(?:expires|max-age|path|domain|secure)$/i;\n\n/**\n * @private\n *\n * Copies all existing keys in the storage.\n *\n * @param {CookieStorage} instance: the object to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {object}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach(function (key) {\n instance[key] = (0, _utils.tryParse)(storage[key]);\n });\n return instance;\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nvar webStorageSettings = {\n default: null,\n isAvailable: _isAvailable.isAvailable\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n var fallback = storageType === 'sessionStorage' ? 'memoryStorage' : webStorageSettings.default;\n var msg = storageType + ' is not available. Falling back to ' + fallback;\n console.warn(msg); // eslint-disable-line\n return fallback;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\n\nvar WebStorage = function () {\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n function WebStorage(storageType) {\n _classCallCheck(this, WebStorage);\n\n if (!Object.prototype.hasOwnProperty.call(_proxyMechanism.proxy, storageType)) {\n throw new Error('Storage type \"' + storageType + '\" is not valid');\n }\n // gets the requested storage mechanism\n var storage = _proxyMechanism.proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n var cachedInstance = INSTANCES[storageType];\n if (cachedInstance) {\n return copyKeys(cachedInstance, storage);\n }\n (0, _utils.setProperty)(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n INSTANCES[storageType] = copyKeys(this, storage);\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n\n _createClass(WebStorage, [{\n key: 'setItem',\n value: function setItem(key, value, options) {\n (0, _utils.checkEmpty)(key);\n var storageType = this.__storage__;\n if (storageType === 'cookieStorage' && BANNED_KEYS.test(key)) {\n throw new Error('The key is a reserved word, therefore not allowed');\n }\n var v = (0, _interceptors2.default)('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n _proxyMechanism.proxy[storageType].setItem(key, value, options);\n // checks if the cookie was created, or delete it if the domain or path are not valid\n if (storageType === 'cookieStorage' && _proxyMechanism.proxy[storageType].getItem(key) === null) {\n delete this[key];\n }\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'getItem',\n value: function getItem(key) {\n (0, _utils.checkEmpty)(key);\n var value = _proxyMechanism.proxy[this.__storage__].getItem(key);\n if (value == null) {\n // null or undefined\n delete this[key];\n value = null;\n } else {\n value = (0, _utils.tryParse)(value);\n this[key] = value;\n }\n var v = (0, _interceptors2.default)('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'removeItem',\n value: function removeItem(key, options) {\n (0, _utils.checkEmpty)(key);\n (0, _interceptors2.default)('removeItem', key, options);\n delete this[key];\n _proxyMechanism.proxy[this.__storage__].removeItem(key, options);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'clear',\n value: function clear() {\n var _this = this;\n\n (0, _interceptors2.default)('clear');\n Object.keys(this).forEach(function (key) {\n delete _this[key];\n }, this);\n _proxyMechanism.proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'length',\n get: function get() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }], [{\n key: 'interceptors',\n value: function interceptors(command, action) {\n if (command in _interceptors.INTERCEPTORS && typeof action === 'function') {\n _interceptors.INTERCEPTORS[command].push(action);\n }\n }\n }]);\n\n return WebStorage;\n}();\n\n/**\n * @public API\n */\n\n\nexports.default = WebStorage;\nexports.webStorageSettings = webStorageSettings;\nexports.proxy = _proxyMechanism.proxy;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nexports.default = executeInterceptors;\n/**\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nvar INTERCEPTORS = exports.INTERCEPTORS = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: []\n};\n\n/**\n * Executes the interceptors for a WebStorage method and allows\n * the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nfunction executeInterceptors(command) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var key = args.shift();\n var value = args.shift();\n if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return INTERCEPTORS[command].reduce(function (val, action) {\n var transformed = action.apply(undefined, [key, val].concat(args));\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = undefined;\n\nvar _cookieStorage = __webpack_require__(6);\n\nvar _cookieStorage2 = _interopRequireDefault(_cookieStorage);\n\nvar _memoryStorage = __webpack_require__(9);\n\nvar _memoryStorage2 = _interopRequireDefault(_memoryStorage);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @public\n *\n * Proxy for the storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nvar proxy = exports.proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: (0, _cookieStorage2.default)(),\n memoryStorage: (0, _memoryStorage2.default)()\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _utils = __webpack_require__(0);\n\nvar _formatMetadata = __webpack_require__(7);\n\nvar _formatMetadata2 = _interopRequireDefault(_formatMetadata);\n\nvar _expirationDate = __webpack_require__(8);\n\nvar _expirationDate2 = _interopRequireDefault(_expirationDate);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @private\n *\n * Proxy for document.cookie\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nvar $cookie = {\n get: function get() {\n return document.cookie;\n },\n set: function set(value) {\n document.cookie = value;\n },\n data: {} // metadata associated to the cookies\n};\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n var nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document.cookie,\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nfunction cookieStorage() {\n var api = {\n setItem: function setItem(key, value, options) {\n options = Object.assign({ path: '/' }, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = { path: options.path };\n var metadata = $cookie.data[key];\n if ((0, _utils.isObject)(options.expires) || options.expires instanceof Date) {\n metadata.expires = (0, _expirationDate2.default)(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n if (options.secure === true) metadata.secure = true;\n var cookie = key + '=' + encodeURIComponent(value) + (0, _formatMetadata2.default)(metadata);\n // TODO: should encodeURIComponent(key) ?\n $cookie.set(cookie);\n },\n getItem: function getItem(key) {\n var value = null;\n var nameEQ = key + '=';\n var cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n\n\n // TODO: Add the method getAll() to get all cookies\n // https://github.com/jherax/proxy-storage/issues/6\n\n removeItem: function removeItem(key, options) {\n var metadata = Object.assign({}, $cookie.data[key], options);\n metadata.expires = { days: -1 };\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n clear: function clear() {\n var key = void 0,\n indexEQ = void 0;\n $cookie.get().split(';').forEach(function (cookie) {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n }\n };\n\n return initialize(api);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initialize(api) {\n // sets API members to read-only and non-enumerable\n for (var prop in api) {\n // eslint-disable-line\n (0, _utils.setProperty)(api, prop);\n }\n // copies all existing elements in the storage\n $cookie.get().split(';').forEach(function (cookie) {\n var index = cookie.indexOf('=');\n var key = cookie.substring(0, index).trim();\n var value = cookie.substring(index + 1).trim();\n if (key) api[key] = decodeURIComponent(value);\n });\n return api;\n}\n\n/**\n * @public API\n */\nexports.default = cookieStorage;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = formatMetadata;\n/**\n * @private\n *\n * Builds the string for the cookie metadata.\n *\n * @param {string} key: name of the metadata\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction buildMetadataFor(key, data) {\n if (!data[key]) return '';\n return ';' + key + '=' + data[key];\n}\n\n/**\n * Builds the whole string for the cookie metadata.\n *\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction formatMetadata(data) {\n var expires = buildMetadataFor('expires', data);\n var domain = buildMetadataFor('domain', data);\n var path = buildMetadataFor('path', data);\n var secure = data.secure ? ';secure' : '';\n return '' + expires + domain + path + secure;\n}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = buildExpiration;\n/**\n * @private\n *\n * Adds or subtracts date portions to the given date and returns the new date.\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nfunction alterDate() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var opt = Object.assign({}, options);\n var d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Builds the expiration for the cookie.\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\nfunction buildExpiration(date) {\n var expires = date instanceof Date ? alterDate({ date: date }) : alterDate(date);\n return expires.toUTCString();\n}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nexports.default = memoryStorage;\n\nvar _utils = __webpack_require__(0);\n\n/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() {\n var store = void 0;\n try {\n store = JSON.parse(window.self.name);\n } catch (e) {\n return {};\n }\n if (store && (typeof store === 'undefined' ? 'undefined' : _typeof(store)) === 'object') return store;\n return {};\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n var store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory, and implements\n * the Web Storage interface. It also adds a hack to persist\n * the storage in the session for the current tab (browser).\n *\n * @return {object}\n */\nfunction memoryStorage() {\n var hashtable = getStoreFromWindow();\n var api = {\n setItem: function setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n getItem: function getItem(key) {\n var value = hashtable[key];\n return value === undefined ? null : value;\n },\n removeItem: function removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n clear: function clear() {\n Object.keys(hashtable).forEach(function (key) {\n return delete hashtable[key];\n });\n setStoreToWindow(hashtable);\n }\n };\n\n return initialize(api, hashtable);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @param {object} hashtable: store from the window tab\n * @return {object}\n */\nfunction initialize(api, hashtable) {\n // sets API members to read-only and non-enumerable\n for (var prop in api) {\n // eslint-disable-line\n (0, _utils.setProperty)(api, prop);\n }\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n return api;\n}\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// proxy-storage.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap fd32f1307368e64ca7b0","/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nexport function isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined or empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nexport function checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nexport function setProperty(obj, name, value) {\n const descriptor = {\n configurable: false,\n enumerable: false,\n writable: false,\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Try to parse a value from JSON.\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nexport function tryParse(value) {\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nexport const isAvailable = {\n localStorage: false,\n cookieStorage: false,\n sessionStorage: false,\n memoryStorage: true, // fallback storage\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/is-available.js","/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nimport WebStorage, {proxy, webStorageSettings} from './web-storage';\nimport {isAvailable} from './is-available';\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\nlet storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nconst configStorage = {\n get() {\n return storage.__storage__;\n },\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set(storageType) {\n storage = new WebStorage(storageType);\n },\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n const storageObj = proxy[storageType];\n const data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (isAvailable[storageType]) {\n webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n isAvailable.localStorage = isStorageAvailable('localStorage');\n isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n webStorageSettings.isAvailable = isAvailable;\n // sets the default storage mechanism available\n Object.keys(isAvailable).some(storageAvailable);\n}\n\ninit();\n\n/**\n * @public API\n */\nexport {storage as default, WebStorage, configStorage, isAvailable};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-storage.js","import executeInterceptors, {INTERCEPTORS} from './interceptors';\nimport {setProperty, checkEmpty, tryParse} from './utils';\nimport {isAvailable} from './is-available';\nimport {proxy} from './proxy-mechanism';\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nconst INSTANCES = {};\n\n/**\n * @private\n *\n * Keys not allowed for cookies.\n *\n * @type {RegExp}\n */\nconst BANNED_KEYS = /^(?:expires|max-age|path|domain|secure)$/i;\n\n/**\n * @private\n *\n * Copies all existing keys in the storage.\n *\n * @param {CookieStorage} instance: the object to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {object}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach((key) => {\n instance[key] = tryParse(storage[key]);\n });\n return instance;\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nconst webStorageSettings = {\n default: null,\n isAvailable,\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n const fallback =\n storageType === 'sessionStorage' ? 'memoryStorage' : webStorageSettings.default;\n const msg = `${storageType} is not available. Falling back to ${fallback}`;\n console.warn(msg); // eslint-disable-line\n return fallback;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\nclass WebStorage {\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n constructor(storageType) {\n if (!Object.prototype.hasOwnProperty.call(proxy, storageType)) {\n throw new Error(`Storage type \"${storageType}\" is not valid`);\n }\n // gets the requested storage mechanism\n const storage = proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n const cachedInstance = INSTANCES[storageType];\n if (cachedInstance) {\n return copyKeys(cachedInstance, storage);\n }\n setProperty(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n INSTANCES[storageType] = copyKeys(this, storage);\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n setItem(key, value, options) {\n checkEmpty(key);\n const storageType = this.__storage__;\n if (storageType === 'cookieStorage' && BANNED_KEYS.test(key)) {\n throw new Error('The key is a reserved word, therefore not allowed');\n }\n const v = executeInterceptors('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n proxy[storageType].setItem(key, value, options);\n // checks if the cookie was created, or delete it if the domain or path are not valid\n if (storageType === 'cookieStorage' && proxy[storageType].getItem(key) === null) {\n delete this[key];\n }\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n getItem(key) {\n checkEmpty(key);\n let value = proxy[this.__storage__].getItem(key);\n if (value == null) { // null or undefined\n delete this[key];\n value = null;\n } else {\n value = tryParse(value);\n this[key] = value;\n }\n const v = executeInterceptors('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n removeItem(key, options) {\n checkEmpty(key);\n executeInterceptors('removeItem', key, options);\n delete this[key];\n proxy[this.__storage__].removeItem(key, options);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n clear() {\n executeInterceptors('clear');\n Object.keys(this).forEach((key) => {\n delete this[key];\n }, this);\n proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n get length() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n static interceptors(command, action) {\n if (command in INTERCEPTORS && typeof action === 'function') {\n INTERCEPTORS[command].push(action);\n }\n }\n}\n\n/**\n * @public API\n */\nexport {WebStorage as default, webStorageSettings, proxy};\n\n\n\n// WEBPACK FOOTER //\n// ./src/web-storage.js","/**\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nexport const INTERCEPTORS = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: [],\n};\n\n/**\n * Executes the interceptors for a WebStorage method and allows\n * the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nexport default function executeInterceptors(command, ...args) {\n const key = args.shift();\n let value = args.shift();\n if (value && typeof value === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return INTERCEPTORS[command].reduce((val, action) => {\n const transformed = action(key, val, ...args);\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/interceptors.js","import cookieStorage from './cookie-storage';\nimport memoryStorage from './memory-storage';\n\n/**\n * @public\n *\n * Proxy for the storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nexport const proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: cookieStorage(),\n memoryStorage: memoryStorage(),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-mechanism.js","import {isObject, setProperty} from './utils';\nimport formatMetadata from './format-metadata';\nimport buildExpiration from './expiration-date';\n\n/**\n * @private\n *\n * Proxy for document.cookie\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nconst $cookie = {\n get: () => document.cookie,\n set: (value) => {\n document.cookie = value;\n },\n data: {}, // metadata associated to the cookies\n};\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n const nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document.cookie,\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nfunction cookieStorage() {\n const api = {\n\n setItem(key, value, options) {\n options = Object.assign({path: '/'}, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = {path: options.path};\n const metadata = $cookie.data[key];\n if (isObject(options.expires) || options.expires instanceof Date) {\n metadata.expires = buildExpiration(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n if (options.secure === true) metadata.secure = true;\n const cookie = `${key}=${encodeURIComponent(value)}${formatMetadata(metadata)}`;\n // TODO: should encodeURIComponent(key) ?\n $cookie.set(cookie);\n },\n\n getItem(key) {\n let value = null;\n const nameEQ = `${key}=`;\n const cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n\n // TODO: Add the method getAll() to get all cookies\n // https://github.com/jherax/proxy-storage/issues/6\n\n removeItem(key, options) {\n const metadata = Object.assign({}, $cookie.data[key], options);\n metadata.expires = {days: -1};\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n\n clear() {\n let key, indexEQ;\n $cookie.get().split(';').forEach((cookie) => {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n },\n };\n\n return initialize(api);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initialize(api) {\n // sets API members to read-only and non-enumerable\n for (let prop in api) { // eslint-disable-line\n setProperty(api, prop);\n }\n // copies all existing elements in the storage\n $cookie.get().split(';').forEach((cookie) => {\n const index = cookie.indexOf('=');\n const key = cookie.substring(0, index).trim();\n const value = cookie.substring(index + 1).trim();\n if (key) api[key] = decodeURIComponent(value);\n });\n return api;\n}\n\n/**\n * @public API\n */\nexport default cookieStorage;\n\n\n\n// WEBPACK FOOTER //\n// ./src/cookie-storage.js","/**\n * @private\n *\n * Builds the string for the cookie metadata.\n *\n * @param {string} key: name of the metadata\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction buildMetadataFor(key, data) {\n if (!data[key]) return '';\n return `;${key}=${data[key]}`;\n}\n\n/**\n * Builds the whole string for the cookie metadata.\n *\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nexport default function formatMetadata(data) {\n const expires = buildMetadataFor('expires', data);\n const domain = buildMetadataFor('domain', data);\n const path = buildMetadataFor('path', data);\n const secure = data.secure ? ';secure' : '';\n return `${expires}${domain}${path}${secure}`;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/format-metadata.js","/**\n * @private\n *\n * Adds or subtracts date portions to the given date and returns the new date.\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nfunction alterDate(options = {}) {\n const opt = Object.assign({}, options);\n const d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Builds the expiration for the cookie.\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\nexport default function buildExpiration(date) {\n const expires = (date instanceof Date ?\n alterDate({date}) :\n alterDate(date));\n return expires.toUTCString();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/expiration-date.js","import {setProperty} from './utils';\n\n/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() {\n let store;\n try {\n store = JSON.parse(window.self.name);\n } catch (e) {\n return {};\n }\n if (store && typeof store === 'object') return store;\n return {};\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n const store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory, and implements\n * the Web Storage interface. It also adds a hack to persist\n * the storage in the session for the current tab (browser).\n *\n * @return {object}\n */\nexport default function memoryStorage() {\n const hashtable = getStoreFromWindow();\n const api = {\n\n setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n\n getItem(key) {\n const value = hashtable[key];\n return value === undefined ? null : value;\n },\n\n removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n\n clear() {\n Object.keys(hashtable).forEach(key => delete hashtable[key]);\n setStoreToWindow(hashtable);\n },\n };\n\n return initialize(api, hashtable);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @param {object} hashtable: store from the window tab\n * @return {object}\n */\nfunction initialize(api, hashtable) {\n // sets API members to read-only and non-enumerable\n for (let prop in api) { // eslint-disable-line\n setProperty(api, prop);\n }\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n return api;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/memory-storage.js"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index b2c8a4b..51442ef 100644 --- a/package.json +++ b/package.json @@ -34,17 +34,17 @@ }, "license": "MIT", "devDependencies": { - "babel-core": "^6.25.0", + "babel-core": "^6.26.0", "babel-eslint": "^7.2.3", - "babel-loader": "^7.1.1", + "babel-loader": "^7.1.2", "babel-preset-es2015": "^6.24.1", "babel-preset-stage-2": "^6.24.1", "clean-webpack-plugin": "^0.1.16", - "eslint": "^4.2.0", - "eslint-config-airbnb-base": "^11.2.0", + "eslint": "^4.5.0", + "eslint-config-airbnb-base": "^11.3.2", "eslint-loader": "^1.9.0", "eslint-plugin-import": "^2.7.0", - "webpack": "^3.3.0" + "webpack": "^3.5.5" }, "babel": { "presets": [ diff --git a/src/cookie-storage.js b/src/cookie-storage.js index cb64338..046e7e7 100644 --- a/src/cookie-storage.js +++ b/src/cookie-storage.js @@ -75,6 +75,9 @@ function cookieStorage() { return value; }, + // TODO: Add the method getAll() to get all cookies + // https://github.com/jherax/proxy-storage/issues/6 + removeItem(key, options) { const metadata = Object.assign({}, $cookie.data[key], options); metadata.expires = {days: -1}; diff --git a/yarn.lock b/yarn.lock index cf783f9..ad88c8a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26,10 +26,14 @@ acorn@^4.0.3: version "4.0.4" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" -acorn@^5.0.0, acorn@^5.0.1: +acorn@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" +acorn@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.1.tgz#53fe161111f912ab999ee887a90a0bc52822fd75" + ajv-keywords@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.1.1.tgz#02550bc605a3e576041565628af972e06c549d50" @@ -79,10 +83,20 @@ ansi-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107" +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" +ansi-styles@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" + dependencies: + color-convert "^1.9.0" + anymatch@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" @@ -191,29 +205,37 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@^6.24.1, babel-core@^6.25.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.25.0.tgz#7dd42b0463c742e9d5296deb3ec67a9322dad729" +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: - babel-code-frame "^6.22.0" - babel-generator "^6.25.0" + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" babel-helpers "^6.24.1" babel-messages "^6.23.0" - babel-register "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.25.0" - babel-traverse "^6.25.0" - babel-types "^6.25.0" - babylon "^6.17.2" - convert-source-map "^1.1.0" - debug "^2.1.1" - json5 "^0.5.0" - lodash "^4.2.0" - minimatch "^3.0.2" - path-is-absolute "^1.0.0" - private "^0.1.6" + 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.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" slash "^1.0.0" - source-map "^0.5.0" + source-map "^0.5.6" babel-eslint@^7.2.3: version "7.2.3" @@ -224,17 +246,17 @@ babel-eslint@^7.2.3: babel-types "^6.23.0" babylon "^6.17.0" -babel-generator@^6.25.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.25.0.tgz#33a1af70d5f2890aeb465a4a7793c1df6a9ea9fc" +babel-generator@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" dependencies: babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.25.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" detect-indent "^4.0.0" jsesc "^1.3.0" - lodash "^4.2.0" - source-map "^0.5.0" + lodash "^4.17.4" + source-map "^0.5.6" trim-right "^1.0.1" babel-helper-bindify-decorators@^6.24.1: @@ -355,9 +377,9 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-loader@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.1.tgz#b87134c8b12e3e4c2a94e0546085bc680a2b8488" +babel-loader@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.2.tgz#f6cbe122710f1aa2af4d881c6d5b54358ca24126" dependencies: find-cache-dir "^1.0.0" loader-utils "^1.0.2" @@ -686,17 +708,17 @@ babel-preset-stage-3@^6.24.1: babel-plugin-transform-exponentiation-operator "^6.24.1" babel-plugin-transform-object-rest-spread "^6.22.0" -babel-register@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f" +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" dependencies: - babel-core "^6.24.1" - babel-runtime "^6.22.0" - core-js "^2.4.0" + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" home-or-tmp "^2.0.0" - lodash "^4.2.0" + lodash "^4.17.4" mkdirp "^0.5.1" - source-map-support "^0.4.2" + source-map-support "^0.4.15" babel-runtime@^6.18.0, babel-runtime@^6.22.0: version "6.23.0" @@ -705,7 +727,14 @@ babel-runtime@^6.18.0, babel-runtime@^6.22.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-template@^6.24.1, babel-template@^6.25.0: +babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1: version "6.25.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.25.0.tgz#665241166b7c2aa4c619d71e192969552b10c071" dependencies: @@ -715,6 +744,16 @@ babel-template@^6.24.1, babel-template@^6.25.0: babylon "^6.17.2" lodash "^4.2.0" +babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + babel-traverse@^6.23.1, babel-traverse@^6.24.1, babel-traverse@^6.25.0: version "6.25.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1" @@ -729,6 +768,20 @@ babel-traverse@^6.23.1, babel-traverse@^6.24.1, babel-traverse@^6.25.0: invariant "^2.2.0" lodash "^4.2.0" +babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24.1, babel-types@^6.25.0: version "6.25.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e" @@ -738,10 +791,23 @@ babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24.1, babel-types@^6.25 lodash "^4.2.0" to-fast-properties "^1.0.1" +babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + babylon@^6.17.0, babylon@^6.17.2: version "6.17.4" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a" +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" @@ -899,9 +965,9 @@ camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" caseless@~0.11.0: version "0.11.0" @@ -924,6 +990,14 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + chokidar@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" @@ -991,6 +1065,16 @@ code-point-at@^1.0.0: dependencies: number-is-nan "^1.0.0" +color-convert@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" @@ -1037,14 +1121,18 @@ contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" -convert-source-map@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67" +convert-source-map@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" core-js@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" +core-js@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.0.tgz#569c050918be6486b3837552028ae0466b717086" + core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1072,6 +1160,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2: create-hash "^1.1.0" inherits "^2.0.1" +cross-spawn@^5.0.1, cross-spawn@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + cryptiles@2.x.x: version "2.0.5" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" @@ -1109,18 +1205,18 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" -debug@^2.1.1, debug@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" - dependencies: - ms "0.7.1" - debug@^2.2.0, debug@^2.6.8: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: ms "2.0.0" +debug@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" + dependencies: + ms "0.7.1" + decamelize@^1.0.0, decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1214,14 +1310,14 @@ emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" -enhanced-resolve@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.3.0.tgz#950964ecc7f0332a42321b673b38dc8ff15535b3" +enhanced-resolve@^3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e" dependencies: graceful-fs "^4.1.2" memory-fs "^0.4.0" object-assign "^4.0.1" - tapable "^0.2.5" + tapable "^0.2.7" errno@^0.1.3: version "0.1.4" @@ -1300,9 +1396,11 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-airbnb-base@^11.2.0: - version "11.2.0" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-11.2.0.tgz#19a9dc4481a26f70904545ec040116876018f853" +eslint-config-airbnb-base@^11.3.2: + version "11.3.2" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-11.3.2.tgz#8703b11abe3c88ac7ec2b745b7fdf52e00ae680a" + dependencies: + eslint-restricted-globals "^0.1.1" eslint-import-resolver-node@^0.3.1: version "0.3.1" @@ -1343,6 +1441,10 @@ eslint-plugin-import@^2.7.0: minimatch "^3.0.3" read-pkg-up "^2.0.0" +eslint-restricted-globals@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz#35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7" + eslint-scope@^3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" @@ -1350,29 +1452,31 @@ eslint-scope@^3.7.1: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.2.0.tgz#a2b3184111b198e02e9c7f3cca625a5e01c56b3d" +eslint@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.5.0.tgz#bb75d3b8bde97fb5e13efcd539744677feb019c3" dependencies: ajv "^5.2.0" babel-code-frame "^6.22.0" - chalk "^1.1.3" + chalk "^2.1.0" concat-stream "^1.6.0" + cross-spawn "^5.1.0" debug "^2.6.8" doctrine "^2.0.0" eslint-scope "^3.7.1" - espree "^3.4.3" + espree "^3.5.0" esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" glob "^7.1.2" globals "^9.17.0" ignore "^3.3.3" imurmurhash "^0.1.4" inquirer "^3.0.6" is-resolvable "^1.0.0" - js-yaml "^3.8.4" + js-yaml "^3.9.1" json-stable-stringify "^1.0.1" levn "^0.3.0" lodash "^4.17.4" @@ -1384,20 +1488,22 @@ eslint@^4.2.0: pluralize "^4.0.0" progress "^2.0.0" require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" strip-json-comments "~2.0.1" table "^4.0.1" text-table "~0.2.0" -espree@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" +espree@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.0.tgz#98358625bdd055861ea27e2867ea729faf463d8d" dependencies: - acorn "^5.0.1" + acorn "^5.1.1" acorn-jsx "^3.0.0" -esprima@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" esquery@^1.0.0: version "1.0.0" @@ -1441,6 +1547,18 @@ evp_bytestokey@^1.0.0: dependencies: create-hash "^1.1.1" +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -1606,6 +1724,10 @@ function-bind@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + gauge@~2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09" @@ -1633,6 +1755,10 @@ get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + getpass@^0.1.1: version "0.1.6" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" @@ -1663,7 +1789,7 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^9.0.0, globals@^9.17.0: +globals@^9.0.0, globals@^9.17.0, globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -1701,9 +1827,9 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" has-unicode@^2.0.0: version "2.0.1" @@ -1833,6 +1959,12 @@ invariant@^2.2.0: dependencies: loose-envify "^1.0.0" +invariant@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" @@ -1950,18 +2082,22 @@ is-resolvable@^1.0.0: dependencies: tryit "^1.0.1" +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" @@ -1986,12 +2122,16 @@ js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@^3.8.4: - version "3.8.4" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@^3.9.1: + version "3.9.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0" dependencies: argparse "^1.0.7" - esprima "^3.1.1" + esprima "^4.0.0" jsbn@~0.1.0: version "0.1.1" @@ -2078,16 +2218,6 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - load-json-file@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" @@ -2153,12 +2283,25 @@ loose-envify@^1.0.0: dependencies: js-tokens "^2.0.0" +lru-cache@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + make-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.0.0.tgz#97a011751e91dd87cfadef58832ebb04936de978" dependencies: pify "^2.3.0" +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + memory-fs@^0.4.0, memory-fs@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" @@ -2320,6 +2463,12 @@ normalize-path@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + npmlog@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f" @@ -2383,16 +2532,22 @@ os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" dependencies: + execa "^0.7.0" lcid "^1.0.0" + mem "^1.1.0" os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + p-limit@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" @@ -2446,7 +2601,7 @@ path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0: +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -2454,18 +2609,14 @@ path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - path-type@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" @@ -2520,6 +2671,10 @@ private@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1" +private@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" + process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" @@ -2536,6 +2691,10 @@ prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + public-encrypt@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" @@ -2586,13 +2745,6 @@ rc@~1.1.6: minimist "^1.2.0" strip-json-comments "~1.0.4" -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - read-pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" @@ -2600,14 +2752,6 @@ read-pkg-up@^2.0.0: find-up "^2.0.0" read-pkg "^2.0.0" -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - read-pkg@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" @@ -2657,6 +2801,10 @@ regenerator-runtime@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb" +regenerator-runtime@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz#7e54fe5b5ccd5d6624ea6255c3473be090b802e1" + regenerator-transform@0.9.11: version "0.9.11" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.11.tgz#3a7d067520cb7b7176769eb5ff868691befe1283" @@ -2803,6 +2951,10 @@ rx-lite@*, rx-lite@^4.0.8: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" +semver@^5.3.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -2821,6 +2973,16 @@ sha.js@^2.3.6: dependencies: inherits "^2.0.1" +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -2843,13 +3005,13 @@ source-list-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" -source-map-support@^0.4.2: - version "0.4.6" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.6.tgz#32552aa64b458392a85eab3b0b5ee61527167aeb" +source-map-support@^0.4.15: + version "0.4.16" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.16.tgz#16fecf98212467d017d586a2af68d628b9421cd8" dependencies: - source-map "^0.5.3" + source-map "^0.5.6" -source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3: +source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -2903,7 +3065,7 @@ stream-http@^2.3.1: to-arraybuffer "^1.0.0" xtend "^4.0.0" -string-width@^1.0.1, string-width@^1.0.2: +string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" dependencies: @@ -2932,16 +3094,20 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" dependencies: - is-utf8 "^0.2.0" + ansi-regex "^3.0.0" strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + strip-json-comments@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" @@ -2954,11 +3120,11 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^3.1.0: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" +supports-color@^4.0.0, supports-color@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.2.1.tgz#65a4bb2631e90e02420dba5554c375a4754bb836" dependencies: - has-flag "^1.0.0" + has-flag "^2.0.0" table@^4.0.1: version "4.0.1" @@ -2971,9 +3137,9 @@ table@^4.0.1: slice-ansi "0.0.4" string-width "^2.0.0" -tapable@^0.2.5, tapable@~0.2.5: - version "0.2.6" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.6.tgz#206be8e188860b514425375e6f1ae89bfb01fd8d" +tapable@^0.2.7: + version "0.2.8" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" tar-pack@~3.3.0: version "3.3.0" @@ -3024,6 +3190,10 @@ to-fast-properties@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + tough-cookie@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" @@ -3140,16 +3310,16 @@ webpack-sources@^1.0.1: source-list-map "^2.0.0" source-map "~0.5.3" -webpack@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.3.0.tgz#ce2f9e076566aba91f74887133a883fd7da187bc" +webpack@^3.5.5: + version "3.5.5" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.5.5.tgz#3226f09fc8b3e435ff781e7af34f82b68b26996c" dependencies: acorn "^5.0.0" acorn-dynamic-import "^2.0.0" ajv "^5.1.5" ajv-keywords "^2.0.0" async "^2.1.2" - enhanced-resolve "^3.3.0" + enhanced-resolve "^3.4.0" escope "^3.6.0" interpret "^1.0.0" json-loader "^0.5.4" @@ -3160,16 +3330,22 @@ webpack@^3.3.0: mkdirp "~0.5.0" node-libs-browser "^2.0.0" source-map "^0.5.3" - supports-color "^3.1.0" - tapable "~0.2.5" + supports-color "^4.2.1" + tapable "^0.2.7" uglifyjs-webpack-plugin "^0.4.6" watchpack "^1.4.0" webpack-sources "^1.0.1" - yargs "^6.0.0" + yargs "^8.0.2" -which-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@^1.2.9: + version "1.3.0" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" + dependencies: + isexe "^2.0.0" wide-align@^1.1.0: version "1.1.0" @@ -3214,29 +3390,33 @@ y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" -yargs-parser@^4.2.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yargs-parser@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" dependencies: - camelcase "^3.0.0" + camelcase "^4.1.0" -yargs@^6.0.0: - version "6.6.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" +yargs@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" dependencies: - camelcase "^3.0.0" + camelcase "^4.1.0" cliui "^3.2.0" decamelize "^1.1.1" get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" + os-locale "^2.0.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 "^1.0.2" - which-module "^1.0.0" + string-width "^2.0.0" + which-module "^2.0.0" y18n "^3.2.1" - yargs-parser "^4.2.0" + yargs-parser "^7.0.0" yargs@~3.10.0: version "3.10.0"