From 7cc7a2f5c1f072c0bae3e45c18eb895884fcb36f Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Sat, 7 Jul 2018 04:00:13 +0300 Subject: [PATCH] renaming anomalyType to analyticUnit --- dist/module.js | 14763 +++++++++++++++- dist/partials/tab_analytics.html | 85 +- ...y_controller.ts => analytic_controller.ts} | 155 +- src/graph_renderer.ts | 37 +- src/graph_tooltip.ts | 4 +- src/model/{anomaly.ts => analytic_unit.ts} | 69 +- src/module.ts | 68 +- src/partials/tab_analytics.html | 85 +- ...anomaly_service.ts => analytic_service.ts} | 18 +- 9 files changed, 14960 insertions(+), 324 deletions(-) rename src/controllers/{anomaly_controller.ts => analytic_controller.ts} (61%) rename src/model/{anomaly.ts => analytic_unit.ts} (64%) rename src/services/{anomaly_service.ts => analytic_service.ts} (77%) diff --git a/dist/module.js b/dist/module.js index 514970b..691bd05 100644 --- a/dist/module.js +++ b/dist/module.js @@ -84,7 +84,40 @@ define(["angular","app/core/config","app/core/core","app/core/core_module","app/ /*! no static exports found */ /***/ (function(module, exports) { -eval("var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n\n\n//# sourceURL=webpack:///../node_modules/charenc/charenc.js?"); +var charenc = { + // UTF-8 encoding + utf8: { + // Convert a string to a byte array + stringToBytes: function(str) { + return charenc.bin.stringToBytes(unescape(encodeURIComponent(str))); + }, + + // Convert a byte array to a string + bytesToString: function(bytes) { + return decodeURIComponent(escape(charenc.bin.bytesToString(bytes))); + } + }, + + // Binary encoding + bin: { + // Convert a string to a byte array + stringToBytes: function(str) { + for (var bytes = [], i = 0; i < str.length; i++) + bytes.push(str.charCodeAt(i) & 0xFF); + return bytes; + }, + + // Convert a byte array to a string + bytesToString: function(bytes) { + for (var str = [], i = 0; i < bytes.length; i++) + str.push(String.fromCharCode(bytes[i])); + return str.join(''); + } + } +}; + +module.exports = charenc; + /***/ }), @@ -95,7 +128,103 @@ eval("var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string t /*! no static exports found */ /***/ (function(module, exports) { -eval("(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n\n\n//# sourceURL=webpack:///../node_modules/crypt/crypt.js?"); +(function() { + var base64map + = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + + crypt = { + // Bit-wise rotation left + rotl: function(n, b) { + return (n << b) | (n >>> (32 - b)); + }, + + // Bit-wise rotation right + rotr: function(n, b) { + return (n << (32 - b)) | (n >>> b); + }, + + // Swap big-endian to little-endian and vice versa + endian: function(n) { + // If number given, swap endian + if (n.constructor == Number) { + return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00; + } + + // Else, assume array and swap all items + for (var i = 0; i < n.length; i++) + n[i] = crypt.endian(n[i]); + return n; + }, + + // Generate an array of any length of random bytes + randomBytes: function(n) { + for (var bytes = []; n > 0; n--) + bytes.push(Math.floor(Math.random() * 256)); + return bytes; + }, + + // Convert a byte array to big-endian 32-bit words + bytesToWords: function(bytes) { + for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) + words[b >>> 5] |= bytes[i] << (24 - b % 32); + return words; + }, + + // Convert big-endian 32-bit words to a byte array + wordsToBytes: function(words) { + for (var bytes = [], b = 0; b < words.length * 32; b += 8) + bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); + return bytes; + }, + + // Convert a byte array to a hex string + bytesToHex: function(bytes) { + for (var hex = [], i = 0; i < bytes.length; i++) { + hex.push((bytes[i] >>> 4).toString(16)); + hex.push((bytes[i] & 0xF).toString(16)); + } + return hex.join(''); + }, + + // Convert a hex string to a byte array + hexToBytes: function(hex) { + for (var bytes = [], c = 0; c < hex.length; c += 2) + bytes.push(parseInt(hex.substr(c, 2), 16)); + return bytes; + }, + + // Convert a byte array to a base-64 string + bytesToBase64: function(bytes) { + for (var base64 = [], i = 0; i < bytes.length; i += 3) { + var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; + for (var j = 0; j < 4; j++) + if (i * 8 + j * 6 <= bytes.length * 8) + base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F)); + else + base64.push('='); + } + return base64.join(''); + }, + + // Convert a base-64 string to a byte array + base64ToBytes: function(base64) { + // Remove non-base-64 characters + base64 = base64.replace(/[^A-Z0-9+\/]/ig, ''); + + for (var bytes = [], i = 0, imod4 = 0; i < base64.length; + imod4 = ++i % 4) { + if (imod4 == 0) continue; + bytes.push(((base64map.indexOf(base64.charAt(i - 1)) + & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) + | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2))); + } + return bytes; + } + }; + + module.exports = crypt; +})(); + /***/ }), @@ -106,7 +235,28 @@ eval("(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefg /*! no static exports found */ /***/ (function(module, exports) { -eval("/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n\n\n//# sourceURL=webpack:///../node_modules/is-buffer/index.js?"); +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +// The _isBuffer check is for Safari 5-7 support, because it's missing +// Object.prototype.constructor. Remove this eventually +module.exports = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) +} + +function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} + +// For Node v0.10 support. Remove this eventually. +function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) +} + /***/ }), @@ -117,7 +267,167 @@ eval("/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukh /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("(function(){\r\n var crypt = __webpack_require__(/*! crypt */ \"../node_modules/crypt/crypt.js\"),\r\n utf8 = __webpack_require__(/*! charenc */ \"../node_modules/charenc/charenc.js\").utf8,\r\n isBuffer = __webpack_require__(/*! is-buffer */ \"../node_modules/is-buffer/index.js\"),\r\n bin = __webpack_require__(/*! charenc */ \"../node_modules/charenc/charenc.js\").bin,\r\n\r\n // The core\r\n md5 = function (message, options) {\r\n // Convert to byte array\r\n if (message.constructor == String)\r\n if (options && options.encoding === 'binary')\r\n message = bin.stringToBytes(message);\r\n else\r\n message = utf8.stringToBytes(message);\r\n else if (isBuffer(message))\r\n message = Array.prototype.slice.call(message, 0);\r\n else if (!Array.isArray(message))\r\n message = message.toString();\r\n // else, assume byte array already\r\n\r\n var m = crypt.bytesToWords(message),\r\n l = message.length * 8,\r\n a = 1732584193,\r\n b = -271733879,\r\n c = -1732584194,\r\n d = 271733878;\r\n\r\n // Swap endian\r\n for (var i = 0; i < m.length; i++) {\r\n m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |\r\n ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;\r\n }\r\n\r\n // Padding\r\n m[l >>> 5] |= 0x80 << (l % 32);\r\n m[(((l + 64) >>> 9) << 4) + 14] = l;\r\n\r\n // Method shortcuts\r\n var FF = md5._ff,\r\n GG = md5._gg,\r\n HH = md5._hh,\r\n II = md5._ii;\r\n\r\n for (var i = 0; i < m.length; i += 16) {\r\n\r\n var aa = a,\r\n bb = b,\r\n cc = c,\r\n dd = d;\r\n\r\n a = FF(a, b, c, d, m[i+ 0], 7, -680876936);\r\n d = FF(d, a, b, c, m[i+ 1], 12, -389564586);\r\n c = FF(c, d, a, b, m[i+ 2], 17, 606105819);\r\n b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);\r\n a = FF(a, b, c, d, m[i+ 4], 7, -176418897);\r\n d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);\r\n c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);\r\n b = FF(b, c, d, a, m[i+ 7], 22, -45705983);\r\n a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);\r\n d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);\r\n c = FF(c, d, a, b, m[i+10], 17, -42063);\r\n b = FF(b, c, d, a, m[i+11], 22, -1990404162);\r\n a = FF(a, b, c, d, m[i+12], 7, 1804603682);\r\n d = FF(d, a, b, c, m[i+13], 12, -40341101);\r\n c = FF(c, d, a, b, m[i+14], 17, -1502002290);\r\n b = FF(b, c, d, a, m[i+15], 22, 1236535329);\r\n\r\n a = GG(a, b, c, d, m[i+ 1], 5, -165796510);\r\n d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);\r\n c = GG(c, d, a, b, m[i+11], 14, 643717713);\r\n b = GG(b, c, d, a, m[i+ 0], 20, -373897302);\r\n a = GG(a, b, c, d, m[i+ 5], 5, -701558691);\r\n d = GG(d, a, b, c, m[i+10], 9, 38016083);\r\n c = GG(c, d, a, b, m[i+15], 14, -660478335);\r\n b = GG(b, c, d, a, m[i+ 4], 20, -405537848);\r\n a = GG(a, b, c, d, m[i+ 9], 5, 568446438);\r\n d = GG(d, a, b, c, m[i+14], 9, -1019803690);\r\n c = GG(c, d, a, b, m[i+ 3], 14, -187363961);\r\n b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);\r\n a = GG(a, b, c, d, m[i+13], 5, -1444681467);\r\n d = GG(d, a, b, c, m[i+ 2], 9, -51403784);\r\n c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);\r\n b = GG(b, c, d, a, m[i+12], 20, -1926607734);\r\n\r\n a = HH(a, b, c, d, m[i+ 5], 4, -378558);\r\n d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);\r\n c = HH(c, d, a, b, m[i+11], 16, 1839030562);\r\n b = HH(b, c, d, a, m[i+14], 23, -35309556);\r\n a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);\r\n d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);\r\n c = HH(c, d, a, b, m[i+ 7], 16, -155497632);\r\n b = HH(b, c, d, a, m[i+10], 23, -1094730640);\r\n a = HH(a, b, c, d, m[i+13], 4, 681279174);\r\n d = HH(d, a, b, c, m[i+ 0], 11, -358537222);\r\n c = HH(c, d, a, b, m[i+ 3], 16, -722521979);\r\n b = HH(b, c, d, a, m[i+ 6], 23, 76029189);\r\n a = HH(a, b, c, d, m[i+ 9], 4, -640364487);\r\n d = HH(d, a, b, c, m[i+12], 11, -421815835);\r\n c = HH(c, d, a, b, m[i+15], 16, 530742520);\r\n b = HH(b, c, d, a, m[i+ 2], 23, -995338651);\r\n\r\n a = II(a, b, c, d, m[i+ 0], 6, -198630844);\r\n d = II(d, a, b, c, m[i+ 7], 10, 1126891415);\r\n c = II(c, d, a, b, m[i+14], 15, -1416354905);\r\n b = II(b, c, d, a, m[i+ 5], 21, -57434055);\r\n a = II(a, b, c, d, m[i+12], 6, 1700485571);\r\n d = II(d, a, b, c, m[i+ 3], 10, -1894986606);\r\n c = II(c, d, a, b, m[i+10], 15, -1051523);\r\n b = II(b, c, d, a, m[i+ 1], 21, -2054922799);\r\n a = II(a, b, c, d, m[i+ 8], 6, 1873313359);\r\n d = II(d, a, b, c, m[i+15], 10, -30611744);\r\n c = II(c, d, a, b, m[i+ 6], 15, -1560198380);\r\n b = II(b, c, d, a, m[i+13], 21, 1309151649);\r\n a = II(a, b, c, d, m[i+ 4], 6, -145523070);\r\n d = II(d, a, b, c, m[i+11], 10, -1120210379);\r\n c = II(c, d, a, b, m[i+ 2], 15, 718787259);\r\n b = II(b, c, d, a, m[i+ 9], 21, -343485551);\r\n\r\n a = (a + aa) >>> 0;\r\n b = (b + bb) >>> 0;\r\n c = (c + cc) >>> 0;\r\n d = (d + dd) >>> 0;\r\n }\r\n\r\n return crypt.endian([a, b, c, d]);\r\n };\r\n\r\n // Auxiliary functions\r\n md5._ff = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._gg = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._hh = function (a, b, c, d, x, s, t) {\r\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._ii = function (a, b, c, d, x, s, t) {\r\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n\r\n // Package private blocksize\r\n md5._blocksize = 16;\r\n md5._digestsize = 16;\r\n\r\n module.exports = function (message, options) {\r\n if (message === undefined || message === null)\r\n throw new Error('Illegal argument ' + message);\r\n\r\n var digestbytes = crypt.wordsToBytes(md5(message, options));\r\n return options && options.asBytes ? digestbytes :\r\n options && options.asString ? bin.bytesToString(digestbytes) :\r\n crypt.bytesToHex(digestbytes);\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///../node_modules/md5/md5.js?"); +(function(){ + var crypt = __webpack_require__(/*! crypt */ "../node_modules/crypt/crypt.js"), + utf8 = __webpack_require__(/*! charenc */ "../node_modules/charenc/charenc.js").utf8, + isBuffer = __webpack_require__(/*! is-buffer */ "../node_modules/is-buffer/index.js"), + bin = __webpack_require__(/*! charenc */ "../node_modules/charenc/charenc.js").bin, + + // The core + md5 = function (message, options) { + // Convert to byte array + if (message.constructor == String) + if (options && options.encoding === 'binary') + message = bin.stringToBytes(message); + else + message = utf8.stringToBytes(message); + else if (isBuffer(message)) + message = Array.prototype.slice.call(message, 0); + else if (!Array.isArray(message)) + message = message.toString(); + // else, assume byte array already + + var m = crypt.bytesToWords(message), + l = message.length * 8, + a = 1732584193, + b = -271733879, + c = -1732584194, + d = 271733878; + + // Swap endian + for (var i = 0; i < m.length; i++) { + m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF | + ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00; + } + + // Padding + m[l >>> 5] |= 0x80 << (l % 32); + m[(((l + 64) >>> 9) << 4) + 14] = l; + + // Method shortcuts + var FF = md5._ff, + GG = md5._gg, + HH = md5._hh, + II = md5._ii; + + for (var i = 0; i < m.length; i += 16) { + + var aa = a, + bb = b, + cc = c, + dd = d; + + a = FF(a, b, c, d, m[i+ 0], 7, -680876936); + d = FF(d, a, b, c, m[i+ 1], 12, -389564586); + c = FF(c, d, a, b, m[i+ 2], 17, 606105819); + b = FF(b, c, d, a, m[i+ 3], 22, -1044525330); + a = FF(a, b, c, d, m[i+ 4], 7, -176418897); + d = FF(d, a, b, c, m[i+ 5], 12, 1200080426); + c = FF(c, d, a, b, m[i+ 6], 17, -1473231341); + b = FF(b, c, d, a, m[i+ 7], 22, -45705983); + a = FF(a, b, c, d, m[i+ 8], 7, 1770035416); + d = FF(d, a, b, c, m[i+ 9], 12, -1958414417); + c = FF(c, d, a, b, m[i+10], 17, -42063); + b = FF(b, c, d, a, m[i+11], 22, -1990404162); + a = FF(a, b, c, d, m[i+12], 7, 1804603682); + d = FF(d, a, b, c, m[i+13], 12, -40341101); + c = FF(c, d, a, b, m[i+14], 17, -1502002290); + b = FF(b, c, d, a, m[i+15], 22, 1236535329); + + a = GG(a, b, c, d, m[i+ 1], 5, -165796510); + d = GG(d, a, b, c, m[i+ 6], 9, -1069501632); + c = GG(c, d, a, b, m[i+11], 14, 643717713); + b = GG(b, c, d, a, m[i+ 0], 20, -373897302); + a = GG(a, b, c, d, m[i+ 5], 5, -701558691); + d = GG(d, a, b, c, m[i+10], 9, 38016083); + c = GG(c, d, a, b, m[i+15], 14, -660478335); + b = GG(b, c, d, a, m[i+ 4], 20, -405537848); + a = GG(a, b, c, d, m[i+ 9], 5, 568446438); + d = GG(d, a, b, c, m[i+14], 9, -1019803690); + c = GG(c, d, a, b, m[i+ 3], 14, -187363961); + b = GG(b, c, d, a, m[i+ 8], 20, 1163531501); + a = GG(a, b, c, d, m[i+13], 5, -1444681467); + d = GG(d, a, b, c, m[i+ 2], 9, -51403784); + c = GG(c, d, a, b, m[i+ 7], 14, 1735328473); + b = GG(b, c, d, a, m[i+12], 20, -1926607734); + + a = HH(a, b, c, d, m[i+ 5], 4, -378558); + d = HH(d, a, b, c, m[i+ 8], 11, -2022574463); + c = HH(c, d, a, b, m[i+11], 16, 1839030562); + b = HH(b, c, d, a, m[i+14], 23, -35309556); + a = HH(a, b, c, d, m[i+ 1], 4, -1530992060); + d = HH(d, a, b, c, m[i+ 4], 11, 1272893353); + c = HH(c, d, a, b, m[i+ 7], 16, -155497632); + b = HH(b, c, d, a, m[i+10], 23, -1094730640); + a = HH(a, b, c, d, m[i+13], 4, 681279174); + d = HH(d, a, b, c, m[i+ 0], 11, -358537222); + c = HH(c, d, a, b, m[i+ 3], 16, -722521979); + b = HH(b, c, d, a, m[i+ 6], 23, 76029189); + a = HH(a, b, c, d, m[i+ 9], 4, -640364487); + d = HH(d, a, b, c, m[i+12], 11, -421815835); + c = HH(c, d, a, b, m[i+15], 16, 530742520); + b = HH(b, c, d, a, m[i+ 2], 23, -995338651); + + a = II(a, b, c, d, m[i+ 0], 6, -198630844); + d = II(d, a, b, c, m[i+ 7], 10, 1126891415); + c = II(c, d, a, b, m[i+14], 15, -1416354905); + b = II(b, c, d, a, m[i+ 5], 21, -57434055); + a = II(a, b, c, d, m[i+12], 6, 1700485571); + d = II(d, a, b, c, m[i+ 3], 10, -1894986606); + c = II(c, d, a, b, m[i+10], 15, -1051523); + b = II(b, c, d, a, m[i+ 1], 21, -2054922799); + a = II(a, b, c, d, m[i+ 8], 6, 1873313359); + d = II(d, a, b, c, m[i+15], 10, -30611744); + c = II(c, d, a, b, m[i+ 6], 15, -1560198380); + b = II(b, c, d, a, m[i+13], 21, 1309151649); + a = II(a, b, c, d, m[i+ 4], 6, -145523070); + d = II(d, a, b, c, m[i+11], 10, -1120210379); + c = II(c, d, a, b, m[i+ 2], 15, 718787259); + b = II(b, c, d, a, m[i+ 9], 21, -343485551); + + a = (a + aa) >>> 0; + b = (b + bb) >>> 0; + c = (c + cc) >>> 0; + d = (d + dd) >>> 0; + } + + return crypt.endian([a, b, c, d]); + }; + + // Auxiliary functions + md5._ff = function (a, b, c, d, x, s, t) { + var n = a + (b & c | ~b & d) + (x >>> 0) + t; + return ((n << s) | (n >>> (32 - s))) + b; + }; + md5._gg = function (a, b, c, d, x, s, t) { + var n = a + (b & d | c & ~d) + (x >>> 0) + t; + return ((n << s) | (n >>> (32 - s))) + b; + }; + md5._hh = function (a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + (x >>> 0) + t; + return ((n << s) | (n >>> (32 - s))) + b; + }; + md5._ii = function (a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + (x >>> 0) + t; + return ((n << s) | (n >>> (32 - s))) + b; + }; + + // Package private blocksize + md5._blocksize = 16; + md5._digestsize = 16; + + module.exports = function (message, options) { + if (message === undefined || message === null) + throw new Error('Illegal argument ' + message); + + var digestbytes = crypt.wordsToBytes(md5(message, options)); + return options && options.asBytes ? digestbytes : + options && options.asString ? bin.bytesToString(digestbytes) : + crypt.bytesToHex(digestbytes); + }; + +})(); + /***/ }), @@ -129,7 +439,1312 @@ eval("(function(){\r\n var crypt = __webpack_require__(/*! crypt */ \"../node_m /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/*!\n * perfect-scrollbar v1.3.0\n * (c) 2017 Hyunje Jun\n * @license MIT\n */\nfunction get(element) {\n return getComputedStyle(element);\n}\n\nfunction set(element, obj) {\n for (var key in obj) {\n var val = obj[key];\n if (typeof val === 'number') {\n val = val + \"px\";\n }\n element.style[key] = val;\n }\n return element;\n}\n\nfunction div(className) {\n var div = document.createElement('div');\n div.className = className;\n return div;\n}\n\nvar elMatches =\n typeof Element !== 'undefined' &&\n (Element.prototype.matches ||\n Element.prototype.webkitMatchesSelector ||\n Element.prototype.msMatchesSelector);\n\nfunction matches(element, query) {\n if (!elMatches) {\n throw new Error('No element matching method supported');\n }\n\n return elMatches.call(element, query);\n}\n\nfunction remove(element) {\n if (element.remove) {\n element.remove();\n } else {\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n }\n}\n\nfunction queryChildren(element, selector) {\n return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); }\n );\n}\n\nvar cls = {\n main: 'ps',\n element: {\n thumb: function (x) { return (\"ps__thumb-\" + x); },\n rail: function (x) { return (\"ps__rail-\" + x); },\n consuming: 'ps__child--consume',\n },\n state: {\n focus: 'ps--focus',\n active: function (x) { return (\"ps--active-\" + x); },\n scrolling: function (x) { return (\"ps--scrolling-\" + x); },\n },\n};\n\n/*\n * Helper methods\n */\nvar scrollingClassTimeout = { x: null, y: null };\n\nfunction addScrollingClass(i, x) {\n var classList = i.element.classList;\n var className = cls.state.scrolling(x);\n\n if (classList.contains(className)) {\n clearTimeout(scrollingClassTimeout[x]);\n } else {\n classList.add(className);\n }\n}\n\nfunction removeScrollingClass(i, x) {\n scrollingClassTimeout[x] = setTimeout(\n function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); },\n i.settings.scrollingThreshold\n );\n}\n\nfunction setScrollingClassInstantly(i, x) {\n addScrollingClass(i, x);\n removeScrollingClass(i, x);\n}\n\nvar EventElement = function EventElement(element) {\n this.element = element;\n this.handlers = {};\n};\n\nvar prototypeAccessors = { isEmpty: { configurable: true } };\n\nEventElement.prototype.bind = function bind (eventName, handler) {\n if (typeof this.handlers[eventName] === 'undefined') {\n this.handlers[eventName] = [];\n }\n this.handlers[eventName].push(handler);\n this.element.addEventListener(eventName, handler, false);\n};\n\nEventElement.prototype.unbind = function unbind (eventName, target) {\n var this$1 = this;\n\n this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {\n if (target && handler !== target) {\n return true;\n }\n this$1.element.removeEventListener(eventName, handler, false);\n return false;\n });\n};\n\nEventElement.prototype.unbindAll = function unbindAll () {\n var this$1 = this;\n\n for (var name in this$1.handlers) {\n this$1.unbind(name);\n }\n};\n\nprototypeAccessors.isEmpty.get = function () {\n var this$1 = this;\n\n return Object.keys(this.handlers).every(\n function (key) { return this$1.handlers[key].length === 0; }\n );\n};\n\nObject.defineProperties( EventElement.prototype, prototypeAccessors );\n\nvar EventManager = function EventManager() {\n this.eventElements = [];\n};\n\nEventManager.prototype.eventElement = function eventElement (element) {\n var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0];\n if (!ee) {\n ee = new EventElement(element);\n this.eventElements.push(ee);\n }\n return ee;\n};\n\nEventManager.prototype.bind = function bind (element, eventName, handler) {\n this.eventElement(element).bind(eventName, handler);\n};\n\nEventManager.prototype.unbind = function unbind (element, eventName, handler) {\n var ee = this.eventElement(element);\n ee.unbind(eventName, handler);\n\n if (ee.isEmpty) {\n // remove\n this.eventElements.splice(this.eventElements.indexOf(ee), 1);\n }\n};\n\nEventManager.prototype.unbindAll = function unbindAll () {\n this.eventElements.forEach(function (e) { return e.unbindAll(); });\n this.eventElements = [];\n};\n\nEventManager.prototype.once = function once (element, eventName, handler) {\n var ee = this.eventElement(element);\n var onceHandler = function (evt) {\n ee.unbind(eventName, onceHandler);\n handler(evt);\n };\n ee.bind(eventName, onceHandler);\n};\n\nfunction createEvent(name) {\n if (typeof window.CustomEvent === 'function') {\n return new CustomEvent(name);\n } else {\n var evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(name, false, false, undefined);\n return evt;\n }\n}\n\nvar processScrollDiff = function(\n i,\n axis,\n diff,\n useScrollingClass,\n forceFireReachEvent\n) {\n if ( useScrollingClass === void 0 ) useScrollingClass = true;\n if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;\n\n var fields;\n if (axis === 'top') {\n fields = [\n 'contentHeight',\n 'containerHeight',\n 'scrollTop',\n 'y',\n 'up',\n 'down' ];\n } else if (axis === 'left') {\n fields = [\n 'contentWidth',\n 'containerWidth',\n 'scrollLeft',\n 'x',\n 'left',\n 'right' ];\n } else {\n throw new Error('A proper axis should be provided');\n }\n\n processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);\n};\n\nfunction processScrollDiff$1(\n i,\n diff,\n ref,\n useScrollingClass,\n forceFireReachEvent\n) {\n var contentHeight = ref[0];\n var containerHeight = ref[1];\n var scrollTop = ref[2];\n var y = ref[3];\n var up = ref[4];\n var down = ref[5];\n if ( useScrollingClass === void 0 ) useScrollingClass = true;\n if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;\n\n var element = i.element;\n\n // reset reach\n i.reach[y] = null;\n\n // 1 for subpixel rounding\n if (element[scrollTop] < 1) {\n i.reach[y] = 'start';\n }\n\n // 1 for subpixel rounding\n if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {\n i.reach[y] = 'end';\n }\n\n if (diff) {\n element.dispatchEvent(createEvent((\"ps-scroll-\" + y)));\n\n if (diff < 0) {\n element.dispatchEvent(createEvent((\"ps-scroll-\" + up)));\n } else if (diff > 0) {\n element.dispatchEvent(createEvent((\"ps-scroll-\" + down)));\n }\n\n if (useScrollingClass) {\n setScrollingClassInstantly(i, y);\n }\n }\n\n if (i.reach[y] && (diff || forceFireReachEvent)) {\n element.dispatchEvent(createEvent((\"ps-\" + y + \"-reach-\" + (i.reach[y]))));\n }\n}\n\nfunction toInt(x) {\n return parseInt(x, 10) || 0;\n}\n\nfunction isEditable(el) {\n return (\n matches(el, 'input,[contenteditable]') ||\n matches(el, 'select,[contenteditable]') ||\n matches(el, 'textarea,[contenteditable]') ||\n matches(el, 'button,[contenteditable]')\n );\n}\n\nfunction outerWidth(element) {\n var styles = get(element);\n return (\n toInt(styles.width) +\n toInt(styles.paddingLeft) +\n toInt(styles.paddingRight) +\n toInt(styles.borderLeftWidth) +\n toInt(styles.borderRightWidth)\n );\n}\n\nvar env = {\n isWebKit:\n typeof document !== 'undefined' &&\n 'WebkitAppearance' in document.documentElement.style,\n supportsTouch:\n typeof window !== 'undefined' &&\n ('ontouchstart' in window ||\n (window.DocumentTouch && document instanceof window.DocumentTouch)),\n supportsIePointer:\n typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,\n isChrome:\n typeof navigator !== 'undefined' &&\n /Chrome/i.test(navigator && navigator.userAgent),\n};\n\nvar updateGeometry = function(i) {\n var element = i.element;\n\n i.containerWidth = element.clientWidth;\n i.containerHeight = element.clientHeight;\n i.contentWidth = element.scrollWidth;\n i.contentHeight = element.scrollHeight;\n\n if (!element.contains(i.scrollbarXRail)) {\n // clean up and append\n queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }\n );\n element.appendChild(i.scrollbarXRail);\n }\n if (!element.contains(i.scrollbarYRail)) {\n // clean up and append\n queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }\n );\n element.appendChild(i.scrollbarYRail);\n }\n\n if (\n !i.settings.suppressScrollX &&\n i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth\n ) {\n i.scrollbarXActive = true;\n i.railXWidth = i.containerWidth - i.railXMarginWidth;\n i.railXRatio = i.containerWidth / i.railXWidth;\n i.scrollbarXWidth = getThumbSize(\n i,\n toInt(i.railXWidth * i.containerWidth / i.contentWidth)\n );\n i.scrollbarXLeft = toInt(\n (i.negativeScrollAdjustment + element.scrollLeft) *\n (i.railXWidth - i.scrollbarXWidth) /\n (i.contentWidth - i.containerWidth)\n );\n } else {\n i.scrollbarXActive = false;\n }\n\n if (\n !i.settings.suppressScrollY &&\n i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight\n ) {\n i.scrollbarYActive = true;\n i.railYHeight = i.containerHeight - i.railYMarginHeight;\n i.railYRatio = i.containerHeight / i.railYHeight;\n i.scrollbarYHeight = getThumbSize(\n i,\n toInt(i.railYHeight * i.containerHeight / i.contentHeight)\n );\n i.scrollbarYTop = toInt(\n element.scrollTop *\n (i.railYHeight - i.scrollbarYHeight) /\n (i.contentHeight - i.containerHeight)\n );\n } else {\n i.scrollbarYActive = false;\n }\n\n if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {\n i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;\n }\n if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {\n i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;\n }\n\n updateCss(element, i);\n\n if (i.scrollbarXActive) {\n element.classList.add(cls.state.active('x'));\n } else {\n element.classList.remove(cls.state.active('x'));\n i.scrollbarXWidth = 0;\n i.scrollbarXLeft = 0;\n element.scrollLeft = 0;\n }\n if (i.scrollbarYActive) {\n element.classList.add(cls.state.active('y'));\n } else {\n element.classList.remove(cls.state.active('y'));\n i.scrollbarYHeight = 0;\n i.scrollbarYTop = 0;\n element.scrollTop = 0;\n }\n};\n\nfunction getThumbSize(i, thumbSize) {\n if (i.settings.minScrollbarLength) {\n thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);\n }\n if (i.settings.maxScrollbarLength) {\n thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);\n }\n return thumbSize;\n}\n\nfunction updateCss(element, i) {\n var xRailOffset = { width: i.railXWidth };\n if (i.isRtl) {\n xRailOffset.left =\n i.negativeScrollAdjustment +\n element.scrollLeft +\n i.containerWidth -\n i.contentWidth;\n } else {\n xRailOffset.left = element.scrollLeft;\n }\n if (i.isScrollbarXUsingBottom) {\n xRailOffset.bottom = i.scrollbarXBottom - element.scrollTop;\n } else {\n xRailOffset.top = i.scrollbarXTop + element.scrollTop;\n }\n set(i.scrollbarXRail, xRailOffset);\n\n var yRailOffset = { top: element.scrollTop, height: i.railYHeight };\n if (i.isScrollbarYUsingRight) {\n if (i.isRtl) {\n yRailOffset.right =\n i.contentWidth -\n (i.negativeScrollAdjustment + element.scrollLeft) -\n i.scrollbarYRight -\n i.scrollbarYOuterWidth;\n } else {\n yRailOffset.right = i.scrollbarYRight - element.scrollLeft;\n }\n } else {\n if (i.isRtl) {\n yRailOffset.left =\n i.negativeScrollAdjustment +\n element.scrollLeft +\n i.containerWidth * 2 -\n i.contentWidth -\n i.scrollbarYLeft -\n i.scrollbarYOuterWidth;\n } else {\n yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;\n }\n }\n set(i.scrollbarYRail, yRailOffset);\n\n set(i.scrollbarX, {\n left: i.scrollbarXLeft,\n width: i.scrollbarXWidth - i.railBorderXWidth,\n });\n set(i.scrollbarY, {\n top: i.scrollbarYTop,\n height: i.scrollbarYHeight - i.railBorderYWidth,\n });\n}\n\nvar clickRail = function(i) {\n i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); });\n i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {\n var positionTop =\n e.pageY -\n window.pageYOffset -\n i.scrollbarYRail.getBoundingClientRect().top;\n var direction = positionTop > i.scrollbarYTop ? 1 : -1;\n\n i.element.scrollTop += direction * i.containerHeight;\n updateGeometry(i);\n\n e.stopPropagation();\n });\n\n i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); });\n i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {\n var positionLeft =\n e.pageX -\n window.pageXOffset -\n i.scrollbarXRail.getBoundingClientRect().left;\n var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;\n\n i.element.scrollLeft += direction * i.containerWidth;\n updateGeometry(i);\n\n e.stopPropagation();\n });\n};\n\nvar dragThumb = function(i) {\n bindMouseScrollHandler(i, [\n 'containerWidth',\n 'contentWidth',\n 'pageX',\n 'railXWidth',\n 'scrollbarX',\n 'scrollbarXWidth',\n 'scrollLeft',\n 'x' ]);\n bindMouseScrollHandler(i, [\n 'containerHeight',\n 'contentHeight',\n 'pageY',\n 'railYHeight',\n 'scrollbarY',\n 'scrollbarYHeight',\n 'scrollTop',\n 'y' ]);\n};\n\nfunction bindMouseScrollHandler(\n i,\n ref\n) {\n var containerHeight = ref[0];\n var contentHeight = ref[1];\n var pageY = ref[2];\n var railYHeight = ref[3];\n var scrollbarY = ref[4];\n var scrollbarYHeight = ref[5];\n var scrollTop = ref[6];\n var y = ref[7];\n\n var element = i.element;\n\n var startingScrollTop = null;\n var startingMousePageY = null;\n var scrollBy = null;\n\n function mouseMoveHandler(e) {\n element[scrollTop] =\n startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);\n addScrollingClass(i, y);\n updateGeometry(i);\n\n e.stopPropagation();\n e.preventDefault();\n }\n\n function mouseUpHandler() {\n removeScrollingClass(i, y);\n i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);\n }\n\n i.event.bind(i[scrollbarY], 'mousedown', function (e) {\n startingScrollTop = element[scrollTop];\n startingMousePageY = e[pageY];\n scrollBy =\n (i[contentHeight] - i[containerHeight]) /\n (i[railYHeight] - i[scrollbarYHeight]);\n\n i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);\n i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);\n\n e.stopPropagation();\n e.preventDefault();\n });\n}\n\nvar keyboard = function(i) {\n var element = i.element;\n\n var elementHovered = function () { return matches(element, ':hover'); };\n var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); };\n\n function shouldPreventDefault(deltaX, deltaY) {\n var scrollTop = element.scrollTop;\n if (deltaX === 0) {\n if (!i.scrollbarYActive) {\n return false;\n }\n if (\n (scrollTop === 0 && deltaY > 0) ||\n (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)\n ) {\n return !i.settings.wheelPropagation;\n }\n }\n\n var scrollLeft = element.scrollLeft;\n if (deltaY === 0) {\n if (!i.scrollbarXActive) {\n return false;\n }\n if (\n (scrollLeft === 0 && deltaX < 0) ||\n (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)\n ) {\n return !i.settings.wheelPropagation;\n }\n }\n return true;\n }\n\n i.event.bind(i.ownerDocument, 'keydown', function (e) {\n if (\n (e.isDefaultPrevented && e.isDefaultPrevented()) ||\n e.defaultPrevented\n ) {\n return;\n }\n\n if (!elementHovered() && !scrollbarFocused()) {\n return;\n }\n\n var activeElement = document.activeElement\n ? document.activeElement\n : i.ownerDocument.activeElement;\n if (activeElement) {\n if (activeElement.tagName === 'IFRAME') {\n activeElement = activeElement.contentDocument.activeElement;\n } else {\n // go deeper if element is a webcomponent\n while (activeElement.shadowRoot) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n }\n if (isEditable(activeElement)) {\n return;\n }\n }\n\n var deltaX = 0;\n var deltaY = 0;\n\n switch (e.which) {\n case 37: // left\n if (e.metaKey) {\n deltaX = -i.contentWidth;\n } else if (e.altKey) {\n deltaX = -i.containerWidth;\n } else {\n deltaX = -30;\n }\n break;\n case 38: // up\n if (e.metaKey) {\n deltaY = i.contentHeight;\n } else if (e.altKey) {\n deltaY = i.containerHeight;\n } else {\n deltaY = 30;\n }\n break;\n case 39: // right\n if (e.metaKey) {\n deltaX = i.contentWidth;\n } else if (e.altKey) {\n deltaX = i.containerWidth;\n } else {\n deltaX = 30;\n }\n break;\n case 40: // down\n if (e.metaKey) {\n deltaY = -i.contentHeight;\n } else if (e.altKey) {\n deltaY = -i.containerHeight;\n } else {\n deltaY = -30;\n }\n break;\n case 32: // space bar\n if (e.shiftKey) {\n deltaY = i.containerHeight;\n } else {\n deltaY = -i.containerHeight;\n }\n break;\n case 33: // page up\n deltaY = i.containerHeight;\n break;\n case 34: // page down\n deltaY = -i.containerHeight;\n break;\n case 36: // home\n deltaY = i.contentHeight;\n break;\n case 35: // end\n deltaY = -i.contentHeight;\n break;\n default:\n return;\n }\n\n if (i.settings.suppressScrollX && deltaX !== 0) {\n return;\n }\n if (i.settings.suppressScrollY && deltaY !== 0) {\n return;\n }\n\n element.scrollTop -= deltaY;\n element.scrollLeft += deltaX;\n updateGeometry(i);\n\n if (shouldPreventDefault(deltaX, deltaY)) {\n e.preventDefault();\n }\n });\n};\n\nvar wheel = function(i) {\n var element = i.element;\n\n function shouldPreventDefault(deltaX, deltaY) {\n var isTop = element.scrollTop === 0;\n var isBottom =\n element.scrollTop + element.offsetHeight === element.scrollHeight;\n var isLeft = element.scrollLeft === 0;\n var isRight =\n element.scrollLeft + element.offsetWidth === element.offsetWidth;\n\n var hitsBound;\n\n // pick axis with primary direction\n if (Math.abs(deltaY) > Math.abs(deltaX)) {\n hitsBound = isTop || isBottom;\n } else {\n hitsBound = isLeft || isRight;\n }\n\n return hitsBound ? !i.settings.wheelPropagation : true;\n }\n\n function getDeltaFromEvent(e) {\n var deltaX = e.deltaX;\n var deltaY = -1 * e.deltaY;\n\n if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {\n // OS X Safari\n deltaX = -1 * e.wheelDeltaX / 6;\n deltaY = e.wheelDeltaY / 6;\n }\n\n if (e.deltaMode && e.deltaMode === 1) {\n // Firefox in deltaMode 1: Line scrolling\n deltaX *= 10;\n deltaY *= 10;\n }\n\n if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {\n // IE in some mouse drivers\n deltaX = 0;\n deltaY = e.wheelDelta;\n }\n\n if (e.shiftKey) {\n // reverse axis with shift key\n return [-deltaY, -deltaX];\n }\n return [deltaX, deltaY];\n }\n\n function shouldBeConsumedByChild(target, deltaX, deltaY) {\n // FIXME: this is a workaround for issue in FF and IE #571 + if (!env.isWebKit && element.querySelector('select:focus')) { + return true; + } + + if (!element.contains(target)) { + return false; + } + + var cursor = target; + + while (cursor && cursor !== element) { + if (cursor.classList.contains(cls.element.consuming)) { + return true; + } + + var style = get(cursor); + var overflow = [style.overflow, style.overflowX, style.overflowY].join( + '' + ); + + // if scrollable + if (overflow.match(/(scroll|auto)/)) { + var maxScrollTop = cursor.scrollHeight - cursor.clientHeight; + if (maxScrollTop > 0) { + if ( + !(cursor.scrollTop === 0 && deltaY > 0) && + !(cursor.scrollTop === maxScrollTop && deltaY < 0) + ) { + return true; + } + } + var maxScrollLeft = cursor.scrollLeft - cursor.clientWidth; + if (maxScrollLeft > 0) { + if ( + !(cursor.scrollLeft === 0 && deltaX < 0) && + !(cursor.scrollLeft === maxScrollLeft && deltaX > 0) + ) { + return true; + } + } + } + + cursor = cursor.parentNode; + } + + return false; + } + + function mousewheelHandler(e) { + var ref = getDeltaFromEvent(e); + var deltaX = ref[0]; + var deltaY = ref[1]; + + if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) { + return; + } + + var shouldPrevent = false; + if (!i.settings.useBothWheelAxes) { + // deltaX will only be used for horizontal scrolling and deltaY will + // only be used for vertical scrolling - this is the default + element.scrollTop -= deltaY * i.settings.wheelSpeed; + element.scrollLeft += deltaX * i.settings.wheelSpeed; + } else if (i.scrollbarYActive && !i.scrollbarXActive) { + // only vertical scrollbar is active and useBothWheelAxes option is + // active, so let's scroll vertical bar using both mouse wheel axes + if (deltaY) { + element.scrollTop -= deltaY * i.settings.wheelSpeed; + } else { + element.scrollTop += deltaX * i.settings.wheelSpeed; + } + shouldPrevent = true; + } else if (i.scrollbarXActive && !i.scrollbarYActive) { + // useBothWheelAxes and only horizontal bar is active, so use both + // wheel axes for horizontal bar + if (deltaX) { + element.scrollLeft += deltaX * i.settings.wheelSpeed; + } else { + element.scrollLeft -= deltaY * i.settings.wheelSpeed; + } + shouldPrevent = true; + } + + updateGeometry(i); + + shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY); + if (shouldPrevent && !e.ctrlKey) { + e.stopPropagation(); + e.preventDefault(); + } + } + + if (typeof window.onwheel !== 'undefined') { + i.event.bind(element, 'wheel', mousewheelHandler); + } else if (typeof window.onmousewheel !== 'undefined') { + i.event.bind(element, 'mousewheel', mousewheelHandler); + } +}; + +var touch = function(i) { + if (!env.supportsTouch && !env.supportsIePointer) { + return; + } + + var element = i.element; + + function shouldPrevent(deltaX, deltaY) { + var scrollTop = element.scrollTop; + var scrollLeft = element.scrollLeft; + var magnitudeX = Math.abs(deltaX); + var magnitudeY = Math.abs(deltaY); + + if (magnitudeY > magnitudeX) { + // user is perhaps trying to swipe up/down the page + + if ( + (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) || + (deltaY > 0 && scrollTop === 0) + ) { + // set prevent for mobile Chrome refresh + return window.scrollY === 0 && deltaY > 0 && env.isChrome; + } + } else if (magnitudeX > magnitudeY) { + // user is perhaps trying to swipe left/right across the page + + if ( + (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) || + (deltaX > 0 && scrollLeft === 0) + ) { + return true; + } + } + + return true; + } + + function applyTouchMove(differenceX, differenceY) { + element.scrollTop -= differenceY; + element.scrollLeft -= differenceX; + + updateGeometry(i); + } + + var startOffset = {}; + var startTime = 0; + var speed = {}; + var easingLoop = null; + + function getTouch(e) { + if (e.targetTouches) { + return e.targetTouches[0]; + } else { + // Maybe IE pointer + return e; + } + } + + function shouldHandle(e) { + if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) { + return false; + } + if (e.targetTouches && e.targetTouches.length === 1) { + return true; + } + if ( + e.pointerType && + e.pointerType !== 'mouse' && + e.pointerType !== e.MSPOINTER_TYPE_MOUSE + ) { + return true; + } + return false; + } + + function touchStart(e) { + if (!shouldHandle(e)) { + return; + } + + var touch = getTouch(e); + + startOffset.pageX = touch.pageX; + startOffset.pageY = touch.pageY; + + startTime = new Date().getTime(); + + if (easingLoop !== null) { + clearInterval(easingLoop); + } + } + + function shouldBeConsumedByChild(target, deltaX, deltaY) { + if (!element.contains(target)) { + return false; + } + + var cursor = target; + + while (cursor && cursor !== element) { + if (cursor.classList.contains(cls.element.consuming)) { + return true; + } + + var style = get(cursor); + var overflow = [style.overflow, style.overflowX, style.overflowY].join( + '' + ); + + // if scrollable + if (overflow.match(/(scroll|auto)/)) { + var maxScrollTop = cursor.scrollHeight - cursor.clientHeight; + if (maxScrollTop > 0) { + if ( + !(cursor.scrollTop === 0 && deltaY > 0) && + !(cursor.scrollTop === maxScrollTop && deltaY < 0) + ) { + return true; + } + } + var maxScrollLeft = cursor.scrollLeft - cursor.clientWidth; + if (maxScrollLeft > 0) { + if ( + !(cursor.scrollLeft === 0 && deltaX < 0) && + !(cursor.scrollLeft === maxScrollLeft && deltaX > 0) + ) { + return true; + } + } + } + + cursor = cursor.parentNode; + } + + return false; + } + + function touchMove(e) { + if (shouldHandle(e)) { + var touch = getTouch(e); + + var currentOffset = { pageX: touch.pageX, pageY: touch.pageY }; + + var differenceX = currentOffset.pageX - startOffset.pageX; + var differenceY = currentOffset.pageY - startOffset.pageY; + + if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) { + return; + } + + applyTouchMove(differenceX, differenceY); + startOffset = currentOffset; + + var currentTime = new Date().getTime(); + + var timeGap = currentTime - startTime; + if (timeGap > 0) { + speed.x = differenceX / timeGap; + speed.y = differenceY / timeGap; + startTime = currentTime; + } + + if (shouldPrevent(differenceX, differenceY)) { + e.preventDefault(); + } + } + } + function touchEnd() { + if (i.settings.swipeEasing) { + clearInterval(easingLoop); + easingLoop = setInterval(function() { + if (i.isInitialized) { + clearInterval(easingLoop); + return; + } + + if (!speed.x && !speed.y) { + clearInterval(easingLoop); + return; + } + + if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) { + clearInterval(easingLoop); + return; + } + + applyTouchMove(speed.x * 30, speed.y * 30); + + speed.x *= 0.8; + speed.y *= 0.8; + }, 10); + } + } + + if (env.supportsTouch) { + i.event.bind(element, 'touchstart', touchStart); + i.event.bind(element, 'touchmove', touchMove); + i.event.bind(element, 'touchend', touchEnd); + } else if (env.supportsIePointer) { + if (window.PointerEvent) { + i.event.bind(element, 'pointerdown', touchStart); + i.event.bind(element, 'pointermove', touchMove); + i.event.bind(element, 'pointerup', touchEnd); + } else if (window.MSPointerEvent) { + i.event.bind(element, 'MSPointerDown', touchStart); + i.event.bind(element, 'MSPointerMove', touchMove); + i.event.bind(element, 'MSPointerUp', touchEnd); + } + } +}; + +var defaultSettings = function () { return ({ + handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'], + maxScrollbarLength: null, + minScrollbarLength: null, + scrollingThreshold: 1000, + scrollXMarginOffset: 0, + scrollYMarginOffset: 0, + suppressScrollX: false, + suppressScrollY: false, + swipeEasing: true, + useBothWheelAxes: false, + wheelPropagation: false, + wheelSpeed: 1, +}); }; + +var handlers = { + 'click-rail': clickRail, + 'drag-thumb': dragThumb, + keyboard: keyboard, + wheel: wheel, + touch: touch, +}; + +var PerfectScrollbar = function PerfectScrollbar(element, userSettings) { + var this$1 = this; + if ( userSettings === void 0 ) userSettings = {}; + + if (typeof element === 'string') { + element = document.querySelector(element); + } + + if (!element || !element.nodeName) { + throw new Error('no element is specified to initialize PerfectScrollbar'); + } + + this.element = element; + + element.classList.add(cls.main); + + this.settings = defaultSettings(); + for (var key in userSettings) { + this$1.settings[key] = userSettings[key]; + } + + this.containerWidth = null; + this.containerHeight = null; + this.contentWidth = null; + this.contentHeight = null; + + var focus = function () { return element.classList.add(cls.state.focus); }; + var blur = function () { return element.classList.remove(cls.state.focus); }; + + this.isRtl = get(element).direction === 'rtl'; + this.isNegativeScroll = (function () { + var originalScrollLeft = element.scrollLeft; + var result = null; + element.scrollLeft = -1; + result = element.scrollLeft < 0; + element.scrollLeft = originalScrollLeft; + return result; + })(); + this.negativeScrollAdjustment = this.isNegativeScroll + ? element.scrollWidth - element.clientWidth + : 0; + this.event = new EventManager(); + this.ownerDocument = element.ownerDocument || document; + + this.scrollbarXRail = div(cls.element.rail('x')); + element.appendChild(this.scrollbarXRail); + this.scrollbarX = div(cls.element.thumb('x')); + this.scrollbarXRail.appendChild(this.scrollbarX); + this.scrollbarX.setAttribute('tabindex', 0); + this.event.bind(this.scrollbarX, 'focus', focus); + this.event.bind(this.scrollbarX, 'blur', blur); + this.scrollbarXActive = null; + this.scrollbarXWidth = null; + this.scrollbarXLeft = null; + var railXStyle = get(this.scrollbarXRail); + this.scrollbarXBottom = parseInt(railXStyle.bottom, 10); + if (isNaN(this.scrollbarXBottom)) { + this.isScrollbarXUsingBottom = false; + this.scrollbarXTop = toInt(railXStyle.top); + } else { + this.isScrollbarXUsingBottom = true; + } + this.railBorderXWidth = + toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth); + // Set rail to display:block to calculate margins + set(this.scrollbarXRail, { display: 'block' }); + this.railXMarginWidth = + toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight); + set(this.scrollbarXRail, { display: '' }); + this.railXWidth = null; + this.railXRatio = null; + + this.scrollbarYRail = div(cls.element.rail('y')); + element.appendChild(this.scrollbarYRail); + this.scrollbarY = div(cls.element.thumb('y')); + this.scrollbarYRail.appendChild(this.scrollbarY); + this.scrollbarY.setAttribute('tabindex', 0); + this.event.bind(this.scrollbarY, 'focus', focus); + this.event.bind(this.scrollbarY, 'blur', blur); + this.scrollbarYActive = null; + this.scrollbarYHeight = null; + this.scrollbarYTop = null; + var railYStyle = get(this.scrollbarYRail); + this.scrollbarYRight = parseInt(railYStyle.right, 10); + if (isNaN(this.scrollbarYRight)) { + this.isScrollbarYUsingRight = false; + this.scrollbarYLeft = toInt(railYStyle.left); + } else { + this.isScrollbarYUsingRight = true; + } + this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null; + this.railBorderYWidth = + toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth); + set(this.scrollbarYRail, { display: 'block' }); + this.railYMarginHeight = + toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom); + set(this.scrollbarYRail, { display: '' }); + this.railYHeight = null; + this.railYRatio = null; + + this.reach = { + x: + element.scrollLeft <= 0 + ? 'start' + : element.scrollLeft >= this.contentWidth - this.containerWidth + ? 'end' + : null, + y: + element.scrollTop <= 0 + ? 'start' + : element.scrollTop >= this.contentHeight - this.containerHeight + ? 'end' + : null, + }; + + this.isAlive = true; + + this.settings.handlers.forEach(function (handlerName) { return handlers[handlerName](this$1); }); + + this.lastScrollTop = element.scrollTop; // for onScroll only + this.lastScrollLeft = element.scrollLeft; // for onScroll only + this.event.bind(this.element, 'scroll', function (e) { return this$1.onScroll(e); }); + updateGeometry(this); +}; + +PerfectScrollbar.prototype.update = function update () { + if (!this.isAlive) { + return; + } + + // Recalcuate negative scrollLeft adjustment + this.negativeScrollAdjustment = this.isNegativeScroll + ? this.element.scrollWidth - this.element.clientWidth + : 0; + + // Recalculate rail margins + set(this.scrollbarXRail, { display: 'block' }); + set(this.scrollbarYRail, { display: 'block' }); + this.railXMarginWidth = + toInt(get(this.scrollbarXRail).marginLeft) + + toInt(get(this.scrollbarXRail).marginRight); + this.railYMarginHeight = + toInt(get(this.scrollbarYRail).marginTop) + + toInt(get(this.scrollbarYRail).marginBottom); + + // Hide scrollbars not to affect scrollWidth and scrollHeight + set(this.scrollbarXRail, { display: 'none' }); + set(this.scrollbarYRail, { display: 'none' }); + + updateGeometry(this); + + processScrollDiff(this, 'top', 0, false, true); + processScrollDiff(this, 'left', 0, false, true); + + set(this.scrollbarXRail, { display: '' }); + set(this.scrollbarYRail, { display: '' }); +}; + +PerfectScrollbar.prototype.onScroll = function onScroll (e) { + if (!this.isAlive) { + return; + } + + updateGeometry(this); + processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop); + processScrollDiff( + this, + 'left', + this.element.scrollLeft - this.lastScrollLeft + ); + + this.lastScrollTop = this.element.scrollTop; + this.lastScrollLeft = this.element.scrollLeft; +}; + +PerfectScrollbar.prototype.destroy = function destroy () { + if (!this.isAlive) { + return; + } + + this.event.unbindAll(); + remove(this.scrollbarX); + remove(this.scrollbarY); + remove(this.scrollbarXRail); + remove(this.scrollbarYRail); + this.removePsClasses(); + + // unset elements + this.element = null; + this.scrollbarX = null; + this.scrollbarY = null; + this.scrollbarXRail = null; + this.scrollbarYRail = null; + + this.isAlive = false; +}; + +PerfectScrollbar.prototype.removePsClasses = function removePsClasses () { + this.element.className = this.element.className + .split(' ') + .filter(function (name) { return !name.match(/^ps([-_].+|)$/); }) + .join(' '); +}; + +/* harmony default export */ __webpack_exports__["default"] = (PerfectScrollbar); + /***/ }), @@ -140,7 +1755,566 @@ eval("__webpack_require__.r(__webpack_exports__);\n/*!\n * perfect-scrollbar v1. /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! tether-drop 1.4.1 */\n\n(function(root, factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! tether */ \"../node_modules/tether/dist/js/tether.js\")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function(Tether) {\n\n/* global Tether */\n'use strict';\n\nvar _bind = Function.prototype.bind;\n\nvar _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();\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 _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _Tether$Utils = Tether.Utils;\nvar extend = _Tether$Utils.extend;\nvar addClass = _Tether$Utils.addClass;\nvar removeClass = _Tether$Utils.removeClass;\nvar hasClass = _Tether$Utils.hasClass;\nvar Evented = _Tether$Utils.Evented;\n\nfunction sortAttach(str) {\n var _str$split = str.split(' ');\n\n var _str$split2 = _slicedToArray(_str$split, 2);\n\n var first = _str$split2[0];\n var second = _str$split2[1];\n\n if (['left', 'right'].indexOf(first) >= 0) {\n var _ref = [second, first];\n first = _ref[0];\n second = _ref[1];\n }\n return [first, second].join(' ');\n}\n\nfunction removeFromArray(arr, item) {\n var index = undefined;\n var results = [];\n while ((index = arr.indexOf(item)) !== -1) {\n results.push(arr.splice(index, 1));\n }\n return results;\n}\n\nvar clickEvents = ['click'];\nif ('ontouchstart' in document.documentElement) {\n clickEvents.push('touchstart');\n}\n\nvar transitionEndEvents = {\n 'WebkitTransition': 'webkitTransitionEnd',\n 'MozTransition': 'transitionend',\n 'OTransition': 'otransitionend',\n 'transition': 'transitionend'\n};\n\nvar transitionEndEvent = '';\nfor (var _name in transitionEndEvents) {\n if (({}).hasOwnProperty.call(transitionEndEvents, _name)) {\n var tempEl = document.createElement('p');\n if (typeof tempEl.style[_name] !== 'undefined') {\n transitionEndEvent = transitionEndEvents[_name];\n }\n }\n}\n\nvar MIRROR_ATTACH = {\n left: 'right',\n right: 'left',\n top: 'bottom',\n bottom: 'top',\n middle: 'middle',\n center: 'center'\n};\n\nvar allDrops = {};\n\n// Drop can be included in external libraries. Calling createContext gives you a fresh\n// copy of drop which won't interact with other copies on the page (beyond calling the document events).\n\nfunction createContext() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var drop = function drop() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return new (_bind.apply(DropInstance, [null].concat(args)))();\n };\n\n extend(drop, {\n createContext: createContext,\n drops: [],\n defaults: {}\n });\n\n var defaultOptions = {\n classPrefix: 'drop',\n defaults: {\n position: 'bottom left',\n openOn: 'click',\n beforeClose: null,\n constrainToScrollParent: true,\n constrainToWindow: true,\n classes: '',\n remove: false,\n openDelay: 0,\n closeDelay: 50,\n // inherited from openDelay and closeDelay if not explicitly defined\n focusDelay: null,\n blurDelay: null,\n hoverOpenDelay: null,\n hoverCloseDelay: null,\n tetherOptions: {}\n }\n };\n\n extend(drop, defaultOptions, options);\n extend(drop.defaults, defaultOptions.defaults, options.defaults);\n\n if (typeof allDrops[drop.classPrefix] === 'undefined') {\n allDrops[drop.classPrefix] = [];\n }\n\n drop.updateBodyClasses = function () {\n // There is only one body, so despite the context concept, we still iterate through all\n // drops which share our classPrefix.\n\n var anyOpen = false;\n var drops = allDrops[drop.classPrefix];\n var len = drops.length;\n for (var i = 0; i < len; ++i) {\n if (drops[i].isOpened()) {\n anyOpen = true;\n break;\n }\n }\n\n if (anyOpen) {\n addClass(document.body, drop.classPrefix + '-open');\n } else {\n removeClass(document.body, drop.classPrefix + '-open');\n }\n };\n\n var DropInstance = (function (_Evented) {\n _inherits(DropInstance, _Evented);\n\n function DropInstance(opts) {\n _classCallCheck(this, DropInstance);\n\n _get(Object.getPrototypeOf(DropInstance.prototype), 'constructor', this).call(this);\n this.options = extend({}, drop.defaults, opts);\n this.target = this.options.target;\n\n if (typeof this.target === 'undefined') {\n throw new Error('Drop Error: You must provide a target.');\n }\n\n var dataPrefix = 'data-' + drop.classPrefix;\n\n var contentAttr = this.target.getAttribute(dataPrefix);\n if (contentAttr && this.options.content == null) {\n this.options.content = contentAttr;\n }\n\n var attrsOverride = ['position', 'openOn'];\n for (var i = 0; i < attrsOverride.length; ++i) {\n\n var override = this.target.getAttribute(dataPrefix + '-' + attrsOverride[i]);\n if (override && this.options[attrsOverride[i]] == null) {\n this.options[attrsOverride[i]] = override;\n }\n }\n\n if (this.options.classes && this.options.addTargetClasses !== false) {\n addClass(this.target, this.options.classes);\n }\n\n drop.drops.push(this);\n allDrops[drop.classPrefix].push(this);\n\n this._boundEvents = [];\n this.bindMethods();\n this.setupElements();\n this.setupEvents();\n this.setupTether();\n }\n\n _createClass(DropInstance, [{\n key: '_on',\n value: function _on(element, event, handler) {\n this._boundEvents.push({ element: element, event: event, handler: handler });\n element.addEventListener(event, handler);\n }\n }, {\n key: 'bindMethods',\n value: function bindMethods() {\n this.transitionEndHandler = this._transitionEndHandler.bind(this);\n }\n }, {\n key: 'setupElements',\n value: function setupElements() {\n var _this = this;\n\n this.drop = document.createElement('div');\n addClass(this.drop, drop.classPrefix);\n\n if (this.options.classes) {\n addClass(this.drop, this.options.classes);\n }\n\n this.content = document.createElement('div');\n addClass(this.content, drop.classPrefix + '-content');\n\n if (typeof this.options.content === 'function') {\n var generateAndSetContent = function generateAndSetContent() {\n // content function might return a string or an element\n var contentElementOrHTML = _this.options.content.call(_this, _this);\n\n if (typeof contentElementOrHTML === 'string') {\n _this.content.innerHTML = contentElementOrHTML;\n } else if (typeof contentElementOrHTML === 'object') {\n _this.content.innerHTML = '';\n _this.content.appendChild(contentElementOrHTML);\n } else {\n throw new Error('Drop Error: Content function should return a string or HTMLElement.');\n }\n };\n\n generateAndSetContent();\n this.on('open', generateAndSetContent.bind(this));\n } else if (typeof this.options.content === 'object') {\n this.content.appendChild(this.options.content);\n } else {\n this.content.innerHTML = this.options.content;\n }\n\n this.drop.appendChild(this.content);\n }\n }, {\n key: 'setupTether',\n value: function setupTether() {\n // Tether expects two attachment points, one in the target element, one in the\n // drop. We use a single one, and use the order as well, to allow us to put\n // the drop on either side of any of the four corners. This magic converts between\n // the two:\n var dropAttach = this.options.position.split(' ');\n dropAttach[0] = MIRROR_ATTACH[dropAttach[0]];\n dropAttach = dropAttach.join(' ');\n\n var constraints = [];\n if (this.options.constrainToScrollParent) {\n constraints.push({\n to: 'scrollParent',\n pin: 'top, bottom',\n attachment: 'together none'\n });\n } else {\n // To get 'out of bounds' classes\n constraints.push({\n to: 'scrollParent'\n });\n }\n\n if (this.options.constrainToWindow !== false) {\n constraints.push({\n to: 'window',\n attachment: 'together'\n });\n } else {\n // To get 'out of bounds' classes\n constraints.push({\n to: 'window'\n });\n }\n\n var opts = {\n element: this.drop,\n target: this.target,\n attachment: sortAttach(dropAttach),\n targetAttachment: sortAttach(this.options.position),\n classPrefix: drop.classPrefix,\n offset: '0 0',\n targetOffset: '0 0',\n enabled: false,\n constraints: constraints,\n addTargetClasses: this.options.addTargetClasses\n };\n\n if (this.options.tetherOptions !== false) {\n this.tether = new Tether(extend({}, opts, this.options.tetherOptions));\n }\n }\n }, {\n key: 'setupEvents',\n value: function setupEvents() {\n var _this2 = this;\n\n if (!this.options.openOn) {\n return;\n }\n\n if (this.options.openOn === 'always') {\n setTimeout(this.open.bind(this));\n return;\n }\n\n var events = this.options.openOn.split(' ');\n\n if (events.indexOf('click') >= 0) {\n var openHandler = function openHandler(event) {\n _this2.toggle(event);\n event.preventDefault();\n };\n\n var closeHandler = function closeHandler(event) {\n if (!_this2.isOpened()) {\n return;\n }\n\n // Clicking inside dropdown\n if (event.target === _this2.drop || _this2.drop.contains(event.target)) {\n return;\n }\n\n // Clicking target\n if (event.target === _this2.target || _this2.target.contains(event.target)) {\n return;\n }\n\n _this2.close(event);\n };\n\n for (var i = 0; i < clickEvents.length; ++i) {\n var clickEvent = clickEvents[i];\n this._on(this.target, clickEvent, openHandler);\n this._on(document, clickEvent, closeHandler);\n }\n }\n\n var inTimeout = null;\n var outTimeout = null;\n\n var inHandler = function inHandler(event) {\n if (outTimeout !== null) {\n clearTimeout(outTimeout);\n } else {\n inTimeout = setTimeout(function () {\n _this2.open(event);\n inTimeout = null;\n }, (event.type === 'focus' ? _this2.options.focusDelay : _this2.options.hoverOpenDelay) || _this2.options.openDelay);\n }\n };\n\n var outHandler = function outHandler(event) {\n if (inTimeout !== null) {\n clearTimeout(inTimeout);\n } else {\n outTimeout = setTimeout(function () {\n _this2.close(event);\n outTimeout = null;\n }, (event.type === 'blur' ? _this2.options.blurDelay : _this2.options.hoverCloseDelay) || _this2.options.closeDelay);\n }\n };\n\n if (events.indexOf('hover') >= 0) {\n this._on(this.target, 'mouseover', inHandler);\n this._on(this.drop, 'mouseover', inHandler);\n this._on(this.target, 'mouseout', outHandler);\n this._on(this.drop, 'mouseout', outHandler);\n }\n\n if (events.indexOf('focus') >= 0) {\n this._on(this.target, 'focus', inHandler);\n this._on(this.drop, 'focus', inHandler);\n this._on(this.target, 'blur', outHandler);\n this._on(this.drop, 'blur', outHandler);\n }\n }\n }, {\n key: 'isOpened',\n value: function isOpened() {\n if (this.drop) {\n return hasClass(this.drop, drop.classPrefix + '-open');\n }\n }\n }, {\n key: 'toggle',\n value: function toggle(event) {\n if (this.isOpened()) {\n this.close(event);\n } else {\n this.open(event);\n }\n }\n }, {\n key: 'open',\n value: function open(event) {\n var _this3 = this;\n\n /* eslint no-unused-vars: 0 */\n if (this.isOpened()) {\n return;\n }\n\n if (!this.drop.parentNode) {\n document.body.appendChild(this.drop);\n }\n\n if (typeof this.tether !== 'undefined') {\n this.tether.enable();\n }\n\n addClass(this.drop, drop.classPrefix + '-open');\n addClass(this.drop, drop.classPrefix + '-open-transitionend');\n\n setTimeout(function () {\n if (_this3.drop) {\n addClass(_this3.drop, drop.classPrefix + '-after-open');\n }\n });\n\n if (typeof this.tether !== 'undefined') {\n this.tether.position();\n }\n\n this.trigger('open');\n\n drop.updateBodyClasses();\n }\n }, {\n key: '_transitionEndHandler',\n value: function _transitionEndHandler(e) {\n if (e.target !== e.currentTarget) {\n return;\n }\n\n if (!hasClass(this.drop, drop.classPrefix + '-open')) {\n removeClass(this.drop, drop.classPrefix + '-open-transitionend');\n }\n this.drop.removeEventListener(transitionEndEvent, this.transitionEndHandler);\n }\n }, {\n key: 'beforeCloseHandler',\n value: function beforeCloseHandler(event) {\n var shouldClose = true;\n\n if (!this.isClosing && typeof this.options.beforeClose === 'function') {\n this.isClosing = true;\n shouldClose = this.options.beforeClose(event, this) !== false;\n }\n\n this.isClosing = false;\n\n return shouldClose;\n }\n }, {\n key: 'close',\n value: function close(event) {\n if (!this.isOpened()) {\n return;\n }\n\n if (!this.beforeCloseHandler(event)) {\n return;\n }\n\n removeClass(this.drop, drop.classPrefix + '-open');\n removeClass(this.drop, drop.classPrefix + '-after-open');\n\n this.drop.addEventListener(transitionEndEvent, this.transitionEndHandler);\n\n this.trigger('close');\n\n if (typeof this.tether !== 'undefined') {\n this.tether.disable();\n }\n\n drop.updateBodyClasses();\n\n if (this.options.remove) {\n this.remove(event);\n }\n }\n }, {\n key: 'remove',\n value: function remove(event) {\n this.close(event);\n if (this.drop.parentNode) {\n this.drop.parentNode.removeChild(this.drop);\n }\n }\n }, {\n key: 'position',\n value: function position() {\n if (this.isOpened() && typeof this.tether !== 'undefined') {\n this.tether.position();\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.remove();\n\n if (typeof this.tether !== 'undefined') {\n this.tether.destroy();\n }\n\n for (var i = 0; i < this._boundEvents.length; ++i) {\n var _boundEvents$i = this._boundEvents[i];\n var element = _boundEvents$i.element;\n var _event = _boundEvents$i.event;\n var handler = _boundEvents$i.handler;\n\n element.removeEventListener(_event, handler);\n }\n\n this._boundEvents = [];\n\n this.tether = null;\n this.drop = null;\n this.content = null;\n this.target = null;\n\n removeFromArray(allDrops[drop.classPrefix], this);\n removeFromArray(drop.drops, this);\n }\n }]);\n\n return DropInstance;\n })(Evented);\n\n return drop;\n}\n\nvar Drop = createContext();\n\ndocument.addEventListener('DOMContentLoaded', function () {\n Drop.updateBodyClasses();\n});\nreturn Drop;\n\n}));\n\n\n//# sourceURL=webpack:///../node_modules/tether-drop/dist/js/drop.js?"); +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! tether-drop 1.4.1 */ + +(function(root, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! tether */ "../node_modules/tether/dist/js/tether.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}(this, function(Tether) { + +/* global Tether */ +'use strict'; + +var _bind = Function.prototype.bind; + +var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })(); + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +var _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var _Tether$Utils = Tether.Utils; +var extend = _Tether$Utils.extend; +var addClass = _Tether$Utils.addClass; +var removeClass = _Tether$Utils.removeClass; +var hasClass = _Tether$Utils.hasClass; +var Evented = _Tether$Utils.Evented; + +function sortAttach(str) { + var _str$split = str.split(' '); + + var _str$split2 = _slicedToArray(_str$split, 2); + + var first = _str$split2[0]; + var second = _str$split2[1]; + + if (['left', 'right'].indexOf(first) >= 0) { + var _ref = [second, first]; + first = _ref[0]; + second = _ref[1]; + } + return [first, second].join(' '); +} + +function removeFromArray(arr, item) { + var index = undefined; + var results = []; + while ((index = arr.indexOf(item)) !== -1) { + results.push(arr.splice(index, 1)); + } + return results; +} + +var clickEvents = ['click']; +if ('ontouchstart' in document.documentElement) { + clickEvents.push('touchstart'); +} + +var transitionEndEvents = { + 'WebkitTransition': 'webkitTransitionEnd', + 'MozTransition': 'transitionend', + 'OTransition': 'otransitionend', + 'transition': 'transitionend' +}; + +var transitionEndEvent = ''; +for (var _name in transitionEndEvents) { + if (({}).hasOwnProperty.call(transitionEndEvents, _name)) { + var tempEl = document.createElement('p'); + if (typeof tempEl.style[_name] !== 'undefined') { + transitionEndEvent = transitionEndEvents[_name]; + } + } +} + +var MIRROR_ATTACH = { + left: 'right', + right: 'left', + top: 'bottom', + bottom: 'top', + middle: 'middle', + center: 'center' +}; + +var allDrops = {}; + +// Drop can be included in external libraries. Calling createContext gives you a fresh +// copy of drop which won't interact with other copies on the page (beyond calling the document events). + +function createContext() { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var drop = function drop() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return new (_bind.apply(DropInstance, [null].concat(args)))(); + }; + + extend(drop, { + createContext: createContext, + drops: [], + defaults: {} + }); + + var defaultOptions = { + classPrefix: 'drop', + defaults: { + position: 'bottom left', + openOn: 'click', + beforeClose: null, + constrainToScrollParent: true, + constrainToWindow: true, + classes: '', + remove: false, + openDelay: 0, + closeDelay: 50, + // inherited from openDelay and closeDelay if not explicitly defined + focusDelay: null, + blurDelay: null, + hoverOpenDelay: null, + hoverCloseDelay: null, + tetherOptions: {} + } + }; + + extend(drop, defaultOptions, options); + extend(drop.defaults, defaultOptions.defaults, options.defaults); + + if (typeof allDrops[drop.classPrefix] === 'undefined') { + allDrops[drop.classPrefix] = []; + } + + drop.updateBodyClasses = function () { + // There is only one body, so despite the context concept, we still iterate through all + // drops which share our classPrefix. + + var anyOpen = false; + var drops = allDrops[drop.classPrefix]; + var len = drops.length; + for (var i = 0; i < len; ++i) { + if (drops[i].isOpened()) { + anyOpen = true; + break; + } + } + + if (anyOpen) { + addClass(document.body, drop.classPrefix + '-open'); + } else { + removeClass(document.body, drop.classPrefix + '-open'); + } + }; + + var DropInstance = (function (_Evented) { + _inherits(DropInstance, _Evented); + + function DropInstance(opts) { + _classCallCheck(this, DropInstance); + + _get(Object.getPrototypeOf(DropInstance.prototype), 'constructor', this).call(this); + this.options = extend({}, drop.defaults, opts); + this.target = this.options.target; + + if (typeof this.target === 'undefined') { + throw new Error('Drop Error: You must provide a target.'); + } + + var dataPrefix = 'data-' + drop.classPrefix; + + var contentAttr = this.target.getAttribute(dataPrefix); + if (contentAttr && this.options.content == null) { + this.options.content = contentAttr; + } + + var attrsOverride = ['position', 'openOn']; + for (var i = 0; i < attrsOverride.length; ++i) { + + var override = this.target.getAttribute(dataPrefix + '-' + attrsOverride[i]); + if (override && this.options[attrsOverride[i]] == null) { + this.options[attrsOverride[i]] = override; + } + } + + if (this.options.classes && this.options.addTargetClasses !== false) { + addClass(this.target, this.options.classes); + } + + drop.drops.push(this); + allDrops[drop.classPrefix].push(this); + + this._boundEvents = []; + this.bindMethods(); + this.setupElements(); + this.setupEvents(); + this.setupTether(); + } + + _createClass(DropInstance, [{ + key: '_on', + value: function _on(element, event, handler) { + this._boundEvents.push({ element: element, event: event, handler: handler }); + element.addEventListener(event, handler); + } + }, { + key: 'bindMethods', + value: function bindMethods() { + this.transitionEndHandler = this._transitionEndHandler.bind(this); + } + }, { + key: 'setupElements', + value: function setupElements() { + var _this = this; + + this.drop = document.createElement('div'); + addClass(this.drop, drop.classPrefix); + + if (this.options.classes) { + addClass(this.drop, this.options.classes); + } + + this.content = document.createElement('div'); + addClass(this.content, drop.classPrefix + '-content'); + + if (typeof this.options.content === 'function') { + var generateAndSetContent = function generateAndSetContent() { + // content function might return a string or an element + var contentElementOrHTML = _this.options.content.call(_this, _this); + + if (typeof contentElementOrHTML === 'string') { + _this.content.innerHTML = contentElementOrHTML; + } else if (typeof contentElementOrHTML === 'object') { + _this.content.innerHTML = ''; + _this.content.appendChild(contentElementOrHTML); + } else { + throw new Error('Drop Error: Content function should return a string or HTMLElement.'); + } + }; + + generateAndSetContent(); + this.on('open', generateAndSetContent.bind(this)); + } else if (typeof this.options.content === 'object') { + this.content.appendChild(this.options.content); + } else { + this.content.innerHTML = this.options.content; + } + + this.drop.appendChild(this.content); + } + }, { + key: 'setupTether', + value: function setupTether() { + // Tether expects two attachment points, one in the target element, one in the + // drop. We use a single one, and use the order as well, to allow us to put + // the drop on either side of any of the four corners. This magic converts between + // the two: + var dropAttach = this.options.position.split(' '); + dropAttach[0] = MIRROR_ATTACH[dropAttach[0]]; + dropAttach = dropAttach.join(' '); + + var constraints = []; + if (this.options.constrainToScrollParent) { + constraints.push({ + to: 'scrollParent', + pin: 'top, bottom', + attachment: 'together none' + }); + } else { + // To get 'out of bounds' classes + constraints.push({ + to: 'scrollParent' + }); + } + + if (this.options.constrainToWindow !== false) { + constraints.push({ + to: 'window', + attachment: 'together' + }); + } else { + // To get 'out of bounds' classes + constraints.push({ + to: 'window' + }); + } + + var opts = { + element: this.drop, + target: this.target, + attachment: sortAttach(dropAttach), + targetAttachment: sortAttach(this.options.position), + classPrefix: drop.classPrefix, + offset: '0 0', + targetOffset: '0 0', + enabled: false, + constraints: constraints, + addTargetClasses: this.options.addTargetClasses + }; + + if (this.options.tetherOptions !== false) { + this.tether = new Tether(extend({}, opts, this.options.tetherOptions)); + } + } + }, { + key: 'setupEvents', + value: function setupEvents() { + var _this2 = this; + + if (!this.options.openOn) { + return; + } + + if (this.options.openOn === 'always') { + setTimeout(this.open.bind(this)); + return; + } + + var events = this.options.openOn.split(' '); + + if (events.indexOf('click') >= 0) { + var openHandler = function openHandler(event) { + _this2.toggle(event); + event.preventDefault(); + }; + + var closeHandler = function closeHandler(event) { + if (!_this2.isOpened()) { + return; + } + + // Clicking inside dropdown + if (event.target === _this2.drop || _this2.drop.contains(event.target)) { + return; + } + + // Clicking target + if (event.target === _this2.target || _this2.target.contains(event.target)) { + return; + } + + _this2.close(event); + }; + + for (var i = 0; i < clickEvents.length; ++i) { + var clickEvent = clickEvents[i]; + this._on(this.target, clickEvent, openHandler); + this._on(document, clickEvent, closeHandler); + } + } + + var inTimeout = null; + var outTimeout = null; + + var inHandler = function inHandler(event) { + if (outTimeout !== null) { + clearTimeout(outTimeout); + } else { + inTimeout = setTimeout(function () { + _this2.open(event); + inTimeout = null; + }, (event.type === 'focus' ? _this2.options.focusDelay : _this2.options.hoverOpenDelay) || _this2.options.openDelay); + } + }; + + var outHandler = function outHandler(event) { + if (inTimeout !== null) { + clearTimeout(inTimeout); + } else { + outTimeout = setTimeout(function () { + _this2.close(event); + outTimeout = null; + }, (event.type === 'blur' ? _this2.options.blurDelay : _this2.options.hoverCloseDelay) || _this2.options.closeDelay); + } + }; + + if (events.indexOf('hover') >= 0) { + this._on(this.target, 'mouseover', inHandler); + this._on(this.drop, 'mouseover', inHandler); + this._on(this.target, 'mouseout', outHandler); + this._on(this.drop, 'mouseout', outHandler); + } + + if (events.indexOf('focus') >= 0) { + this._on(this.target, 'focus', inHandler); + this._on(this.drop, 'focus', inHandler); + this._on(this.target, 'blur', outHandler); + this._on(this.drop, 'blur', outHandler); + } + } + }, { + key: 'isOpened', + value: function isOpened() { + if (this.drop) { + return hasClass(this.drop, drop.classPrefix + '-open'); + } + } + }, { + key: 'toggle', + value: function toggle(event) { + if (this.isOpened()) { + this.close(event); + } else { + this.open(event); + } + } + }, { + key: 'open', + value: function open(event) { + var _this3 = this; + + /* eslint no-unused-vars: 0 */ + if (this.isOpened()) { + return; + } + + if (!this.drop.parentNode) { + document.body.appendChild(this.drop); + } + + if (typeof this.tether !== 'undefined') { + this.tether.enable(); + } + + addClass(this.drop, drop.classPrefix + '-open'); + addClass(this.drop, drop.classPrefix + '-open-transitionend'); + + setTimeout(function () { + if (_this3.drop) { + addClass(_this3.drop, drop.classPrefix + '-after-open'); + } + }); + + if (typeof this.tether !== 'undefined') { + this.tether.position(); + } + + this.trigger('open'); + + drop.updateBodyClasses(); + } + }, { + key: '_transitionEndHandler', + value: function _transitionEndHandler(e) { + if (e.target !== e.currentTarget) { + return; + } + + if (!hasClass(this.drop, drop.classPrefix + '-open')) { + removeClass(this.drop, drop.classPrefix + '-open-transitionend'); + } + this.drop.removeEventListener(transitionEndEvent, this.transitionEndHandler); + } + }, { + key: 'beforeCloseHandler', + value: function beforeCloseHandler(event) { + var shouldClose = true; + + if (!this.isClosing && typeof this.options.beforeClose === 'function') { + this.isClosing = true; + shouldClose = this.options.beforeClose(event, this) !== false; + } + + this.isClosing = false; + + return shouldClose; + } + }, { + key: 'close', + value: function close(event) { + if (!this.isOpened()) { + return; + } + + if (!this.beforeCloseHandler(event)) { + return; + } + + removeClass(this.drop, drop.classPrefix + '-open'); + removeClass(this.drop, drop.classPrefix + '-after-open'); + + this.drop.addEventListener(transitionEndEvent, this.transitionEndHandler); + + this.trigger('close'); + + if (typeof this.tether !== 'undefined') { + this.tether.disable(); + } + + drop.updateBodyClasses(); + + if (this.options.remove) { + this.remove(event); + } + } + }, { + key: 'remove', + value: function remove(event) { + this.close(event); + if (this.drop.parentNode) { + this.drop.parentNode.removeChild(this.drop); + } + } + }, { + key: 'position', + value: function position() { + if (this.isOpened() && typeof this.tether !== 'undefined') { + this.tether.position(); + } + } + }, { + key: 'destroy', + value: function destroy() { + this.remove(); + + if (typeof this.tether !== 'undefined') { + this.tether.destroy(); + } + + for (var i = 0; i < this._boundEvents.length; ++i) { + var _boundEvents$i = this._boundEvents[i]; + var element = _boundEvents$i.element; + var _event = _boundEvents$i.event; + var handler = _boundEvents$i.handler; + + element.removeEventListener(_event, handler); + } + + this._boundEvents = []; + + this.tether = null; + this.drop = null; + this.content = null; + this.target = null; + + removeFromArray(allDrops[drop.classPrefix], this); + removeFromArray(drop.drops, this); + } + }]); + + return DropInstance; + })(Evented); + + return drop; +} + +var Drop = createContext(); + +document.addEventListener('DOMContentLoaded', function () { + Drop.updateBodyClasses(); +}); +return Drop; + +})); + /***/ }), @@ -151,7 +2325,1820 @@ eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPAC /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! tether 1.4.3 */\n\n(function(root, factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function(require, exports, module) {\n\n'use strict';\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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar TetherBase = undefined;\nif (typeof TetherBase === 'undefined') {\n TetherBase = { modules: [] };\n}\n\nvar zeroElement = null;\n\n// Same as native getBoundingClientRect, except it takes into account parent offsets\n// if the element lies within a nested document ( or