From 2dd724f88f88671f051f75f5d308433a903e2805 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Thu, 29 Mar 2018 00:40:50 +0700 Subject: [PATCH] Updates * Switched standard to eslint with eslint-config-standard (and 4 more eslint plugins needed by standard). * Added "curly" eslint rule with "all" option. I like it. * Refactored all JS files to apply the new "curly" eslint rule. * Renewed axios.min.js, dropzone.min.js and sweetalert.min.js. Re-minified and added a small comment stating their version and copyright statement. * Some buttons in dashboard will now show loading icon whenever they're waiting for response from the server. * Updated README.md and .gitignore. --- .gitignore | 1 + README.md | 14 +- controllers/albumsController.js | 26 +- controllers/authController.js | 26 +- controllers/tokenController.js | 8 +- controllers/uploadController.js | 60 +++-- controllers/utilsController.js | 16 +- database/db.js | 4 +- package.json | 31 ++- pages/album.html | 4 +- pages/auth.html | 6 +- pages/dashboard.html | 6 +- pages/home.html | 8 +- public/js/auth.js | 4 +- public/js/dashboard.js | 149 ++++++---- public/js/home.js | 8 +- public/libs/axios/axios.min.js | 4 +- public/libs/dropzone/dropzone.min.js | 2 +- public/libs/sweetalert/sweetalert.min.js | 3 +- views/album.handlebars | 4 +- yarn.lock | 328 +++++------------------ 21 files changed, 291 insertions(+), 421 deletions(-) diff --git a/.gitignore b/.gitignore index 5c95e05..1604c07 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,6 @@ npm-debug.log pages/custom/** migrate.js yarn.lock +yarn-error.log package-lock.json .vscode/ diff --git a/README.md b/README.md index af23e7e..2ca7881 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,14 @@ -![loli-safe](https://s.fiery.me/rlpHkNJejaYKuVesQN1Gxtm43NokI8WQ.png) +![loli-safe](https://s.fiery.me/cFUN.png) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/kanadeko/Kuro/master/LICENSE) [![Chat / Support](https://img.shields.io/badge/Chat%20%2F%20Support-discord-7289DA.svg?style=flat-square)](https://discord.gg/5g6vgwn) # lolisafe, a small safe worth protecting. ## What is `safe.fiery.me` branch? -This branch is the one being used at https://safe.fiery.me. If you are looking for the original, head to `master` branch, or even better to [WeebDev/lolisafe](https://github.com/WeebDev/lolisafe). - -## What's new in v3.0.0 -- Backend rewrite to make it faster, better and easier to extend -- Album downloads (Thanks to [PascalTemel](https://github.com/PascalTemel)) -- See releases for changelog - -If you're upgrading from a version prior to v3.0.0 make sure to run **ONCE** `node database/migration.js` to create the missing columns on the database. +[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard) +This branch is the one being used at https://safe.fiery.me. If you are looking for the original, head to `master` branch, or even better to [WeebDev/lolisafe](https://github.com/WeebDev/lolisafe). +If you want to use an existing lolisafe database with this branch, make sure to run `node database/migration.js` at least once to create some new columns introduced in this branch. You can ignore any errors about duplicate columns. +Configuration file of lolisafe, `config.js`, is not 100% compatible with this branch. There are some options that had been renamed and/or restructured. Please make sure your config matches the sample in `config.sample.js` before starting. ## Running 1. Ensure you have at least version 7.6.0 of node installed diff --git a/controllers/albumsController.js b/controllers/albumsController.js index 8a66af6..0f2c1de 100644 --- a/controllers/albumsController.js +++ b/controllers/albumsController.js @@ -10,7 +10,7 @@ const albumsController = {} albumsController.list = async (req, res, next) => { const albumDomain = config.albumDomain || config.domain const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } const fields = ['id', 'name'] if (req.params.sidebar === undefined) { @@ -35,16 +35,16 @@ albumsController.list = async (req, res, next) => { const files = await db.table('files').whereIn('albumid', ids).select('albumid') const albumsCount = {} - for (let id of ids) albumsCount[id] = 0 - for (let file of files) albumsCount[file.albumid] += 1 - for (let album of albums) album.files = albumsCount[album.id] + for (let id of ids) { albumsCount[id] = 0 } + for (let file of files) { albumsCount[file.albumid] += 1 } + for (let album of albums) { album.files = albumsCount[album.id] } return res.json({ success: true, albums }) } albumsController.create = async (req, res, next) => { const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } const name = req.body.name if (name === undefined || name === '') { @@ -76,7 +76,7 @@ albumsController.create = async (req, res, next) => { albumsController.delete = async (req, res, next) => { const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } const id = req.body.id if (id === undefined || id === '') { @@ -89,7 +89,7 @@ albumsController.delete = async (req, res, next) => { albumsController.rename = async (req, res, next) => { const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } const id = req.body.id if (id === undefined || id === '') { @@ -112,10 +112,10 @@ albumsController.rename = async (req, res, next) => { albumsController.get = async (req, res, next) => { const identifier = req.params.identifier - if (identifier === undefined) return res.status(401).json({ success: false, description: 'No identifier provided.' }) + if (identifier === undefined) { return res.status(401).json({ success: false, description: 'No identifier provided.' }) } const album = await db.table('albums').where({ identifier, enabled: 1 }).first() - if (!album) return res.json({ success: false, description: 'Album not found.' }) + if (!album) { return res.json({ success: false, description: 'Album not found.' }) } const title = album.name const files = await db.table('files').select('name').where('albumid', album.id).orderBy('id', 'DESC') @@ -139,11 +139,11 @@ albumsController.get = async (req, res, next) => { albumsController.generateZip = async (req, res, next) => { const identifier = req.params.identifier - if (identifier === undefined) return res.status(401).json({ success: false, description: 'No identifier provided.' }) - if (!config.uploads.generateZips) return res.status(401).json({ success: false, description: 'Zip generation disabled.' }) + if (identifier === undefined) { return res.status(401).json({ success: false, description: 'No identifier provided.' }) } + if (!config.uploads.generateZips) { return res.status(401).json({ success: false, description: 'Zip generation disabled.' }) } const album = await db.table('albums').where({ identifier, enabled: 1 }).first() - if (!album) return res.json({ success: false, description: 'Album not found.' }) + if (!album) { return res.json({ success: false, description: 'Album not found.' }) } if (album.zipGeneratedAt > album.editedAt) { const filePath = path.join(config.uploads.folder, 'zips', `${identifier}.zip`) @@ -152,7 +152,7 @@ albumsController.generateZip = async (req, res, next) => { } else { console.log(`Generating zip for album identifier: ${identifier}`) const files = await db.table('files').select('name').where('albumid', album.id) - if (files.length === 0) return res.json({ success: false, description: 'There are no files in the album.' }) + if (files.length === 0) { return res.json({ success: false, description: 'There are no files in the album.' }) } const zipPath = path.join(__dirname, '..', config.uploads.folder, 'zips', `${album.identifier}.zip`) let archive = new Zip() diff --git a/controllers/authController.js b/controllers/authController.js index c9a12fd..348e68d 100644 --- a/controllers/authController.js +++ b/controllers/authController.js @@ -10,11 +10,11 @@ authController.verify = async (req, res, next) => { const username = req.body.username const password = req.body.password - if (username === undefined) return res.json({ success: false, description: 'No username provided.' }) - if (password === undefined) return res.json({ success: false, description: 'No password provided.' }) + if (username === undefined) { return res.json({ success: false, description: 'No username provided.' }) } + if (password === undefined) { return res.json({ success: false, description: 'No password provided.' }) } const user = await db.table('users').where('username', username).first() - if (!user) return res.json({ success: false, description: 'Username doesn\'t exist.' }) + if (!user) { return res.json({ success: false, description: 'Username doesn\'t exist.' }) } if (user.enabled === false || user.enabled === 0) { return res.json({ success: false, @@ -27,7 +27,7 @@ authController.verify = async (req, res, next) => { console.log(err) return res.json({ success: false, description: 'There was an error.' }) } - if (result === false) return res.json({ success: false, description: 'Wrong password.' }) + if (result === false) { return res.json({ success: false, description: 'Wrong password.' }) } return res.json({ success: true, token: user.token }) }) } @@ -40,8 +40,8 @@ authController.register = async (req, res, next) => { const username = req.body.username const password = req.body.password - if (username === undefined) return res.json({ success: false, description: 'No username provided.' }) - if (password === undefined) return res.json({ success: false, description: 'No password provided.' }) + if (username === undefined) { return res.json({ success: false, description: 'No username provided.' }) } + if (password === undefined) { return res.json({ success: false, description: 'No password provided.' }) } if (username.length < 4 || username.length > 32) { return res.json({ success: false, description: 'Username must have 4-32 characters.' }) @@ -51,7 +51,7 @@ authController.register = async (req, res, next) => { } const user = await db.table('users').where('username', username).first() - if (user) return res.json({ success: false, description: 'Username already exists.' }) + if (user) { return res.json({ success: false, description: 'Username already exists.' }) } bcrypt.hash(password, 10, async (err, hash) => { if (err) { @@ -71,10 +71,10 @@ authController.register = async (req, res, next) => { authController.changePassword = async (req, res, next) => { const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } let password = req.body.password - if (password === undefined) return res.json({ success: false, description: 'No password provided.' }) + if (password === undefined) { return res.json({ success: false, description: 'No password provided.' }) } if (password.length < 6 || password.length > 64) { return res.json({ success: false, description: 'Password must have 6-64 characters.' }) @@ -93,7 +93,7 @@ authController.changePassword = async (req, res, next) => { authController.getFileLengthConfig = async (req, res, next) => { const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } return res.json({ success: true, fileLength: user.fileLength, config: config.uploads.fileLength }) } @@ -103,11 +103,11 @@ authController.changeFileLength = async (req, res, next) => { } const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } let fileLength = parseInt(req.body.fileLength) - if (fileLength === undefined) return res.json({ success: false, description: 'No file name length provided.' }) - if (isNaN(fileLength)) return res.json({ success: false, description: 'File name length is not a valid number.' }) + if (fileLength === undefined) { return res.json({ success: false, description: 'No file name length provided.' }) } + if (isNaN(fileLength)) { return res.json({ success: false, description: 'File name length is not a valid number.' }) } if (fileLength < config.uploads.fileLength.min || fileLength > config.uploads.fileLength.max) { return res.json({ success: false, description: `File name length must be ${config.uploads.fileLength.min} to ${config.uploads.fileLength.max} characters.` }) diff --git a/controllers/tokenController.js b/controllers/tokenController.js index b857073..6e2249b 100644 --- a/controllers/tokenController.js +++ b/controllers/tokenController.js @@ -7,22 +7,22 @@ const tokenController = {} tokenController.verify = async (req, res, next) => { const token = req.body.token - if (token === undefined) return res.status(401).json({ success: false, description: 'No token provided.' }) + if (token === undefined) { return res.status(401).json({ success: false, description: 'No token provided.' }) } const user = await db.table('users').where('token', token).first() - if (!user) return res.status(401).json({ success: false, description: 'Invalid token.' }) + if (!user) { return res.status(401).json({ success: false, description: 'Invalid token.' }) } return res.json({ success: true, username: user.username }) } tokenController.list = async (req, res, next) => { const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } return res.json({ success: true, token: user.token }) } tokenController.change = async (req, res, next) => { const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } const newtoken = randomstring.generate(64) await db.table('users').where('token', user.token).update({ diff --git a/controllers/uploadController.js b/controllers/uploadController.js index 5753b8c..7e6438b 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -28,11 +28,11 @@ const storage = multer.diskStorage({ const uuidDir = path.join(chunksDir, req.body.uuid) fs.access(uuidDir, err => { // If it exists, callback - if (!err) return cb(null, uuidDir) + if (!err) { return cb(null, uuidDir) } // It it doesn't, then make it first fs.mkdir(uuidDir, err => { // If there was no error, callback - if (!err) return cb(null, uuidDir) + if (!err) { return cb(null, uuidDir) } // Otherwise, log it console.log(err) // eslint-disable-next-line standard/no-callback-literal @@ -81,7 +81,7 @@ const upload = multer({ const keys = Object.keys(req.body) if (keys.length) { for (const key of keys) { - if (!/^dz/.test(key)) continue + if (!/^dz/.test(key)) { continue } req.body[key.replace(/^dz/, '')] = req.body[key] delete req.body[key] } @@ -114,11 +114,11 @@ uploadsController.getUniqueRandomName = (length, extension, cb) => { const name = randomstring.generate(length) + extension fs.access(path.join(uploadDir, name), err => { // If a file with the same name does not exist - if (err) return cb(null, name) + if (err) { return cb(null, name) } // If a file with the same name already exists, log to console console.log(`A file named ${name} already exists (${++i}/${maxTries}).`) // If it still haven't reached allowed maximum tries, then try again - if (i < maxTries) return access(i) + if (i < maxTries) { return access(i) } // eslint-disable-next-line standard/no-callback-literal return cb('Could not allocate a unique random name. Try again?') }) @@ -131,7 +131,7 @@ uploadsController.upload = async (req, res, next) => { let user if (config.private === true) { user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } } else if (req.headers.token) { user = await db.table('users').where('token', req.headers.token).first() } @@ -172,12 +172,12 @@ uploadsController.actuallyUpload = async (req, res, user, albumid) => { } upload(req, res, async err => { - if (err) return erred(err) + if (err) { return erred(err) } - if (req.files.length === 0) return erred(new Error('No files.')) + if (req.files.length === 0) { return erred(new Error('No files.')) } // If chunked uploads is enabeld and the uploaded file is a chunk, then just say that it was a success - if (chunkedUploads && req.body.uuid) return res.json({ success: true }) + if (chunkedUploads && req.body.uuid) { return res.json({ success: true }) } const infoMap = req.files.map(file => { return { @@ -206,7 +206,7 @@ uploadsController.finishChunks = async (req, res, next) => { let user if (config.private === true) { user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } } else if (req.headers.token) { user = await db.table('users').where('token', req.headers.token).first() } @@ -247,25 +247,25 @@ uploadsController.actuallyFinishChunks = async (req, res, user, albumid) => { } const files = req.body.files - if (!files) return erred(new Error('Missing files array.')) + if (!files) { return erred(new Error('Missing files array.')) } let iteration = 0 const infoMap = [] files.forEach(file => { const { uuid, count } = file - if (!uuid || !count) return erred(new Error('Missing UUID and/or chunks count.')) + if (!uuid || !count) { return erred(new Error('Missing UUID and/or chunks count.')) } const chunksDirUuid = path.join(chunksDir, uuid) fs.readdir(chunksDirUuid, async (err, chunks) => { - if (err) return erred(err) - if (count < chunks.length) return erred(new Error('Chunks count mismatch.')) + if (err) { return erred(err) } + if (count < chunks.length) { return erred(new Error('Chunks count mismatch.')) } const extension = path.extname(chunks[0]) const length = uploadsController.getFileNameLength(req) uploadsController.getUniqueRandomName(length, extension, async (err, name) => { - if (err) return erred(err) + if (err) { return erred(err) } const destination = path.join(uploadDir, name) const destFileStream = fs.createWriteStream(destination, { flags: 'a' }) @@ -280,7 +280,7 @@ uploadsController.actuallyFinishChunks = async (req, res, user, albumid) => { } }) - if (!appended) return + if (!appended) { return } infoMap.push({ path: destination, @@ -348,8 +348,11 @@ uploadsController.writeFilesToDb = async (req, res, user, albumid, infoMap) => { const fileHash = hash.digest('hex') const dbFile = await db.table('files') .where(function () { - if (user === undefined) this.whereNull('userid') - else this.where('userid', user.id) + if (user === undefined) { + this.whereNull('userid') + } else { + this.where('userid', user.id) + } }) .where({ hash: fileHash, @@ -433,7 +436,7 @@ uploadsController.processFilesForDisplay = async (req, res, files, existingFiles uploadsController.delete = async (req, res) => { const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } const id = req.body.id if (id === undefined || id === '') { return res.json({ success: false, description: 'No file specified.' }) @@ -451,7 +454,7 @@ uploadsController.delete = async (req, res) => { try { await uploadsController.deleteFile(file.name).catch(err => { // ENOENT is missing file, for whatever reason, then just delete from db - if (err.code !== 'ENOENT') throw err + if (err.code !== 'ENOENT') { throw err } }) await db.table('files').where('id', id).del() if (file.albumid) { @@ -494,18 +497,21 @@ uploadsController.deleteFile = function (file) { uploadsController.list = async (req, res) => { const user = await utils.authorize(req, res) - if (!user) return + if (!user) { return } let offset = req.params.page - if (offset === undefined) offset = 0 + if (offset === undefined) { offset = 0 } const files = await db.table('files') .where(function () { - if (req.params.id === undefined) this.where('id', '<>', '') - else this.where('albumid', req.params.id) + if (req.params.id === undefined) { + this.where('id', '<>', '') + } else { + this.where('albumid', req.params.id) + } }) .where(function () { - if (user.username !== 'root') this.where('userid', user.id) + if (user.username !== 'root') { this.where('userid', user.id) } }) .orderBy('id', 'DESC') .limit(25) @@ -546,10 +552,10 @@ uploadsController.list = async (req, res) => { } // If we are a normal user, send response - if (user.username !== 'root') return res.json({ success: true, files }) + if (user.username !== 'root') { return res.json({ success: true, files }) } // If we are root but there are no uploads attached to a user, send response - if (userids.length === 0) return res.json({ success: true, files }) + if (userids.length === 0) { return res.json({ success: true, files }) } const users = await db.table('users').whereIn('id', userids) for (let dbUser of users) { diff --git a/controllers/utilsController.js b/controllers/utilsController.js index 4619250..d4b985a 100644 --- a/controllers/utilsController.js +++ b/controllers/utilsController.js @@ -26,11 +26,11 @@ utilsController.getPrettyDate = function (date) { utilsController.getPrettyBytes = function (num) { // MIT License // Copyright (c) Sindre Sorhus (sindresorhus.com) - if (!Number.isFinite(num)) return num + if (!Number.isFinite(num)) { return num } const neg = num < 0 - if (neg) num = -num - if (num < 1) return (neg ? '-' : '') + num + ' B' + if (neg) { num = -num } + if (num < 1) { return (neg ? '-' : '') + num + ' B' } const exponent = Math.min(Math.floor(Math.log10(num) / 3), units.length - 1) const numStr = Number((num / Math.pow(1000, exponent)).toPrecision(3)) @@ -47,7 +47,7 @@ utilsController.authorize = async (req, res) => { } const user = await db.table('users').where('token', token).first() - if (user) return user + if (user) { return user } res.status(401).json({ success: false, description: 'Invalid token.' }) } @@ -56,9 +56,9 @@ utilsController.generateThumbs = function (file, basedomain) { const isVideoExt = utilsController.videoExtensions.includes(ext) const isImageExt = utilsController.imageExtensions.includes(ext) - if (!isVideoExt && !isImageExt) return - if (isVideoExt && config.uploads.generateThumbnails.video !== true) return - if (isImageExt && config.uploads.generateThumbnails.image !== true) return + if (!isVideoExt && !isImageExt) { return } + if (isVideoExt && config.uploads.generateThumbnails.video !== true) { return } + if (isImageExt && config.uploads.generateThumbnails.image !== true) { return } let thumbname = path.join(__dirname, '..', config.uploads.folder, 'thumbs', file.name.slice(0, -ext.length) + '.png') fs.access(thumbname, err => { @@ -83,7 +83,7 @@ utilsController.generateThumbs = function (file, basedomain) { .extent(size.width, size.height) .background('transparent') .write(thumbname, error => { - if (error) console.log('Error - ', error) + if (error) { console.log('Error - ', error) } }) } } diff --git a/database/db.js b/database/db.js index 4aba7a3..17c4cd0 100644 --- a/database/db.js +++ b/database/db.js @@ -43,10 +43,10 @@ let init = function (db) { table.integer('timestamp') }).then(() => { db.table('users').where({username: 'root'}).then((user) => { - if (user.length > 0) return + if (user.length > 0) { return } require('bcrypt').hash('root', 10, function (err, hash) { - if (err) console.error('Error generating password hash for root') + if (err) { console.error('Error generating password hash for root') } db.table('users').insert({ username: 'root', diff --git a/package.json b/package.json index e5c7aca..51dd9dd 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,29 @@ "sqlite3": "^4.0.0" }, "devDependencies": { - "standard": "^11.0.1" + "eslint": "^4.19.1", + "eslint-config-standard": "^11.0.0", + "eslint-plugin-import": "^2.9.0", + "eslint-plugin-node": "^6.0.1", + "eslint-plugin-promise": "^3.7.0", + "eslint-plugin-standard": "^3.0.1" }, - "standard": { - "envs": [ - "browser", - "node" - ] - } + "eslintConfig": { + "env": { + "browser": true, + "node": true + }, + "extends": [ + "standard" + ], + "rules": { + "curly": [ + "error", + "all" + ] + } + }, + "eslintIgnore": [ + "**/*.min.js" + ] } diff --git a/pages/album.html b/pages/album.html index 08b51ce..ca0a10c 100644 --- a/pages/album.html +++ b/pages/album.html @@ -12,8 +12,8 @@ - - + + diff --git a/pages/auth.html b/pages/auth.html index 3b20fa6..c8c0beb 100644 --- a/pages/auth.html +++ b/pages/auth.html @@ -13,9 +13,9 @@ - - - + + + diff --git a/pages/dashboard.html b/pages/dashboard.html index 5511461..24ec6b9 100644 --- a/pages/dashboard.html +++ b/pages/dashboard.html @@ -14,9 +14,9 @@ - - - + + + diff --git a/pages/home.html b/pages/home.html index 5added5..7f8d7c5 100644 --- a/pages/home.html +++ b/pages/home.html @@ -12,10 +12,10 @@ - - - - + + + + diff --git a/public/js/auth.js b/public/js/auth.js index 2e51931..3e07f6b 100644 --- a/public/js/auth.js +++ b/public/js/auth.js @@ -33,7 +33,7 @@ page.do = dest => { page.onkeypress = function (event, element) { event = event || window.event - if (!event) return + if (!event) { return } if (event.keyCode === 13 || event.which === 13) { return this.do('login') } @@ -41,7 +41,7 @@ page.onkeypress = function (event, element) { page.verify = () => { page.token = localStorage.token - if (page.token === undefined) return + if (page.token === undefined) { return } axios.post('api/tokens/verify', { token: page.token diff --git a/public/js/dashboard.js b/public/js/dashboard.js index b4f21dc..2ac0fd1 100644 --- a/public/js/dashboard.js +++ b/public/js/dashboard.js @@ -89,16 +89,29 @@ panel.closeModal = () => { document.getElementById('modal').className = 'modal' } -panel.getUploads = (album, page) => { - if (page === undefined) page = 0 +panel.isLoading = (element, state) => { + if (!element) { return } + if (state && !element.className.includes(' is-loading')) { + element.className += ' is-loading' + } else if (!state && element.className.includes(' is-loading')) { + element.className = element.className.replace(' is-loading', '') + } +} + +panel.getUploads = (album, page, element) => { + if (element) { panel.isLoading(element, true) } + if (page === undefined) { page = 0 } let url = 'api/uploads/' + page if (album !== undefined) { url = 'api/album/' + album + '/' + page } axios.get(url).then(response => { if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } let prevPage = 0 @@ -106,23 +119,23 @@ panel.getUploads = (album, page) => { if (response.data.files.length < 25) { nextPage = page } - if (page > 0) prevPage = page - 1 + if (page > 0) { prevPage = page - 1 } const pagination = ` ` const listType = `
- + - + @@ -242,10 +255,10 @@ panel.getUploads = (album, page) => { }) } -panel.setFilesView = (view, album, page) => { +panel.setFilesView = (view, album, page, element) => { localStorage.filesView = view panel.filesView = view - panel.getUploads(album, page) + panel.getUploads(album, page, element) } panel.deleteFile = (id, album, page) => { @@ -262,14 +275,17 @@ panel.deleteFile = (id, album, page) => { } } }).then(value => { - if (!value) return + if (!value) { return } axios.post('api/upload/delete', { id: id }) .then(response => { if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } swal('Deleted!', 'The file has been deleted.', 'success') @@ -285,8 +301,11 @@ panel.deleteFile = (id, album, page) => { panel.getAlbums = () => { axios.get('api/albums').then(response => { if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } panel.page.innerHTML = ` @@ -349,7 +368,7 @@ panel.getAlbums = () => { } document.getElementById('submitAlbum').addEventListener('click', function () { - panel.submitAlbum() + panel.submitAlbum(this) }) }) .catch(err => { @@ -376,16 +395,14 @@ panel.renameAlbum = id => { } } }).then(value => { - if (!value) return swal.close() + if (!value) { return swal.close() } axios.post('api/albums/rename', { id: id, name: value }) .then(response => { if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else if (response.data.description === 'Name already in use') swal.showInputError('That name is already in use!') - else swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { return panel.verifyToken(panel.token) } else if (response.data.description === 'Name already in use') { swal.showInputError('That name is already in use!') } else { swal('An error occurred', response.data.description, 'error') } return } @@ -414,14 +431,17 @@ panel.deleteAlbum = id => { } } }).then(value => { - if (!value) return + if (!value) { return } axios.post('api/albums/delete', { id: id }) .then(response => { if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } swal('Deleted!', 'Your album has been deleted.', 'success') @@ -435,14 +455,19 @@ panel.deleteAlbum = id => { }) } -panel.submitAlbum = () => { +panel.submitAlbum = element => { + panel.isLoading(element, true) axios.post('api/albums', { name: document.getElementById('albumName').value }) - .then(response => { + .then(async response => { + panel.setLoading(element, false) if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } swal('Woohoo!', 'Album was added successfully', 'success') @@ -451,6 +476,7 @@ panel.submitAlbum = () => { }) .catch(err => { console.log(err) + panel.setLoading(element, false) return swal('An error occurred', 'There was an error with the request, please check the console for more information.', 'error') }) } @@ -459,14 +485,17 @@ panel.getAlbumsSidebar = () => { axios.get('api/albums/sidebar') .then(response => { if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } const albumsContainer = document.getElementById('albumsContainer') albumsContainer.innerHTML = '' - if (response.data.albums === undefined) return + if (response.data.albums === undefined) { return } for (const album of response.data.albums) { const li = document.createElement('li') @@ -497,8 +526,11 @@ panel.changeFileLength = () => { axios.get('api/filelength/config') .then(response => { if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } panel.page.innerHTML = ` @@ -519,7 +551,7 @@ panel.changeFileLength = () => { ` document.getElementById('setFileLength').addEventListener('click', function () { - panel.setFileLength(document.getElementById('fileLength').value) + panel.setFileLength(document.getElementById('fileLength').value, this) }) }) .catch(err => { @@ -528,12 +560,17 @@ panel.changeFileLength = () => { }) } -panel.setFileLength = fileLength => { +panel.setFileLength = (fileLength, element) => { + panel.isLoading(element, true) axios.post('api/filelength/change', { fileLength }) .then(response => { + panel.isLoading(element, false) if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } swal({ @@ -546,6 +583,7 @@ panel.setFileLength = fileLength => { }) .catch(err => { console.log(err) + panel.isLoading(element, false) return swal('An error occurred', 'There was an error with the request, please check the console for more information.', 'error') }) } @@ -554,8 +592,11 @@ panel.changeToken = () => { axios.get('api/tokens') .then(response => { if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } panel.page.innerHTML = ` @@ -575,7 +616,7 @@ panel.changeToken = () => { ` document.getElementById('getNewToken').addEventListener('click', function () { - panel.getNewToken() + panel.getNewToken(this) }) }) .catch(err => { @@ -584,12 +625,17 @@ panel.changeToken = () => { }) } -panel.getNewToken = () => { +panel.getNewToken = element => { + panel.isLoading(element, true) axios.post('api/tokens/change') .then(response => { + panel.isLoading(element, false) if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } swal({ @@ -603,6 +649,7 @@ panel.getNewToken = () => { }) .catch(err => { console.log(err) + panel.isLoading(element, false) return swal('An error occurred', 'There was an error with the request, please check the console for more information.', 'error') }) } @@ -632,7 +679,7 @@ panel.changePassword = () => { document.getElementById('sendChangePassword').addEventListener('click', function () { if (document.getElementById('password').value === document.getElementById('passwordConfirm').value) { - panel.sendNewPassword(document.getElementById('password').value) + panel.sendNewPassword(document.getElementById('password').value, this) } else { swal({ title: 'Password mismatch!', @@ -645,12 +692,17 @@ panel.changePassword = () => { }) } -panel.sendNewPassword = pass => { - axios.post('api/password/change', {password: pass}) +panel.sendNewPassword = (pass, element) => { + panel.isLoading(element, true) + axios.post('api/password/change', { password: pass }) .then(response => { + panel.isLoading(element, false) if (response.data.success === false) { - if (response.data.description === 'No token provided') return panel.verifyToken(panel.token) - else return swal('An error occurred', response.data.description, 'error') + if (response.data.description === 'No token provided') { + return panel.verifyToken(panel.token) + } else { + return swal('An error occurred', response.data.description, 'error') + } } swal({ @@ -663,6 +715,7 @@ panel.sendNewPassword = pass => { }) .catch(err => { console.log(err) + panel.isLoading(element, false) return swal('An error occurred', 'There was an error with the request, please check the console for more information.', 'error') }) } diff --git a/public/js/home.js b/public/js/home.js index 5a13b9d..7cdc1c5 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -84,7 +84,7 @@ upload.prepareUpload = () => { // If the user doesn't have any albums we don't really need to display // an album selection - if (albums.length === 0) return + if (albums.length === 0) { return } // Loop through the albums and create an option for each album for (let i = 0; i < albums.length; i++) { @@ -190,18 +190,18 @@ upload.prepareDropzone = () => { // Add the selected albumid, if an album is selected, as a header upload.dropzone.on('sending', (file, xhr, formData) => { - if (upload.album) xhr.setRequestHeader('albumid', upload.album) + if (upload.album) { xhr.setRequestHeader('albumid', upload.album) } }) // Update the total progress bar upload.dropzone.on('uploadprogress', (file, progress, bytesSent) => { - if (file.upload.chunked && progress === 100) return + if (file.upload.chunked && progress === 100) { return } file.previewElement.querySelector('.progress').setAttribute('value', progress) file.previewElement.querySelector('.progress').innerHTML = `${progress}%` }) upload.dropzone.on('success', (file, response) => { - if (!response) return + if (!response) { return } file.previewTemplate.querySelector('.progress').style.display = 'none' if (response.success === false) { diff --git a/public/libs/axios/axios.min.js b/public/libs/axios/axios.min.js index 6dfa1da..a55aae9 100644 --- a/public/libs/axios/axios.min.js +++ b/public/libs/axios/axios.min.js @@ -1,3 +1 @@ -/* axios v0.15.3 | (c) 2016 by Matt Zabriskie */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new i(e),n=s(i.prototype.request,t);return o.extend(n,i.prototype,t),o.extend(n,t),n}var o=n(2),s=n(3),i=n(4),a=n(5),u=r(a);u.Axios=i,u.create=function(e){return r(o.merge(a,e))},u.Cancel=n(22),u.CancelToken=n(23),u.isCancel=n(19),u.all=function(e){return Promise.all(e)},u.spread=n(24),e.exports=u,e.exports.default=u},function(e,t,n){"use strict";function r(e){return"[object Array]"===C.call(e)}function o(e){return"[object ArrayBuffer]"===C.call(e)}function s(e){return"undefined"!=typeof FormData&&e instanceof FormData}function i(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function a(e){return"string"==typeof e}function u(e){return"number"==typeof e}function c(e){return"undefined"==typeof e}function f(e){return null!==e&&"object"==typeof e}function p(e){return"[object Date]"===C.call(e)}function d(e){return"[object File]"===C.call(e)}function l(e){return"[object Blob]"===C.call(e)}function h(e){return"[object Function]"===C.call(e)}function m(e){return f(e)&&h(e.pipe)}function y(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function w(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.createElement}function v(e,t){if(null!==e&&"undefined"!=typeof e)if("object"==typeof e||r(e)||(e=[e]),r(e))for(var n=0,o=e.length;n=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},s.forEach(["delete","get","head"],function(e){c.headers[e]={}}),s.forEach(["post","put","patch"],function(e){c.headers[e]=s.merge(u)}),e.exports=c},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(8),s=n(11),i=n(12),a=n(13),u=n(9),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(14);e.exports=function(e){return new Promise(function(t,f){var p=e.data,d=e.headers;r.isFormData(p)&&delete d["Content-Type"];var l=new XMLHttpRequest,h="onreadystatechange",m=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in l||a(e.url)||(l=new window.XDomainRequest,h="onload",m=!0,l.onprogress=function(){},l.ontimeout=function(){}),e.auth){var y=e.auth.username||"",w=e.auth.password||"";d.Authorization="Basic "+c(y+":"+w)}if(l.open(e.method.toUpperCase(),s(e.url,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l[h]=function(){if(l&&(4===l.readyState||m)&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?i(l.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?l.response:l.responseText,s={data:r,status:1223===l.status?204:l.status,statusText:1223===l.status?"No Content":l.statusText,headers:n,config:e,request:l};o(t,f,s),l=null}},l.onerror=function(){f(u("Network Error",e)),l=null},l.ontimeout=function(){f(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED")),l=null},r.isStandardBrowserEnv()){var g=n(15),v=(e.withCredentials||a(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;v&&(d[e.xsrfHeaderName]=v)}if("setRequestHeader"in l&&r.forEach(d,function(e,t){"undefined"==typeof p&&"content-type"===t.toLowerCase()?delete d[t]:l.setRequestHeader(t,e)}),e.withCredentials&&(l.withCredentials=!0),e.responseType)try{l.responseType=e.responseType}catch(e){if("json"!==l.responseType)throw e}"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),f(e),l=null)}),void 0===p&&(p=null),l.send(p)})}},function(e,t,n){"use strict";var r=n(9);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n)):e(n)}},function(e,t,n){"use strict";var r=n(10);e.exports=function(e,t,n,o){var s=new Error(e);return r(s,t,n,o)}},function(e,t){"use strict";e.exports=function(e,t,n,r){return e.config=t,n&&(e.code=n),e.response=r,e}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(2);e.exports=function(e,t,n){if(!t)return e;var s;if(n)s=n(t);else if(o.isURLSearchParams(t))s=t.toString();else{var i=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)&&(t+="[]"),o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),i.push(r(t)+"="+r(e))}))}),s=i.join("&")}return s&&(e+=(e.indexOf("?")===-1?"?":"&")+s),e}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e){var t,n,o,s={};return e?(r.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t&&(s[t]=s[t]?s[t]+", "+n:n)}),s):s}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t){"use strict";function n(){this.message="String contains an invalid character"}function r(e){for(var t,r,s=String(e),i="",a=0,u=o;s.charAt(0|a)||(u="=",a%1);i+=u.charAt(63&t>>8-a%1*8)){if(r=s.charCodeAt(a+=.75),r>255)throw new n;t=t<<8|r}return i}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=r},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";function r(){this.handlers=[]}var o=n(2);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var o=n(2),s=n(18),i=n(19),a=n(5);e.exports=function(e){r(e),e.headers=e.headers||{},e.data=s(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||a.adapter;return t(e).then(function(t){return r(e),t.data=s(t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(r(e),t&&t.response&&(t.response.data=s(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,"")}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(22);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}); -//# sourceMappingURL=axios.min.map \ No newline at end of file +/*! axios v0.17.1 | Copyright (c) 2017 Matt Zabriskie */(function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()})(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new s(e),n=i(s.prototype.request,t);return o.extend(n,s.prototype,t),o.extend(n,t),n}var o=n(2),i=n(3),s=n(5),u=n(6),a=r(u);a.Axios=s,a.create=function(e){return r(o.merge(u,e))},a.Cancel=n(23),a.CancelToken=n(24),a.isCancel=n(20),a.all=function(e){return Promise.all(e)},a.spread=n(25),e.exports=a,e.exports.default=a},function(e,t,n){"use strict";function r(e){return"[object Array]"===R.call(e)}function o(e){return"[object ArrayBuffer]"===R.call(e)}function i(e){return"undefined"!=typeof FormData&&e instanceof FormData}function s(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function u(e){return"string"==typeof e}function a(e){return"number"==typeof e}function c(e){return"undefined"==typeof e}function f(e){return null!==e&&"object"==typeof e}function p(e){return"[object Date]"===R.call(e)}function d(e){return"[object File]"===R.call(e)}function l(e){return"[object Blob]"===R.call(e)}function h(e){return"[object Function]"===R.call(e)}function m(e){return f(e)&&h(e.pipe)}function y(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function w(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function v(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n=200&&e<300}};a.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){a.headers[e]={}}),i.forEach(["post","put","patch"],function(e){a.headers[e]=i.merge(u)}),e.exports=a},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(9),i=n(12),s=n(13),u=n(14),a=n(10),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(15);e.exports=function(e){return new Promise(function(t,f){var p=e.data,d=e.headers;r.isFormData(p)&&delete d["Content-Type"];var l=new XMLHttpRequest,h="onreadystatechange",m=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in l||u(e.url)||(l=new window.XDomainRequest,h="onload",m=!0,l.onprogress=function(){},l.ontimeout=function(){}),e.auth){var y=e.auth.username||"",w=e.auth.password||"";d.Authorization="Basic "+c(y+":"+w)}if(l.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l[h]=function(){if(l&&(4===l.readyState||m)&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?s(l.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?l.response:l.responseText,i={data:r,status:1223===l.status?204:l.status,statusText:1223===l.status?"No Content":l.statusText,headers:n,config:e,request:l};o(t,f,i),l=null}},l.onerror=function(){f(a("Network Error",e,null,l)),l=null},l.ontimeout=function(){f(a("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var g=n(16),v=(e.withCredentials||u(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;v&&(d[e.xsrfHeaderName]=v)}if("setRequestHeader"in l&&r.forEach(d,function(e,t){"undefined"==typeof p&&"content-type"===t.toLowerCase()?delete d[t]:l.setRequestHeader(t,e)}),e.withCredentials&&(l.withCredentials=!0),e.responseType)try{l.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),f(e),l=null)}),void 0===p&&(p=null),l.send(p)})}},function(e,t,n){"use strict";var r=n(10);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";var r=n(11);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(2);e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(o.isURLSearchParams(t))i=t.toString();else{var s=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)&&(t+="[]"),o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),s.push(r(t)+"="+r(e))}))}),i=s.join("&")}return i&&(e+=(e.indexOf("?")===-1?"?":"&")+i),e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?s[t]=(s[t]?s[t]:[]).concat([n]):s[t]=s[t]?s[t]+", "+n:n}}),s):s}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t){"use strict";function n(){this.message="String contains an invalid character"}function r(e){for(var t,r,i=String(e),s="",u=0,a=o;i.charAt(0|u)||(a="=",u%1);s+=a.charAt(63&t>>8-u%1*8)){if(r=i.charCodeAt(u+=.75),r>255)throw new n;t=t<<8|r}return s}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=r},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";function r(){this.handlers=[]}var o=n(2);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var o=n(2),i=n(19),s=n(20),u=n(6),a=n(21),c=n(22);e.exports=function(e){r(e),e.baseURL&&!a(e.url)&&(e.url=c(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||u.adapter;return t(e).then(function(t){return r(e),t.data=i(t.data,t.headers,e.transformResponse),t},function(t){return s(t)||(r(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}); diff --git a/public/libs/dropzone/dropzone.min.js b/public/libs/dropzone/dropzone.min.js index 320fd00..3f667b0 100644 --- a/public/libs/dropzone/dropzone.min.js +++ b/public/libs/dropzone/dropzone.min.js @@ -1,2 +1,2 @@ -"use strict";function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function __guard__(e,t){return"undefined"!=typeof e&&null!==e?t(e):void 0}function __guardMethod__(e,t,i){return"undefined"!=typeof e&&null!==e&&"function"==typeof e[t]?i(e,t):void 0}var _createClass=function(){function e(e,t){for(var i=0;i1?i-1:0),r=1;r=o.length)break;s=o[l++]}else{if(l=o.next(),l.done)break;s=l.value}var u=s;u.apply(this,n)}}return this}},{key:"off",value:function(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(var n=0;n=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;if(/(^| )dz-message($| )/.test(a.className)){e=a,a.className="dz-message";break}}e||(e=t.createElement('
'),this.element.appendChild(e));var l=e.getElementsByTagName("span")[0];return l&&(null!=l.textContent?l.textContent=this.options.dictFallbackMessage:null!=l.innerText&&(l.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,i,n){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==i?(t=r.srcWidth,i=r.srcHeight):null==t?t=i*o:null==i&&(i=t/o),t=Math.min(t,r.srcWidth),i=Math.min(i,r.srcHeight);var a=t/i;if(r.srcWidth>t||r.srcHeight>i)if("crop"===n)o>a?(r.srcHeight=e.height,r.srcWidth=r.srcHeight*a):(r.srcWidth=e.width,r.srcHeight=r.srcWidth/a);else{if("contain"!==n)throw new Error("Unknown resizeMethod '"+n+"'");o>a?i=t/o:t=i*o}return r.srcX=(e.width-r.srcWidth)/2,r.srcY=(e.height-r.srcHeight)/2,r.trgWidth=t,r.trgHeight=i,r},transformFile:function(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:'
\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
',drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:function(e){},dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:function(e){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var i=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){e.previewElement=t.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement);for(var n=e.previewElement.querySelectorAll("[data-dz-name]"),r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;l.textContent=e.name}for(var s=e.previewElement.querySelectorAll("[data-dz-size]"),u=!0,d=0,s=u?s:s[Symbol.iterator]();;){if(u){if(d>=s.length)break;l=s[d++]}else{if(d=s.next(),d.done)break;l=d.value}l.innerHTML=this.filesize(e.size)}this.options.addRemoveLinks&&(e._removeLink=t.createElement('
'+this.options.dictRemoveFile+""),e.previewElement.appendChild(e._removeLink));for(var c=function(n){return n.preventDefault(),n.stopPropagation(),e.status===t.UPLOADING?t.confirm(i.options.dictCancelUploadConfirmation,function(){return i.removeFile(e)}):i.options.dictRemoveFileConfirmation?t.confirm(i.options.dictRemoveFileConfirmation,function(){return i.removeFile(e)}):i.removeFile(e)},p=e.previewElement.querySelectorAll("[data-dz-remove]"),h=!0,f=0,p=h?p:p[Symbol.iterator]();;){var v;if(h){if(f>=p.length)break;v=p[f++]}else{if(f=p.next(),f.done)break;v=f.value}var m=v;m.addEventListener("click",c)}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(var i=e.previewElement.querySelectorAll("[data-dz-thumbnail]"),n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;a.alt=e.name,a.src=t}return setTimeout(function(){return e.previewElement.classList.add("dz-image-preview")},1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error);for(var i=e.previewElement.querySelectorAll("[data-dz-errormessage]"),n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;a.textContent=t}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t,i){if(e.previewElement)for(var n=e.previewElement.querySelectorAll("[data-dz-uploadprogress]"),r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;"PROGRESS"===l.nodeName?l.value=t:l.style.width=t+"%"}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.textContent=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;for(var u in s){var d=s[u];e[u]=d}}return e}}]),_createClass(t,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(e){return e.accepted}).map(function(e){return e})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(e){return!e.accepted}).map(function(e){return e})}},{key:"getFilesWithStatus",value:function(e){return this.files.filter(function(t){return t.status===e}).map(function(e){return e})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(t.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(t.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(t.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(e){return e.status===t.UPLOADING||e.status===t.QUEUED}).map(function(e){return e})}},{key:"init",value:function(){var e=this;if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(t.createElement('
'+this.options.dictDefaultMessage+"
")),this.clickableElements.length){var i=function t(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null===e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!==e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!==e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var i=e.hiddenFileInput.files;if(i.length)for(var n=i,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;e.addFile(l)}return e.emit("addedfiles",i),t()})};i()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(var n=this.events,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;this.on(l,this.options[l])}this.on("uploadprogress",function(){return e.updateTotalUploadProgress()}),this.on("removedfile",function(){return e.updateTotalUploadProgress()}),this.on("canceled",function(t){return e.emit("complete",t)}),this.on("complete",function(t){if(0===e.getAddedFiles().length&&0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length)return setTimeout(function(){return e.emit("queuecomplete")},0)});var s=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function(t){return e.emit("dragstart",t)},dragenter:function(t){return s(t),e.emit("dragenter",t)},dragover:function(t){var i=void 0;try{i=t.dataTransfer.effectAllowed}catch(e){}return t.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",s(t),e.emit("dragover",t)},dragleave:function(t){return e.emit("dragleave",t)},drop:function(t){return s(t),e.drop(t)},dragend:function(t){return e.emit("dragend",t)}}}],this.clickableElements.forEach(function(i){return e.listeners.push({element:i,events:{click:function(n){return(i!==e.element||n.target===e.element||t.elementInside(n.target,e.element.querySelector(".dz-message")))&&e.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,t.instances.splice(t.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e=void 0,t=0,i=0,n=this.getActiveFiles();if(n.length){for(var r=this.getActiveFiles(),o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;t+=s.upload.bytesSent,i+=s.upload.total}e=100*t/i}else e=100;return this.emit("totaluploadprogress",e,i,t)}},{key:"_getParamName",value:function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):""+this.options.paramName+(this.options.uploadMultiple?"["+e+"]":"")}},{key:"_renameFile",value:function(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}},{key:"getFallbackForm",value:function(){var e=void 0,i=void 0;if(e=this.getExistingFallback())return e;var n='
';this.options.dictFallbackText&&(n+="

"+this.options.dictFallbackText+"

"),n+='
';var r=t.createElement(n);return"FORM"!==this.element.tagName?(i=t.createElement('
'),i.appendChild(r)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=i?i:r}},{key:"getExistingFallback",value:function(){for(var e=function(e){for(var t=e,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;if(/(^| )fallback($| )/.test(o.className))return o}},t=["div","form"],i=0;i0){for(var n=["tb","gb","mb","kb","b"],r=0;r=a){t=e/Math.pow(this.options.filesizeBase,4-r),i=o;break}}t=Math.round(10*t)/10}return""+t+" "+this.options.dictFileSizeUnits[i]}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(e){if(e.dataTransfer){this.emit("drop",e);var t=e.dataTransfer.files;if(this.emit("addedfiles",t),t.length){var i=e.dataTransfer.items;i&&i.length&&null!=i[0].webkitGetAsEntry?this._addFilesFromItems(i):this.handleFiles(t)}}}},{key:"paste",value:function(e){if(null!=__guard__(null!=e?e.clipboardData:void 0,function(e){return e.items})){this.emit("paste",e);var t=e.clipboardData.items;return t.length?this._addFilesFromItems(t):void 0}}},{key:"handleFiles",value:function(e){for(var t=e,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;this.addFile(o)}}},{key:"_addFilesFromItems",value:function(e){var t=this;return function(){for(var i=[],n=e,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l,s=a;null!=s.webkitGetAsEntry&&(l=s.webkitGetAsEntry())?l.isFile?i.push(t.addFile(s.getAsFile())):l.isDirectory?i.push(t._addFilesFromDirectory(l,l.name)):i.push(void 0):null!=s.getAsFile&&(null==s.kind||"file"===s.kind)?i.push(t.addFile(s.getAsFile())):i.push(void 0)}return i}()}},{key:"_addFilesFromDirectory",value:function(e,t){var i=this,n=e.createReader(),r=function(e){return __guardMethod__(console,"log",function(t){return t.log(e)})},o=function e(){return n.readEntries(function(n){if(n.length>0){for(var r=n,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;s.isFile?s.file(function(e){if(!i.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=t+"/"+e.name,i.addFile(e)}):s.isDirectory&&i._addFilesFromDirectory(s,t+"/"+s.name)}e()}return null},r)};return o()}},{key:"accept",value:function(e,i){return e.size>1024*this.options.maxFilesize*1024?i(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(i(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,i):i(this.options.dictInvalidFileType)}},{key:"addFile",value:function(e){var i=this;return e.upload={uuid:t.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e),chunked:this.options.chunking&&(this.options.forceChunking||e.size>this.options.chunkSize),totalChunkCount:Math.ceil(e.size/this.options.chunkSize)},this.files.push(e),e.status=t.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return t?(e.accepted=!1,i._errorProcessing([e],t)):(e.accepted=!0,i.options.autoQueue&&i.enqueueFile(e)),i._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(e){for(var t=e,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;this.enqueueFile(o)}return null}},{key:"enqueueFile",value:function(e){var i=this;if(e.status!==t.ADDED||e.accepted!==!0)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=t.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return i.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout(function(){return t._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var e=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var t=this._thumbnailQueue.shift();return this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(i){return e.emit("thumbnail",t,i),e._processingThumbnail=!1,e._processThumbnailQueue()})}}},{key:"removeFile",value:function(e){if(e.status===t.UPLOADING&&this.cancelUpload(e),this.files=without(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);for(var i=this.files.slice(),n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;(a.status!==t.UPLOADING||e)&&this.removeFile(a)}return null}},{key:"resizeImage",value:function(e,i,n,r,o){var a=this;return this.createThumbnail(e,i,n,r,!1,function(i,n){if(null==n)return o(e);var r=a.options.resizeMimeType;null==r&&(r=e.type);var l=n.toDataURL(r,a.options.resizeQuality);return"image/jpeg"!==r&&"image/jpg"!==r||(l=ExifRestore.restore(e.dataURL,l)),o(t.dataURItoBlob(l))})}},{key:"createThumbnail",value:function(e,t,i,n,r,o){var a=this,l=new FileReader;return l.onload=function(){return e.dataURL=l.result,"image/svg+xml"===e.type?void(null!=o&&o(l.result)):a.createThumbnailFromUrl(e,t,i,n,r,o)},l.readAsDataURL(e)}},{key:"createThumbnailFromUrl",value:function(e,t,i,n,r,o,a){var l=this,s=document.createElement("img");return a&&(s.crossOrigin=a),s.onload=function(){var a=function(e){return e(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&r&&(a=function(e){return EXIF.getData(s,function(){return e(EXIF.getTag(this,"Orientation"))})}),a(function(r){e.width=s.width,e.height=s.height;var a=l.options.resize.call(l,e,t,i,n),u=document.createElement("canvas"),d=u.getContext("2d");switch(u.width=a.trgWidth,u.height=a.trgHeight,r>4&&(u.width=a.trgHeight,u.height=a.trgWidth),r){case 2:d.translate(u.width,0),d.scale(-1,1);break;case 3:d.translate(u.width,u.height),d.rotate(Math.PI);break;case 4:d.translate(0,u.height),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-u.height);break;case 7:d.rotate(.5*Math.PI),d.translate(u.width,-u.height),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-u.width,0)}drawImageIOSFix(d,s,null!=a.srcX?a.srcX:0,null!=a.srcY?a.srcY:0,a.srcWidth,a.srcHeight,null!=a.trgX?a.trgX:0,null!=a.trgY?a.trgY:0,a.trgWidth,a.trgHeight);var c=u.toDataURL("image/png");if(null!=o)return o(c,u)})},null!=o&&(s.onerror=o),s.src=e.dataURL}},{key:"processQueue",value:function(){var e=this.options.parallelUploads,t=this.getUploadingFiles().length,i=t;if(!(t>=e)){var n=this.getQueuedFiles();if(n.length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,e-t));for(;i=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;a.processing=!0,a.status=t.UPLOADING,this.emit("processing",a)}return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}},{key:"_getFilesWithXhr",value:function(e){var t=void 0;return t=this.files.filter(function(t){return t.xhr===e}).map(function(e){return e})}},{key:"cancelUpload",value:function(e){if(e.status===t.UPLOADING){for(var i=this._getFilesWithXhr(e.xhr),n=i,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;l.status=t.CANCELED}"undefined"!=typeof e.xhr&&e.xhr.abort();for(var s=i,u=!0,d=0,s=u?s:s[Symbol.iterator]();;){var c;if(u){if(d>=s.length)break;c=s[d++]}else{if(d=s.next(),d.done)break;c=d.value}var p=c;this.emit("canceled",p)}this.options.uploadMultiple&&this.emit("canceledmultiple",i)}else e.status!==t.ADDED&&e.status!==t.QUEUED||(e.status=t.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(e){if("function"==typeof e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n=r.upload.totalChunkCount)){a++;var l=n*i.options.chunkSize,s=Math.min(l+i.options.chunkSize,r.size),u={name:i._getParamName(0),data:o.webkitSlice?o.webkitSlice(l,s):o.slice(l,s),filename:r.upload.filename,chunkIndex:n};r.upload.chunks[n]={file:r,index:n,dataBlock:u,status:t.UPLOADING,progress:0,retries:0},i._uploadData(e,[u])}};if(r.upload.finishedChunkUpload=function(n){var o=!0;n.status=t.SUCCESS,n.dataBlock=null;for(var a=0;a1?i-1:0),r=1;r=o.length)break;s=o[l++]}else{if(l=o.next(),l.done)break;s=l.value}var u=s;u.apply(this,n)}}return this}},{key:"off",value:function(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(var n=0;n=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;if(/(^| )dz-message($| )/.test(a.className)){e=a,a.className="dz-message";break}}e||(e=t.createElement('
'),this.element.appendChild(e));var l=e.getElementsByTagName("span")[0];return l&&(null!=l.textContent?l.textContent=this.options.dictFallbackMessage:null!=l.innerText&&(l.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,i,n){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==i?(t=r.srcWidth,i=r.srcHeight):null==t?t=i*o:null==i&&(i=t/o),t=Math.min(t,r.srcWidth),i=Math.min(i,r.srcHeight);var a=t/i;if(r.srcWidth>t||r.srcHeight>i)if("crop"===n)o>a?(r.srcHeight=e.height,r.srcWidth=r.srcHeight*a):(r.srcWidth=e.width,r.srcHeight=r.srcWidth/a);else{if("contain"!==n)throw new Error("Unknown resizeMethod '"+n+"'");o>a?i=t/o:t=i*o}return r.srcX=(e.width-r.srcWidth)/2,r.srcY=(e.height-r.srcHeight)/2,r.trgWidth=t,r.trgHeight=i,r},transformFile:function(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:'
\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
',drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:function(e){},dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:function(e){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var i=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){e.previewElement=t.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement);for(var n=e.previewElement.querySelectorAll("[data-dz-name]"),r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;l.textContent=e.name}for(var s=e.previewElement.querySelectorAll("[data-dz-size]"),u=!0,d=0,s=u?s:s[Symbol.iterator]();;){if(u){if(d>=s.length)break;l=s[d++]}else{if(d=s.next(),d.done)break;l=d.value}l.innerHTML=this.filesize(e.size)}this.options.addRemoveLinks&&(e._removeLink=t.createElement(''+this.options.dictRemoveFile+""),e.previewElement.appendChild(e._removeLink));for(var c=function(n){return n.preventDefault(),n.stopPropagation(),e.status===t.UPLOADING?t.confirm(i.options.dictCancelUploadConfirmation,function(){return i.removeFile(e)}):i.options.dictRemoveFileConfirmation?t.confirm(i.options.dictRemoveFileConfirmation,function(){return i.removeFile(e)}):i.removeFile(e)},p=e.previewElement.querySelectorAll("[data-dz-remove]"),h=!0,f=0,p=h?p:p[Symbol.iterator]();;){var v;if(h){if(f>=p.length)break;v=p[f++]}else{if(f=p.next(),f.done)break;v=f.value}var m=v;m.addEventListener("click",c)}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(var i=e.previewElement.querySelectorAll("[data-dz-thumbnail]"),n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;a.alt=e.name,a.src=t}return setTimeout(function(){return e.previewElement.classList.add("dz-image-preview")},1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error);for(var i=e.previewElement.querySelectorAll("[data-dz-errormessage]"),n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;a.textContent=t}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t,i){if(e.previewElement)for(var n=e.previewElement.querySelectorAll("[data-dz-uploadprogress]"),r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;"PROGRESS"===l.nodeName?l.value=t:l.style.width=t+"%"}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.textContent=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;for(var u in s){var d=s[u];e[u]=d}}return e}}]),_createClass(t,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(e){return e.accepted}).map(function(e){return e})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(e){return!e.accepted}).map(function(e){return e})}},{key:"getFilesWithStatus",value:function(e){return this.files.filter(function(t){return t.status===e}).map(function(e){return e})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(t.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(t.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(t.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(e){return e.status===t.UPLOADING||e.status===t.QUEUED}).map(function(e){return e})}},{key:"init",value:function(){var e=this;if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(t.createElement('
'+this.options.dictDefaultMessage+"
")),this.clickableElements.length){var i=function t(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null===e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!==e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!==e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var i=e.hiddenFileInput.files;if(i.length)for(var n=i,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;e.addFile(l)}return e.emit("addedfiles",i),t()})};i()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(var n=this.events,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;this.on(l,this.options[l])}this.on("uploadprogress",function(){return e.updateTotalUploadProgress()}),this.on("removedfile",function(){return e.updateTotalUploadProgress()}),this.on("canceled",function(t){return e.emit("complete",t)}),this.on("complete",function(t){if(0===e.getAddedFiles().length&&0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length)return setTimeout(function(){return e.emit("queuecomplete")},0)});var s=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function(t){return e.emit("dragstart",t)},dragenter:function(t){return s(t),e.emit("dragenter",t)},dragover:function(t){var i=void 0;try{i=t.dataTransfer.effectAllowed}catch(e){}return t.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",s(t),e.emit("dragover",t)},dragleave:function(t){return e.emit("dragleave",t)},drop:function(t){return s(t),e.drop(t)},dragend:function(t){return e.emit("dragend",t)}}}],this.clickableElements.forEach(function(i){return e.listeners.push({element:i,events:{click:function(n){return(i!==e.element||n.target===e.element||t.elementInside(n.target,e.element.querySelector(".dz-message")))&&e.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,t.instances.splice(t.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e=void 0,t=0,i=0,n=this.getActiveFiles();if(n.length){for(var r=this.getActiveFiles(),o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;t+=s.upload.bytesSent,i+=s.upload.total}e=100*t/i}else e=100;return this.emit("totaluploadprogress",e,i,t)}},{key:"_getParamName",value:function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):""+this.options.paramName+(this.options.uploadMultiple?"["+e+"]":"")}},{key:"_renameFile",value:function(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}},{key:"getFallbackForm",value:function(){var e=void 0,i=void 0;if(e=this.getExistingFallback())return e;var n='
';this.options.dictFallbackText&&(n+="

"+this.options.dictFallbackText+"

"),n+='
';var r=t.createElement(n);return"FORM"!==this.element.tagName?(i=t.createElement('
'),i.appendChild(r)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=i?i:r}},{key:"getExistingFallback",value:function(){for(var e=function(e){for(var t=e,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;if(/(^| )fallback($| )/.test(o.className))return o}},t=["div","form"],i=0;i0){for(var n=["tb","gb","mb","kb","b"],r=0;r=a){t=e/Math.pow(this.options.filesizeBase,4-r),i=o;break}}t=Math.round(10*t)/10}return""+t+" "+this.options.dictFileSizeUnits[i]}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(e){if(e.dataTransfer){this.emit("drop",e);var t=e.dataTransfer.files;if(this.emit("addedfiles",t),t.length){var i=e.dataTransfer.items;i&&i.length&&null!=i[0].webkitGetAsEntry?this._addFilesFromItems(i):this.handleFiles(t)}}}},{key:"paste",value:function(e){if(null!=__guard__(null!=e?e.clipboardData:void 0,function(e){return e.items})){this.emit("paste",e);var t=e.clipboardData.items;return t.length?this._addFilesFromItems(t):void 0}}},{key:"handleFiles",value:function(e){for(var t=e,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;this.addFile(o)}}},{key:"_addFilesFromItems",value:function(e){var t=this;return function(){for(var i=[],n=e,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l,s=a;null!=s.webkitGetAsEntry&&(l=s.webkitGetAsEntry())?l.isFile?i.push(t.addFile(s.getAsFile())):l.isDirectory?i.push(t._addFilesFromDirectory(l,l.name)):i.push(void 0):null!=s.getAsFile&&(null==s.kind||"file"===s.kind)?i.push(t.addFile(s.getAsFile())):i.push(void 0)}return i}()}},{key:"_addFilesFromDirectory",value:function(e,t){var i=this,n=e.createReader(),r=function(e){return __guardMethod__(console,"log",function(t){return t.log(e)})},o=function e(){return n.readEntries(function(n){if(n.length>0){for(var r=n,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;s.isFile?s.file(function(e){if(!i.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=t+"/"+e.name,i.addFile(e)}):s.isDirectory&&i._addFilesFromDirectory(s,t+"/"+s.name)}e()}return null},r)};return o()}},{key:"accept",value:function(e,i){return e.size>1024*this.options.maxFilesize*1024?i(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(i(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,i):i(this.options.dictInvalidFileType)}},{key:"addFile",value:function(e){var i=this;return e.upload={uuid:t.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e),chunked:this.options.chunking&&(this.options.forceChunking||e.size>this.options.chunkSize),totalChunkCount:Math.ceil(e.size/this.options.chunkSize)},this.files.push(e),e.status=t.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return t?(e.accepted=!1,i._errorProcessing([e],t)):(e.accepted=!0,i.options.autoQueue&&i.enqueueFile(e)),i._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(e){for(var t=e,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;this.enqueueFile(o)}return null}},{key:"enqueueFile",value:function(e){var i=this;if(e.status!==t.ADDED||e.accepted!==!0)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=t.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return i.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout(function(){return t._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var e=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var t=this._thumbnailQueue.shift();return this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(i){return e.emit("thumbnail",t,i),e._processingThumbnail=!1,e._processThumbnailQueue()})}}},{key:"removeFile",value:function(e){if(e.status===t.UPLOADING&&this.cancelUpload(e),this.files=without(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);for(var i=this.files.slice(),n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;(a.status!==t.UPLOADING||e)&&this.removeFile(a)}return null}},{key:"resizeImage",value:function(e,i,n,r,o){var a=this;return this.createThumbnail(e,i,n,r,!1,function(i,n){if(null==n)return o(e);var r=a.options.resizeMimeType;null==r&&(r=e.type);var l=n.toDataURL(r,a.options.resizeQuality);return"image/jpeg"!==r&&"image/jpg"!==r||(l=ExifRestore.restore(e.dataURL,l)),o(t.dataURItoBlob(l))})}},{key:"createThumbnail",value:function(e,t,i,n,r,o){var a=this,l=new FileReader;return l.onload=function(){return e.dataURL=l.result,"image/svg+xml"===e.type?void(null!=o&&o(l.result)):a.createThumbnailFromUrl(e,t,i,n,r,o)},l.readAsDataURL(e)}},{key:"createThumbnailFromUrl",value:function(e,t,i,n,r,o,a){var l=this,s=document.createElement("img");return a&&(s.crossOrigin=a),s.onload=function(){var a=function(e){return e(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&r&&(a=function(e){return EXIF.getData(s,function(){return e(EXIF.getTag(this,"Orientation"))})}),a(function(r){e.width=s.width,e.height=s.height;var a=l.options.resize.call(l,e,t,i,n),u=document.createElement("canvas"),d=u.getContext("2d");switch(u.width=a.trgWidth,u.height=a.trgHeight,r>4&&(u.width=a.trgHeight,u.height=a.trgWidth),r){case 2:d.translate(u.width,0),d.scale(-1,1);break;case 3:d.translate(u.width,u.height),d.rotate(Math.PI);break;case 4:d.translate(0,u.height),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-u.height);break;case 7:d.rotate(.5*Math.PI),d.translate(u.width,-u.height),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-u.width,0)}drawImageIOSFix(d,s,null!=a.srcX?a.srcX:0,null!=a.srcY?a.srcY:0,a.srcWidth,a.srcHeight,null!=a.trgX?a.trgX:0,null!=a.trgY?a.trgY:0,a.trgWidth,a.trgHeight);var c=u.toDataURL("image/png");if(null!=o)return o(c,u)})},null!=o&&(s.onerror=o),s.src=e.dataURL}},{key:"processQueue",value:function(){var e=this.options.parallelUploads,t=this.getUploadingFiles().length,i=t;if(!(t>=e)){var n=this.getQueuedFiles();if(n.length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,e-t));for(;i=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;a.processing=!0,a.status=t.UPLOADING,this.emit("processing",a)}return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}},{key:"_getFilesWithXhr",value:function(e){var t=void 0;return t=this.files.filter(function(t){return t.xhr===e}).map(function(e){return e})}},{key:"cancelUpload",value:function(e){if(e.status===t.UPLOADING){for(var i=this._getFilesWithXhr(e.xhr),n=i,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;l.status=t.CANCELED}"undefined"!=typeof e.xhr&&e.xhr.abort();for(var s=i,u=!0,d=0,s=u?s:s[Symbol.iterator]();;){var c;if(u){if(d>=s.length)break;c=s[d++]}else{if(d=s.next(),d.done)break;c=d.value}var p=c;this.emit("canceled",p)}this.options.uploadMultiple&&this.emit("canceledmultiple",i)}else e.status!==t.ADDED&&e.status!==t.QUEUED||(e.status=t.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(e){if("function"==typeof e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n=r.upload.totalChunkCount)){a++;var l=n*i.options.chunkSize,s=Math.min(l+i.options.chunkSize,r.size),u={name:i._getParamName(0),data:o.webkitSlice?o.webkitSlice(l,s):o.slice(l,s),filename:r.upload.filename,chunkIndex:n};r.upload.chunks[n]={file:r,index:n,dataBlock:u,status:t.UPLOADING,progress:0,retries:0},i._uploadData(e,[u])}};if(r.upload.finishedChunkUpload=function(n){var o=!0;n.status=t.SUCCESS,n.dataBlock=null;for(var a=0;a=o.length)break;s=o[l++]}else{if(l=o.next(),l.done)break;s=l.value}var u=s;u.xhr=r}e[0].upload.chunked&&(e[0].upload.chunks[i[0].chunkIndex].xhr=r);var d=this.resolveOption(this.options.method,e),c=this.resolveOption(this.options.url,e);r.open(d,c,!0),r.timeout=this.resolveOption(this.options.timeout,e),r.withCredentials=!!this.options.withCredentials,r.onload=function(t){n._finishedUploading(e,r,t)},r.onerror=function(){n._handleUploadError(e,r)};var p=null!=r.upload?r.upload:r;p.onprogress=function(t){return n._updateFilesUploadProgress(e,r,t)};var h={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};this.options.headers&&t.extend(h,this.options.headers);for(var f in h){var v=h[f];v&&r.setRequestHeader(f,v)}var m=new FormData;if(this.options.params){var g=this.options.params;"function"==typeof g&&(g=g.call(this,e,r,e[0].upload.chunked?this._getChunk(e[0],r):null));for(var k in g){var b=g[k];m.append(k,b)}}for(var y=e,F=!0,w=0,y=F?y:y[Symbol.iterator]();;){var x;if(F){if(w>=y.length)break;x=y[w++]}else{if(w=y.next(),w.done)break;x=w.value}var E=x;this.emit("sending",E,r,m)}this.options.uploadMultiple&&this.emit("sendingmultiple",e,r,m),this._addFormElementData(m);for(var z=0;z=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r,a=o.getAttribute("name"),l=o.getAttribute("type");if(l&&(l=l.toLowerCase()),"undefined"!=typeof a&&null!==a)if("SELECT"===o.tagName&&o.hasAttribute("multiple"))for(var s=o.options,u=!0,d=0,s=u?s:s[Symbol.iterator]();;){var c;if(u){if(d>=s.length)break;c=s[d++]}else{if(d=s.next(),d.done)break;c=d.value}var p=c;p.selected&&e.append(a,p.value)}else(!l||"checkbox"!==l&&"radio"!==l||o.checked)&&e.append(a,o.value)}}},{key:"_updateFilesUploadProgress",value:function(e,t,i){var n=void 0;if("undefined"!=typeof i){if(n=100*i.loaded/i.total,e[0].upload.chunked){var r=e[0],o=this._getChunk(r,t);o.progress=n,o.total=i.total,o.bytesSent=i.loaded;r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(var a=0;a=l.length)break;d=l[u++]}else{if(u=l.next(),u.done)break;d=u.value}var c=d;c.upload.progress=n,c.upload.total=i.total,c.upload.bytesSent=i.loaded}for(var p=e,h=!0,f=0,p=h?p:p[Symbol.iterator]();;){var v;if(h){if(f>=p.length)break;v=p[f++]}else{if(f=p.next(),f.done)break;v=f.value}var m=v;this.emit("uploadprogress",m,m.upload.progress,m.upload.bytesSent)}}else{var g=!0;n=100;for(var k=e,b=!0,y=0,k=b?k:k[Symbol.iterator]();;){var F;if(b){if(y>=k.length)break;F=k[y++]}else{if(y=k.next(),y.done)break;F=y.value}var w=F;100===w.upload.progress&&w.upload.bytesSent===w.upload.total||(g=!1),w.upload.progress=n,w.upload.bytesSent=w.upload.total}if(g)return;for(var x=e,E=!0,z=0,x=E?x:x[Symbol.iterator]();;){var C;if(E){if(z>=x.length)break;C=x[z++]}else{if(z=x.next(),z.done)break;C=z.value}var S=C;this.emit("uploadprogress",S,n,S.upload.bytesSent)}}}},{key:"_finishedUploading",value:function(e,i,n){var r=void 0;if(e[0].status!==t.CANCELED&&4===i.readyState){if("arraybuffer"!==i.responseType&&"blob"!==i.responseType&&(r=i.responseText,i.getResponseHeader("content-type")&&~i.getResponseHeader("content-type").indexOf("application/json")))try{r=JSON.parse(r)}catch(e){n=e,r="Invalid JSON response from server."}this._updateFilesUploadProgress(e),200<=i.status&&i.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],i)):this._finished(e,r,n):this._handleUploadError(e,i,r)}}},{key:"_handleUploadError",value:function(e,i,n){if(e[0].status!==t.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){var r=this._getChunk(e[0],i);if(r.retries++=o.length)break;s=o[l++]}else{if(l=o.next(),l.done)break;s=l.value}this._errorProcessing(e,n||this.options.dictResponseError.replace("{{statusCode}}",i.status),i)}}}},{key:"submitRequest",value:function(e,t,i){e.send(t)}},{key:"_finished",value:function(e,i,n){for(var r=e,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;s.status=t.SUCCESS,this.emit("success",s,i,n),this.emit("complete",s)}if(this.options.uploadMultiple&&(this.emit("successmultiple",e,i,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(e,i,n){for(var r=e,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;s.status=t.ERROR,this.emit("error",s,i,n),this.emit("complete",s)}if(this.options.uploadMultiple&&(this.emit("errormultiple",e,i,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,i="x"===e?t:3&t|8;return i.toString(16)})}}]),t}(Emitter);Dropzone.initClass(),Dropzone.version="5.3.1",Dropzone.options={},Dropzone.optionsForElement=function(e){return e.getAttribute("id")?Dropzone.options[camelize(e.getAttribute("id"))]:void 0},Dropzone.instances=[],Dropzone.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},Dropzone.autoDiscover=!0,Dropzone.discover=function(){var e=void 0;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];var t=function(t){return function(){for(var i=[],n=t,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;/(^| )dropzone($| )/.test(l.className)?i.push(e.push(l)):i.push(void 0)}return i}()};t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return function(){for(var t=[],i=e,n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Dropzone.optionsForElement(a)!==!1?t.push(new Dropzone(a)):t.push(void 0)}return t}()},Dropzone.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],Dropzone.isBrowserSupported=function(){var e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(var t=Dropzone.blacklistedBrowsers,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;o.test(navigator.userAgent)&&(e=!1)}else e=!1;else e=!1;return e},Dropzone.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),r=new Uint8Array(n),o=0,a=t.length,l=0<=a;l?o<=a:o>=a;l?o++:o--)r[o]=t.charCodeAt(o);return new Blob([n],{type:i})};var without=function(e,t){return e.filter(function(e){return e!==t}).map(function(e){return e})},camelize=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})};Dropzone.createElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},Dropzone.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},Dropzone.getElement=function(e,t){var i=void 0;if("string"==typeof e?i=document.querySelector(e):null!=e.nodeType&&(i=e),null==i)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector or a plain HTML element.");return i},Dropzone.getElements=function(e,t){var i=void 0,n=void 0;if(e instanceof Array){n=[];try{for(var r=e,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){if(o){if(a>=r.length)break;i=r[a++]}else{if(a=r.next(),a.done)break;i=a.value}n.push(this.getElement(i,t))}}catch(e){n=null}}else if("string"==typeof e){n=[];for(var l=document.querySelectorAll(e),s=!0,u=0,l=s?l:l[Symbol.iterator]();;){if(s){if(u>=l.length)break;i=l[u++]}else{if(u=l.next(),u.done)break;i=u.value}n.push(i)}}else null!=e.nodeType&&(n=[e]);if(null==n||!n.length)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return n},Dropzone.confirm=function(e,t,i){return window.confirm(e)?t():null!=i?i():void 0},Dropzone.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");for(var i=e.type,n=i.replace(/\/.*$/,""),r=t,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;if(s=s.trim(),"."===s.charAt(0)){if(e.name.toLowerCase().indexOf(s.toLowerCase(),e.name.length-s.length)!==-1)return!0}else if(/\/\*$/.test(s)){if(n===s.replace(/\/.*$/,""))return!0}else if(i===s)return!0}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new Dropzone(this,e)})}),"undefined"!=typeof module&&null!==module?module.exports=Dropzone:window.Dropzone=Dropzone,Dropzone.ADDED="added",Dropzone.QUEUED="queued",Dropzone.ACCEPTED=Dropzone.QUEUED,Dropzone.UPLOADING="uploading",Dropzone.PROCESSING=Dropzone.UPLOADING,Dropzone.CANCELED="canceled",Dropzone.ERROR="error",Dropzone.SUCCESS="success";var detectVerticalSquash=function(e){var t=(e.naturalWidth,e.naturalHeight),i=document.createElement("canvas");i.width=1,i.height=t;var n=i.getContext("2d");n.drawImage(e,0,0);for(var r=n.getImageData(1,0,1,t),o=r.data,a=0,l=t,s=t;s>a;){var u=o[4*(s-1)+3];0===u?l=s:a=s,s=l+a>>1}var d=s/t;return 0===d?1:d},drawImageIOSFix=function(e,t,i,n,r,o,a,l,s,u){var d=detectVerticalSquash(t);return e.drawImage(t,i,n,r,o,a,l,s,u/d)},ExifRestore=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(e){for(var t="",i=void 0,n=void 0,r="",o=void 0,a=void 0,l=void 0,s="",u=0;;)if(i=e[u++],n=e[u++],r=e[u++],o=i>>2,a=(3&i)<<4|n>>4,l=(15&n)<<2|r>>6,s=63&r,isNaN(n)?l=s=64:isNaN(r)&&(s=64),t=t+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l)+this.KEY_STR.charAt(s),i=n=r="",o=a=l=s="",!(ue.length)break}return i}},{key:"decode64",value:function(e){var t=void 0,i=void 0,n="",r=void 0,o=void 0,a=void 0,l="",s=0,u=[],d=/[^A-Za-z0-9\+\/\=]/g;for(d.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");;)if(r=this.KEY_STR.indexOf(e.charAt(s++)),o=this.KEY_STR.indexOf(e.charAt(s++)),a=this.KEY_STR.indexOf(e.charAt(s++)),l=this.KEY_STR.indexOf(e.charAt(s++)),t=r<<2|o>>4,i=(15&o)<<4|a>>2,n=(3&a)<<6|l,u.push(t),64!==a&&u.push(i),64!==l&&u.push(n),t=i=n="",r=o=a=l="",!(s
',e.titleMarkup='\n
\n',e.textMarkup='\n
',e.footerMarkup='\n
\n'},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.CONFIRM_KEY="confirm",e.CANCEL_KEY="cancel";var r={visible:!0,text:null,value:null,className:"",closeModal:!0},i=Object.assign({},r,{visible:!1,text:"Cancel",value:null}),a=Object.assign({},r,{text:"OK",value:!0});e.defaultButtonList={cancel:i,confirm:a};var s=function(t){switch(t){case e.CONFIRM_KEY:return a;case e.CANCEL_KEY:return i;default:var n=t.charAt(0).toUpperCase()+t.slice(1);return Object.assign({},r,{text:n,value:t})}},c=function(t,e){var n=s(t);return!0===e?Object.assign({},n,{visible:!0}):"string"==typeof e?Object.assign({},n,{visible:!0,text:e}):o.isPlainObject(e)?Object.assign({visible:!0},n,e):Object.assign({},n,{visible:!1})},l=function(t){for(var e={},n=0,o=Object.keys(t);n=0&&w.splice(e,1)}function s(t){var e=document.createElement("style");return t.attrs.type="text/css",l(e,t.attrs),i(t,e),e}function c(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",l(e,t.attrs),i(t,e),e}function l(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function u(t,e){var n,o,r,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var l=h++;n=g||(g=s(e)),o=f.bind(null,n,l,!1),r=f.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=c(e),o=p.bind(null,n,e),r=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(e),o=d.bind(null,n),r=function(){a(n)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else r()}}function f(t,e,n,o){var r=n?"":o.css;if(t.styleSheet)t.styleSheet.cssText=x(e,r);else{var i=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}function d(t,e){var n=e.css,o=e.media;if(o&&t.setAttribute("media",o),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function p(t,e,n){var o=n.css,r=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||i)&&(o=y(o)),r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([o],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var m={},b=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),v=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t.call(this,n)),e[n]}}(function(t){return document.querySelector(t)}),g=null,h=0,w=[],y=n(15);t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},e.attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||(e.singleton=b()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=r(t,e);return o(n,e),function(t){for(var i=[],a=0;athis.length)&&-1!==this.indexOf(t,e)}),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),o=n.length>>>0;if(0===o)return!1;for(var r=0|e,i=Math.max(r>=0?r:o-Math.abs(r),0);i=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(19),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate},function(t,e,n){(function(t,e){!function(t,n){"use strict";function o(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n
',e.default=e.modalMarkup},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=o.default.OVERLAY,i='
\n
';e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=o.default.ICON;e.errorIconMarkup=function(){var t=r+"--error",e=t+"__line";return'\n
\n \n \n
\n '},e.warningIconMarkup=function(){var t=r+"--warning";return'\n \n \n \n '},e.successIconMarkup=function(){var t=r+"--success";return'\n \n \n\n
\n
\n '}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=o.default.CONTENT;e.contentMarkup='\n
\n\n
\n'},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=o.default.BUTTON_CONTAINER,i=o.default.BUTTON,a=o.default.BUTTON_LOADER;e.buttonMarkup='\n
\n\n \n\n
\n
\n
\n
\n
\n\n
\n'},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(4),r=n(2),i=n(0),a=i.default.ICON,s=i.default.ICON_CUSTOM,c=["error","warning","success","info"],l={error:r.errorIconMarkup(),warning:r.warningIconMarkup(),success:r.successIconMarkup()},u=function(t,e){var n=a+"--"+t;e.classList.add(n);var o=l[t];o&&(e.innerHTML=o)},f=function(t,e){e.classList.add(s);var n=document.createElement("img");n.src=t,e.appendChild(n)},d=function(t){if(t){var e=o.injectElIntoModal(r.iconMarkup);c.includes(t)?u(t,e):f(t,e)}};e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),r=n(4),i=function(t){navigator.userAgent.includes("AppleWebKit")&&(t.style.display="none",t.offsetHeight,t.style.display="")};e.initTitle=function(t){if(t){var e=r.injectElIntoModal(o.titleMarkup);e.textContent=t,i(e)}},e.initText=function(t){if(t){var e=document.createDocumentFragment();t.split("\n").forEach(function(t,n,o){e.appendChild(document.createTextNode(t)),n0}).forEach(function(t){b.classList.add(t)})}n&&t===c.CONFIRM_KEY&&b.classList.add(s),b.textContent=r;var g={};return g[t]=i,f.setActionValue(g),f.setActionOptionsFor(t,{closeModal:p}),b.addEventListener("click",function(){return u.onAction(t)}),m},p=function(t,e){var n=r.injectElIntoModal(l.footerMarkup);for(var o in t){var i=t[o],a=d(o,i,e);i.visible&&n.appendChild(a)}0===n.children.length&&n.remove()};e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),r=n(4),i=n(2),a=n(5),s=n(6),c=n(0),l=c.default.CONTENT,u=function(t){t.addEventListener("input",function(t){var e=t.target,n=e.value;a.setActionValue(n)}),t.addEventListener("keyup",function(t){if("Enter"===t.key)return s.onAction(o.CONFIRM_KEY)}),setTimeout(function(){t.focus(),a.setActionValue("")},0)},f=function(t,e,n){var o=document.createElement(e),r=l+"__"+e;o.classList.add(r);for(var i in n){var a=n[i];o[i]=a}"input"===e&&u(o),t.appendChild(o)},d=function(t){if(t){var e=r.injectElIntoModal(i.contentMarkup),n=t.element,o=t.attributes;"string"==typeof n?f(e,n,o):e.appendChild(n)}};e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(2),i=function(){var t=o.stringToNode(r.overlayMarkup);document.body.appendChild(t)};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(5),r=n(6),i=n(1),a=n(3),s=n(0),c=s.default.MODAL,l=s.default.BUTTON,u=s.default.OVERLAY,f=function(t){t.preventDefault(),v()},d=function(t){t.preventDefault(),g()},p=function(t){if(o.default.isOpen)switch(t.key){case"Escape":return r.onAction(a.CANCEL_KEY)}},m=function(t){if(o.default.isOpen)switch(t.key){case"Tab":return f(t)}},b=function(t){if(o.default.isOpen)return"Tab"===t.key&&t.shiftKey?d(t):void 0},v=function(){var t=i.getNode(l);t&&(t.tabIndex=0,t.focus())},g=function(){var t=i.getNode(c),e=t.querySelectorAll("."+l),n=e.length-1,o=e[n];o&&o.focus()},h=function(t){t[t.length-1].addEventListener("keydown",m)},w=function(t){t[0].addEventListener("keydown",b)},y=function(){var t=i.getNode(c),e=t.querySelectorAll("."+l);e.length&&(h(e),w(e))},x=function(t){if(i.getNode(u)===t.target)return r.onAction(a.CANCEL_KEY)},_=function(t){var e=i.getNode(u);e.removeEventListener("click",x),t&&e.addEventListener("click",x)},k=function(t){o.default.timer&&clearTimeout(o.default.timer),t&&(o.default.timer=window.setTimeout(function(){return r.onAction(a.CANCEL_KEY)},t))},O=function(t){t.closeOnEsc?document.addEventListener("keyup",p):document.removeEventListener("keyup",p),t.dangerMode?v():g(),y(),_(t.closeOnClickOutside),k(t.timer)};e.default=O},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(3),i=n(37),a=n(38),s={title:null,text:null,icon:null,buttons:r.defaultButtonList,content:null,className:null,closeOnClickOutside:!0,closeOnEsc:!0,dangerMode:!1,timer:null},c=Object.assign({},s);e.setDefaults=function(t){c=Object.assign({},s,t)};var l=function(t){var e=t&&t.button,n=t&&t.buttons;return void 0!==e&&void 0!==n&&o.throwErr("Cannot set both 'button' and 'buttons' options!"),void 0!==e?{confirm:e}:n},u=function(t){return o.ordinalSuffixOf(t+1)},f=function(t,e){o.throwErr(u(e)+" argument ('"+t+"') is invalid")},d=function(t,e){var n=t+1,r=e[n];o.isPlainObject(r)||void 0===r||o.throwErr("Expected "+u(n)+" argument ('"+r+"') to be a plain object")},p=function(t,e){var n=t+1,r=e[n];void 0!==r&&o.throwErr("Unexpected "+u(n)+" argument ("+r+")")},m=function(t,e,n,r){var i=typeof e,a="string"===i,s=e instanceof Element;if(a){if(0===n)return{text:e};if(1===n)return{text:e,title:r[0]};if(2===n)return d(n,r),{icon:e};f(e,n)}else{if(s&&0===n)return d(n,r),{content:e};if(o.isPlainObject(e))return p(n,r),e;f(e,n)}};e.getOpts=function(){for(var t=[],e=0;e',e.titleMarkup='\n
\n',e.textMarkup='\n
',e.footerMarkup='\n
\n'},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.CONFIRM_KEY="confirm",e.CANCEL_KEY="cancel";var r={visible:!0,text:null,value:null,className:"",closeModal:!0},i=Object.assign({},r,{visible:!1,text:"Cancel",value:null}),a=Object.assign({},r,{text:"OK",value:!0});e.defaultButtonList={cancel:i,confirm:a};var s=function(t){switch(t){case e.CONFIRM_KEY:return a;case e.CANCEL_KEY:return i;default:var n=t.charAt(0).toUpperCase()+t.slice(1);return Object.assign({},r,{text:n,value:t})}},c=function(t,e){var n=s(t);return!0===e?Object.assign({},n,{visible:!0}):"string"==typeof e?Object.assign({},n,{visible:!0,text:e}):o.isPlainObject(e)?Object.assign({visible:!0},n,e):Object.assign({},n,{visible:!1})},l=function(t){for(var e={},n=0,o=Object.keys(t);n=0&&w.splice(e,1)}function s(t){var e=document.createElement("style");return t.attrs.type="text/css",l(e,t.attrs),i(t,e),e}function c(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",l(e,t.attrs),i(t,e),e}function l(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function u(t,e){var n,o,r,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var l=h++;n=g||(g=s(e)),o=f.bind(null,n,l,!1),r=f.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=c(e),o=p.bind(null,n,e),r=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(e),o=d.bind(null,n),r=function(){a(n)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else r()}}function f(t,e,n,o){var r=n?"":o.css;if(t.styleSheet)t.styleSheet.cssText=x(e,r);else{var i=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}function d(t,e){var n=e.css,o=e.media;if(o&&t.setAttribute("media",o),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function p(t,e,n){var o=n.css,r=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||i)&&(o=y(o)),r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([o],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var m={},b=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),v=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t.call(this,n)),e[n]}}(function(t){return document.querySelector(t)}),g=null,h=0,w=[],y=n(15);t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},e.attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||(e.singleton=b()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=r(t,e);return o(n,e),function(t){for(var i=[],a=0;athis.length)&&-1!==this.indexOf(t,e)}),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),o=n.length>>>0;if(0===o)return!1;for(var r=0|e,i=Math.max(r>=0?r:o-Math.abs(r),0);i=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(19),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate},function(t,e,n){(function(t,e){!function(t,n){"use strict";function o(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n',e.default=e.modalMarkup},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=o.default.OVERLAY,i='
\n
';e.default=i},function(t,e,n){ +"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=o.default.ICON;e.errorIconMarkup=function(){var t=r+"--error",e=t+"__line";return'\n
\n \n \n
\n '},e.warningIconMarkup=function(){var t=r+"--warning";return'\n \n \n \n '},e.successIconMarkup=function(){var t=r+"--success";return'\n \n \n\n
\n
\n '}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=o.default.CONTENT;e.contentMarkup='\n
\n\n
\n'},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=o.default.BUTTON_CONTAINER,i=o.default.BUTTON,a=o.default.BUTTON_LOADER;e.buttonMarkup='\n
\n\n \n\n
\n
\n
\n
\n
\n\n
\n'},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(4),r=n(2),i=n(0),a=i.default.ICON,s=i.default.ICON_CUSTOM,c=["error","warning","success","info"],l={error:r.errorIconMarkup(),warning:r.warningIconMarkup(),success:r.successIconMarkup()},u=function(t,e){var n=a+"--"+t;e.classList.add(n);var o=l[t];o&&(e.innerHTML=o)},f=function(t,e){e.classList.add(s);var n=document.createElement("img");n.src=t,e.appendChild(n)},d=function(t){if(t){var e=o.injectElIntoModal(r.iconMarkup);c.includes(t)?u(t,e):f(t,e)}};e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),r=n(4),i=function(t){navigator.userAgent.includes("AppleWebKit")&&(t.style.display="none",t.offsetHeight,t.style.display="")};e.initTitle=function(t){if(t){var e=r.injectElIntoModal(o.titleMarkup);e.textContent=t,i(e)}},e.initText=function(t){if(t){var e=document.createDocumentFragment();t.split("\n").forEach(function(t,n,o){e.appendChild(document.createTextNode(t)),n0}).forEach(function(t){b.classList.add(t)}),n&&t===c.CONFIRM_KEY&&b.classList.add(s),b.textContent=r;var g={};return g[t]=i,f.setActionValue(g),f.setActionOptionsFor(t,{closeModal:p}),b.addEventListener("click",function(){return u.onAction(t)}),m},p=function(t,e){var n=r.injectElIntoModal(l.footerMarkup);for(var o in t){var i=t[o],a=d(o,i,e);i.visible&&n.appendChild(a)}0===n.children.length&&n.remove()};e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),r=n(4),i=n(2),a=n(5),s=n(6),c=n(0),l=c.default.CONTENT,u=function(t){t.addEventListener("input",function(t){var e=t.target,n=e.value;a.setActionValue(n)}),t.addEventListener("keyup",function(t){if("Enter"===t.key)return s.onAction(o.CONFIRM_KEY)}),setTimeout(function(){t.focus(),a.setActionValue("")},0)},f=function(t,e,n){var o=document.createElement(e),r=l+"__"+e;o.classList.add(r);for(var i in n){var a=n[i];o[i]=a}"input"===e&&u(o),t.appendChild(o)},d=function(t){if(t){var e=r.injectElIntoModal(i.contentMarkup),n=t.element,o=t.attributes;"string"==typeof n?f(e,n,o):e.appendChild(n)}};e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(2),i=function(){var t=o.stringToNode(r.overlayMarkup);document.body.appendChild(t)};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(5),r=n(6),i=n(1),a=n(3),s=n(0),c=s.default.MODAL,l=s.default.BUTTON,u=s.default.OVERLAY,f=function(t){t.preventDefault(),v()},d=function(t){t.preventDefault(),g()},p=function(t){if(o.default.isOpen)switch(t.key){case"Escape":return r.onAction(a.CANCEL_KEY)}},m=function(t){if(o.default.isOpen)switch(t.key){case"Tab":return f(t)}},b=function(t){if(o.default.isOpen)return"Tab"===t.key&&t.shiftKey?d(t):void 0},v=function(){var t=i.getNode(l);t&&(t.tabIndex=0,t.focus())},g=function(){var t=i.getNode(c),e=t.querySelectorAll("."+l),n=e.length-1,o=e[n];o&&o.focus()},h=function(t){t[t.length-1].addEventListener("keydown",m)},w=function(t){t[0].addEventListener("keydown",b)},y=function(){var t=i.getNode(c),e=t.querySelectorAll("."+l);e.length&&(h(e),w(e))},x=function(t){if(i.getNode(u)===t.target)return r.onAction(a.CANCEL_KEY)},_=function(t){var e=i.getNode(u);e.removeEventListener("click",x),t&&e.addEventListener("click",x)},k=function(t){o.default.timer&&clearTimeout(o.default.timer),t&&(o.default.timer=window.setTimeout(function(){return r.onAction(a.CANCEL_KEY)},t))},O=function(t){t.closeOnEsc?document.addEventListener("keyup",p):document.removeEventListener("keyup",p),t.dangerMode?v():g(),y(),_(t.closeOnClickOutside),k(t.timer)};e.default=O},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(3),i=n(37),a=n(38),s={title:null,text:null,icon:null,buttons:r.defaultButtonList,content:null,className:null,closeOnClickOutside:!0,closeOnEsc:!0,dangerMode:!1,timer:null},c=Object.assign({},s);e.setDefaults=function(t){c=Object.assign({},s,t)};var l=function(t){var e=t&&t.button,n=t&&t.buttons;return void 0!==e&&void 0!==n&&o.throwErr("Cannot set both 'button' and 'buttons' options!"),void 0!==e?{confirm:e}:n},u=function(t){return o.ordinalSuffixOf(t+1)},f=function(t,e){o.throwErr(u(e)+" argument ('"+t+"') is invalid")},d=function(t,e){var n=t+1,r=e[n];o.isPlainObject(r)||void 0===r||o.throwErr("Expected "+u(n)+" argument ('"+r+"') to be a plain object")},p=function(t,e){var n=t+1,r=e[n];void 0!==r&&o.throwErr("Unexpected "+u(n)+" argument ("+r+")")},m=function(t,e,n,r){var i=typeof e,a="string"===i,s=e instanceof Element;if(a){if(0===n)return{text:e};if(1===n)return{text:e,title:r[0]};if(2===n)return d(n,r),{icon:e};f(e,n)}else{if(s&&0===n)return d(n,r),{content:e};if(o.isPlainObject(e))return p(n,r),e;f(e,n)}};e.getOpts=function(){for(var t=[],e=0;e - - + + diff --git a/yarn.lock b/yarn.lock index a1ba1b3..49ecc0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,9 +23,9 @@ acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^5.4.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.0.tgz#1abb587fbf051f94e3de20e6b26ef910b1828298" +acorn@^5.5.0: + version "5.5.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" ajv-keywords@^2.1.0: version "2.1.1" @@ -62,8 +62,8 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" ansi-escapes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" ansi-regex@^2.0.0: version "2.1.1" @@ -77,12 +77,18 @@ 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, ansi-styles@^3.2.0: +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" +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + append-field@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/append-field/-/append-field-0.1.0.tgz#6ddc58fa083c7bc545d3c5995b2830cc2366d44a" @@ -124,13 +130,6 @@ array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" -array-includes@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" - dependencies: - define-properties "^1.1.2" - es-abstract "^1.7.0" - array-parallel@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/array-parallel/-/array-parallel-0.1.3.tgz#8f785308926ed5aa478c47e64d1b334b6c0c947d" @@ -312,6 +311,10 @@ braces@^2.3.1: split-string "^3.0.2" to-regex "^3.0.1" +buffer-from@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" + builtin-modules@^1.0.0, builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -389,12 +392,12 @@ chalk@^1.1.3: supports-color "^2.0.0" chalk@^2.0.0, chalk@^2.1.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" + version "2.3.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" dependencies: - ansi-styles "^3.2.0" + ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" - supports-color "^5.2.0" + supports-color "^5.3.0" chardet@^0.4.0: version "0.4.2" @@ -491,9 +494,10 @@ concat-stream@^1.5.0: typedarray "^0.0.6" concat-stream@^1.6.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.1.tgz#261b8f518301f1d834e36342b9fea095d2620a26" + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" dependencies: + buffer-from "^1.0.0" inherits "^2.0.3" readable-stream "^2.2.2" typedarray "^0.0.6" @@ -530,10 +534,6 @@ copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" -core-js@^1.0.0: - version "1.2.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" - core-js@^2.4.0: version "2.5.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b" @@ -577,10 +577,6 @@ dasherize@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/dasherize/-/dasherize-2.0.0.tgz#6d809c9cd0cf7bb8952d80fc84fa13d47ddb1308" -debug-log@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" - debug@2.6.9, debug@^2.1.2, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -647,17 +643,6 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -deglob@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.0.tgz#4d44abe16ef32c779b4972bd141a80325029a14a" - dependencies: - find-root "^1.0.0" - glob "^7.0.5" - ignore "^3.0.9" - pkg-config "^1.1.0" - run-parallel "^1.1.2" - uniq "^1.0.1" - del@^2.0.2: version "2.2.2" resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" @@ -716,7 +701,7 @@ doctrine@1.5.0: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.0.2, doctrine@^2.1.0: +doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" dependencies: @@ -740,36 +725,12 @@ encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" -encoding@^0.1.11: - version "0.1.12" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" - dependencies: - iconv-lite "~0.4.13" - -error-ex@^1.2.0, error-ex@^1.3.1: +error-ex@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: is-arrayish "^0.2.1" -es-abstract@^1.7.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" - dependencies: - es-to-primitive "^1.1.1" - function-bind "^1.1.1" - has "^1.0.1" - is-callable "^1.1.3" - is-regex "^1.0.4" - -es-to-primitive@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" - dependencies: - is-callable "^1.1.1" - is-date-object "^1.0.1" - is-symbol "^1.0.1" - es6-promise@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" @@ -782,11 +743,7 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" -eslint-config-standard-jsx@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-5.0.0.tgz#4abfac554f38668e0078c664569e7b2384e5d2aa" - -eslint-config-standard@11.0.0: +eslint-config-standard@^11.0.0: version "11.0.0" resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz#87ee0d3c9d95382dc761958cbb23da9eea31e0ba" @@ -804,7 +761,7 @@ eslint-module-utils@^2.1.1: debug "^2.6.8" pkg-dir "^1.0.0" -eslint-plugin-import@~2.9.0: +eslint-plugin-import@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz#26002efbfca5989b7288ac047508bd24f217b169" dependencies: @@ -819,7 +776,7 @@ eslint-plugin-import@~2.9.0: minimatch "^3.0.3" read-pkg-up "^2.0.0" -eslint-plugin-node@~6.0.0: +eslint-plugin-node@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz#bf19642298064379315d7a4b2a75937376fa05e4" dependencies: @@ -828,20 +785,11 @@ eslint-plugin-node@~6.0.0: resolve "^1.3.3" semver "^5.4.1" -eslint-plugin-promise@~3.7.0: +eslint-plugin-promise@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.7.0.tgz#f4bde5c2c77cdd69557a8f69a24d1ad3cfc9e67e" -eslint-plugin-react@~7.7.0: - version "7.7.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz#f606c719dbd8a1a2b3d25c16299813878cca0160" - dependencies: - doctrine "^2.0.2" - has "^1.0.1" - jsx-ast-utils "^2.0.1" - prop-types "^15.6.0" - -eslint-plugin-standard@~3.0.1: +eslint-plugin-standard@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz#34d0c915b45edc6f010393c7eef3823b08565cf2" @@ -856,9 +804,9 @@ eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -eslint@~4.18.0: - version "4.18.2" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45" +eslint@^4.19.1: + version "4.19.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0" @@ -869,7 +817,7 @@ eslint@~4.18.0: doctrine "^2.1.0" eslint-scope "^3.7.1" eslint-visitor-keys "^1.0.0" - espree "^3.5.2" + espree "^3.5.4" esquery "^1.0.0" esutils "^2.0.2" file-entry-cache "^2.0.0" @@ -891,6 +839,7 @@ eslint@~4.18.0: path-is-inside "^1.0.2" pluralize "^7.0.0" progress "^2.0.0" + regexpp "^1.0.1" require-uncached "^1.0.3" semver "^5.3.0" strip-ansi "^4.0.0" @@ -898,11 +847,11 @@ eslint@~4.18.0: table "4.0.2" text-table "~0.2.0" -espree@^3.5.2: - version "3.5.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.3.tgz#931e0af64e7fbbed26b050a29daad1fc64799fa6" +espree@^3.5.4: + version "3.5.4" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" dependencies: - acorn "^5.4.0" + acorn "^5.5.0" acorn-jsx "^3.0.0" esprima@^4.0.0: @@ -1060,18 +1009,6 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -fbjs@^0.8.16: - version "0.8.16" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" - dependencies: - core-js "^1.0.0" - isomorphic-fetch "^2.1.1" - loose-envify "^1.0.0" - object-assign "^4.1.0" - promise "^7.1.1" - setimmediate "^1.0.5" - ua-parser-js "^0.7.9" - figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" @@ -1106,10 +1043,6 @@ finalhandler@1.1.1: statuses "~1.4.0" unpipe "~1.0.0" -find-root@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" - find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -1233,7 +1166,7 @@ fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: mkdirp ">=0.5 0" rimraf "2" -function-bind@^1.0.2, function-bind@^1.1.0, function-bind@^1.1.1: +function-bind@^1.0.2, function-bind@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -1254,10 +1187,6 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -get-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -1308,8 +1237,8 @@ global-prefix@^1.0.1: which "^1.2.14" globals@^11.0.1: - version "11.3.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0" + version "11.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.4.0.tgz#b85c793349561c16076a3c13549238a27945f1bc" globby@^5.0.0: version "5.0.0" @@ -1486,7 +1415,7 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -iconv-lite@0.4.19, iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.19, iconv-lite@^0.4.17, iconv-lite@^0.4.4: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -1500,7 +1429,7 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^3.0.9, ignore@^3.3.3, ignore@^3.3.6: +ignore@^3.3.3, ignore@^3.3.6: version "3.3.7" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" @@ -1587,10 +1516,6 @@ is-builtin-module@^1.0.0: dependencies: builtin-modules "^1.0.0" -is-callable@^1.1.1, is-callable@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" - is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -1603,10 +1528,6 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -1674,13 +1595,12 @@ is-path-cwd@^1.0.0: resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" is-path-in-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" dependencies: is-path-inside "^1.0.0" -is-path-inside@^1.0.0, is-symbol@^1.0.1: - name is-path-inside +is-path-inside@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" dependencies: @@ -1696,12 +1616,6 @@ is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - dependencies: - has "^1.0.1" - is-relative@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" @@ -1712,10 +1626,6 @@ is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" -is-stream@^1.0.1: - 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" @@ -1756,24 +1666,17 @@ isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" -isomorphic-fetch@^2.1.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - dependencies: - node-fetch "^1.0.1" - whatwg-fetch ">=0.10.0" - isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -js-tokens@^3.0.0, js-tokens@^3.0.2: +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.10.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" + version "3.11.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef" dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -1782,10 +1685,6 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" -json-parse-better-errors@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz#50183cd1b2d25275de069e9e71b467ac9eab973a" - json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" @@ -1821,12 +1720,6 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -jsx-ast-utils@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f" - dependencies: - array-includes "^3.0.3" - jszip@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" @@ -1925,15 +1818,6 @@ load-json-file@^2.0.0: pify "^2.0.0" strip-bom "^3.0.0" -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -1957,12 +1841,6 @@ longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" -loose-envify@^1.0.0, loose-envify@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" - dependencies: - js-tokens "^3.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" @@ -2054,7 +1932,7 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@1.2.0, minimist@^1.1.0, minimist@^1.2.0: +minimist@1.2.0, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -2153,13 +2031,6 @@ nocache@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/nocache/-/nocache-2.0.0.tgz#202b48021a0c4cbde2df80de15a17443c8b43980" -node-fetch@^1.0.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" - node-pre-gyp@0.6.36: version "0.6.36" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz#db604112cb74e0d477554e9b505b17abddfab786" @@ -2237,7 +2108,7 @@ object-assign@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" -object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2374,13 +2245,6 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" @@ -2447,10 +2311,6 @@ pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -2461,21 +2321,6 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pkg-conf@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.1.0.tgz#2126514ca6f2abfebd168596df18ba57867f0058" - dependencies: - find-up "^2.0.0" - load-json-file "^4.0.0" - -pkg-config@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pkg-config/-/pkg-config-1.1.1.tgz#557ef22d73da3c8837107766c52eadabde298fe4" - dependencies: - debug-log "^1.0.0" - find-root "^1.0.0" - xtend "^4.0.1" - pkg-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" @@ -2506,20 +2351,12 @@ progress@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" -promise@^7.0.0, promise@^7.1.1: +promise@^7.0.0: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" dependencies: asap "~2.0.3" -prop-types@^15.6.0: - version "15.6.1" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" - dependencies: - fbjs "^0.8.16" - loose-envify "^1.3.1" - object-assign "^4.1.1" - proxy-addr@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" @@ -2635,6 +2472,10 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexpp@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.0.1.tgz#d857c3a741dce075c2848dcb019a0a975b190d43" + repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" @@ -2699,8 +2540,8 @@ resolve@^1.1.6, resolve@^1.1.7: path-parse "^1.0.5" resolve@^1.3.3, resolve@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" + version "1.6.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c" dependencies: path-parse "^1.0.5" @@ -2733,10 +2574,6 @@ run-async@^2.2.0: dependencies: is-promise "^2.1.0" -run-parallel@^1.1.2: - version "1.1.6" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.6.tgz#29003c9a2163e01e2d2dfc90575f2c6c1d61a039" - rx-lite-aggregates@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" @@ -2824,10 +2661,6 @@ set-value@^2.0.0: is-plain-object "^2.0.3" split-string "^3.0.1" -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - setprototypeof@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" @@ -2966,29 +2799,6 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" -standard-engine@~8.0.0: - version "8.0.1" - resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-8.0.1.tgz#0b77be8d7ab963675717dbeac1ef1d6675fb62f0" - dependencies: - deglob "^2.1.0" - get-stdin "^6.0.0" - minimist "^1.1.0" - pkg-conf "^2.0.0" - -standard@^11.0.1: - version "11.0.1" - resolved "https://registry.yarnpkg.com/standard/-/standard-11.0.1.tgz#49be40c76f1d564964b22bbf7309929ad0335e29" - dependencies: - eslint "~4.18.0" - eslint-config-standard "11.0.0" - eslint-config-standard-jsx "5.0.0" - eslint-plugin-import "~2.9.0" - eslint-plugin-node "~6.0.0" - eslint-plugin-promise "~3.7.0" - eslint-plugin-react "~7.7.0" - eslint-plugin-standard "~3.0.1" - standard-engine "~8.0.0" - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -3067,9 +2877,9 @@ supports-color@^4.0.0: dependencies: has-flag "^2.0.0" -supports-color@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.2.0.tgz#b0d5333b1184dd3666cbe5aa0b45c5ac7ac17a4a" +supports-color@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0" dependencies: has-flag "^3.0.0" @@ -3202,10 +3012,6 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -ua-parser-js@^0.7.9: - version "0.7.17" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" - uglify-js@^2.6: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" @@ -3236,10 +3042,6 @@ union-value@^1.0.0: is-extendable "^0.1.1" set-value "^0.4.3" -uniq@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" - unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -3304,10 +3106,6 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -whatwg-fetch@>=0.10.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" - which@^1.1.1, which@^1.2.14, which@^1.2.9: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" @@ -3350,7 +3148,7 @@ x-xss-protection@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/x-xss-protection/-/x-xss-protection-1.1.0.tgz#4f1898c332deb1e7f2be1280efb3e2c53d69c1a7" -xtend@^4.0.0, xtend@^4.0.1: +xtend@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"