diff --git a/.gitignore b/.gitignore index 54cf77d5..89f79069 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ downloads/ +downloading/ +uploadedTorrents/ storage.db.lock storage.db .torrent.bolt.db.lock @@ -10,4 +12,5 @@ output.json .idea/workspace.xml .idea/vcs.xml *.torrent -boltbrowser.win64.exe \ No newline at end of file +boltbrowser.win64.exe +logs/server.log \ No newline at end of file diff --git a/config.toml b/config.toml index 013996f2..d5be0450 100644 --- a/config.toml +++ b/config.toml @@ -3,16 +3,16 @@ ServerPort = ":8000" #leave format as is it expects a string with colon ServerAddr = "" #blank will bind to default IP address, usually fine to leave be - LogLevel = "Info" # Options = Debug, Info, Warn, Error, Fatal, Panic - LogOutput = "stdout" #Options = file, stdout #file will print it to logs/server.log + LogLevel = "Debug" # Options = Debug, Info, Warn, Error, Fatal, Panic + LogOutput = "file" #Options = file, stdout #file will print it to logs/server.log SeedRatioStop = 1.50 #automatically stops the torrent after it reaches this seeding ratio - DefaultMoveFolder = "downloads" #default path that a finished torrent is symlinked to after completion. Torrents added via RSS will default here + DefaultMoveFolder = "downloaded" #default path that a finished torrent is symlinked to after completion. Torrents added via RSS will default here - [notifications] +[notifications] - PushBulletToken = "o.QW6G7F6FUOKXCUKmw948fBceCUn0msFi" #add your pushbullet api token here to notify of torrent completion to pushbullet + PushBulletToken = "o.QW6G7F6FUOKXCUKmw948fBceCUn0msFi" #add your pushbullet api token here to notify of torrent completion to pushbullet [EncryptionPolicy] @@ -23,9 +23,12 @@ [torrentClientConfig] - DownloadDir = "downloads" #the full OR relative path where the torrent server stores in-progress torrents + DownloadDir = "downloading" #the full OR relative path where the torrent server stores in-progress torrents Seed = true #boolean #seed after download + + # Never send chunks to peers. + NoUpload = false #boolean #The address to listen for new uTP and TCP bittorrent protocolconnections. DHT shares a UDP socket with uTP unless configured otherwise. ListenAddr = "" #Leave Blank for default, syntax "HOST:PORT" @@ -38,9 +41,6 @@ # Don't create a DHT. NoDHT = false #boolean - # Never send chunks to peers. - NoUpload = false #boolean - # Events are data bytes sent in pieces. The burst must be large enough to fit a whole chunk. UploadRateLimiter = "" #*rate.Limiter diff --git a/engine/cronJobs.go b/engine/cronJobs.go index 2c02c324..df87ebfb 100644 --- a/engine/cronJobs.go +++ b/engine/cronJobs.go @@ -22,6 +22,7 @@ func InitializeCronEngine() *cron.Cron { //RefreshRSSCron refreshes all of the RSS feeds on an hourly basis func RefreshRSSCron(c *cron.Cron, db *storm.DB, tclient *torrent.Client, torrentLocalStorage Storage.TorrentLocal, dataDir string) { c.AddFunc("@hourly", func() { + torrentHashHistory := Storage.FetchHashHistory(db) RSSFeedStore := Storage.FetchRSSFeeds(db) singleRSSTorrent := Storage.SingleRSSTorrent{} newFeedStore := Storage.RSSFeedStore{ID: RSSFeedStore.ID} //creating a new feed store just using old one to parse for new torrents @@ -36,6 +37,12 @@ func RefreshRSSCron(c *cron.Cron, db *storm.DB, tclient *torrent.Client, torrent singleRSSTorrent.Link = RSSTorrent.Link singleRSSTorrent.Title = RSSTorrent.Title singleRSSTorrent.PubDate = RSSTorrent.Published + for _, hash := range torrentHashHistory.HashList { + linkHash := singleRSSTorrent.Link[20:60] //cutting the infohash out of the link + if linkHash == hash { + Logger.WithFields(logrus.Fields{"Torrent": RSSTorrent.Title}).Warn("Torrent already added for this RSS item, skipping torrent") + } + } clientTorrent, err := tclient.AddMagnet(RSSTorrent.Link) if err != nil { Logger.WithFields(logrus.Fields{"err": err, "Torrent": RSSTorrent.Title}).Warn("Unable to add torrent to torrent client!") diff --git a/engine/doneTorrentActions.go b/engine/doneTorrentActions.go index 9948567f..26cbddd4 100644 --- a/engine/doneTorrentActions.go +++ b/engine/doneTorrentActions.go @@ -1,6 +1,7 @@ package engine import ( + "fmt" "io" "os" "path/filepath" @@ -11,44 +12,77 @@ import ( Storage "github.com/deranjer/goTorrent/storage" pushbullet "github.com/mitsuse/pushbullet-go" "github.com/mitsuse/pushbullet-go/requests" + folderCopy "github.com/otiai10/copy" "github.com/sirupsen/logrus" ) //MoveAndLeaveSymlink takes the file from the default download dir and moves it to the user specified directory and then leaves a symlink behind. func MoveAndLeaveSymlink(config FullClientSettings, singleTorrent *torrent.Torrent, db *storm.DB) { + Logger.WithFields(logrus.Fields{"Torrent Name": singleTorrent.Name()}).Error("Move and Create symlink started for torrent") tStorage := Storage.FetchTorrentFromStorage(db, singleTorrent.InfoHash().String()) oldFilePath := filepath.Join(config.TorrentConfig.DataDir, singleTorrent.Name()) newFilePath := filepath.Join(tStorage.StoragePath, singleTorrent.Name()) + _, err := os.Stat(tStorage.StoragePath) + if os.IsNotExist(err) { + err := os.MkdirAll(tStorage.StoragePath, 0644) + if err != nil { + Logger.WithFields(logrus.Fields{"New File Path": newFilePath, "error": err}).Error("Cannot create new directory") + } + } + oldFileInfo, err := os.Stat(oldFilePath) + if err != nil { + Logger.WithFields(logrus.Fields{"Old File info": oldFileInfo, "error": err}).Error("Cannot find the old file to copy/symlink!") + return + } + if oldFilePath != newFilePath { if runtime.GOOS == "windows" { //TODO the windows symlink is broken on windows 10 creator edition, so doing a copy for now until Go 1.11 + if oldFileInfo.IsDir() { + os.Mkdir(newFilePath, 0644) + folderCopy.Copy(oldFilePath, newFilePath) //copy the folder to the new location + notifyUser(tStorage, config, singleTorrent) + return + } + srcFile, err := os.Open(oldFilePath) if err != nil { Logger.WithFields(logrus.Fields{"Old File Path": oldFilePath, "error": err}).Error("Windows: Cannot open old file for copy") return } - destFile, err := os.Create(newFilePath) // creating new file to copy old one to + defer srcFile.Close() + destFile, err := os.Create(newFilePath) if err != nil { Logger.WithFields(logrus.Fields{"New File Path": newFilePath, "error": err}).Error("Windows: Cannot open new file for copying into") return } - _, err = io.Copy(srcFile, destFile) + defer destFile.Close() + bytesWritten, err := io.Copy(destFile, srcFile) if err != nil { Logger.WithFields(logrus.Fields{"Old File Path": oldFilePath, "New File Path": newFilePath, "error": err}).Error("Windows: Cannot copy old file into new") return } - Logger.WithFields(logrus.Fields{"Old File Path": oldFilePath, "New File Path": newFilePath}).Info("Windows Torrent Copy Completed") + err = destFile.Sync() + if err != nil { + Logger.WithFields(logrus.Fields{"Old File Path": oldFilePath, "New File Path": newFilePath, "error": err}).Error("Windows: Error syncing new file to disk") + } + Logger.WithFields(logrus.Fields{"Old File Path": oldFilePath, "New File Path": newFilePath, "bytesWritten": bytesWritten}).Info("Windows Torrent Copy Completed") + notifyUser(tStorage, config, singleTorrent) } else { err := os.Symlink(oldFilePath, newFilePath) //For all other OS's create a symlink if err != nil { Logger.WithFields(logrus.Fields{"Old File Path": oldFilePath, "New File Path": newFilePath, "error": err}).Error("Error creating symlink") return } + notifyUser(tStorage, config, singleTorrent) Logger.WithFields(logrus.Fields{"Old File Path": oldFilePath, "New File Path": newFilePath}).Info("Moving completed torrent") } } tStorage.TorrentMoved = true Storage.AddTorrentLocalStorage(db, tStorage) //Updating the fact that we moved the torrent +} +func notifyUser(tStorage Storage.TorrentLocal, config FullClientSettings, singleTorrent *torrent.Torrent) { + fmt.Println("Pushbullet token", config.PushBulletToken) if config.PushBulletToken != "" { pb := pushbullet.New(config.PushBulletToken) n := requests.NewNote() @@ -60,5 +94,4 @@ func MoveAndLeaveSymlink(config FullClientSettings, singleTorrent *torrent.Torre } Logger.WithFields(logrus.Fields{"Torrent": singleTorrent.Name(), "New File Path": tStorage.StoragePath}).Info("Pushbullet note sent") } - } diff --git a/engine/engine.go b/engine/engine.go index 4dfdf471..1c20b474 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -80,7 +80,7 @@ func timeOutInfo(clientTorrent *torrent.Torrent, seconds time.Duration) (deleted } -func readTorrentFileFromDB(element *Storage.TorrentLocal, singleTorrent *torrent.Torrent, tclient *torrent.Client, db *storm.DB) { +func readTorrentFileFromDB(element *Storage.TorrentLocal, tclient *torrent.Client, db *storm.DB) (singleTorrent *torrent.Torrent) { tempFile, err := ioutil.TempFile("", "TorrentFileTemp") if err != nil { Logger.WithFields(logrus.Fields{"tempfile": tempFile, "err": err}).Error("Unable to create tempfile") @@ -92,13 +92,16 @@ func readTorrentFileFromDB(element *Storage.TorrentLocal, singleTorrent *torrent if err := tempFile.Close(); err != nil { //close the tempfile so that we can add it back into the torrent client Logger.WithFields(logrus.Fields{"tempfile": tempFile, "err": err}).Error("Unable to close tempfile") } - singleTorrent, _ = tclient.AddTorrentFromFile(tempFile.Name()) - if _, err := os.Stat(element.TorrentFileName); err == nil { //if we CAN find the torrent, add it - singleTorrent, _ = tclient.AddTorrentFromFile(element.TorrentFileName) - } else { //if we cant find the torrent delete it - Storage.DelTorrentLocalStorage(db, element.Hash) - Logger.WithFields(logrus.Fields{"tempfile": tempFile, "err": err}).Error("Unable to find Torrent, deleting..") + _, err = os.Stat(element.TorrentFileName) //if we CAN find the torrent, add it + if err != nil { + Logger.WithFields(logrus.Fields{"tempfile": tempFile, "err": err}).Error("Unable to find file") } + singleTorrent, err = tclient.AddTorrentFromFile(element.TorrentFileName) + if err != nil { + Logger.WithFields(logrus.Fields{"tempfile": element.TorrentFileName, "err": err}).Error("Unable to add Torrent from file!") + + } + return singleTorrent } //StartTorrent creates the storage.db entry and starts A NEW TORRENT and adds to the running torrent array @@ -147,7 +150,6 @@ func StartTorrent(clientTorrent *torrent.Torrent, torrentLocalStorage Storage.To func CreateRunningTorrentArray(tclient *torrent.Client, TorrentLocalArray []*Storage.TorrentLocal, PreviousTorrentArray []ClientDB, config FullClientSettings, db *storm.DB) (RunningTorrentArray []ClientDB) { for _, singleTorrentFromStorage := range TorrentLocalArray { - var singleTorrent *torrent.Torrent var TempHash metainfo.Hash @@ -155,15 +157,13 @@ func CreateRunningTorrentArray(tclient *torrent.Client, TorrentLocalArray []*Sto //singleTorrentStorageInfo := Storage.FetchTorrentFromStorage(db, TempHash.String()) //pulling the single torrent info from storage () if singleTorrentFromStorage.TorrentType == "file" { //if it is a file pull it from the uploaded torrent folder - readTorrentFileFromDB(singleTorrentFromStorage, singleTorrent, tclient, db) + singleTorrent = readTorrentFileFromDB(singleTorrentFromStorage, tclient, db) fullClientDB.SourceType = "Torrent File" - continue } else { singleTorrentFromStorageMagnet := "magnet:?xt=urn:btih:" + singleTorrentFromStorage.Hash //For magnet links just need to prepend the magnet part to the hash to readd singleTorrent, _ = tclient.AddMagnet(singleTorrentFromStorageMagnet) fullClientDB.SourceType = "Magnet Link" } - if len(singleTorrentFromStorage.InfoBytes) == 0 { //TODO.. kind of a fringe scenario.. not sure if needed since the db should always have the infobytes timeOut := timeOutInfo(singleTorrent, 45) if timeOut == true { // if we did timeout then drop the torrent from the boltdb database @@ -173,8 +173,12 @@ func CreateRunningTorrentArray(tclient *torrent.Client, TorrentLocalArray []*Sto singleTorrentFromStorage.InfoBytes = singleTorrent.Metainfo().InfoBytes } + err := singleTorrent.SetInfoBytes(singleTorrentFromStorage.InfoBytes) //setting the infobytes back into the torrent + if err != nil { + Logger.WithFields(logrus.Fields{"torrentFile": singleTorrent.Name(), "error": err}).Error("Unable to add infobytes to the torrent!") + } + //Logger.WithFields(logrus.Fields{"singleTorrent": singleTorrentFromStorage.TorrentName}).Info("Generating infohash") TempHash = singleTorrent.InfoHash() - singleTorrent.SetInfoBytes(singleTorrentFromStorage.InfoBytes) //setting the infobytes back into the torrent if (singleTorrent.BytesCompleted() == singleTorrent.Length()) && (singleTorrentFromStorage.TorrentMoved == false) { //if we are done downloading and havent moved torrent yet MoveAndLeaveSymlink(config, singleTorrent, db) @@ -190,7 +194,7 @@ func CreateRunningTorrentArray(tclient *torrent.Client, TorrentLocalArray []*Sto downloadedSizeHumanized := HumanizeBytes(float32(singleTorrent.BytesCompleted())) //convert size to GB if needed totalSizeHumanized := HumanizeBytes(float32(singleTorrent.Length())) - + //Logger.WithFields(logrus.Fields{"singleTorrent": singleTorrentFromStorage.TorrentName}).Info("Generated infohash") //grabbed from torrent client fullClientDB.DownloadedSize = downloadedSizeHumanized fullClientDB.Size = totalSizeHumanized @@ -206,7 +210,7 @@ func CreateRunningTorrentArray(tclient *torrent.Client, TorrentLocalArray []*Sto fullClientDB.DateAdded = singleTorrentFromStorage.DateAdded fullClientDB.BytesCompleted = singleTorrent.BytesCompleted() fullClientDB.NumberofFiles = len(singleTorrent.Files()) - CalculateTorrentETA(singleTorrent, fullClientDB) + //ranging over the previous torrent array to calculate the speed for each torrent if len(PreviousTorrentArray) > 0 { //if we actually have a previous array for _, previousElement := range PreviousTorrentArray { @@ -217,6 +221,7 @@ func CreateRunningTorrentArray(tclient *torrent.Client, TorrentLocalArray []*Sto } } } + CalculateTorrentETA(singleTorrent, fullClientDB) //needs to be here since we need the speed calcuated before we can estimate the eta. fullClientDB.TotalUploadedSize = HumanizeBytes(float32(fullClientDB.TotalUploadedBytes)) fullClientDB.UploadRatio = CalculateUploadRatio(singleTorrent, fullClientDB) //calculate the upload ratio diff --git a/engine/settings.go b/engine/settings.go index b18a37ab..36e74d7e 100644 --- a/engine/settings.go +++ b/engine/settings.go @@ -67,7 +67,7 @@ func FullClientSettingsNew() FullClientSettings { httpAddrPort := viper.GetString("serverConfig.ServerPort") seedRatioStop := viper.GetFloat64("serverConfig.SeedRatioStop") httpAddr = httpAddrIP + httpAddrPort - pushBulletToken := viper.GetString("serverConfig.notifications.PushBulletToken") + pushBulletToken := viper.GetString("notifications.PushBulletToken") defaultMoveFolder := viper.GetString("serverConfig.DefaultMoveFolder") dataDir := viper.GetString("torrentClientConfig.DownloadDir") @@ -117,9 +117,6 @@ func FullClientSettingsNew() FullClientSettings { downloadRateLimiter := new(rate.Limiter) viper.UnmarshalKey("DownloadRateLimiter", &downloadRateLimiter) - rreferNoEncryption := viper.GetBool("EncryptionPolicy.PreferNoEncryption") - fmt.Println("Encryption", rreferNoEncryption) - encryptionPolicy := torrent.EncryptionPolicy{ DisableEncryption: viper.GetBool("EncryptionPolicy.DisableEncryption"), ForceEncryption: viper.GetBool("EncryptionPolicy.ForceEncryption"), diff --git a/goTorrentWebUI/node_modules/attr-accept/package.json b/goTorrentWebUI/node_modules/attr-accept/package.json index fefb7662..bcbbeeab 100644 --- a/goTorrentWebUI/node_modules/attr-accept/package.json +++ b/goTorrentWebUI/node_modules/attr-accept/package.json @@ -22,7 +22,8 @@ "fetchSpec": "1.1.0" }, "_requiredBy": [ - "/" + "/", + "/react-dropzone" ], "_resolved": "https://registry.npmjs.org/attr-accept/-/attr-accept-1.1.0.tgz", "_spec": "1.1.0", diff --git a/goTorrentWebUI/node_modules/react-dropzone/.babelrc b/goTorrentWebUI/node_modules/react-dropzone/.babelrc new file mode 100644 index 00000000..b387ab56 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/.babelrc @@ -0,0 +1,19 @@ +{ + "env": { + "development": { + "presets": ["env", "react", "stage-1"], + "plugins": ["add-module-exports"] + }, + "test": { + "presets": ["env", "react", "stage-1"], + "plugins": ["add-module-exports"] + }, + "production": { + "presets": ["env", "react", "stage-1"], + "plugins": ["add-module-exports"] + }, + "es": { + "presets": [["env",{ "modules": false }], "react", "stage-1"] + } + } +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/.codeclimate.yml b/goTorrentWebUI/node_modules/react-dropzone/.codeclimate.yml new file mode 100644 index 00000000..b16eb728 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/.codeclimate.yml @@ -0,0 +1,15 @@ +engines: + duplication: + enabled: true + config: + languages: + - javascript + eslint: + enabled: true + channel: "eslint-3" +ratings: + paths: + - "**.js" +exclude_paths: + - "dist/" + - "src/*.spec.js" diff --git a/goTorrentWebUI/node_modules/react-dropzone/.editorconfig b/goTorrentWebUI/node_modules/react-dropzone/.editorconfig new file mode 100644 index 00000000..e717f5eb --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/.editorconfig @@ -0,0 +1,13 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/goTorrentWebUI/node_modules/react-dropzone/.eslintrc b/goTorrentWebUI/node_modules/react-dropzone/.eslintrc new file mode 100644 index 00000000..1d7e74ac --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/.eslintrc @@ -0,0 +1,34 @@ +{ + "extends": [ + "okonet", + "prettier" + ], + "plugins": [ + "prettier" + ], + "rules": { + // React + "react/forbid-prop-types": [ + 2, + { + "forbid": [ + "any", + "array" + ] + } + ], + "react/require-default-props": 0, + + // Import + "import/no-extraneous-dependencies": [ + 2, + { + "devDependencies": [ + "webpack*.js", + "**/*.spec.js", + "**/testSetup.js" + ] + } + ] + } +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/.travis.yml b/goTorrentWebUI/node_modules/react-dropzone/.travis.yml new file mode 100644 index 00000000..0d3eb038 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +cache: yarn +notifications: + email: false +node_js: + - '8' +after_success: + - bash <(curl -s https://codecov.io/bash) + - npm run semantic-release +branches: + except: + - /^v\d+\.\d+\.\d+$/ diff --git a/goTorrentWebUI/node_modules/react-dropzone/LICENSE b/goTorrentWebUI/node_modules/react-dropzone/LICENSE new file mode 100644 index 00000000..863075c4 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Param Aggarwal + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/goTorrentWebUI/node_modules/react-dropzone/README.md b/goTorrentWebUI/node_modules/react-dropzone/README.md new file mode 100644 index 00000000..cd216c23 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/README.md @@ -0,0 +1,165 @@ +![react-dropzone logo](https://raw.githubusercontent.com/react-dropzone/react-dropzone/master/logo/logo.png) + +# react-dropzone + +[![Build Status](https://travis-ci.org/react-dropzone/react-dropzone.svg?branch=master)](https://travis-ci.org/react-dropzone/react-dropzone) [![npm version](https://badge.fury.io/js/react-dropzone.svg)](https://badge.fury.io/js/react-dropzone) [![codecov](https://codecov.io/gh/react-dropzone/react-dropzone/branch/master/graph/badge.svg)](https://codecov.io/gh/react-dropzone/react-dropzone) [![OpenCollective](https://opencollective.com/react-dropzone/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/react-dropzone/sponsors/badge.svg)](#sponsors) + +Simple HTML5-compliant drag'n'drop zone for files built with React.js. + +Documentation and examples: https://react-dropzone.js.org +Source code: https://github.com/react-dropzone/react-dropzone/ + +--- + +**Looking for maintainers: https://github.com/react-dropzone/react-dropzone/issues/479** + +--- + +## Installation + +Install it from npm and include it in your React build process (using [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/), etc). + +```bash +npm install --save react-dropzone +``` +or: +```bash +yarn add react-dropzone +``` + +## Usage + +Import `Dropzone` in your React component: + +```javascript static +import Dropzone from 'react-dropzone' +``` + + and specify the `onDrop` method that accepts two arguments. The first argument represents the accepted files and the second argument the rejected files. + +```javascript static +function onDrop(acceptedFiles, rejectedFiles) { + // do stuff with files... +} +``` + +Files accepted or rejected based on `accept` prop. This must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file). + +Please note that `onDrop` method will always be called regardless if dropped file was accepted or rejected. The `onDropAccepted` method will be called if all dropped files were accepted and the `onDropRejected` method will be called if any of the dropped files was rejected. + +Using `react-dropzone` is similar to using a file form field, but instead of getting the `files` property from the field, you listen to the `onDrop` callback to handle the files. Simple explanation here: http://abandon.ie/notebook/simple-file-uploads-using-jquery-ajax + +Specifying the `onDrop` method, provides you with an array of [Files](https://developer.mozilla.org/en-US/docs/Web/API/File) which you can then send to a server. For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library: + +```javascript static +onDrop: acceptedFiles => { + const req = request.post('/upload'); + acceptedFiles.forEach(file => { + req.attach(file.name, file); + }); + req.end(callback); +} +``` + +**Warning**: On most recent browsers versions, the files given by `onDrop` won't have properties `path` or `fullPath`, see [this SO question](https://stackoverflow.com/a/23005925/2275818) and [this issue](https://github.com/react-dropzone/react-dropzone/issues/477). +If you want to access file content you have to use the [FileReader API](https://developer.mozilla.org/en-US/docs/Web/API/FileReader). + +```javascript static +onDrop: acceptedFiles => { + acceptedFiles.forEach(file => { + const reader = new FileReader(); + reader.onload = () => { + const fileAsBinaryString = reader.result; + // do whatever you want with the file content + }; + reader.onabort = () => console.log('file reading was aborted'); + reader.onerror = () => console.log('file reading has failed'); + + reader.readAsBinaryString(file); + }); +} +``` + +## PropTypes + +See https://react-dropzone.netlify.com/#proptypes + +### Word of caution when working with previews + +*Important*: `react-dropzone` doesn't manage dropped files. You need to destroy the object URL yourself whenever you don't need the `preview` by calling `window.URL.revokeObjectURL(file.preview);` to avoid memory leaks. + +## Support + +### Backers +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/react-dropzone#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +### Sponsors +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/react-dropzone#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +MIT diff --git a/goTorrentWebUI/node_modules/react-dropzone/commitlint.config.js b/goTorrentWebUI/node_modules/react-dropzone/commitlint.config.js new file mode 100644 index 00000000..f78763c2 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-angular'] } diff --git a/goTorrentWebUI/node_modules/react-dropzone/dist/es/index.js b/goTorrentWebUI/node_modules/react-dropzone/dist/es/index.js new file mode 100644 index 00000000..01056bc8 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/dist/es/index.js @@ -0,0 +1,619 @@ +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/* eslint prefer-template: 0 */ + +import React from 'react'; +import PropTypes from 'prop-types'; +import { supportMultiple, fileAccepted, allFilesAccepted, fileMatchSize, onDocumentDragOver, getDataTransferItems } from './utils'; +import styles from './utils/styles'; + +var Dropzone = function (_React$Component) { + _inherits(Dropzone, _React$Component); + + function Dropzone(props, context) { + _classCallCheck(this, Dropzone); + + var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this, props, context)); + + _this.renderChildren = function (children, isDragActive, isDragAccept, isDragReject) { + if (typeof children === 'function') { + return children(_extends({}, _this.state, { + isDragActive: isDragActive, + isDragAccept: isDragAccept, + isDragReject: isDragReject + })); + } + return children; + }; + + _this.composeHandlers = _this.composeHandlers.bind(_this); + _this.onClick = _this.onClick.bind(_this); + _this.onDocumentDrop = _this.onDocumentDrop.bind(_this); + _this.onDragEnter = _this.onDragEnter.bind(_this); + _this.onDragLeave = _this.onDragLeave.bind(_this); + _this.onDragOver = _this.onDragOver.bind(_this); + _this.onDragStart = _this.onDragStart.bind(_this); + _this.onDrop = _this.onDrop.bind(_this); + _this.onFileDialogCancel = _this.onFileDialogCancel.bind(_this); + _this.onInputElementClick = _this.onInputElementClick.bind(_this); + + _this.setRef = _this.setRef.bind(_this); + _this.setRefs = _this.setRefs.bind(_this); + + _this.isFileDialogActive = false; + + _this.state = { + draggedFiles: [], + acceptedFiles: [], + rejectedFiles: [] + }; + return _this; + } + + _createClass(Dropzone, [{ + key: 'componentDidMount', + value: function componentDidMount() { + var preventDropOnDocument = this.props.preventDropOnDocument; + + this.dragTargets = []; + + if (preventDropOnDocument) { + document.addEventListener('dragover', onDocumentDragOver, false); + document.addEventListener('drop', this.onDocumentDrop, false); + } + this.fileInputEl.addEventListener('click', this.onInputElementClick, false); + // Tried implementing addEventListener, but didn't work out + document.body.onfocus = this.onFileDialogCancel; + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + var preventDropOnDocument = this.props.preventDropOnDocument; + + if (preventDropOnDocument) { + document.removeEventListener('dragover', onDocumentDragOver); + document.removeEventListener('drop', this.onDocumentDrop); + } + if (this.fileInputEl != null) { + this.fileInputEl.removeEventListener('click', this.onInputElementClick, false); + } + // Can be replaced with removeEventListener, if addEventListener works + if (document != null) { + document.body.onfocus = null; + } + } + }, { + key: 'composeHandlers', + value: function composeHandlers(handler) { + if (this.props.disabled) { + return null; + } + + return handler; + } + }, { + key: 'onDocumentDrop', + value: function onDocumentDrop(evt) { + if (this.node && this.node.contains(evt.target)) { + // if we intercepted an event for our instance, let it propagate down to the instance's onDrop handler + return; + } + evt.preventDefault(); + this.dragTargets = []; + } + }, { + key: 'onDragStart', + value: function onDragStart(evt) { + if (this.props.onDragStart) { + this.props.onDragStart.call(this, evt); + } + } + }, { + key: 'onDragEnter', + value: function onDragEnter(evt) { + evt.preventDefault(); + + // Count the dropzone and any children that are entered. + if (this.dragTargets.indexOf(evt.target) === -1) { + this.dragTargets.push(evt.target); + } + + this.setState({ + isDragActive: true, // Do not rely on files for the drag state. It doesn't work in Safari. + draggedFiles: getDataTransferItems(evt) + }); + + if (this.props.onDragEnter) { + this.props.onDragEnter.call(this, evt); + } + } + }, { + key: 'onDragOver', + value: function onDragOver(evt) { + // eslint-disable-line class-methods-use-this + evt.preventDefault(); + evt.stopPropagation(); + try { + // The file dialog on Chrome allows users to drag files from the dialog onto + // the dropzone, causing the browser the crash when the file dialog is closed. + // A drop effect of 'none' prevents the file from being dropped + evt.dataTransfer.dropEffect = this.isFileDialogActive ? 'none' : 'copy'; // eslint-disable-line no-param-reassign + } catch (err) { + // continue regardless of error + } + + if (this.props.onDragOver) { + this.props.onDragOver.call(this, evt); + } + return false; + } + }, { + key: 'onDragLeave', + value: function onDragLeave(evt) { + var _this2 = this; + + evt.preventDefault(); + + // Only deactivate once the dropzone and all children have been left. + this.dragTargets = this.dragTargets.filter(function (el) { + return el !== evt.target && _this2.node.contains(el); + }); + if (this.dragTargets.length > 0) { + return; + } + + // Clear dragging files state + this.setState({ + isDragActive: false, + draggedFiles: [] + }); + + if (this.props.onDragLeave) { + this.props.onDragLeave.call(this, evt); + } + } + }, { + key: 'onDrop', + value: function onDrop(evt) { + var _this3 = this; + + var _props = this.props, + onDrop = _props.onDrop, + onDropAccepted = _props.onDropAccepted, + onDropRejected = _props.onDropRejected, + multiple = _props.multiple, + disablePreview = _props.disablePreview, + accept = _props.accept; + + var fileList = getDataTransferItems(evt); + var acceptedFiles = []; + var rejectedFiles = []; + + // Stop default browser behavior + evt.preventDefault(); + + // Reset the counter along with the drag on a drop. + this.dragTargets = []; + this.isFileDialogActive = false; + + fileList.forEach(function (file) { + if (!disablePreview) { + try { + file.preview = window.URL.createObjectURL(file); // eslint-disable-line no-param-reassign + } catch (err) { + if (process.env.NODE_ENV !== 'production') { + console.error('Failed to generate preview for file', file, err); // eslint-disable-line no-console + } + } + } + + if (fileAccepted(file, accept) && fileMatchSize(file, _this3.props.maxSize, _this3.props.minSize)) { + acceptedFiles.push(file); + } else { + rejectedFiles.push(file); + } + }); + + if (!multiple) { + // if not in multi mode add any extra accepted files to rejected. + // This will allow end users to easily ignore a multi file drop in "single" mode. + rejectedFiles.push.apply(rejectedFiles, _toConsumableArray(acceptedFiles.splice(1))); + } + + if (onDrop) { + onDrop.call(this, acceptedFiles, rejectedFiles, evt); + } + + if (rejectedFiles.length > 0 && onDropRejected) { + onDropRejected.call(this, rejectedFiles, evt); + } + + if (acceptedFiles.length > 0 && onDropAccepted) { + onDropAccepted.call(this, acceptedFiles, evt); + } + + // Clear files value + this.draggedFiles = null; + + // Reset drag state + this.setState({ + isDragActive: false, + draggedFiles: [], + acceptedFiles: acceptedFiles, + rejectedFiles: rejectedFiles + }); + } + }, { + key: 'onClick', + value: function onClick(evt) { + var _props2 = this.props, + onClick = _props2.onClick, + disableClick = _props2.disableClick; + + if (!disableClick) { + evt.stopPropagation(); + + if (onClick) { + onClick.call(this, evt); + } + + // in IE11/Edge the file-browser dialog is blocking, ensure this is behind setTimeout + // this is so react can handle state changes in the onClick prop above above + // see: https://github.com/react-dropzone/react-dropzone/issues/450 + setTimeout(this.open.bind(this), 0); + } + } + }, { + key: 'onInputElementClick', + value: function onInputElementClick(evt) { + evt.stopPropagation(); + if (this.props.inputProps && this.props.inputProps.onClick) { + this.props.inputProps.onClick(); + } + } + }, { + key: 'onFileDialogCancel', + value: function onFileDialogCancel() { + // timeout will not recognize context of this method + var onFileDialogCancel = this.props.onFileDialogCancel; + var fileInputEl = this.fileInputEl; + var isFileDialogActive = this.isFileDialogActive; + // execute the timeout only if the onFileDialogCancel is defined and FileDialog + // is opened in the browser + + if (onFileDialogCancel && isFileDialogActive) { + setTimeout(function () { + // Returns an object as FileList + var FileList = fileInputEl.files; + if (!FileList.length) { + isFileDialogActive = false; + onFileDialogCancel(); + } + }, 300); + } + } + }, { + key: 'setRef', + value: function setRef(ref) { + this.node = ref; + } + }, { + key: 'setRefs', + value: function setRefs(ref) { + this.fileInputEl = ref; + } + /** + * Open system file upload dialog. + * + * @public + */ + + }, { + key: 'open', + value: function open() { + this.isFileDialogActive = true; + this.fileInputEl.value = null; + this.fileInputEl.click(); + } + }, { + key: 'render', + value: function render() { + var _props3 = this.props, + accept = _props3.accept, + acceptClassName = _props3.acceptClassName, + activeClassName = _props3.activeClassName, + children = _props3.children, + disabled = _props3.disabled, + disabledClassName = _props3.disabledClassName, + inputProps = _props3.inputProps, + multiple = _props3.multiple, + name = _props3.name, + rejectClassName = _props3.rejectClassName, + rest = _objectWithoutProperties(_props3, ['accept', 'acceptClassName', 'activeClassName', 'children', 'disabled', 'disabledClassName', 'inputProps', 'multiple', 'name', 'rejectClassName']); + + var acceptStyle = rest.acceptStyle, + activeStyle = rest.activeStyle, + _rest$className = rest.className, + className = _rest$className === undefined ? '' : _rest$className, + disabledStyle = rest.disabledStyle, + rejectStyle = rest.rejectStyle, + style = rest.style, + props = _objectWithoutProperties(rest, ['acceptStyle', 'activeStyle', 'className', 'disabledStyle', 'rejectStyle', 'style']); + + var _state = this.state, + isDragActive = _state.isDragActive, + draggedFiles = _state.draggedFiles; + + var filesCount = draggedFiles.length; + var isMultipleAllowed = multiple || filesCount <= 1; + var isDragAccept = filesCount > 0 && allFilesAccepted(draggedFiles, this.props.accept); + var isDragReject = filesCount > 0 && (!isDragAccept || !isMultipleAllowed); + var noStyles = !className && !style && !activeStyle && !acceptStyle && !rejectStyle && !disabledStyle; + + if (isDragActive && activeClassName) { + className += ' ' + activeClassName; + } + if (isDragAccept && acceptClassName) { + className += ' ' + acceptClassName; + } + if (isDragReject && rejectClassName) { + className += ' ' + rejectClassName; + } + if (disabled && disabledClassName) { + className += ' ' + disabledClassName; + } + + if (noStyles) { + style = styles.default; + activeStyle = styles.active; + acceptStyle = style.active; + rejectStyle = styles.rejected; + disabledStyle = styles.disabled; + } + + var appliedStyle = _extends({}, style); + if (activeStyle && isDragActive) { + appliedStyle = _extends({}, style, activeStyle); + } + if (acceptStyle && isDragAccept) { + appliedStyle = _extends({}, appliedStyle, acceptStyle); + } + if (rejectStyle && isDragReject) { + appliedStyle = _extends({}, appliedStyle, rejectStyle); + } + if (disabledStyle && disabled) { + appliedStyle = _extends({}, style, disabledStyle); + } + + var inputAttributes = { + accept: accept, + disabled: disabled, + type: 'file', + style: { display: 'none' }, + multiple: supportMultiple && multiple, + ref: this.setRefs, + onChange: this.onDrop, + autoComplete: 'off' + }; + + if (name && name.length) { + inputAttributes.name = name; + } + + // Destructure custom props away from props used for the div element + + var acceptedFiles = props.acceptedFiles, + preventDropOnDocument = props.preventDropOnDocument, + disablePreview = props.disablePreview, + disableClick = props.disableClick, + onDropAccepted = props.onDropAccepted, + onDropRejected = props.onDropRejected, + onFileDialogCancel = props.onFileDialogCancel, + maxSize = props.maxSize, + minSize = props.minSize, + divProps = _objectWithoutProperties(props, ['acceptedFiles', 'preventDropOnDocument', 'disablePreview', 'disableClick', 'onDropAccepted', 'onDropRejected', 'onFileDialogCancel', 'maxSize', 'minSize']); + + return React.createElement( + 'div', + _extends({ + className: className, + style: appliedStyle + }, divProps /* expand user provided props first so event handlers are never overridden */, { + onClick: this.composeHandlers(this.onClick), + onDragStart: this.composeHandlers(this.onDragStart), + onDragEnter: this.composeHandlers(this.onDragEnter), + onDragOver: this.composeHandlers(this.onDragOver), + onDragLeave: this.composeHandlers(this.onDragLeave), + onDrop: this.composeHandlers(this.onDrop), + ref: this.setRef, + 'aria-disabled': disabled + }), + this.renderChildren(children, isDragActive, isDragAccept, isDragReject), + React.createElement('input', _extends({}, inputProps /* expand user provided inputProps first so inputAttributes override them */, inputAttributes)) + ); + } + }]); + + return Dropzone; +}(React.Component); + +export default Dropzone; + +Dropzone.propTypes = { + /** + * Allow specific types of files. See https://github.com/okonet/attr-accept for more information. + * Keep in mind that mime type determination is not reliable across platforms. CSV files, + * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under + * Windows. In some cases there might not be a mime type set at all. + * See: https://github.com/react-dropzone/react-dropzone/issues/276 + */ + accept: PropTypes.string, + + /** + * Contents of the dropzone + */ + children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), + + /** + * Disallow clicking on the dropzone container to open file dialog + */ + disableClick: PropTypes.bool, + + /** + * Enable/disable the dropzone entirely + */ + disabled: PropTypes.bool, + + /** + * Enable/disable preview generation + */ + disablePreview: PropTypes.bool, + + /** + * If false, allow dropped items to take over the current browser window + */ + preventDropOnDocument: PropTypes.bool, + + /** + * Pass additional attributes to the `` tag + */ + inputProps: PropTypes.object, + + /** + * Allow dropping multiple files + */ + multiple: PropTypes.bool, + + /** + * `name` attribute for the input tag + */ + name: PropTypes.string, + + /** + * Maximum file size + */ + maxSize: PropTypes.number, + + /** + * Minimum file size + */ + minSize: PropTypes.number, + + /** + * className + */ + className: PropTypes.string, + + /** + * className for active state + */ + activeClassName: PropTypes.string, + + /** + * className for accepted state + */ + acceptClassName: PropTypes.string, + + /** + * className for rejected state + */ + rejectClassName: PropTypes.string, + + /** + * className for disabled state + */ + disabledClassName: PropTypes.string, + + /** + * CSS styles to apply + */ + style: PropTypes.object, + + /** + * CSS styles to apply when drag is active + */ + activeStyle: PropTypes.object, + + /** + * CSS styles to apply when drop will be accepted + */ + acceptStyle: PropTypes.object, + + /** + * CSS styles to apply when drop will be rejected + */ + rejectStyle: PropTypes.object, + + /** + * CSS styles to apply when dropzone is disabled + */ + disabledStyle: PropTypes.object, + + /** + * onClick callback + * @param {Event} event + */ + onClick: PropTypes.func, + + /** + * onDrop callback + */ + onDrop: PropTypes.func, + + /** + * onDropAccepted callback + */ + onDropAccepted: PropTypes.func, + + /** + * onDropRejected callback + */ + onDropRejected: PropTypes.func, + + /** + * onDragStart callback + */ + onDragStart: PropTypes.func, + + /** + * onDragEnter callback + */ + onDragEnter: PropTypes.func, + + /** + * onDragOver callback + */ + onDragOver: PropTypes.func, + + /** + * onDragLeave callback + */ + onDragLeave: PropTypes.func, + + /** + * Provide a callback on clicking the cancel button of the file dialog + */ + onFileDialogCancel: PropTypes.func +}; + +Dropzone.defaultProps = { + preventDropOnDocument: true, + disabled: false, + disablePreview: false, + disableClick: false, + multiple: true, + maxSize: Infinity, + minSize: 0 +}; \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/dist/es/utils/index.js b/goTorrentWebUI/node_modules/react-dropzone/dist/es/utils/index.js new file mode 100644 index 00000000..f1d03af0 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/dist/es/utils/index.js @@ -0,0 +1,42 @@ +import accepts from 'attr-accept'; + +export var supportMultiple = typeof document !== 'undefined' && document && document.createElement ? 'multiple' in document.createElement('input') : true; + +export function getDataTransferItems(event) { + var dataTransferItemsList = []; + if (event.dataTransfer) { + var dt = event.dataTransfer; + if (dt.files && dt.files.length) { + dataTransferItemsList = dt.files; + } else if (dt.items && dt.items.length) { + // During the drag even the dataTransfer.files is null + // but Chrome implements some drag store, which is accesible via dataTransfer.items + dataTransferItemsList = dt.items; + } + } else if (event.target && event.target.files) { + dataTransferItemsList = event.target.files; + } + // Convert from DataTransferItemsList to the native Array + return Array.prototype.slice.call(dataTransferItemsList); +} + +// Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with +// that MIME type will always be accepted +export function fileAccepted(file, accept) { + return file.type === 'application/x-moz-file' || accepts(file, accept); +} + +export function fileMatchSize(file, maxSize, minSize) { + return file.size <= maxSize && file.size >= minSize; +} + +export function allFilesAccepted(files, accept) { + return files.every(function (file) { + return fileAccepted(file, accept); + }); +} + +// allow the entire document to be a drag target +export function onDocumentDragOver(evt) { + evt.preventDefault(); +} \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/dist/es/utils/styles.js b/goTorrentWebUI/node_modules/react-dropzone/dist/es/utils/styles.js new file mode 100644 index 00000000..f090a46c --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/dist/es/utils/styles.js @@ -0,0 +1,23 @@ +export default { + rejected: { + borderStyle: 'solid', + borderColor: '#c66', + backgroundColor: '#eee' + }, + disabled: { + opacity: 0.5 + }, + active: { + borderStyle: 'solid', + borderColor: '#6c6', + backgroundColor: '#eee' + }, + default: { + width: 200, + height: 200, + borderWidth: 2, + borderColor: '#666', + borderStyle: 'dashed', + borderRadius: 5 + } +}; \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/dist/index.js b/goTorrentWebUI/node_modules/react-dropzone/dist/index.js new file mode 100644 index 00000000..1ca5b90c --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/dist/index.js @@ -0,0 +1,1029 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("react"), require("prop-types")); + else if(typeof define === 'function' && define.amd) + define(["react", "prop-types"], factory); + else if(typeof exports === 'object') + exports["Dropzone"] = factory(require("react"), require("prop-types")); + else + root["Dropzone"] = factory(root["react"], root["prop-types"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = __webpack_require__(3); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _utils = __webpack_require__(4); + +var _styles = __webpack_require__(6); + +var _styles2 = _interopRequireDefault(_styles); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint prefer-template: 0 */ + +var Dropzone = function (_React$Component) { + _inherits(Dropzone, _React$Component); + + function Dropzone(props, context) { + _classCallCheck(this, Dropzone); + + var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this, props, context)); + + _this.renderChildren = function (children, isDragActive, isDragAccept, isDragReject) { + if (typeof children === 'function') { + return children(_extends({}, _this.state, { + isDragActive: isDragActive, + isDragAccept: isDragAccept, + isDragReject: isDragReject + })); + } + return children; + }; + + _this.composeHandlers = _this.composeHandlers.bind(_this); + _this.onClick = _this.onClick.bind(_this); + _this.onDocumentDrop = _this.onDocumentDrop.bind(_this); + _this.onDragEnter = _this.onDragEnter.bind(_this); + _this.onDragLeave = _this.onDragLeave.bind(_this); + _this.onDragOver = _this.onDragOver.bind(_this); + _this.onDragStart = _this.onDragStart.bind(_this); + _this.onDrop = _this.onDrop.bind(_this); + _this.onFileDialogCancel = _this.onFileDialogCancel.bind(_this); + _this.onInputElementClick = _this.onInputElementClick.bind(_this); + + _this.setRef = _this.setRef.bind(_this); + _this.setRefs = _this.setRefs.bind(_this); + + _this.isFileDialogActive = false; + + _this.state = { + draggedFiles: [], + acceptedFiles: [], + rejectedFiles: [] + }; + return _this; + } + + _createClass(Dropzone, [{ + key: 'componentDidMount', + value: function componentDidMount() { + var preventDropOnDocument = this.props.preventDropOnDocument; + + this.dragTargets = []; + + if (preventDropOnDocument) { + document.addEventListener('dragover', _utils.onDocumentDragOver, false); + document.addEventListener('drop', this.onDocumentDrop, false); + } + this.fileInputEl.addEventListener('click', this.onInputElementClick, false); + // Tried implementing addEventListener, but didn't work out + document.body.onfocus = this.onFileDialogCancel; + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + var preventDropOnDocument = this.props.preventDropOnDocument; + + if (preventDropOnDocument) { + document.removeEventListener('dragover', _utils.onDocumentDragOver); + document.removeEventListener('drop', this.onDocumentDrop); + } + if (this.fileInputEl != null) { + this.fileInputEl.removeEventListener('click', this.onInputElementClick, false); + } + // Can be replaced with removeEventListener, if addEventListener works + if (document != null) { + document.body.onfocus = null; + } + } + }, { + key: 'composeHandlers', + value: function composeHandlers(handler) { + if (this.props.disabled) { + return null; + } + + return handler; + } + }, { + key: 'onDocumentDrop', + value: function onDocumentDrop(evt) { + if (this.node && this.node.contains(evt.target)) { + // if we intercepted an event for our instance, let it propagate down to the instance's onDrop handler + return; + } + evt.preventDefault(); + this.dragTargets = []; + } + }, { + key: 'onDragStart', + value: function onDragStart(evt) { + if (this.props.onDragStart) { + this.props.onDragStart.call(this, evt); + } + } + }, { + key: 'onDragEnter', + value: function onDragEnter(evt) { + evt.preventDefault(); + + // Count the dropzone and any children that are entered. + if (this.dragTargets.indexOf(evt.target) === -1) { + this.dragTargets.push(evt.target); + } + + this.setState({ + isDragActive: true, // Do not rely on files for the drag state. It doesn't work in Safari. + draggedFiles: (0, _utils.getDataTransferItems)(evt) + }); + + if (this.props.onDragEnter) { + this.props.onDragEnter.call(this, evt); + } + } + }, { + key: 'onDragOver', + value: function onDragOver(evt) { + // eslint-disable-line class-methods-use-this + evt.preventDefault(); + evt.stopPropagation(); + try { + // The file dialog on Chrome allows users to drag files from the dialog onto + // the dropzone, causing the browser the crash when the file dialog is closed. + // A drop effect of 'none' prevents the file from being dropped + evt.dataTransfer.dropEffect = this.isFileDialogActive ? 'none' : 'copy'; // eslint-disable-line no-param-reassign + } catch (err) { + // continue regardless of error + } + + if (this.props.onDragOver) { + this.props.onDragOver.call(this, evt); + } + return false; + } + }, { + key: 'onDragLeave', + value: function onDragLeave(evt) { + var _this2 = this; + + evt.preventDefault(); + + // Only deactivate once the dropzone and all children have been left. + this.dragTargets = this.dragTargets.filter(function (el) { + return el !== evt.target && _this2.node.contains(el); + }); + if (this.dragTargets.length > 0) { + return; + } + + // Clear dragging files state + this.setState({ + isDragActive: false, + draggedFiles: [] + }); + + if (this.props.onDragLeave) { + this.props.onDragLeave.call(this, evt); + } + } + }, { + key: 'onDrop', + value: function onDrop(evt) { + var _this3 = this; + + var _props = this.props, + onDrop = _props.onDrop, + onDropAccepted = _props.onDropAccepted, + onDropRejected = _props.onDropRejected, + multiple = _props.multiple, + disablePreview = _props.disablePreview, + accept = _props.accept; + + var fileList = (0, _utils.getDataTransferItems)(evt); + var acceptedFiles = []; + var rejectedFiles = []; + + // Stop default browser behavior + evt.preventDefault(); + + // Reset the counter along with the drag on a drop. + this.dragTargets = []; + this.isFileDialogActive = false; + + fileList.forEach(function (file) { + if (!disablePreview) { + try { + file.preview = window.URL.createObjectURL(file); // eslint-disable-line no-param-reassign + } catch (err) { + if (process.env.NODE_ENV !== 'production') { + console.error('Failed to generate preview for file', file, err); // eslint-disable-line no-console + } + } + } + + if ((0, _utils.fileAccepted)(file, accept) && (0, _utils.fileMatchSize)(file, _this3.props.maxSize, _this3.props.minSize)) { + acceptedFiles.push(file); + } else { + rejectedFiles.push(file); + } + }); + + if (!multiple) { + // if not in multi mode add any extra accepted files to rejected. + // This will allow end users to easily ignore a multi file drop in "single" mode. + rejectedFiles.push.apply(rejectedFiles, _toConsumableArray(acceptedFiles.splice(1))); + } + + if (onDrop) { + onDrop.call(this, acceptedFiles, rejectedFiles, evt); + } + + if (rejectedFiles.length > 0 && onDropRejected) { + onDropRejected.call(this, rejectedFiles, evt); + } + + if (acceptedFiles.length > 0 && onDropAccepted) { + onDropAccepted.call(this, acceptedFiles, evt); + } + + // Clear files value + this.draggedFiles = null; + + // Reset drag state + this.setState({ + isDragActive: false, + draggedFiles: [], + acceptedFiles: acceptedFiles, + rejectedFiles: rejectedFiles + }); + } + }, { + key: 'onClick', + value: function onClick(evt) { + var _props2 = this.props, + onClick = _props2.onClick, + disableClick = _props2.disableClick; + + if (!disableClick) { + evt.stopPropagation(); + + if (onClick) { + onClick.call(this, evt); + } + + // in IE11/Edge the file-browser dialog is blocking, ensure this is behind setTimeout + // this is so react can handle state changes in the onClick prop above above + // see: https://github.com/react-dropzone/react-dropzone/issues/450 + setTimeout(this.open.bind(this), 0); + } + } + }, { + key: 'onInputElementClick', + value: function onInputElementClick(evt) { + evt.stopPropagation(); + if (this.props.inputProps && this.props.inputProps.onClick) { + this.props.inputProps.onClick(); + } + } + }, { + key: 'onFileDialogCancel', + value: function onFileDialogCancel() { + // timeout will not recognize context of this method + var onFileDialogCancel = this.props.onFileDialogCancel; + var fileInputEl = this.fileInputEl; + var isFileDialogActive = this.isFileDialogActive; + // execute the timeout only if the onFileDialogCancel is defined and FileDialog + // is opened in the browser + + if (onFileDialogCancel && isFileDialogActive) { + setTimeout(function () { + // Returns an object as FileList + var FileList = fileInputEl.files; + if (!FileList.length) { + isFileDialogActive = false; + onFileDialogCancel(); + } + }, 300); + } + } + }, { + key: 'setRef', + value: function setRef(ref) { + this.node = ref; + } + }, { + key: 'setRefs', + value: function setRefs(ref) { + this.fileInputEl = ref; + } + /** + * Open system file upload dialog. + * + * @public + */ + + }, { + key: 'open', + value: function open() { + this.isFileDialogActive = true; + this.fileInputEl.value = null; + this.fileInputEl.click(); + } + }, { + key: 'render', + value: function render() { + var _props3 = this.props, + accept = _props3.accept, + acceptClassName = _props3.acceptClassName, + activeClassName = _props3.activeClassName, + children = _props3.children, + disabled = _props3.disabled, + disabledClassName = _props3.disabledClassName, + inputProps = _props3.inputProps, + multiple = _props3.multiple, + name = _props3.name, + rejectClassName = _props3.rejectClassName, + rest = _objectWithoutProperties(_props3, ['accept', 'acceptClassName', 'activeClassName', 'children', 'disabled', 'disabledClassName', 'inputProps', 'multiple', 'name', 'rejectClassName']); + + var acceptStyle = rest.acceptStyle, + activeStyle = rest.activeStyle, + _rest$className = rest.className, + className = _rest$className === undefined ? '' : _rest$className, + disabledStyle = rest.disabledStyle, + rejectStyle = rest.rejectStyle, + style = rest.style, + props = _objectWithoutProperties(rest, ['acceptStyle', 'activeStyle', 'className', 'disabledStyle', 'rejectStyle', 'style']); + + var _state = this.state, + isDragActive = _state.isDragActive, + draggedFiles = _state.draggedFiles; + + var filesCount = draggedFiles.length; + var isMultipleAllowed = multiple || filesCount <= 1; + var isDragAccept = filesCount > 0 && (0, _utils.allFilesAccepted)(draggedFiles, this.props.accept); + var isDragReject = filesCount > 0 && (!isDragAccept || !isMultipleAllowed); + var noStyles = !className && !style && !activeStyle && !acceptStyle && !rejectStyle && !disabledStyle; + + if (isDragActive && activeClassName) { + className += ' ' + activeClassName; + } + if (isDragAccept && acceptClassName) { + className += ' ' + acceptClassName; + } + if (isDragReject && rejectClassName) { + className += ' ' + rejectClassName; + } + if (disabled && disabledClassName) { + className += ' ' + disabledClassName; + } + + if (noStyles) { + style = _styles2.default.default; + activeStyle = _styles2.default.active; + acceptStyle = style.active; + rejectStyle = _styles2.default.rejected; + disabledStyle = _styles2.default.disabled; + } + + var appliedStyle = _extends({}, style); + if (activeStyle && isDragActive) { + appliedStyle = _extends({}, style, activeStyle); + } + if (acceptStyle && isDragAccept) { + appliedStyle = _extends({}, appliedStyle, acceptStyle); + } + if (rejectStyle && isDragReject) { + appliedStyle = _extends({}, appliedStyle, rejectStyle); + } + if (disabledStyle && disabled) { + appliedStyle = _extends({}, style, disabledStyle); + } + + var inputAttributes = { + accept: accept, + disabled: disabled, + type: 'file', + style: { display: 'none' }, + multiple: _utils.supportMultiple && multiple, + ref: this.setRefs, + onChange: this.onDrop, + autoComplete: 'off' + }; + + if (name && name.length) { + inputAttributes.name = name; + } + + // Destructure custom props away from props used for the div element + + var acceptedFiles = props.acceptedFiles, + preventDropOnDocument = props.preventDropOnDocument, + disablePreview = props.disablePreview, + disableClick = props.disableClick, + onDropAccepted = props.onDropAccepted, + onDropRejected = props.onDropRejected, + onFileDialogCancel = props.onFileDialogCancel, + maxSize = props.maxSize, + minSize = props.minSize, + divProps = _objectWithoutProperties(props, ['acceptedFiles', 'preventDropOnDocument', 'disablePreview', 'disableClick', 'onDropAccepted', 'onDropRejected', 'onFileDialogCancel', 'maxSize', 'minSize']); + + return _react2.default.createElement( + 'div', + _extends({ + className: className, + style: appliedStyle + }, divProps /* expand user provided props first so event handlers are never overridden */, { + onClick: this.composeHandlers(this.onClick), + onDragStart: this.composeHandlers(this.onDragStart), + onDragEnter: this.composeHandlers(this.onDragEnter), + onDragOver: this.composeHandlers(this.onDragOver), + onDragLeave: this.composeHandlers(this.onDragLeave), + onDrop: this.composeHandlers(this.onDrop), + ref: this.setRef, + 'aria-disabled': disabled + }), + this.renderChildren(children, isDragActive, isDragAccept, isDragReject), + _react2.default.createElement('input', _extends({}, inputProps /* expand user provided inputProps first so inputAttributes override them */, inputAttributes)) + ); + } + }]); + + return Dropzone; +}(_react2.default.Component); + +exports.default = Dropzone; + + +Dropzone.propTypes = { + /** + * Allow specific types of files. See https://github.com/okonet/attr-accept for more information. + * Keep in mind that mime type determination is not reliable across platforms. CSV files, + * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under + * Windows. In some cases there might not be a mime type set at all. + * See: https://github.com/react-dropzone/react-dropzone/issues/276 + */ + accept: _propTypes2.default.string, + + /** + * Contents of the dropzone + */ + children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), + + /** + * Disallow clicking on the dropzone container to open file dialog + */ + disableClick: _propTypes2.default.bool, + + /** + * Enable/disable the dropzone entirely + */ + disabled: _propTypes2.default.bool, + + /** + * Enable/disable preview generation + */ + disablePreview: _propTypes2.default.bool, + + /** + * If false, allow dropped items to take over the current browser window + */ + preventDropOnDocument: _propTypes2.default.bool, + + /** + * Pass additional attributes to the `` tag + */ + inputProps: _propTypes2.default.object, + + /** + * Allow dropping multiple files + */ + multiple: _propTypes2.default.bool, + + /** + * `name` attribute for the input tag + */ + name: _propTypes2.default.string, + + /** + * Maximum file size + */ + maxSize: _propTypes2.default.number, + + /** + * Minimum file size + */ + minSize: _propTypes2.default.number, + + /** + * className + */ + className: _propTypes2.default.string, + + /** + * className for active state + */ + activeClassName: _propTypes2.default.string, + + /** + * className for accepted state + */ + acceptClassName: _propTypes2.default.string, + + /** + * className for rejected state + */ + rejectClassName: _propTypes2.default.string, + + /** + * className for disabled state + */ + disabledClassName: _propTypes2.default.string, + + /** + * CSS styles to apply + */ + style: _propTypes2.default.object, + + /** + * CSS styles to apply when drag is active + */ + activeStyle: _propTypes2.default.object, + + /** + * CSS styles to apply when drop will be accepted + */ + acceptStyle: _propTypes2.default.object, + + /** + * CSS styles to apply when drop will be rejected + */ + rejectStyle: _propTypes2.default.object, + + /** + * CSS styles to apply when dropzone is disabled + */ + disabledStyle: _propTypes2.default.object, + + /** + * onClick callback + * @param {Event} event + */ + onClick: _propTypes2.default.func, + + /** + * onDrop callback + */ + onDrop: _propTypes2.default.func, + + /** + * onDropAccepted callback + */ + onDropAccepted: _propTypes2.default.func, + + /** + * onDropRejected callback + */ + onDropRejected: _propTypes2.default.func, + + /** + * onDragStart callback + */ + onDragStart: _propTypes2.default.func, + + /** + * onDragEnter callback + */ + onDragEnter: _propTypes2.default.func, + + /** + * onDragOver callback + */ + onDragOver: _propTypes2.default.func, + + /** + * onDragLeave callback + */ + onDragLeave: _propTypes2.default.func, + + /** + * Provide a callback on clicking the cancel button of the file dialog + */ + onFileDialogCancel: _propTypes2.default.func +}; + +Dropzone.defaultProps = { + preventDropOnDocument: true, + disabled: false, + disablePreview: false, + disableClick: false, + multiple: true, + maxSize: Infinity, + minSize: 0 +}; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_2__; + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_3__; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.supportMultiple = undefined; +exports.getDataTransferItems = getDataTransferItems; +exports.fileAccepted = fileAccepted; +exports.fileMatchSize = fileMatchSize; +exports.allFilesAccepted = allFilesAccepted; +exports.onDocumentDragOver = onDocumentDragOver; + +var _attrAccept = __webpack_require__(5); + +var _attrAccept2 = _interopRequireDefault(_attrAccept); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var supportMultiple = exports.supportMultiple = typeof document !== 'undefined' && document && document.createElement ? 'multiple' in document.createElement('input') : true; + +function getDataTransferItems(event) { + var dataTransferItemsList = []; + if (event.dataTransfer) { + var dt = event.dataTransfer; + if (dt.files && dt.files.length) { + dataTransferItemsList = dt.files; + } else if (dt.items && dt.items.length) { + // During the drag even the dataTransfer.files is null + // but Chrome implements some drag store, which is accesible via dataTransfer.items + dataTransferItemsList = dt.items; + } + } else if (event.target && event.target.files) { + dataTransferItemsList = event.target.files; + } + // Convert from DataTransferItemsList to the native Array + return Array.prototype.slice.call(dataTransferItemsList); +} + +// Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with +// that MIME type will always be accepted +function fileAccepted(file, accept) { + return file.type === 'application/x-moz-file' || (0, _attrAccept2.default)(file, accept); +} + +function fileMatchSize(file, maxSize, minSize) { + return file.size <= maxSize && file.size >= minSize; +} + +function allFilesAccepted(files, accept) { + return files.every(function (file) { + return fileAccepted(file, accept); + }); +} + +// allow the entire document to be a drag target +function onDocumentDragOver(evt) { + evt.preventDefault(); +} + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +module.exports=function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";n.__esModule=!0,r(8),r(9),n["default"]=function(t,n){if(t&&n){var r=function(){var r=Array.isArray(n)?n:n.split(","),e=t.name||"",o=t.type||"",i=o.replace(/\/.*$/,"");return{v:r.some(function(t){var n=t.trim();return"."===n.charAt(0)?e.toLowerCase().endsWith(n.toLowerCase()):/\/\*$/.test(n)?i===n.replace(/\/.*$/,""):o===n})}}();if("object"==typeof r)return r.v}return!0},t.exports=n["default"]},function(t,n){var r=t.exports={version:"1.2.2"};"number"==typeof __e&&(__e=r)},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n,r){var e=r(2),o=r(1),i=r(4),u=r(19),c="prototype",f=function(t,n){return function(){return t.apply(n,arguments)}},s=function(t,n,r){var a,p,l,y,d=t&s.G,h=t&s.P,v=d?e:t&s.S?e[n]||(e[n]={}):(e[n]||{})[c],x=d?o:o[n]||(o[n]={});d&&(r=n);for(a in r)p=!(t&s.F)&&v&&a in v,l=(p?v:r)[a],y=t&s.B&&p?f(l,e):h&&"function"==typeof l?f(Function.call,l):l,v&&!p&&u(v,a,l),x[a]!=l&&i(x,a,y),h&&((x[c]||(x[c]={}))[a]=l)};e.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,n,r){var e=r(5),o=r(18);t.exports=r(22)?function(t,n,r){return e.setDesc(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){var e=r(20)("wks"),o=r(2).Symbol;t.exports=function(t){return e[t]||(e[t]=o&&o[t]||(o||r(6))("Symbol."+t))}},function(t,n,r){r(26),t.exports=r(1).Array.some},function(t,n,r){r(25),t.exports=r(1).String.endsWith},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(10);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[r(7)("match")]=!1,!"/./"[t](n)}catch(o){}}return!0}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(16),o=r(11),i=r(7)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==o(t))}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),o=r(4),i=r(6)("src"),u="toString",c=Function[u],f=(""+c).split(u);r(1).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,r,u){"function"==typeof r&&(o(r,i,t[n]?""+t[n]:f.join(String(n))),"name"in r||(r.name=n)),t===e?t[n]=r:(u||delete t[n],o(t,n,r))})(Function.prototype,u,function(){return"function"==typeof this&&this[i]||c.call(this)})},function(t,n,r){var e=r(2),o="__core-js_shared__",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e=r(17),o=r(13);t.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(o(t))}},function(t,n,r){t.exports=!r(15)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(23),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){"use strict";var e=r(3),o=r(24),i=r(21),u="endsWith",c=""[u];e(e.P+e.F*r(14)(u),"String",{endsWith:function(t){var n=i(this,t,u),r=arguments,e=r.length>1?r[1]:void 0,f=o(n.length),s=void 0===e?f:Math.min(o(e),f),a=String(t);return c?c.call(n,a,s):n.slice(s-a.length,s)===a}})},function(t,n,r){var e=r(5),o=r(3),i=r(1).Array||Array,u={},c=function(t,n){e.each.call(t.split(","),function(t){void 0==n&&t in i?u[t]=i[t]:t in[]&&(u[t]=r(12)(Function.call,[][t],n))})};c("pop,reverse,shift,keys,values,entries",1),c("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),c("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill"),o(o.S,"Array",u)}]); + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = { + rejected: { + borderStyle: 'solid', + borderColor: '#c66', + backgroundColor: '#eee' + }, + disabled: { + opacity: 0.5 + }, + active: { + borderStyle: 'solid', + borderColor: '#6c6', + backgroundColor: '#eee' + }, + default: { + width: 200, + height: 200, + borderWidth: 2, + borderColor: '#666', + borderStyle: 'dashed', + borderRadius: 5 + } +}; +module.exports = exports['default']; + +/***/ }) +/******/ ]); +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/dist/index.js.map b/goTorrentWebUI/node_modules/react-dropzone/dist/index.js.map new file mode 100644 index 00000000..74367389 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 5c1f85df70828faca129","webpack:///./src/index.js","webpack:///./node_modules/process/browser.js","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///./src/utils/index.js","webpack:///./node_modules/attr-accept/dist/index.js","webpack:///./src/utils/styles.js"],"names":["Dropzone","props","context","renderChildren","children","isDragActive","isDragAccept","isDragReject","state","composeHandlers","bind","onClick","onDocumentDrop","onDragEnter","onDragLeave","onDragOver","onDragStart","onDrop","onFileDialogCancel","onInputElementClick","setRef","setRefs","isFileDialogActive","draggedFiles","acceptedFiles","rejectedFiles","preventDropOnDocument","dragTargets","document","addEventListener","fileInputEl","body","onfocus","removeEventListener","handler","disabled","evt","node","contains","target","preventDefault","call","indexOf","push","setState","stopPropagation","dataTransfer","dropEffect","err","filter","el","length","onDropAccepted","onDropRejected","multiple","disablePreview","accept","fileList","forEach","file","preview","window","URL","createObjectURL","process","env","NODE_ENV","console","error","maxSize","minSize","splice","disableClick","setTimeout","open","inputProps","FileList","files","ref","value","click","acceptClassName","activeClassName","disabledClassName","name","rejectClassName","rest","acceptStyle","activeStyle","className","disabledStyle","rejectStyle","style","filesCount","isMultipleAllowed","noStyles","default","active","rejected","appliedStyle","inputAttributes","type","display","onChange","autoComplete","divProps","Component","propTypes","string","oneOfType","func","bool","object","number","defaultProps","Infinity","getDataTransferItems","fileAccepted","fileMatchSize","allFilesAccepted","onDocumentDragOver","supportMultiple","createElement","event","dataTransferItemsList","dt","items","Array","prototype","slice","size","every","borderStyle","borderColor","backgroundColor","opacity","width","height","borderWidth","borderRadius"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;AC3DA;;;;AACA;;;;AACA;;AAQA;;;;;;;;;;;;;;+eAZA;;IAcMA,Q;;;AACJ,oBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oHACpBD,KADoB,EACbC,OADa;;AAAA,UAiQ5BC,cAjQ4B,GAiQX,UAACC,QAAD,EAAWC,YAAX,EAAyBC,YAAzB,EAAuCC,YAAvC,EAAwD;AACvE,UAAI,OAAOH,QAAP,KAAoB,UAAxB,EAAoC;AAClC,eAAOA,sBACF,MAAKI,KADH;AAELH,oCAFK;AAGLC,oCAHK;AAILC;AAJK,WAAP;AAMD;AACD,aAAOH,QAAP;AACD,KA3Q2B;;AAE1B,UAAKK,eAAL,GAAuB,MAAKA,eAAL,CAAqBC,IAArB,OAAvB;AACA,UAAKC,OAAL,GAAe,MAAKA,OAAL,CAAaD,IAAb,OAAf;AACA,UAAKE,cAAL,GAAsB,MAAKA,cAAL,CAAoBF,IAApB,OAAtB;AACA,UAAKG,WAAL,GAAmB,MAAKA,WAAL,CAAiBH,IAAjB,OAAnB;AACA,UAAKI,WAAL,GAAmB,MAAKA,WAAL,CAAiBJ,IAAjB,OAAnB;AACA,UAAKK,UAAL,GAAkB,MAAKA,UAAL,CAAgBL,IAAhB,OAAlB;AACA,UAAKM,WAAL,GAAmB,MAAKA,WAAL,CAAiBN,IAAjB,OAAnB;AACA,UAAKO,MAAL,GAAc,MAAKA,MAAL,CAAYP,IAAZ,OAAd;AACA,UAAKQ,kBAAL,GAA0B,MAAKA,kBAAL,CAAwBR,IAAxB,OAA1B;AACA,UAAKS,mBAAL,GAA2B,MAAKA,mBAAL,CAAyBT,IAAzB,OAA3B;;AAEA,UAAKU,MAAL,GAAc,MAAKA,MAAL,CAAYV,IAAZ,OAAd;AACA,UAAKW,OAAL,GAAe,MAAKA,OAAL,CAAaX,IAAb,OAAf;;AAEA,UAAKY,kBAAL,GAA0B,KAA1B;;AAEA,UAAKd,KAAL,GAAa;AACXe,oBAAc,EADH;AAEXC,qBAAe,EAFJ;AAGXC,qBAAe;AAHJ,KAAb;AAlB0B;AAuB3B;;;;wCAEmB;AAAA,UACVC,qBADU,GACgB,KAAKzB,KADrB,CACVyB,qBADU;;AAElB,WAAKC,WAAL,GAAmB,EAAnB;;AAEA,UAAID,qBAAJ,EAA2B;AACzBE,iBAASC,gBAAT,CAA0B,UAA1B,6BAA0D,KAA1D;AACAD,iBAASC,gBAAT,CAA0B,MAA1B,EAAkC,KAAKjB,cAAvC,EAAuD,KAAvD;AACD;AACD,WAAKkB,WAAL,CAAiBD,gBAAjB,CAAkC,OAAlC,EAA2C,KAAKV,mBAAhD,EAAqE,KAArE;AACA;AACAS,eAASG,IAAT,CAAcC,OAAd,GAAwB,KAAKd,kBAA7B;AACD;;;2CAEsB;AAAA,UACbQ,qBADa,GACa,KAAKzB,KADlB,CACbyB,qBADa;;AAErB,UAAIA,qBAAJ,EAA2B;AACzBE,iBAASK,mBAAT,CAA6B,UAA7B;AACAL,iBAASK,mBAAT,CAA6B,MAA7B,EAAqC,KAAKrB,cAA1C;AACD;AACD,UAAI,KAAKkB,WAAL,IAAoB,IAAxB,EAA8B;AAC5B,aAAKA,WAAL,CAAiBG,mBAAjB,CAAqC,OAArC,EAA8C,KAAKd,mBAAnD,EAAwE,KAAxE;AACD;AACD;AACA,UAAIS,YAAY,IAAhB,EAAsB;AACpBA,iBAASG,IAAT,CAAcC,OAAd,GAAwB,IAAxB;AACD;AACF;;;oCAEeE,O,EAAS;AACvB,UAAI,KAAKjC,KAAL,CAAWkC,QAAf,EAAyB;AACvB,eAAO,IAAP;AACD;;AAED,aAAOD,OAAP;AACD;;;mCAEcE,G,EAAK;AAClB,UAAI,KAAKC,IAAL,IAAa,KAAKA,IAAL,CAAUC,QAAV,CAAmBF,IAAIG,MAAvB,CAAjB,EAAiD;AAC/C;AACA;AACD;AACDH,UAAII,cAAJ;AACA,WAAKb,WAAL,GAAmB,EAAnB;AACD;;;gCAEWS,G,EAAK;AACf,UAAI,KAAKnC,KAAL,CAAWe,WAAf,EAA4B;AAC1B,aAAKf,KAAL,CAAWe,WAAX,CAAuByB,IAAvB,CAA4B,IAA5B,EAAkCL,GAAlC;AACD;AACF;;;gCAEWA,G,EAAK;AACfA,UAAII,cAAJ;;AAEA;AACA,UAAI,KAAKb,WAAL,CAAiBe,OAAjB,CAAyBN,IAAIG,MAA7B,MAAyC,CAAC,CAA9C,EAAiD;AAC/C,aAAKZ,WAAL,CAAiBgB,IAAjB,CAAsBP,IAAIG,MAA1B;AACD;;AAED,WAAKK,QAAL,CAAc;AACZvC,sBAAc,IADF,EACQ;AACpBkB,sBAAc,iCAAqBa,GAArB;AAFF,OAAd;;AAKA,UAAI,KAAKnC,KAAL,CAAWY,WAAf,EAA4B;AAC1B,aAAKZ,KAAL,CAAWY,WAAX,CAAuB4B,IAAvB,CAA4B,IAA5B,EAAkCL,GAAlC;AACD;AACF;;;+BAEUA,G,EAAK;AACd;AACAA,UAAII,cAAJ;AACAJ,UAAIS,eAAJ;AACA,UAAI;AACF;AACA;AACA;AACAT,YAAIU,YAAJ,CAAiBC,UAAjB,GAA8B,KAAKzB,kBAAL,GAA0B,MAA1B,GAAmC,MAAjE,CAJE,CAIsE;AACzE,OALD,CAKE,OAAO0B,GAAP,EAAY;AACZ;AACD;;AAED,UAAI,KAAK/C,KAAL,CAAWc,UAAf,EAA2B;AACzB,aAAKd,KAAL,CAAWc,UAAX,CAAsB0B,IAAtB,CAA2B,IAA3B,EAAiCL,GAAjC;AACD;AACD,aAAO,KAAP;AACD;;;gCAEWA,G,EAAK;AAAA;;AACfA,UAAII,cAAJ;;AAEA;AACA,WAAKb,WAAL,GAAmB,KAAKA,WAAL,CAAiBsB,MAAjB,CAAwB;AAAA,eAAMC,OAAOd,IAAIG,MAAX,IAAqB,OAAKF,IAAL,CAAUC,QAAV,CAAmBY,EAAnB,CAA3B;AAAA,OAAxB,CAAnB;AACA,UAAI,KAAKvB,WAAL,CAAiBwB,MAAjB,GAA0B,CAA9B,EAAiC;AAC/B;AACD;;AAED;AACA,WAAKP,QAAL,CAAc;AACZvC,sBAAc,KADF;AAEZkB,sBAAc;AAFF,OAAd;;AAKA,UAAI,KAAKtB,KAAL,CAAWa,WAAf,EAA4B;AAC1B,aAAKb,KAAL,CAAWa,WAAX,CAAuB2B,IAAvB,CAA4B,IAA5B,EAAkCL,GAAlC;AACD;AACF;;;2BAEMA,G,EAAK;AAAA;;AAAA,mBAC2E,KAAKnC,KADhF;AAAA,UACFgB,MADE,UACFA,MADE;AAAA,UACMmC,cADN,UACMA,cADN;AAAA,UACsBC,cADtB,UACsBA,cADtB;AAAA,UACsCC,QADtC,UACsCA,QADtC;AAAA,UACgDC,cADhD,UACgDA,cADhD;AAAA,UACgEC,MADhE,UACgEA,MADhE;;AAEV,UAAMC,WAAW,iCAAqBrB,GAArB,CAAjB;AACA,UAAMZ,gBAAgB,EAAtB;AACA,UAAMC,gBAAgB,EAAtB;;AAEA;AACAW,UAAII,cAAJ;;AAEA;AACA,WAAKb,WAAL,GAAmB,EAAnB;AACA,WAAKL,kBAAL,GAA0B,KAA1B;;AAEAmC,eAASC,OAAT,CAAiB,gBAAQ;AACvB,YAAI,CAACH,cAAL,EAAqB;AACnB,cAAI;AACFI,iBAAKC,OAAL,GAAeC,OAAOC,GAAP,CAAWC,eAAX,CAA2BJ,IAA3B,CAAf,CADE,CAC8C;AACjD,WAFD,CAEE,OAAOX,GAAP,EAAY;AACZ,gBAAIgB,QAAQC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;AACzCC,sBAAQC,KAAR,CAAc,qCAAd,EAAqDT,IAArD,EAA2DX,GAA3D,EADyC,CACuB;AACjE;AACF;AACF;;AAED,YACE,yBAAaW,IAAb,EAAmBH,MAAnB,KACA,0BAAcG,IAAd,EAAoB,OAAK1D,KAAL,CAAWoE,OAA/B,EAAwC,OAAKpE,KAAL,CAAWqE,OAAnD,CAFF,EAGE;AACA9C,wBAAcmB,IAAd,CAAmBgB,IAAnB;AACD,SALD,MAKO;AACLlC,wBAAckB,IAAd,CAAmBgB,IAAnB;AACD;AACF,OAnBD;;AAqBA,UAAI,CAACL,QAAL,EAAe;AACb;AACA;AACA7B,sBAAckB,IAAd,yCAAsBnB,cAAc+C,MAAd,CAAqB,CAArB,CAAtB;AACD;;AAED,UAAItD,MAAJ,EAAY;AACVA,eAAOwB,IAAP,CAAY,IAAZ,EAAkBjB,aAAlB,EAAiCC,aAAjC,EAAgDW,GAAhD;AACD;;AAED,UAAIX,cAAc0B,MAAd,GAAuB,CAAvB,IAA4BE,cAAhC,EAAgD;AAC9CA,uBAAeZ,IAAf,CAAoB,IAApB,EAA0BhB,aAA1B,EAAyCW,GAAzC;AACD;;AAED,UAAIZ,cAAc2B,MAAd,GAAuB,CAAvB,IAA4BC,cAAhC,EAAgD;AAC9CA,uBAAeX,IAAf,CAAoB,IAApB,EAA0BjB,aAA1B,EAAyCY,GAAzC;AACD;;AAED;AACA,WAAKb,YAAL,GAAoB,IAApB;;AAEA;AACA,WAAKqB,QAAL,CAAc;AACZvC,sBAAc,KADF;AAEZkB,sBAAc,EAFF;AAGZC,oCAHY;AAIZC;AAJY,OAAd;AAMD;;;4BAEOW,G,EAAK;AAAA,oBACuB,KAAKnC,KAD5B;AAAA,UACHU,OADG,WACHA,OADG;AAAA,UACM6D,YADN,WACMA,YADN;;AAEX,UAAI,CAACA,YAAL,EAAmB;AACjBpC,YAAIS,eAAJ;;AAEA,YAAIlC,OAAJ,EAAa;AACXA,kBAAQ8B,IAAR,CAAa,IAAb,EAAmBL,GAAnB;AACD;;AAED;AACA;AACA;AACAqC,mBAAW,KAAKC,IAAL,CAAUhE,IAAV,CAAe,IAAf,CAAX,EAAiC,CAAjC;AACD;AACF;;;wCAEmB0B,G,EAAK;AACvBA,UAAIS,eAAJ;AACA,UAAI,KAAK5C,KAAL,CAAW0E,UAAX,IAAyB,KAAK1E,KAAL,CAAW0E,UAAX,CAAsBhE,OAAnD,EAA4D;AAC1D,aAAKV,KAAL,CAAW0E,UAAX,CAAsBhE,OAAtB;AACD;AACF;;;yCAEoB;AACnB;AADmB,UAEXO,kBAFW,GAEY,KAAKjB,KAFjB,CAEXiB,kBAFW;AAAA,UAGXY,WAHW,GAGK,IAHL,CAGXA,WAHW;AAAA,UAIbR,kBAJa,GAIU,IAJV,CAIbA,kBAJa;AAKnB;AACA;;AACA,UAAIJ,sBAAsBI,kBAA1B,EAA8C;AAC5CmD,mBAAW,YAAM;AACf;AACA,cAAMG,WAAW9C,YAAY+C,KAA7B;AACA,cAAI,CAACD,SAASzB,MAAd,EAAsB;AACpB7B,iCAAqB,KAArB;AACAJ;AACD;AACF,SAPD,EAOG,GAPH;AAQD;AACF;;;2BAEM4D,G,EAAK;AACV,WAAKzC,IAAL,GAAYyC,GAAZ;AACD;;;4BAEOA,G,EAAK;AACX,WAAKhD,WAAL,GAAmBgD,GAAnB;AACD;AACD;;;;;;;;2BAKO;AACL,WAAKxD,kBAAL,GAA0B,IAA1B;AACA,WAAKQ,WAAL,CAAiBiD,KAAjB,GAAyB,IAAzB;AACA,WAAKjD,WAAL,CAAiBkD,KAAjB;AACD;;;6BAcQ;AAAA,oBAaH,KAAK/E,KAbF;AAAA,UAELuD,MAFK,WAELA,MAFK;AAAA,UAGLyB,eAHK,WAGLA,eAHK;AAAA,UAILC,eAJK,WAILA,eAJK;AAAA,UAKL9E,QALK,WAKLA,QALK;AAAA,UAML+B,QANK,WAMLA,QANK;AAAA,UAOLgD,iBAPK,WAOLA,iBAPK;AAAA,UAQLR,UARK,WAQLA,UARK;AAAA,UASLrB,QATK,WASLA,QATK;AAAA,UAUL8B,IAVK,WAULA,IAVK;AAAA,UAWLC,eAXK,WAWLA,eAXK;AAAA,UAYFC,IAZE;;AAAA,UAgBLC,WAhBK,GAuBHD,IAvBG,CAgBLC,WAhBK;AAAA,UAiBLC,WAjBK,GAuBHF,IAvBG,CAiBLE,WAjBK;AAAA,4BAuBHF,IAvBG,CAkBLG,SAlBK;AAAA,UAkBLA,SAlBK,mCAkBO,EAlBP;AAAA,UAmBLC,aAnBK,GAuBHJ,IAvBG,CAmBLI,aAnBK;AAAA,UAoBLC,WApBK,GAuBHL,IAvBG,CAoBLK,WApBK;AAAA,UAqBLC,KArBK,GAuBHN,IAvBG,CAqBLM,KArBK;AAAA,UAsBF3F,KAtBE,4BAuBHqF,IAvBG;;AAAA,mBAyBgC,KAAK9E,KAzBrC;AAAA,UAyBCH,YAzBD,UAyBCA,YAzBD;AAAA,UAyBekB,YAzBf,UAyBeA,YAzBf;;AA0BP,UAAMsE,aAAatE,aAAa4B,MAAhC;AACA,UAAM2C,oBAAoBxC,YAAYuC,cAAc,CAApD;AACA,UAAMvF,eAAeuF,aAAa,CAAb,IAAkB,6BAAiBtE,YAAjB,EAA+B,KAAKtB,KAAL,CAAWuD,MAA1C,CAAvC;AACA,UAAMjD,eAAesF,aAAa,CAAb,KAAmB,CAACvF,YAAD,IAAiB,CAACwF,iBAArC,CAArB;AACA,UAAMC,WACJ,CAACN,SAAD,IAAc,CAACG,KAAf,IAAwB,CAACJ,WAAzB,IAAwC,CAACD,WAAzC,IAAwD,CAACI,WAAzD,IAAwE,CAACD,aAD3E;;AAGA,UAAIrF,gBAAgB6E,eAApB,EAAqC;AACnCO,qBAAa,MAAMP,eAAnB;AACD;AACD,UAAI5E,gBAAgB2E,eAApB,EAAqC;AACnCQ,qBAAa,MAAMR,eAAnB;AACD;AACD,UAAI1E,gBAAgB8E,eAApB,EAAqC;AACnCI,qBAAa,MAAMJ,eAAnB;AACD;AACD,UAAIlD,YAAYgD,iBAAhB,EAAmC;AACjCM,qBAAa,MAAMN,iBAAnB;AACD;;AAED,UAAIY,QAAJ,EAAc;AACZH,gBAAQ,iBAAOI,OAAf;AACAR,sBAAc,iBAAOS,MAArB;AACAV,sBAAcK,MAAMK,MAApB;AACAN,sBAAc,iBAAOO,QAArB;AACAR,wBAAgB,iBAAOvD,QAAvB;AACD;;AAED,UAAIgE,4BAAoBP,KAApB,CAAJ;AACA,UAAIJ,eAAenF,YAAnB,EAAiC;AAC/B8F,oCACKP,KADL,EAEKJ,WAFL;AAID;AACD,UAAID,eAAejF,YAAnB,EAAiC;AAC/B6F,oCACKA,YADL,EAEKZ,WAFL;AAID;AACD,UAAII,eAAepF,YAAnB,EAAiC;AAC/B4F,oCACKA,YADL,EAEKR,WAFL;AAID;AACD,UAAID,iBAAiBvD,QAArB,EAA+B;AAC7BgE,oCACKP,KADL,EAEKF,aAFL;AAID;;AAED,UAAMU,kBAAkB;AACtB5C,sBADsB;AAEtBrB,0BAFsB;AAGtBkE,cAAM,MAHgB;AAItBT,eAAO,EAAEU,SAAS,MAAX,EAJe;AAKtBhD,kBAAU,0BAAmBA,QALP;AAMtBwB,aAAK,KAAKzD,OANY;AAOtBkF,kBAAU,KAAKtF,MAPO;AAQtBuF,sBAAc;AARQ,OAAxB;;AAWA,UAAIpB,QAAQA,KAAKjC,MAAjB,EAAyB;AACvBiD,wBAAgBhB,IAAhB,GAAuBA,IAAvB;AACD;;AAED;;AA/FO,UAiGL5D,aAjGK,GA2GHvB,KA3GG,CAiGLuB,aAjGK;AAAA,UAkGLE,qBAlGK,GA2GHzB,KA3GG,CAkGLyB,qBAlGK;AAAA,UAmGL6B,cAnGK,GA2GHtD,KA3GG,CAmGLsD,cAnGK;AAAA,UAoGLiB,YApGK,GA2GHvE,KA3GG,CAoGLuE,YApGK;AAAA,UAqGLpB,cArGK,GA2GHnD,KA3GG,CAqGLmD,cArGK;AAAA,UAsGLC,cAtGK,GA2GHpD,KA3GG,CAsGLoD,cAtGK;AAAA,UAuGLnC,kBAvGK,GA2GHjB,KA3GG,CAuGLiB,kBAvGK;AAAA,UAwGLmD,OAxGK,GA2GHpE,KA3GG,CAwGLoE,OAxGK;AAAA,UAyGLC,OAzGK,GA2GHrE,KA3GG,CAyGLqE,OAzGK;AAAA,UA0GFmC,QA1GE,4BA2GHxG,KA3GG;;AA6GP,aACE;AAAA;AAAA;AACE,qBAAWwF,SADb;AAEE,iBAAOU;AAFT,WAGMM,QAHN,CAGe,6EAHf;AAIE,mBAAS,KAAKhG,eAAL,CAAqB,KAAKE,OAA1B,CAJX;AAKE,uBAAa,KAAKF,eAAL,CAAqB,KAAKO,WAA1B,CALf;AAME,uBAAa,KAAKP,eAAL,CAAqB,KAAKI,WAA1B,CANf;AAOE,sBAAY,KAAKJ,eAAL,CAAqB,KAAKM,UAA1B,CAPd;AAQE,uBAAa,KAAKN,eAAL,CAAqB,KAAKK,WAA1B,CARf;AASE,kBAAQ,KAAKL,eAAL,CAAqB,KAAKQ,MAA1B,CATV;AAUE,eAAK,KAAKG,MAVZ;AAWE,2BAAee;AAXjB;AAaG,aAAKhC,cAAL,CAAoBC,QAApB,EAA8BC,YAA9B,EAA4CC,YAA5C,EAA0DC,YAA1D,CAbH;AAcE,4DACMoE,UADN,CACiB,4EADjB,EAEMyB,eAFN;AAdF,OADF;AAqBD;;;;EAhZoB,gBAAMM,S;;kBAmZd1G,Q;;;AAEfA,SAAS2G,SAAT,GAAqB;AACnB;;;;;;;AAOAnD,UAAQ,oBAAUoD,MARC;;AAUnB;;;AAGAxG,YAAU,oBAAUyG,SAAV,CAAoB,CAAC,oBAAUxE,IAAX,EAAiB,oBAAUyE,IAA3B,CAApB,CAbS;;AAenB;;;AAGAtC,gBAAc,oBAAUuC,IAlBL;;AAoBnB;;;AAGA5E,YAAU,oBAAU4E,IAvBD;;AAyBnB;;;AAGAxD,kBAAgB,oBAAUwD,IA5BP;;AA8BnB;;;AAGArF,yBAAuB,oBAAUqF,IAjCd;;AAmCnB;;;AAGApC,cAAY,oBAAUqC,MAtCH;;AAwCnB;;;AAGA1D,YAAU,oBAAUyD,IA3CD;;AA6CnB;;;AAGA3B,QAAM,oBAAUwB,MAhDG;;AAkDnB;;;AAGAvC,WAAS,oBAAU4C,MArDA;;AAuDnB;;;AAGA3C,WAAS,oBAAU2C,MA1DA;;AA4DnB;;;AAGAxB,aAAW,oBAAUmB,MA/DF;;AAiEnB;;;AAGA1B,mBAAiB,oBAAU0B,MApER;;AAsEnB;;;AAGA3B,mBAAiB,oBAAU2B,MAzER;;AA2EnB;;;AAGAvB,mBAAiB,oBAAUuB,MA9ER;;AAgFnB;;;AAGAzB,qBAAmB,oBAAUyB,MAnFV;;AAqFnB;;;AAGAhB,SAAO,oBAAUoB,MAxFE;;AA0FnB;;;AAGAxB,eAAa,oBAAUwB,MA7FJ;;AA+FnB;;;AAGAzB,eAAa,oBAAUyB,MAlGJ;;AAoGnB;;;AAGArB,eAAa,oBAAUqB,MAvGJ;;AAyGnB;;;AAGAtB,iBAAe,oBAAUsB,MA5GN;;AA8GnB;;;;AAIArG,WAAS,oBAAUmG,IAlHA;;AAoHnB;;;AAGA7F,UAAQ,oBAAU6F,IAvHC;;AAyHnB;;;AAGA1D,kBAAgB,oBAAU0D,IA5HP;;AA8HnB;;;AAGAzD,kBAAgB,oBAAUyD,IAjIP;;AAmInB;;;AAGA9F,eAAa,oBAAU8F,IAtIJ;;AAwInB;;;AAGAjG,eAAa,oBAAUiG,IA3IJ;;AA6InB;;;AAGA/F,cAAY,oBAAU+F,IAhJH;;AAkJnB;;;AAGAhG,eAAa,oBAAUgG,IArJJ;;AAuJnB;;;AAGA5F,sBAAoB,oBAAU4F;AA1JX,CAArB;;AA6JA9G,SAASkH,YAAT,GAAwB;AACtBxF,yBAAuB,IADD;AAEtBS,YAAU,KAFY;AAGtBoB,kBAAgB,KAHM;AAItBiB,gBAAc,KAJQ;AAKtBlB,YAAU,IALY;AAMtBe,WAAS8C,QANa;AAOtB7C,WAAS;AAPa,CAAxB;;;;;;;;AChkBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;ACvLtC,+C;;;;;;ACAA,+C;;;;;;;;;;;;;QCOgB8C,oB,GAAAA,oB;QAoBAC,Y,GAAAA,Y;QAIAC,a,GAAAA,a;QAIAC,gB,GAAAA,gB;QAKAC,kB,GAAAA,kB;;AAxChB;;;;;;AAEO,IAAMC,4CACX,OAAO7F,QAAP,KAAoB,WAApB,IAAmCA,QAAnC,IAA+CA,SAAS8F,aAAxD,GACI,cAAc9F,SAAS8F,aAAT,CAAuB,OAAvB,CADlB,GAEI,IAHC;;AAKA,SAASN,oBAAT,CAA8BO,KAA9B,EAAqC;AAC1C,MAAIC,wBAAwB,EAA5B;AACA,MAAID,MAAM7E,YAAV,EAAwB;AACtB,QAAM+E,KAAKF,MAAM7E,YAAjB;AACA,QAAI+E,GAAGhD,KAAH,IAAYgD,GAAGhD,KAAH,CAAS1B,MAAzB,EAAiC;AAC/ByE,8BAAwBC,GAAGhD,KAA3B;AACD,KAFD,MAEO,IAAIgD,GAAGC,KAAH,IAAYD,GAAGC,KAAH,CAAS3E,MAAzB,EAAiC;AACtC;AACA;AACAyE,8BAAwBC,GAAGC,KAA3B;AACD;AACF,GATD,MASO,IAAIH,MAAMpF,MAAN,IAAgBoF,MAAMpF,MAAN,CAAasC,KAAjC,EAAwC;AAC7C+C,4BAAwBD,MAAMpF,MAAN,CAAasC,KAArC;AACD;AACD;AACA,SAAOkD,MAAMC,SAAN,CAAgBC,KAAhB,CAAsBxF,IAAtB,CAA2BmF,qBAA3B,CAAP;AACD;;AAED;AACA;AACO,SAASP,YAAT,CAAsB1D,IAAtB,EAA4BH,MAA5B,EAAoC;AACzC,SAAOG,KAAK0C,IAAL,KAAc,wBAAd,IAA0C,0BAAQ1C,IAAR,EAAcH,MAAd,CAAjD;AACD;;AAEM,SAAS8D,aAAT,CAAuB3D,IAAvB,EAA6BU,OAA7B,EAAsCC,OAAtC,EAA+C;AACpD,SAAOX,KAAKuE,IAAL,IAAa7D,OAAb,IAAwBV,KAAKuE,IAAL,IAAa5D,OAA5C;AACD;;AAEM,SAASiD,gBAAT,CAA0B1C,KAA1B,EAAiCrB,MAAjC,EAAyC;AAC9C,SAAOqB,MAAMsD,KAAN,CAAY;AAAA,WAAQd,aAAa1D,IAAb,EAAmBH,MAAnB,CAAR;AAAA,GAAZ,CAAP;AACD;;AAED;AACO,SAASgE,kBAAT,CAA4BpF,GAA5B,EAAiC;AACtCA,MAAII,cAAJ;AACD,C;;;;;;AC1CD,2BAA2B,cAAc,4BAA4B,YAAY,UAAU,iBAAiB,gEAAgE,SAAS,+BAA+B,kBAAkB,aAAa,qDAAqD,SAAS,iBAAiB,wFAAwF,OAAO,qBAAqB,eAAe,kHAAkH,GAAG,GAAG,iCAAiC,SAAS,wBAAwB,eAAe,iBAAiB,iBAAiB,8BAA8B,eAAe,8IAA8I,8BAA8B,iBAAiB,+DAA+D,kBAAkB,6BAA6B,mBAAmB,sDAAsD,WAAW,yBAAyB,EAAE,SAAS,kKAAkK,UAAU,2DAA2D,iBAAiB,mBAAmB,gCAAgC,6BAA6B,iBAAiB,iBAAiB,eAAe,aAAa,WAAW,mDAAmD,gNAAgN,eAAe,wBAAwB,sBAAsB,mEAAmE,iBAAiB,iCAAiC,sBAAsB,qDAAqD,iBAAiB,gCAAgC,iBAAiB,qCAAqC,eAAe,sBAAsB,iEAAiE,UAAU,eAAe,QAAQ,UAAU,sBAAsB,8BAA8B,iBAAiB,YAAY,0BAA0B,4BAA4B,UAAU,0BAA0B,oBAAoB,4BAA4B,sBAAsB,8BAA8B,wBAAwB,kBAAkB,8BAA8B,eAAe,sBAAsB,yDAAyD,UAAU,iBAAiB,sBAAsB,UAAU,IAAI,YAAY,SAAS,IAAI,wCAAwC,WAAW,UAAU,eAAe,sBAAsB,IAAI,YAAY,SAAS,WAAW,eAAe,sBAAsB,wDAAwD,iBAAiB,oCAAoC,sBAAsB,MAAM,qDAAqD,eAAe,wBAAwB,OAAO,gEAAgE,iBAAiB,6EAA6E,+BAA+B,iBAAiB,8BAA8B,4HAA4H,kCAAkC,qDAAqD,EAAE,iBAAiB,kDAAkD,EAAE,sBAAsB,qBAAqB,GAAG,iBAAiB,oBAAoB,0BAA0B,8DAA8D,qBAAqB,iBAAiB,4BAA4B,kCAAkC,MAAM,eAAe,UAAU,IAAI,EAAE,eAAe,6BAA6B,sBAAsB,mCAAmC,iBAAiB,uBAAuB,sBAAsB,uCAAuC,iBAAiB,aAAa,gDAAgD,6BAA6B,qBAAqB,iHAAiH,kDAAkD,EAAE,iBAAiB,0CAA0C,iBAAiB,qCAAqC,wEAAwE,GAAG,kOAAkO,G;;;;;;;;;;;;kBCAr2J;AACb0D,YAAU;AACRkC,iBAAa,OADL;AAERC,iBAAa,MAFL;AAGRC,qBAAiB;AAHT,GADG;AAMbnG,YAAU;AACRoG,aAAS;AADD,GANG;AASbtC,UAAQ;AACNmC,iBAAa,OADP;AAENC,iBAAa,MAFP;AAGNC,qBAAiB;AAHX,GATK;AAcbtC,WAAS;AACPwC,WAAO,GADA;AAEPC,YAAQ,GAFD;AAGPC,iBAAa,CAHN;AAIPL,iBAAa,MAJN;AAKPD,iBAAa,QALN;AAMPO,kBAAc;AANP;AAdI,C","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"prop-types\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"prop-types\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Dropzone\"] = factory(require(\"react\"), require(\"prop-types\"));\n\telse\n\t\troot[\"Dropzone\"] = factory(root[\"react\"], root[\"prop-types\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 5c1f85df70828faca129","/* eslint prefer-template: 0 */\n\nimport React from 'react'\nimport PropTypes from 'prop-types'\nimport {\n supportMultiple,\n fileAccepted,\n allFilesAccepted,\n fileMatchSize,\n onDocumentDragOver,\n getDataTransferItems\n} from './utils'\nimport styles from './utils/styles'\n\nclass Dropzone extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.composeHandlers = this.composeHandlers.bind(this)\n this.onClick = this.onClick.bind(this)\n this.onDocumentDrop = this.onDocumentDrop.bind(this)\n this.onDragEnter = this.onDragEnter.bind(this)\n this.onDragLeave = this.onDragLeave.bind(this)\n this.onDragOver = this.onDragOver.bind(this)\n this.onDragStart = this.onDragStart.bind(this)\n this.onDrop = this.onDrop.bind(this)\n this.onFileDialogCancel = this.onFileDialogCancel.bind(this)\n this.onInputElementClick = this.onInputElementClick.bind(this)\n\n this.setRef = this.setRef.bind(this)\n this.setRefs = this.setRefs.bind(this)\n\n this.isFileDialogActive = false\n\n this.state = {\n draggedFiles: [],\n acceptedFiles: [],\n rejectedFiles: []\n }\n }\n\n componentDidMount() {\n const { preventDropOnDocument } = this.props\n this.dragTargets = []\n\n if (preventDropOnDocument) {\n document.addEventListener('dragover', onDocumentDragOver, false)\n document.addEventListener('drop', this.onDocumentDrop, false)\n }\n this.fileInputEl.addEventListener('click', this.onInputElementClick, false)\n // Tried implementing addEventListener, but didn't work out\n document.body.onfocus = this.onFileDialogCancel\n }\n\n componentWillUnmount() {\n const { preventDropOnDocument } = this.props\n if (preventDropOnDocument) {\n document.removeEventListener('dragover', onDocumentDragOver)\n document.removeEventListener('drop', this.onDocumentDrop)\n }\n if (this.fileInputEl != null) {\n this.fileInputEl.removeEventListener('click', this.onInputElementClick, false)\n }\n // Can be replaced with removeEventListener, if addEventListener works\n if (document != null) {\n document.body.onfocus = null\n }\n }\n\n composeHandlers(handler) {\n if (this.props.disabled) {\n return null\n }\n\n return handler\n }\n\n onDocumentDrop(evt) {\n if (this.node && this.node.contains(evt.target)) {\n // if we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return\n }\n evt.preventDefault()\n this.dragTargets = []\n }\n\n onDragStart(evt) {\n if (this.props.onDragStart) {\n this.props.onDragStart.call(this, evt)\n }\n }\n\n onDragEnter(evt) {\n evt.preventDefault()\n\n // Count the dropzone and any children that are entered.\n if (this.dragTargets.indexOf(evt.target) === -1) {\n this.dragTargets.push(evt.target)\n }\n\n this.setState({\n isDragActive: true, // Do not rely on files for the drag state. It doesn't work in Safari.\n draggedFiles: getDataTransferItems(evt)\n })\n\n if (this.props.onDragEnter) {\n this.props.onDragEnter.call(this, evt)\n }\n }\n\n onDragOver(evt) {\n // eslint-disable-line class-methods-use-this\n evt.preventDefault()\n evt.stopPropagation()\n try {\n // The file dialog on Chrome allows users to drag files from the dialog onto\n // the dropzone, causing the browser the crash when the file dialog is closed.\n // A drop effect of 'none' prevents the file from being dropped\n evt.dataTransfer.dropEffect = this.isFileDialogActive ? 'none' : 'copy' // eslint-disable-line no-param-reassign\n } catch (err) {\n // continue regardless of error\n }\n\n if (this.props.onDragOver) {\n this.props.onDragOver.call(this, evt)\n }\n return false\n }\n\n onDragLeave(evt) {\n evt.preventDefault()\n\n // Only deactivate once the dropzone and all children have been left.\n this.dragTargets = this.dragTargets.filter(el => el !== evt.target && this.node.contains(el))\n if (this.dragTargets.length > 0) {\n return\n }\n\n // Clear dragging files state\n this.setState({\n isDragActive: false,\n draggedFiles: []\n })\n\n if (this.props.onDragLeave) {\n this.props.onDragLeave.call(this, evt)\n }\n }\n\n onDrop(evt) {\n const { onDrop, onDropAccepted, onDropRejected, multiple, disablePreview, accept } = this.props\n const fileList = getDataTransferItems(evt)\n const acceptedFiles = []\n const rejectedFiles = []\n\n // Stop default browser behavior\n evt.preventDefault()\n\n // Reset the counter along with the drag on a drop.\n this.dragTargets = []\n this.isFileDialogActive = false\n\n fileList.forEach(file => {\n if (!disablePreview) {\n try {\n file.preview = window.URL.createObjectURL(file) // eslint-disable-line no-param-reassign\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Failed to generate preview for file', file, err) // eslint-disable-line no-console\n }\n }\n }\n\n if (\n fileAccepted(file, accept) &&\n fileMatchSize(file, this.props.maxSize, this.props.minSize)\n ) {\n acceptedFiles.push(file)\n } else {\n rejectedFiles.push(file)\n }\n })\n\n if (!multiple) {\n // if not in multi mode add any extra accepted files to rejected.\n // This will allow end users to easily ignore a multi file drop in \"single\" mode.\n rejectedFiles.push(...acceptedFiles.splice(1))\n }\n\n if (onDrop) {\n onDrop.call(this, acceptedFiles, rejectedFiles, evt)\n }\n\n if (rejectedFiles.length > 0 && onDropRejected) {\n onDropRejected.call(this, rejectedFiles, evt)\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted.call(this, acceptedFiles, evt)\n }\n\n // Clear files value\n this.draggedFiles = null\n\n // Reset drag state\n this.setState({\n isDragActive: false,\n draggedFiles: [],\n acceptedFiles,\n rejectedFiles\n })\n }\n\n onClick(evt) {\n const { onClick, disableClick } = this.props\n if (!disableClick) {\n evt.stopPropagation()\n\n if (onClick) {\n onClick.call(this, evt)\n }\n\n // in IE11/Edge the file-browser dialog is blocking, ensure this is behind setTimeout\n // this is so react can handle state changes in the onClick prop above above\n // see: https://github.com/react-dropzone/react-dropzone/issues/450\n setTimeout(this.open.bind(this), 0)\n }\n }\n\n onInputElementClick(evt) {\n evt.stopPropagation()\n if (this.props.inputProps && this.props.inputProps.onClick) {\n this.props.inputProps.onClick()\n }\n }\n\n onFileDialogCancel() {\n // timeout will not recognize context of this method\n const { onFileDialogCancel } = this.props\n const { fileInputEl } = this\n let { isFileDialogActive } = this\n // execute the timeout only if the onFileDialogCancel is defined and FileDialog\n // is opened in the browser\n if (onFileDialogCancel && isFileDialogActive) {\n setTimeout(() => {\n // Returns an object as FileList\n const FileList = fileInputEl.files\n if (!FileList.length) {\n isFileDialogActive = false\n onFileDialogCancel()\n }\n }, 300)\n }\n }\n\n setRef(ref) {\n this.node = ref\n }\n\n setRefs(ref) {\n this.fileInputEl = ref\n }\n /**\n * Open system file upload dialog.\n *\n * @public\n */\n open() {\n this.isFileDialogActive = true\n this.fileInputEl.value = null\n this.fileInputEl.click()\n }\n\n renderChildren = (children, isDragActive, isDragAccept, isDragReject) => {\n if (typeof children === 'function') {\n return children({\n ...this.state,\n isDragActive,\n isDragAccept,\n isDragReject\n })\n }\n return children\n }\n\n render() {\n const {\n accept,\n acceptClassName,\n activeClassName,\n children,\n disabled,\n disabledClassName,\n inputProps,\n multiple,\n name,\n rejectClassName,\n ...rest\n } = this.props\n\n let {\n acceptStyle,\n activeStyle,\n className = '',\n disabledStyle,\n rejectStyle,\n style,\n ...props // eslint-disable-line prefer-const\n } = rest\n\n const { isDragActive, draggedFiles } = this.state\n const filesCount = draggedFiles.length\n const isMultipleAllowed = multiple || filesCount <= 1\n const isDragAccept = filesCount > 0 && allFilesAccepted(draggedFiles, this.props.accept)\n const isDragReject = filesCount > 0 && (!isDragAccept || !isMultipleAllowed)\n const noStyles =\n !className && !style && !activeStyle && !acceptStyle && !rejectStyle && !disabledStyle\n\n if (isDragActive && activeClassName) {\n className += ' ' + activeClassName\n }\n if (isDragAccept && acceptClassName) {\n className += ' ' + acceptClassName\n }\n if (isDragReject && rejectClassName) {\n className += ' ' + rejectClassName\n }\n if (disabled && disabledClassName) {\n className += ' ' + disabledClassName\n }\n\n if (noStyles) {\n style = styles.default\n activeStyle = styles.active\n acceptStyle = style.active\n rejectStyle = styles.rejected\n disabledStyle = styles.disabled\n }\n\n let appliedStyle = { ...style }\n if (activeStyle && isDragActive) {\n appliedStyle = {\n ...style,\n ...activeStyle\n }\n }\n if (acceptStyle && isDragAccept) {\n appliedStyle = {\n ...appliedStyle,\n ...acceptStyle\n }\n }\n if (rejectStyle && isDragReject) {\n appliedStyle = {\n ...appliedStyle,\n ...rejectStyle\n }\n }\n if (disabledStyle && disabled) {\n appliedStyle = {\n ...style,\n ...disabledStyle\n }\n }\n\n const inputAttributes = {\n accept,\n disabled,\n type: 'file',\n style: { display: 'none' },\n multiple: supportMultiple && multiple,\n ref: this.setRefs,\n onChange: this.onDrop,\n autoComplete: 'off'\n }\n\n if (name && name.length) {\n inputAttributes.name = name\n }\n\n // Destructure custom props away from props used for the div element\n const {\n acceptedFiles,\n preventDropOnDocument,\n disablePreview,\n disableClick,\n onDropAccepted,\n onDropRejected,\n onFileDialogCancel,\n maxSize,\n minSize,\n ...divProps\n } = props\n\n return (\n \n {this.renderChildren(children, isDragActive, isDragAccept, isDragReject)}\n \n \n )\n }\n}\n\nexport default Dropzone\n\nDropzone.propTypes = {\n /**\n * Allow specific types of files. See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n */\n accept: PropTypes.string,\n\n /**\n * Contents of the dropzone\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n\n /**\n * Disallow clicking on the dropzone container to open file dialog\n */\n disableClick: PropTypes.bool,\n\n /**\n * Enable/disable the dropzone entirely\n */\n disabled: PropTypes.bool,\n\n /**\n * Enable/disable preview generation\n */\n disablePreview: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * Pass additional attributes to the `` tag\n */\n inputProps: PropTypes.object,\n\n /**\n * Allow dropping multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * `name` attribute for the input tag\n */\n name: PropTypes.string,\n\n /**\n * Maximum file size\n */\n maxSize: PropTypes.number,\n\n /**\n * Minimum file size\n */\n minSize: PropTypes.number,\n\n /**\n * className\n */\n className: PropTypes.string,\n\n /**\n * className for active state\n */\n activeClassName: PropTypes.string,\n\n /**\n * className for accepted state\n */\n acceptClassName: PropTypes.string,\n\n /**\n * className for rejected state\n */\n rejectClassName: PropTypes.string,\n\n /**\n * className for disabled state\n */\n disabledClassName: PropTypes.string,\n\n /**\n * CSS styles to apply\n */\n style: PropTypes.object,\n\n /**\n * CSS styles to apply when drag is active\n */\n activeStyle: PropTypes.object,\n\n /**\n * CSS styles to apply when drop will be accepted\n */\n acceptStyle: PropTypes.object,\n\n /**\n * CSS styles to apply when drop will be rejected\n */\n rejectStyle: PropTypes.object,\n\n /**\n * CSS styles to apply when dropzone is disabled\n */\n disabledStyle: PropTypes.object,\n\n /**\n * onClick callback\n * @param {Event} event\n */\n onClick: PropTypes.func,\n\n /**\n * onDrop callback\n */\n onDrop: PropTypes.func,\n\n /**\n * onDropAccepted callback\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * onDropRejected callback\n */\n onDropRejected: PropTypes.func,\n\n /**\n * onDragStart callback\n */\n onDragStart: PropTypes.func,\n\n /**\n * onDragEnter callback\n */\n onDragEnter: PropTypes.func,\n\n /**\n * onDragOver callback\n */\n onDragOver: PropTypes.func,\n\n /**\n * onDragLeave callback\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Provide a callback on clicking the cancel button of the file dialog\n */\n onFileDialogCancel: PropTypes.func\n}\n\nDropzone.defaultProps = {\n preventDropOnDocument: true,\n disabled: false,\n disablePreview: false,\n disableClick: false,\n multiple: true,\n maxSize: Infinity,\n minSize: 0\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/process/browser.js\n// module id = 1\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 2\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"prop-types\"\n// module id = 3\n// module chunks = 0","import accepts from 'attr-accept'\n\nexport const supportMultiple =\n typeof document !== 'undefined' && document && document.createElement\n ? 'multiple' in document.createElement('input')\n : true\n\nexport function getDataTransferItems(event) {\n let dataTransferItemsList = []\n if (event.dataTransfer) {\n const dt = event.dataTransfer\n if (dt.files && dt.files.length) {\n dataTransferItemsList = dt.files\n } else if (dt.items && dt.items.length) {\n // During the drag even the dataTransfer.files is null\n // but Chrome implements some drag store, which is accesible via dataTransfer.items\n dataTransferItemsList = dt.items\n }\n } else if (event.target && event.target.files) {\n dataTransferItemsList = event.target.files\n }\n // Convert from DataTransferItemsList to the native Array\n return Array.prototype.slice.call(dataTransferItemsList)\n}\n\n// Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n// that MIME type will always be accepted\nexport function fileAccepted(file, accept) {\n return file.type === 'application/x-moz-file' || accepts(file, accept)\n}\n\nexport function fileMatchSize(file, maxSize, minSize) {\n return file.size <= maxSize && file.size >= minSize\n}\n\nexport function allFilesAccepted(files, accept) {\n return files.every(file => fileAccepted(file, accept))\n}\n\n// allow the entire document to be a drag target\nexport function onDocumentDragOver(evt) {\n evt.preventDefault()\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/index.js","module.exports=function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p=\"\",n(0)}([function(t,n,r){\"use strict\";n.__esModule=!0,r(8),r(9),n[\"default\"]=function(t,n){if(t&&n){var r=function(){var r=Array.isArray(n)?n:n.split(\",\"),e=t.name||\"\",o=t.type||\"\",i=o.replace(/\\/.*$/,\"\");return{v:r.some(function(t){var n=t.trim();return\".\"===n.charAt(0)?e.toLowerCase().endsWith(n.toLowerCase()):/\\/\\*$/.test(n)?i===n.replace(/\\/.*$/,\"\"):o===n})}}();if(\"object\"==typeof r)return r.v}return!0},t.exports=n[\"default\"]},function(t,n){var r=t.exports={version:\"1.2.2\"};\"number\"==typeof __e&&(__e=r)},function(t,n){var r=t.exports=\"undefined\"!=typeof window&&window.Math==Math?window:\"undefined\"!=typeof self&&self.Math==Math?self:Function(\"return this\")();\"number\"==typeof __g&&(__g=r)},function(t,n,r){var e=r(2),o=r(1),i=r(4),u=r(19),c=\"prototype\",f=function(t,n){return function(){return t.apply(n,arguments)}},s=function(t,n,r){var a,p,l,y,d=t&s.G,h=t&s.P,v=d?e:t&s.S?e[n]||(e[n]={}):(e[n]||{})[c],x=d?o:o[n]||(o[n]={});d&&(r=n);for(a in r)p=!(t&s.F)&&v&&a in v,l=(p?v:r)[a],y=t&s.B&&p?f(l,e):h&&\"function\"==typeof l?f(Function.call,l):l,v&&!p&&u(v,a,l),x[a]!=l&&i(x,a,y),h&&((x[c]||(x[c]={}))[a]=l)};e.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,n,r){var e=r(5),o=r(18);t.exports=r(22)?function(t,n,r){return e.setDesc(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return\"Symbol(\".concat(void 0===t?\"\":t,\")_\",(++r+e).toString(36))}},function(t,n,r){var e=r(20)(\"wks\"),o=r(2).Symbol;t.exports=function(t){return e[t]||(e[t]=o&&o[t]||(o||r(6))(\"Symbol.\"+t))}},function(t,n,r){r(26),t.exports=r(1).Array.some},function(t,n,r){r(25),t.exports=r(1).String.endsWith},function(t,n){t.exports=function(t){if(\"function\"!=typeof t)throw TypeError(t+\" is not a function!\");return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(10);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError(\"Can't call method on \"+t);return t}},function(t,n,r){t.exports=function(t){var n=/./;try{\"/./\"[t](n)}catch(e){try{return n[r(7)(\"match\")]=!1,!\"/./\"[t](n)}catch(o){}}return!0}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return\"object\"==typeof t?null!==t:\"function\"==typeof t}},function(t,n,r){var e=r(16),o=r(11),i=r(7)(\"match\");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:\"RegExp\"==o(t))}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),o=r(4),i=r(6)(\"src\"),u=\"toString\",c=Function[u],f=(\"\"+c).split(u);r(1).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,r,u){\"function\"==typeof r&&(o(r,i,t[n]?\"\"+t[n]:f.join(String(n))),\"name\"in r||(r.name=n)),t===e?t[n]=r:(u||delete t[n],o(t,n,r))})(Function.prototype,u,function(){return\"function\"==typeof this&&this[i]||c.call(this)})},function(t,n,r){var e=r(2),o=\"__core-js_shared__\",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e=r(17),o=r(13);t.exports=function(t,n,r){if(e(n))throw TypeError(\"String#\"+r+\" doesn't accept regex!\");return String(o(t))}},function(t,n,r){t.exports=!r(15)(function(){return 7!=Object.defineProperty({},\"a\",{get:function(){return 7}}).a})},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(23),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){\"use strict\";var e=r(3),o=r(24),i=r(21),u=\"endsWith\",c=\"\"[u];e(e.P+e.F*r(14)(u),\"String\",{endsWith:function(t){var n=i(this,t,u),r=arguments,e=r.length>1?r[1]:void 0,f=o(n.length),s=void 0===e?f:Math.min(o(e),f),a=String(t);return c?c.call(n,a,s):n.slice(s-a.length,s)===a}})},function(t,n,r){var e=r(5),o=r(3),i=r(1).Array||Array,u={},c=function(t,n){e.each.call(t.split(\",\"),function(t){void 0==n&&t in i?u[t]=i[t]:t in[]&&(u[t]=r(12)(Function.call,[][t],n))})};c(\"pop,reverse,shift,keys,values,entries\",1),c(\"indexOf,every,some,forEach,map,filter,find,findIndex,includes\",3),c(\"join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill\"),o(o.S,\"Array\",u)}]);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/attr-accept/dist/index.js\n// module id = 5\n// module chunks = 0","export default {\n rejected: {\n borderStyle: 'solid',\n borderColor: '#c66',\n backgroundColor: '#eee'\n },\n disabled: {\n opacity: 0.5\n },\n active: {\n borderStyle: 'solid',\n borderColor: '#6c6',\n backgroundColor: '#eee'\n },\n default: {\n width: 200,\n height: 200,\n borderWidth: 2,\n borderColor: '#666',\n borderStyle: 'dashed',\n borderRadius: 5\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/styles.js"],"sourceRoot":""} \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/examples/.eslintrc b/goTorrentWebUI/node_modules/react-dropzone/examples/.eslintrc new file mode 100644 index 00000000..99cb1fb7 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/examples/.eslintrc @@ -0,0 +1,8 @@ +{ + "globals": { + "Dropzone": true + }, + "rules": { + "react/jsx-no-bind": "off" + } +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/examples/Accept/Readme.md b/goTorrentWebUI/node_modules/react-dropzone/examples/Accept/Readme.md new file mode 100644 index 00000000..d8c22297 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/examples/Accept/Readme.md @@ -0,0 +1,99 @@ +By providing `accept` prop you can make Dropzone to accept specific file types and reject the others. + +The value must be a comma-separated list of unique content type specifiers: +* A file extension starting with the STOP character (U+002E). (e.g. .jpg, .png, .doc). +* A valid MIME type with no extensions. +* audio/* representing sound files. +* video/* representing video files. +* image/* representing image files. + +For more information see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input + +``` +class Accept extends React.Component { + constructor() { + super() + this.state = { + accepted: [], + rejected: [] + } + } + + render() { + return ( +
+
+ { this.setState({ accepted, rejected }); }} + > +

Try dropping some files here, or click to select files to upload.

+

Only *.jpeg and *.png images will be accepted

+
+
+ +
+ ); + } +} + + +``` + +### Browser limitations + +Because of HTML5 File API differences across different browsers during the drag, Dropzone will only display `rejected` styles in Chrome (and Chromium based browser). It isn't working in Safari nor IE. + +Also, at this moment it's not possible to read file names (and thus, file extensions) during the drag operation. For that reason, if you want to react on different file types _during_ the drag operation, _you have to use_ mime types and not extensions! For example, the following example won't work even in Chrome: + +``` + + {({ isDragActive, isDragReject }) => { + if (isDragActive) { + return "All files will be accepted"; + } + if (isDragReject) { + return "Some files will be rejected"; + } + return "Dropping some files here..."; + }} + +``` + +but this one will: + +``` + + {({ isDragActive, isDragReject }) => { + if (isDragActive) { + return "All files will be accepted"; + } + if (isDragReject) { + return "Some files will be rejected"; + } + return "Dropping some files here..."; + }} + +``` + +### Notes + +Mime type determination is not reliable accross platforms. CSV files, for example, are reported as text/plain under macOS but as application/vnd.ms-excel under Windows. In some cases there might not be a mime type set at all. + diff --git a/goTorrentWebUI/node_modules/react-dropzone/examples/Basic/Readme.md b/goTorrentWebUI/node_modules/react-dropzone/examples/Basic/Readme.md new file mode 100644 index 00000000..b6eff57c --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/examples/Basic/Readme.md @@ -0,0 +1,80 @@ +Dropzone with default properties and displays list of the dropped files. + +``` +class Basic extends React.Component { + constructor() { + super() + this.state = { files: [] } + } + + onDrop(files) { + this.setState({ + files + }); + } + + render() { + return ( +
+
+ +

Try dropping some files here, or click to select files to upload.

+
+
+ +
+ ); + } +} + + +``` + +Dropzone with `disabled` property: + +``` +class Basic extends React.Component { + constructor() { + super() + this.state = { disabled: true, files: [] } + } + + onDrop(files) { + this.setState({ + files + }); + } + + render() { + return ( +
+ +
+ +

Try dropping some files here, or click to select files to upload.

+
+
+ +
+ ); + } +} + + +``` diff --git a/goTorrentWebUI/node_modules/react-dropzone/examples/File Dialog/Readme.md b/goTorrentWebUI/node_modules/react-dropzone/examples/File Dialog/Readme.md new file mode 100644 index 00000000..48cd2fab --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/examples/File Dialog/Readme.md @@ -0,0 +1,16 @@ +You can programmatically invoke default OS file prompt. In order to do that you'll have to set the ref on your `Dropzone` instance and call the instance `open` method. + +``` +let dropzoneRef; + +
+ { dropzoneRef = node; }} onDrop={(accepted, rejected) => { alert(accepted) }}> +

Drop files here.

+
+ +
+``` + +The completion handler for the `open` function is also the `onDrop` function. diff --git a/goTorrentWebUI/node_modules/react-dropzone/examples/Fullscreen/Readme.md b/goTorrentWebUI/node_modules/react-dropzone/examples/Fullscreen/Readme.md new file mode 100644 index 00000000..52cc657f --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/examples/Fullscreen/Readme.md @@ -0,0 +1,85 @@ +You can wrap the whole app into the dropzone. This will make the whole app a Dropzone target. + +``` +class FullScreen extends React.Component { + constructor() { + super() + this.state = { + accept: '', + files: [], + dropzoneActive: false + } + } + + onDragEnter() { + this.setState({ + dropzoneActive: true + }); + } + + onDragLeave() { + this.setState({ + dropzoneActive: false + }); + } + + onDrop(files) { + this.setState({ + files, + dropzoneActive: false + }); + } + + applyMimeTypes(event) { + this.setState({ + accept: event.target.value + }); + } + + render() { + const { accept, files, dropzoneActive } = this.state; + const overlayStyle = { + position: 'absolute', + top: 0, + right: 0, + bottom: 0, + left: 0, + padding: '2.5em 0', + background: 'rgba(0,0,0,0.5)', + textAlign: 'center', + color: '#fff' + }; + return ( + + { dropzoneActive &&
Drop files...
} +
+

My awesome app

+ + + +

Dropped files

+
    + { + files.map(f =>
  • {f.name} - {f.size} bytes
  • ) + } +
+ +
+
+ ); + } +} + + +``` diff --git a/goTorrentWebUI/node_modules/react-dropzone/examples/Styling/Readme.md b/goTorrentWebUI/node_modules/react-dropzone/examples/Styling/Readme.md new file mode 100644 index 00000000..8bca8c09 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/examples/Styling/Readme.md @@ -0,0 +1,23 @@ +By default, the Dropzone component picks up some default styling to get you started. You can customize `` by specifying a `style`, `activeStyle` or `rejectStyle` which is applied when a file is dragged over the zone. You can also specify `className`, `activeClassName` or `rejectClassName` if you would rather style using CSS. + +## Updating styles and contents based on user input + +By providing a function that returns the component's children you can not only style Dropzone appropriately but also render appropriate content. + +``` + + {({ isDragActive, isDragReject, acceptedFiles, rejectedFiles }) => { + if (isDragActive) { + return "This file is authorized"; + } + if (isDragReject) { + return "This file is not authorized"; + } + return acceptedFiles.length || rejectedFiles.length + ? `Accepted ${acceptedFiles.length}, rejected ${rejectedFiles.length} files` + : "Try dropping some files."; + }} + +``` diff --git a/goTorrentWebUI/node_modules/react-dropzone/examples/theme.css b/goTorrentWebUI/node_modules/react-dropzone/examples/theme.css new file mode 100644 index 00000000..9b960d4e --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/examples/theme.css @@ -0,0 +1,12 @@ +section { + display: flex; +} + +.dropzone { + flex: 1 auto; + width: 50%; +} + +aside { + width: 50%; +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/.bin/loose-envify b/goTorrentWebUI/node_modules/react-dropzone/node_modules/.bin/loose-envify new file mode 100644 index 00000000..0939216f --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/.bin/loose-envify @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../loose-envify/cli.js" "$@" + ret=$? +else + node "$basedir/../loose-envify/cli.js" "$@" + ret=$? +fi +exit $ret diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/.bin/loose-envify.cmd b/goTorrentWebUI/node_modules/react-dropzone/node_modules/.bin/loose-envify.cmd new file mode 100644 index 00000000..6238bbb2 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/.bin/loose-envify.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\loose-envify\cli.js" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\loose-envify\cli.js" %* +) \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/CHANGES.md b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/CHANGES.md new file mode 100644 index 00000000..f105b919 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/CHANGES.md @@ -0,0 +1,70 @@ + +## 2.0.6 + +Version 2.0.4 adds support for React Native by clarifying in package.json that +the browser environment does not support Node.js domains. +Why this is necessary, we leave as an exercise for the user. + +## 2.0.3 + +Version 2.0.3 fixes a bug when adjusting the capacity of the task queue. + +## 2.0.1-2.02 + +Version 2.0.1 fixes a bug in the way redirects were expressed that affected the +function of Browserify, but which Mr would tolerate. + +## 2.0.0 + +Version 2 of ASAP is a full rewrite with a few salient changes. +First, the ASAP source is CommonJS only and designed with [Browserify][] and +[Browserify-compatible][Mr] module loaders in mind. + +[Browserify]: https://github.com/substack/node-browserify +[Mr]: https://github.com/montagejs/mr + +The new version has been refactored in two dimensions. +Support for Node.js and browsers have been separated, using Browserify +redirects and ASAP has been divided into two modules. +The "raw" layer depends on the tasks to catch thrown exceptions and unravel +Node.js domains. + +The full implementation of ASAP is loadable as `require("asap")` in both Node.js +and browsers. + +The raw layer that lacks exception handling overhead is loadable as +`require("asap/raw")`. +The interface is the same for both layers. + +Tasks are no longer required to be functions, but can rather be any object that +implements `task.call()`. +With this feature you can recycle task objects to avoid garbage collector churn +and avoid closures in general. + +The implementation has been rigorously documented so that our successors can +understand the scope of the problem that this module solves and all of its +nuances, ensuring that the next generation of implementations know what details +are essential. + +- [asap.js](https://github.com/kriskowal/asap/blob/master/asap.js) +- [raw.js](https://github.com/kriskowal/asap/blob/master/raw.js) +- [browser-asap.js](https://github.com/kriskowal/asap/blob/master/browser-asap.js) +- [browser-raw.js](https://github.com/kriskowal/asap/blob/master/browser-raw.js) + +The new version has also been rigorously tested across a broad spectrum of +browsers, in both the window and worker context. +The following charts capture the browser test results for the most recent +release. +The first chart shows test results for ASAP running in the main window context. +The second chart shows test results for ASAP running in a web worker context. +Test results are inconclusive (grey) on browsers that do not support web +workers. +These data are captured automatically by [Continuous +Integration][]. + +![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg) + +![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg) + +[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md + diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/LICENSE.md b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/LICENSE.md new file mode 100644 index 00000000..ba18c613 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/LICENSE.md @@ -0,0 +1,21 @@ + +Copyright 2009–2014 Contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/README.md b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/README.md new file mode 100644 index 00000000..452fd8c2 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/README.md @@ -0,0 +1,237 @@ +# ASAP + +[![Build Status](https://travis-ci.org/kriskowal/asap.png?branch=master)](https://travis-ci.org/kriskowal/asap) + +Promise and asynchronous observer libraries, as well as hand-rolled callback +programs and libraries, often need a mechanism to postpone the execution of a +callback until the next available event. +(See [Designing API’s for Asynchrony][Zalgo].) +The `asap` function executes a task **as soon as possible** but not before it +returns, waiting only for the completion of the current event and previously +scheduled tasks. + +```javascript +asap(function () { + // ... +}); +``` + +[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony + +This CommonJS package provides an `asap` module that exports a function that +executes a task function *as soon as possible*. + +ASAP strives to schedule events to occur before yielding for IO, reflow, +or redrawing. +Each event receives an independent stack, with only platform code in parent +frames and the events run in the order they are scheduled. + +ASAP provides a fast event queue that will execute tasks until it is +empty before yielding to the JavaScript engine's underlying event-loop. +When a task gets added to a previously empty event queue, ASAP schedules a flush +event, preferring for that event to occur before the JavaScript engine has an +opportunity to perform IO tasks or rendering, thus making the first task and +subsequent tasks semantically indistinguishable. +ASAP uses a variety of techniques to preserve this invariant on different +versions of browsers and Node.js. + +By design, ASAP prevents input events from being handled until the task +queue is empty. +If the process is busy enough, this may cause incoming connection requests to be +dropped, and may cause existing connections to inform the sender to reduce the +transmission rate or stall. +ASAP allows this on the theory that, if there is enough work to do, there is no +sense in looking for trouble. +As a consequence, ASAP can interfere with smooth animation. +If your task should be tied to the rendering loop, consider using +`requestAnimationFrame` instead. +A long sequence of tasks can also effect the long running script dialog. +If this is a problem, you may be able to use ASAP’s cousin `setImmediate` to +break long processes into shorter intervals and periodically allow the browser +to breathe. +`setImmediate` will yield for IO, reflow, and repaint events. +It also returns a handler and can be canceled. +For a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate]. + +[setImmediate]: https://github.com/YuzuJS/setImmediate + +Take care. +ASAP can sustain infinite recursive calls without warning. +It will not halt from a stack overflow, and it will not consume unbounded +memory. +This is behaviorally equivalent to an infinite loop. +Just as with infinite loops, you can monitor a Node.js process for this behavior +with a heart-beat signal. +As with infinite loops, a very small amount of caution goes a long way to +avoiding problems. + +```javascript +function loop() { + asap(loop); +} +loop(); +``` + +In browsers, if a task throws an exception, it will not interrupt the flushing +of high-priority tasks. +The exception will be postponed to a later, low-priority event to avoid +slow-downs. +In Node.js, if a task throws an exception, ASAP will resume flushing only if—and +only after—the error is handled by `domain.on("error")` or +`process.on("uncaughtException")`. + +## Raw ASAP + +Checking for exceptions comes at a cost. +The package also provides an `asap/raw` module that exports the underlying +implementation which is faster but stalls if a task throws an exception. +This internal version of the ASAP function does not check for errors. +If a task does throw an error, it will stall the event queue unless you manually +call `rawAsap.requestFlush()` before throwing the error, or any time after. + +In Node.js, `asap/raw` also runs all tasks outside any domain. +If you need a task to be bound to your domain, you will have to do it manually. + +```js +if (process.domain) { + task = process.domain.bind(task); +} +rawAsap(task); +``` + +## Tasks + +A task may be any object that implements `call()`. +A function will suffice, but closures tend not to be reusable and can cause +garbage collector churn. +Both `asap` and `rawAsap` accept task objects to give you the option of +recycling task objects or using higher callable object abstractions. +See the `asap` source for an illustration. + + +## Compatibility + +ASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers. +The following charts capture the browser test results for the most recent +release. +The first chart shows test results for ASAP running in the main window context. +The second chart shows test results for ASAP running in a web worker context. +Test results are inconclusive (grey) on browsers that do not support web +workers. +These data are captured automatically by [Continuous +Integration][]. + +[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md + +![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg) + +![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg) + +## Caveats + +When a task is added to an empty event queue, it is not always possible to +guarantee that the task queue will begin flushing immediately after the current +event. +However, once the task queue begins flushing, it will not yield until the queue +is empty, even if the queue grows while executing tasks. + +The following browsers allow the use of [DOM mutation observers][] to access +the HTML [microtask queue][], and thus begin flushing ASAP's task queue +immediately at the end of the current event loop turn, before any rendering or +IO: + +[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue +[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers + +- Android 4–4.3 +- Chrome 26–34 +- Firefox 14–29 +- Internet Explorer 11 +- iPad Safari 6–7.1 +- iPhone Safari 7–7.1 +- Safari 6–7 + +In the absense of mutation observers, there are a few browsers, and situations +like web workers in some of the above browsers, where [message channels][] +would be a useful way to avoid falling back to timers. +Message channels give direct access to the HTML [task queue][], so the ASAP +task queue would flush after any already queued rendering and IO tasks, but +without having the minimum delay imposed by timers. +However, among these browsers, Internet Explorer 10 and Safari do not reliably +dispatch messages, so they are not worth the trouble to implement. + +[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels +[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task + +- Internet Explorer 10 +- Safair 5.0-1 +- Opera 11-12 + +In the absense of mutation observers, these browsers and the following browsers +all fall back to using `setTimeout` and `setInterval` to ensure that a `flush` +occurs. +The implementation uses both and cancels whatever handler loses the race, since +`setTimeout` tends to occasionally skip tasks in unisolated circumstances. +Timers generally delay the flushing of ASAP's task queue for four milliseconds. + +- Firefox 3–13 +- Internet Explorer 6–10 +- iPad Safari 4.3 +- Lynx 2.8.7 + + +## Heritage + +ASAP has been factored out of the [Q][] asynchronous promise library. +It originally had a naïve implementation in terms of `setTimeout`, but +[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be +useful for creating a high-priority, no-delay event dispatch hack. +Since then, Internet Explorer proposed and implemented `setImmediate`. +Robert Katić began contributing to Q by measuring the performance of +the internal implementation of `asap`, paying particular attention to +error recovery. +Domenic, Robert, and Kris Kowal collectively settled on the current strategy of +unrolling the high-priority event queue internally regardless of what strategy +we used to dispatch the potentially lower-priority flush event. +Domenic went on to make ASAP cooperate with Node.js domains. + +[Q]: https://github.com/kriskowal/q +[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html + +For further reading, Nicholas Zakas provided a thorough article on [The +Case for setImmediate][NCZ]. + +[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/ + +Ember’s RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but +further developed the implentation. +Particularly, The `MessagePort` implementation was abandoned due to interaction +[problems with Mobile Internet Explorer][IE Problems] in favor of an +implementation backed on the newer and more reliable DOM `MutationObserver` +interface. +These changes were back-ported into this library. + +[IE Problems]: https://github.com/cujojs/when/issues/197 +[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js + +In addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained +exception-safe, but `asap/raw` provided a tight kernel that could be used for +tasks that guaranteed that they would not throw exceptions. +This core is useful for promise implementations that capture thrown errors in +rejected promises and do not need a second safety net. +At the same time, the exception handling in `asap` was factored into separate +implementations for Node.js and browsers, using the the [Browserify][Browser +Config] `browser` property in `package.json` to instruct browser module loaders +and bundlers, including [Browserify][], [Mr][], and [Mop][], to use the +browser-only implementation. + +[Browser Config]: https://gist.github.com/defunctzombie/4339901 +[Browserify]: https://github.com/substack/node-browserify +[Mr]: https://github.com/montagejs/mr +[Mop]: https://github.com/montagejs/mop + +## License + +Copyright 2009-2014 by Contributors +MIT License (enclosed) + diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/asap.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/asap.js new file mode 100644 index 00000000..f04fcd58 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/asap.js @@ -0,0 +1,65 @@ +"use strict"; + +var rawAsap = require("./raw"); +var freeTasks = []; + +/** + * Calls a task as soon as possible after returning, in its own event, with + * priority over IO events. An exception thrown in a task can be handled by + * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise + * crash the process. If the error is handled, all subsequent tasks will + * resume. + * + * @param {{call}} task A callable object, typically a function that takes no + * arguments. + */ +module.exports = asap; +function asap(task) { + var rawTask; + if (freeTasks.length) { + rawTask = freeTasks.pop(); + } else { + rawTask = new RawTask(); + } + rawTask.task = task; + rawTask.domain = process.domain; + rawAsap(rawTask); +} + +function RawTask() { + this.task = null; + this.domain = null; +} + +RawTask.prototype.call = function () { + if (this.domain) { + this.domain.enter(); + } + var threw = true; + try { + this.task.call(); + threw = false; + // If the task throws an exception (presumably) Node.js restores the + // domain stack for the next event. + if (this.domain) { + this.domain.exit(); + } + } finally { + // We use try/finally and a threw flag to avoid messing up stack traces + // when we catch and release errors. + if (threw) { + // In Node.js, uncaught exceptions are considered fatal errors. + // Re-throw them to interrupt flushing! + // Ensure that flushing continues if an uncaught exception is + // suppressed listening process.on("uncaughtException") or + // domain.on("error"). + rawAsap.requestFlush(); + } + // If the task threw an error, we do not want to exit the domain here. + // Exiting the domain would prevent the domain from catching the error. + this.task = null; + this.domain = null; + freeTasks.push(this); + } +}; + diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/browser-asap.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/browser-asap.js new file mode 100644 index 00000000..805c9824 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/browser-asap.js @@ -0,0 +1,66 @@ +"use strict"; + +// rawAsap provides everything we need except exception management. +var rawAsap = require("./raw"); +// RawTasks are recycled to reduce GC churn. +var freeTasks = []; +// We queue errors to ensure they are thrown in right order (FIFO). +// Array-as-queue is good enough here, since we are just dealing with exceptions. +var pendingErrors = []; +var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError); + +function throwFirstError() { + if (pendingErrors.length) { + throw pendingErrors.shift(); + } +} + +/** + * Calls a task as soon as possible after returning, in its own event, with priority + * over other events like animation, reflow, and repaint. An error thrown from an + * event will not interrupt, nor even substantially slow down the processing of + * other events, but will be rather postponed to a lower priority event. + * @param {{call}} task A callable object, typically a function that takes no + * arguments. + */ +module.exports = asap; +function asap(task) { + var rawTask; + if (freeTasks.length) { + rawTask = freeTasks.pop(); + } else { + rawTask = new RawTask(); + } + rawTask.task = task; + rawAsap(rawTask); +} + +// We wrap tasks with recyclable task objects. A task object implements +// `call`, just like a function. +function RawTask() { + this.task = null; +} + +// The sole purpose of wrapping the task is to catch the exception and recycle +// the task object after its single use. +RawTask.prototype.call = function () { + try { + this.task.call(); + } catch (error) { + if (asap.onerror) { + // This hook exists purely for testing purposes. + // Its name will be periodically randomized to break any code that + // depends on its existence. + asap.onerror(error); + } else { + // In a web browser, exceptions are not fatal. However, to avoid + // slowing down the queue of pending tasks, we rethrow the error in a + // lower priority turn. + pendingErrors.push(error); + requestErrorThrow(); + } + } finally { + this.task = null; + freeTasks[freeTasks.length] = this; + } +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/browser-raw.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/browser-raw.js new file mode 100644 index 00000000..9cee7e32 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/browser-raw.js @@ -0,0 +1,223 @@ +"use strict"; + +// Use the fastest means possible to execute a task in its own turn, with +// priority over other events including IO, animation, reflow, and redraw +// events in browsers. +// +// An exception thrown by a task will permanently interrupt the processing of +// subsequent tasks. The higher level `asap` function ensures that if an +// exception is thrown by a task, that the task queue will continue flushing as +// soon as possible, but if you use `rawAsap` directly, you are responsible to +// either ensure that no exceptions are thrown from your task, or to manually +// call `rawAsap.requestFlush` if an exception is thrown. +module.exports = rawAsap; +function rawAsap(task) { + if (!queue.length) { + requestFlush(); + flushing = true; + } + // Equivalent to push, but avoids a function call. + queue[queue.length] = task; +} + +var queue = []; +// Once a flush has been requested, no further calls to `requestFlush` are +// necessary until the next `flush` completes. +var flushing = false; +// `requestFlush` is an implementation-specific method that attempts to kick +// off a `flush` event as quickly as possible. `flush` will attempt to exhaust +// the event queue before yielding to the browser's own event loop. +var requestFlush; +// The position of the next task to execute in the task queue. This is +// preserved between calls to `flush` so that it can be resumed if +// a task throws an exception. +var index = 0; +// If a task schedules additional tasks recursively, the task queue can grow +// unbounded. To prevent memory exhaustion, the task queue will periodically +// truncate already-completed tasks. +var capacity = 1024; + +// The flush function processes all tasks that have been scheduled with +// `rawAsap` unless and until one of those tasks throws an exception. +// If a task throws an exception, `flush` ensures that its state will remain +// consistent and will resume where it left off when called again. +// However, `flush` does not make any arrangements to be called again if an +// exception is thrown. +function flush() { + while (index < queue.length) { + var currentIndex = index; + // Advance the index before calling the task. This ensures that we will + // begin flushing on the next task the task throws an error. + index = index + 1; + queue[currentIndex].call(); + // Prevent leaking memory for long chains of recursive calls to `asap`. + // If we call `asap` within tasks scheduled by `asap`, the queue will + // grow, but to avoid an O(n) walk for every task we execute, we don't + // shift tasks off the queue after they have been executed. + // Instead, we periodically shift 1024 tasks off the queue. + if (index > capacity) { + // Manually shift all values starting at the index back to the + // beginning of the queue. + for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { + queue[scan] = queue[scan + index]; + } + queue.length -= index; + index = 0; + } + } + queue.length = 0; + index = 0; + flushing = false; +} + +// `requestFlush` is implemented using a strategy based on data collected from +// every available SauceLabs Selenium web driver worker at time of writing. +// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593 + +// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that +// have WebKitMutationObserver but not un-prefixed MutationObserver. +// Must use `global` or `self` instead of `window` to work in both frames and web +// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop. + +/* globals self */ +var scope = typeof global !== "undefined" ? global : self; +var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver; + +// MutationObservers are desirable because they have high priority and work +// reliably everywhere they are implemented. +// They are implemented in all modern browsers. +// +// - Android 4-4.3 +// - Chrome 26-34 +// - Firefox 14-29 +// - Internet Explorer 11 +// - iPad Safari 6-7.1 +// - iPhone Safari 7-7.1 +// - Safari 6-7 +if (typeof BrowserMutationObserver === "function") { + requestFlush = makeRequestCallFromMutationObserver(flush); + +// MessageChannels are desirable because they give direct access to the HTML +// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera +// 11-12, and in web workers in many engines. +// Although message channels yield to any queued rendering and IO tasks, they +// would be better than imposing the 4ms delay of timers. +// However, they do not work reliably in Internet Explorer or Safari. + +// Internet Explorer 10 is the only browser that has setImmediate but does +// not have MutationObservers. +// Although setImmediate yields to the browser's renderer, it would be +// preferrable to falling back to setTimeout since it does not have +// the minimum 4ms penalty. +// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and +// Desktop to a lesser extent) that renders both setImmediate and +// MessageChannel useless for the purposes of ASAP. +// https://github.com/kriskowal/q/issues/396 + +// Timers are implemented universally. +// We fall back to timers in workers in most engines, and in foreground +// contexts in the following browsers. +// However, note that even this simple case requires nuances to operate in a +// broad spectrum of browsers. +// +// - Firefox 3-13 +// - Internet Explorer 6-9 +// - iPad Safari 4.3 +// - Lynx 2.8.7 +} else { + requestFlush = makeRequestCallFromTimer(flush); +} + +// `requestFlush` requests that the high priority event queue be flushed as +// soon as possible. +// This is useful to prevent an error thrown in a task from stalling the event +// queue if the exception handled by Node.js’s +// `process.on("uncaughtException")` or by a domain. +rawAsap.requestFlush = requestFlush; + +// To request a high priority event, we induce a mutation observer by toggling +// the text of a text node between "1" and "-1". +function makeRequestCallFromMutationObserver(callback) { + var toggle = 1; + var observer = new BrowserMutationObserver(callback); + var node = document.createTextNode(""); + observer.observe(node, {characterData: true}); + return function requestCall() { + toggle = -toggle; + node.data = toggle; + }; +} + +// The message channel technique was discovered by Malte Ubl and was the +// original foundation for this library. +// http://www.nonblocking.io/2011/06/windownexttick.html + +// Safari 6.0.5 (at least) intermittently fails to create message ports on a +// page's first load. Thankfully, this version of Safari supports +// MutationObservers, so we don't need to fall back in that case. + +// function makeRequestCallFromMessageChannel(callback) { +// var channel = new MessageChannel(); +// channel.port1.onmessage = callback; +// return function requestCall() { +// channel.port2.postMessage(0); +// }; +// } + +// For reasons explained above, we are also unable to use `setImmediate` +// under any circumstances. +// Even if we were, there is another bug in Internet Explorer 10. +// It is not sufficient to assign `setImmediate` to `requestFlush` because +// `setImmediate` must be called *by name* and therefore must be wrapped in a +// closure. +// Never forget. + +// function makeRequestCallFromSetImmediate(callback) { +// return function requestCall() { +// setImmediate(callback); +// }; +// } + +// Safari 6.0 has a problem where timers will get lost while the user is +// scrolling. This problem does not impact ASAP because Safari 6.0 supports +// mutation observers, so that implementation is used instead. +// However, if we ever elect to use timers in Safari, the prevalent work-around +// is to add a scroll event listener that calls for a flush. + +// `setTimeout` does not call the passed callback if the delay is less than +// approximately 7 in web workers in Firefox 8 through 18, and sometimes not +// even then. + +function makeRequestCallFromTimer(callback) { + return function requestCall() { + // We dispatch a timeout with a specified delay of 0 for engines that + // can reliably accommodate that request. This will usually be snapped + // to a 4 milisecond delay, but once we're flushing, there's no delay + // between events. + var timeoutHandle = setTimeout(handleTimer, 0); + // However, since this timer gets frequently dropped in Firefox + // workers, we enlist an interval handle that will try to fire + // an event 20 times per second until it succeeds. + var intervalHandle = setInterval(handleTimer, 50); + + function handleTimer() { + // Whichever timer succeeds will cancel both timers and + // execute the callback. + clearTimeout(timeoutHandle); + clearInterval(intervalHandle); + callback(); + } + }; +} + +// This is for `asap.js` only. +// Its name will be periodically randomized to break any code that depends on +// its existence. +rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer; + +// ASAP was originally a nextTick shim included in Q. This was factored out +// into this ASAP package. It was later adapted to RSVP which made further +// amendments. These decisions, particularly to marginalize MessageChannel and +// to capture the MutationObserver implementation in a closure, were integrated +// back into ASAP proper. +// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/package.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/package.json new file mode 100644 index 00000000..3b88c321 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/package.json @@ -0,0 +1,87 @@ +{ + "_from": "asap@~2.0.3", + "_id": "asap@2.0.6", + "_inBundle": false, + "_integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "_location": "/react-dropzone/asap", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "asap@~2.0.3", + "name": "asap", + "escapedName": "asap", + "rawSpec": "~2.0.3", + "saveSpec": null, + "fetchSpec": "~2.0.3" + }, + "_requiredBy": [ + "/react-dropzone/promise" + ], + "_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "_shasum": "e50347611d7e690943208bbdafebcbc2fb866d46", + "_spec": "asap@~2.0.3", + "_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI\\node_modules\\react-dropzone\\node_modules\\promise", + "browser": { + "./asap": "./browser-asap.js", + "./asap.js": "./browser-asap.js", + "./raw": "./browser-raw.js", + "./raw.js": "./browser-raw.js", + "./test/domain.js": "./test/browser-domain.js" + }, + "bugs": { + "url": "https://github.com/kriskowal/asap/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "High-priority task queue for Node.js and browsers", + "devDependencies": { + "benchmark": "^1.0.0", + "events": "^1.0.1", + "jshint": "^2.5.1", + "knox": "^0.8.10", + "mr": "^2.0.5", + "opener": "^1.3.0", + "q": "^2.0.3", + "q-io": "^2.0.3", + "saucelabs": "^0.1.1", + "wd": "^0.2.21", + "weak-map": "^1.0.5" + }, + "files": [ + "raw.js", + "asap.js", + "browser-raw.js", + "browser-asap.js" + ], + "homepage": "https://github.com/kriskowal/asap#readme", + "keywords": [ + "event", + "task", + "queue" + ], + "license": "MIT", + "main": "./asap.js", + "name": "asap", + "react-native": { + "domain": false + }, + "repository": { + "type": "git", + "url": "git+https://github.com/kriskowal/asap.git" + }, + "scripts": { + "benchmarks": "node benchmarks", + "lint": "jshint raw.js asap.js browser-raw.js browser-asap.js $(find scripts -name '*.js' | grep -v gauntlet)", + "test": "npm run lint && npm run test-node", + "test-browser": "node scripts/publish-bundle.js test/asap-test.js | xargs opener", + "test-node": "node test/asap-test.js", + "test-publish": "node scripts/publish-bundle.js test/asap-test.js | pbcopy", + "test-saucelabs": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-spot-configurations.json", + "test-saucelabs-all": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-all-configurations.json", + "test-saucelabs-worker": "node scripts/saucelabs-worker-test.js scripts/saucelabs-spot-configurations.json", + "test-saucelabs-worker-all": "node scripts/saucelabs-worker-test.js scripts/saucelabs-all-configurations.json", + "test-travis": "npm run lint && npm run test-node && npm run test-saucelabs && npm run test-saucelabs-worker" + }, + "version": "2.0.6" +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/raw.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/raw.js new file mode 100644 index 00000000..ae3b8923 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/asap/raw.js @@ -0,0 +1,101 @@ +"use strict"; + +var domain; // The domain module is executed on demand +var hasSetImmediate = typeof setImmediate === "function"; + +// Use the fastest means possible to execute a task in its own turn, with +// priority over other events including network IO events in Node.js. +// +// An exception thrown by a task will permanently interrupt the processing of +// subsequent tasks. The higher level `asap` function ensures that if an +// exception is thrown by a task, that the task queue will continue flushing as +// soon as possible, but if you use `rawAsap` directly, you are responsible to +// either ensure that no exceptions are thrown from your task, or to manually +// call `rawAsap.requestFlush` if an exception is thrown. +module.exports = rawAsap; +function rawAsap(task) { + if (!queue.length) { + requestFlush(); + flushing = true; + } + // Avoids a function call + queue[queue.length] = task; +} + +var queue = []; +// Once a flush has been requested, no further calls to `requestFlush` are +// necessary until the next `flush` completes. +var flushing = false; +// The position of the next task to execute in the task queue. This is +// preserved between calls to `flush` so that it can be resumed if +// a task throws an exception. +var index = 0; +// If a task schedules additional tasks recursively, the task queue can grow +// unbounded. To prevent memory excaustion, the task queue will periodically +// truncate already-completed tasks. +var capacity = 1024; + +// The flush function processes all tasks that have been scheduled with +// `rawAsap` unless and until one of those tasks throws an exception. +// If a task throws an exception, `flush` ensures that its state will remain +// consistent and will resume where it left off when called again. +// However, `flush` does not make any arrangements to be called again if an +// exception is thrown. +function flush() { + while (index < queue.length) { + var currentIndex = index; + // Advance the index before calling the task. This ensures that we will + // begin flushing on the next task the task throws an error. + index = index + 1; + queue[currentIndex].call(); + // Prevent leaking memory for long chains of recursive calls to `asap`. + // If we call `asap` within tasks scheduled by `asap`, the queue will + // grow, but to avoid an O(n) walk for every task we execute, we don't + // shift tasks off the queue after they have been executed. + // Instead, we periodically shift 1024 tasks off the queue. + if (index > capacity) { + // Manually shift all values starting at the index back to the + // beginning of the queue. + for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { + queue[scan] = queue[scan + index]; + } + queue.length -= index; + index = 0; + } + } + queue.length = 0; + index = 0; + flushing = false; +} + +rawAsap.requestFlush = requestFlush; +function requestFlush() { + // Ensure flushing is not bound to any domain. + // It is not sufficient to exit the domain, because domains exist on a stack. + // To execute code outside of any domain, the following dance is necessary. + var parentDomain = process.domain; + if (parentDomain) { + if (!domain) { + // Lazy execute the domain module. + // Only employed if the user elects to use domains. + domain = require("domain"); + } + domain.active = process.domain = null; + } + + // `setImmediate` is slower that `process.nextTick`, but `process.nextTick` + // cannot handle recursion. + // `requestFlush` will only be called recursively from `asap.js`, to resume + // flushing after an error is thrown into a domain. + // Conveniently, `setImmediate` was introduced in the same version + // `process.nextTick` started throwing recursion errors. + if (flushing && hasSetImmediate) { + setImmediate(flush); + } else { + process.nextTick(flush); + } + + if (parentDomain) { + domain.active = process.domain = parentDomain; + } +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/CHANGELOG.md b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/CHANGELOG.md new file mode 100644 index 00000000..6fbcbb41 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/CHANGELOG.md @@ -0,0 +1,409 @@ +## Changelog +##### 1.2.7 [LEGACY] - 2016.07.18 +* some fixes for issues like #159, #186, #194, #207 + +##### 1.2.6 - 2015.11.09 +* reject with `TypeError` on attempt resolve promise itself +* correct behavior with broken `Promise` subclass constructors / methods +* added `Promise`-based fallback for microtask +* fixed V8 and FF `Array#{values, @@iterator}.name` +* fixed IE7- `[1, 2].join(undefined) -> '1,2'` +* some other fixes / improvements / optimizations + +##### 1.2.5 - 2015.11.02 +* some more `Number` constructor fixes: + * fixed V8 ~ Node 0.8 bug: `Number('+0x1')` should be `NaN` + * fixed `Number(' 0b1\n')` case, should be `1` + * fixed `Number()` case, should be `0` + +##### 1.2.4 - 2015.11.01 +* fixed `Number('0b12') -> NaN` case in the shim +* fixed V8 ~ Chromium 40- bug - `Weak(Map|Set)#{delete, get, has}` should not throw errors [#124](https://github.com/zloirock/core-js/issues/124) +* some other fixes and optimizations + +##### 1.2.3 - 2015.10.23 +* fixed some problems related old V8 bug `Object('a').propertyIsEnumerable(0) // => false`, for example, `Object.assign({}, 'qwe')` from the last release +* fixed `.name` property and `Function#toString` conversion some polyfilled methods +* fixed `Math.imul` arity in Safari 8- + +##### 1.2.2 - 2015.10.18 +* improved optimisations for V8 +* fixed build process from external packages, [#120](https://github.com/zloirock/core-js/pull/120) +* one more `Object.{assign, values, entries}` fix for [**very** specific case](https://github.com/ljharb/proposal-object-values-entries/issues/5) + +##### 1.2.1 - 2015.10.02 +* replaced fix `JSON.stringify` + `Symbol` behavior from `.toJSON` method to wrapping `JSON.stringify` - little more correct, [compat-table/642](https://github.com/kangax/compat-table/pull/642) +* fixed typo which broke tasks scheduler in WebWorkers in old FF, [#114](https://github.com/zloirock/core-js/pull/114) + +##### 1.2.0 - 2015.09.27 +* added browser [`Promise` rejection hook](#unhandled-rejection-tracking), [#106](https://github.com/zloirock/core-js/issues/106) +* added correct [`IsRegExp`](http://www.ecma-international.org/ecma-262/6.0/#sec-isregexp) logic to [`String#{includes, startsWith, endsWith}`](https://github.com/zloirock/core-js/#ecmascript-6-string) and [`RegExp` constructor](https://github.com/zloirock/core-js/#ecmascript-6-regexp), `@@match` case, [example](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match#Disabling_the_isRegExp_check) +* updated [`String#leftPad`](https://github.com/zloirock/core-js/#ecmascript-7) [with proposal](https://github.com/ljharb/proposal-string-pad-left-right/issues/6): string filler truncated from the right side +* replaced V8 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) - its properties order not only [incorrect](https://github.com/sindresorhus/object-assign/issues/22), it is non-deterministic and it causes some problems +* fixed behavior with deleted in getters properties for `Object.{`[`assign`](https://github.com/zloirock/core-js/#ecmascript-6-object)`, `[`entries, values`](https://github.com/zloirock/core-js/#ecmascript-7)`}`, [example](http://goo.gl/iQE01c) +* fixed [`Math.sinh`](https://github.com/zloirock/core-js/#ecmascript-6-math) with very small numbers in V8 near Chromium 38 +* some other fixes and optimizations + +##### 1.1.4 - 2015.09.05 +* fixed support symbols in FF34-35 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) +* fixed [collections iterators](https://github.com/zloirock/core-js/#ecmascript-6-iterators) in FF25-26 +* fixed non-generic WebKit [`Array.of`](https://github.com/zloirock/core-js/#ecmascript-6-array) +* some other fixes and optimizations + +##### 1.1.3 - 2015.08.29 +* fixed support Node.js domains in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise), [#103](https://github.com/zloirock/core-js/issues/103) + +##### 1.1.2 - 2015.08.28 +* added `toJSON` method to [`Symbol`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill and to MS Edge implementation for expected `JSON.stringify` result w/o patching this method +* replaced [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) implementations w/o correct support third argument +* fixed `global` detection with changed `document.domain` in ~IE8, [#100](https://github.com/zloirock/core-js/issues/100) + +##### 1.1.1 - 2015.08.20 +* added more correct microtask implementation for [`Promise`](#ecmascript-6-promise) + +##### 1.1.0 - 2015.08.17 +* updated [string padding](https://github.com/zloirock/core-js/#ecmascript-7) to [actual proposal](https://github.com/ljharb/proposal-string-pad-left-right) - renamed, minor internal changes: + * `String#lpad` -> `String#padLeft` + * `String#rpad` -> `String#padRight` +* added [string trim functions](#ecmascript-7) - [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), defacto standard - required only for IE11- and fixed for some old engines: + * `String#trimLeft` + * `String#trimRight` +* [`String#trim`](https://github.com/zloirock/core-js/#ecmascript-6-string) fixed for some engines by es6 spec and moved from `es5` to single `es6` module +* splitted [`es6.object.statics-accept-primitives`](https://github.com/zloirock/core-js/#ecmascript-6-object) +* caps for `freeze`-family `Object` methods moved from `es5` to `es6` namespace and joined with [es6 wrappers](https://github.com/zloirock/core-js/#ecmascript-6-object) +* `es5` [namespace](https://github.com/zloirock/core-js/#commonjs) also includes modules, moved to `es6` namespace - you can use it as before +* increased `MessageChannel` priority in `$.task`, [#95](https://github.com/zloirock/core-js/issues/95) +* does not get `global.Symbol` on each getting iterator, if you wanna use alternative `Symbol` shim - add it before `core-js` +* [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) optimized and fixed for some cases +* simplified [`Reflect.enumerate`](https://github.com/zloirock/core-js/#ecmascript-6-reflect), see [this question](https://esdiscuss.org/topic/question-about-enumerate-and-property-decision-timing) +* some corrections in [`Math.acosh`](https://github.com/zloirock/core-js/#ecmascript-6-math) +* fixed [`Math.imul`](https://github.com/zloirock/core-js/#ecmascript-6-math) for old WebKit +* some fixes in string / RegExp [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp) logic +* some other fixes and optimizations + +##### 1.0.1 - 2015.07.31 +* some fixes for final MS Edge, replaced broken native `Reflect.defineProperty` +* some minor fixes and optimizations +* changed compression `client/*.min.js` options for safe `Function#name` and `Function#length`, should be fixed [#92](https://github.com/zloirock/core-js/issues/92) + +##### 1.0.0 - 2015.07.22 +* added logic for [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp): + * `Symbol.match` + * `Symbol.replace` + * `Symbol.split` + * `Symbol.search` +* actualized and optimized work with iterables: + * optimized [`Map`, `Set`, `WeakMap`, `WeakSet` constructors](https://github.com/zloirock/core-js/#ecmascript-6-collections), [`Promise.all`, `Promise.race`](https://github.com/zloirock/core-js/#ecmascript-6-promise) for default `Array Iterator` + * optimized [`Array.from`](https://github.com/zloirock/core-js/#ecmascript-6-array) for default `Array Iterator` + * added [`core.getIteratorMethod`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) helper +* uses enumerable properties in shimmed instances - collections, iterators, etc for optimize performance +* added support native constructors to [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) with 2 arguments +* added support native constructors to [`Function#bind`](https://github.com/zloirock/core-js/#ecmascript-5) shim with `new` +* removed obsolete `.clear` methods native [`Weak`-collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) +* maximum modularity, reduced minimal custom build size, separated into submodules: + * [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) + * [`es6.regexp`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) + * [`es6.math`](https://github.com/zloirock/core-js/#ecmascript-6-math) + * [`es6.number`](https://github.com/zloirock/core-js/#ecmascript-6-number) + * [`es7.object.to-array`](https://github.com/zloirock/core-js/#ecmascript-7) + * [`core.object`](https://github.com/zloirock/core-js/#object) + * [`core.string`](https://github.com/zloirock/core-js/#escaping-html) + * [`core.iter-helpers`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) + * internal modules (`$`, `$.iter`, etc) +* many other optimizations +* final cleaning non-standard features + * moved `$for` to [separate library](https://github.com/zloirock/forof). This work for syntax - `for-of` loop and comprehensions + * moved `Date#{format, formatUTC}` to [separate library](https://github.com/zloirock/dtf). Standard way for this - `ECMA-402` + * removed `Math` methods from `Number.prototype`. Slight sugar for simple `Math` methods calling + * removed `{Array#, Array, Dict}.turn` + * removed `core.global` +* uses `ToNumber` instead of `ToLength` in [`Number Iterator`](https://github.com/zloirock/core-js/#number-iterator), `Array.from(2.5)` will be `[0, 1, 2]` instead of `[0, 1]` +* fixed [#85](https://github.com/zloirock/core-js/issues/85) - invalid `Promise` unhandled rejection message in nested `setTimeout` +* fixed [#86](https://github.com/zloirock/core-js/issues/86) - support FF extensions +* fixed [#89](https://github.com/zloirock/core-js/issues/89) - behavior `Number` constructor in strange case + +##### 0.9.18 - 2015.06.17 +* removed `/` from [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7) escaped characters + +##### 0.9.17 - 2015.06.14 +* updated [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7) to the [latest proposal](https://github.com/benjamingr/RexExp.escape) +* fixed conflict with webpack dev server + IE buggy behavior + +##### 0.9.16 - 2015.06.11 +* more correct order resolving thenable in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) polyfill +* uses polyfill instead of [buggy V8 `Promise`](https://github.com/zloirock/core-js/issues/78) + +##### 0.9.15 - 2015.06.09 +* [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) from `library` version return wrapped native instances +* fixed collections prototype methods in `library` version +* optimized [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) + +##### 0.9.14 - 2015.06.04 +* updated [`Promise.resolve` behavior](https://esdiscuss.org/topic/fixing-promise-resolve) +* added fallback for IE11 buggy `Object.getOwnPropertyNames` + iframe +* some other fixes + +##### 0.9.13 - 2015.05.25 +* added fallback for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) for old Android +* some other fixes + +##### 0.9.12 - 2015.05.24 +* different instances `core-js` should use / recognize the same symbols +* some fixes + +##### 0.9.11 - 2015.05.18 +* simplified [custom build](https://github.com/zloirock/core-js/#custom-build) + * add custom build js api + * added `grunt-cli` to `devDependencies` for `npm run grunt` +* some fixes + +##### 0.9.10 - 2015.05.16 +* wrapped `Function#toString` for correct work wrapped methods / constructors with methods similar to the [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197) +* added proto versions of methods to export object in `default` version for consistency with `library` version + +##### 0.9.9 - 2015.05.14 +* wrapped `Object#propertyIsEnumerable` for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) +* [added proto versions of methods to `library` for ES7 bind syntax](https://github.com/zloirock/core-js/issues/65) +* some other fixes + +##### 0.9.8 - 2015.05.12 +* fixed [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) with negative arguments +* added `Object#toString.toString` as fallback for [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197) + +##### 0.9.7 - 2015.05.07 +* added [support DOM collections](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice#Streamlining_cross-browser_behavior) to IE8- `Array#slice` + +##### 0.9.6 - 2015.05.01 +* added [`String#lpad`, `String#rpad`](https://github.com/zloirock/core-js/#ecmascript-7) + +##### 0.9.5 - 2015.04.30 +* added cap for `Function#@@hasInstance` +* some fixes and optimizations + +##### 0.9.4 - 2015.04.27 +* fixed `RegExp` constructor + +##### 0.9.3 - 2015.04.26 +* some fixes and optimizations + +##### 0.9.2 - 2015.04.25 +* more correct [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking and resolving / rejection priority + +##### 0.9.1 - 2015.04.25 +* fixed `__proto__`-based [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) subclassing in some environments + +##### 0.9.0 - 2015.04.24 +* added correct [symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol) descriptors + * fixed behavior `Object.{assign, create, defineProperty, defineProperties, getOwnPropertyDescriptor, getOwnPropertyDescriptors}` with symbols + * added [single entry points](https://github.com/zloirock/core-js/#commonjs) for `Object.{create, defineProperty, defineProperties}` +* added [`Map#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7) +* removed non-standard methods `Object#[_]` and `Function#only` - they solves syntax problems, but now in compilers available arrows and ~~in near future will be available~~ [available](http://babeljs.io/blog/2015/05/14/function-bind/) [bind syntax](https://github.com/zenparsing/es-function-bind) +* removed non-standard undocumented methods `Symbol.{pure, set}` +* some fixes and internal changes + +##### 0.8.4 - 2015.04.18 +* uses `webpack` instead of `browserify` for browser builds - more compression-friendly result + +##### 0.8.3 - 2015.04.14 +* fixed `Array` statics with single entry points + +##### 0.8.2 - 2015.04.13 +* [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) now also works in IE9- +* added [`Set#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7) +* some optimizations and fixes + +##### 0.8.1 - 2015.04.03 +* fixed `Symbol.keyFor` + +##### 0.8.0 - 2015.04.02 +* changed [CommonJS API](https://github.com/zloirock/core-js/#commonjs) +* splitted and renamed some modules +* added support ES3 environment (ES5 polyfill) to **all** default versions - size increases slightly (+ ~4kb w/o gzip), many issues disappear, if you don't need it - [simply include only required namespaces / features / modules](https://github.com/zloirock/core-js/#commonjs) +* removed [abstract references](https://github.com/zenparsing/es-abstract-refs) support - proposal has been superseded =\ +* [`$for.isIterable` -> `core.isIterable`, `$for.getIterator` -> `core.getIterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), temporary available in old namespace +* fixed iterators support in v8 `Promise.all` and `Promise.race` +* many other fixes + +##### 0.7.2 - 2015.03.09 +* some fixes + +##### 0.7.1 - 2015.03.07 +* some fixes + +##### 0.7.0 - 2015.03.06 +* rewritten and splitted into [CommonJS modules](https://github.com/zloirock/core-js/#commonjs) + +##### 0.6.1 - 2015.02.24 +* fixed support [`Object.defineProperty`](https://github.com/zloirock/core-js/#ecmascript-5) with accessors on DOM elements on IE8 + +##### 0.6.0 - 2015.02.23 +* added support safe closing iteration - calling `iterator.return` on abort iteration, if it exists +* added basic support [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking in shim +* added [`Object.getOwnPropertyDescriptors`](https://github.com/zloirock/core-js/#ecmascript-7) +* removed `console` cap - creates too many problems - you can use [`core.log`](https://github.com/zloirock/core-js/#console) module as that +* restructuring [namespaces](https://github.com/zloirock/core-js/#custom-build) +* some fixes + +##### 0.5.4 - 2015.02.15 +* some fixes + +##### 0.5.3 - 2015.02.14 +* added [support binary and octal literals](https://github.com/zloirock/core-js/#ecmascript-6-number) to `Number` constructor +* added [`Date#toISOString`](https://github.com/zloirock/core-js/#ecmascript-5) + +##### 0.5.2 - 2015.02.10 +* some fixes + +##### 0.5.1 - 2015.02.09 +* some fixes + +##### 0.5.0 - 2015.02.08 +* systematization of modules +* splitted [`es6` module](https://github.com/zloirock/core-js/#ecmascript-6) +* splitted [`console` module](https://github.com/zloirock/core-js/#console): `web.console` - only cap for missing methods, `core.log` - bound methods & additional features +* added [`delay` method](https://github.com/zloirock/core-js/#delay) +* some fixes + +##### 0.4.10 - 2015.01.28 +* [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill returns array of wrapped keys + +##### 0.4.9 - 2015.01.27 +* FF20-24 fix + +##### 0.4.8 - 2015.01.25 +* some [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) fixes + +##### 0.4.7 - 2015.01.25 +* added support frozen objects as [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) keys + +##### 0.4.6 - 2015.01.21 +* added [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) +* added [`NodeList.prototype[@@iterator]`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) +* added basic `@@species` logic - getter in native constructors +* removed `Function#by` +* some fixes + +##### 0.4.5 - 2015.01.16 +* some fixes + +##### 0.4.4 - 2015.01.11 +* enabled CSP support + +##### 0.4.3 - 2015.01.10 +* added `Function` instances `name` property for IE9+ + +##### 0.4.2 - 2015.01.10 +* `Object` static methods accept primitives +* `RegExp` constructor can alter flags (IE9+) +* added `Array.prototype[Symbol.unscopables]` + +##### 0.4.1 - 2015.01.05 +* some fixes + +##### 0.4.0 - 2015.01.03 +* added [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) module: + * added `Reflect.apply` + * added `Reflect.construct` + * added `Reflect.defineProperty` + * added `Reflect.deleteProperty` + * added `Reflect.enumerate` + * added `Reflect.get` + * added `Reflect.getOwnPropertyDescriptor` + * added `Reflect.getPrototypeOf` + * added `Reflect.has` + * added `Reflect.isExtensible` + * added `Reflect.preventExtensions` + * added `Reflect.set` + * added `Reflect.setPrototypeOf` +* `core-js` methods now can use external `Symbol.iterator` polyfill +* some fixes + +##### 0.3.3 - 2014.12.28 +* [console cap](https://github.com/zloirock/core-js/#console) excluded from node.js default builds + +##### 0.3.2 - 2014.12.25 +* added cap for [ES5](https://github.com/zloirock/core-js/#ecmascript-5) freeze-family methods +* fixed `console` bug + +##### 0.3.1 - 2014.12.23 +* some fixes + +##### 0.3.0 - 2014.12.23 +* Optimize [`Map` & `Set`](https://github.com/zloirock/core-js/#ecmascript-6-collections): + * use entries chain on hash table + * fast & correct iteration + * iterators moved to [`es6`](https://github.com/zloirock/core-js/#ecmascript-6) and [`es6.collections`](https://github.com/zloirock/core-js/#ecmascript-6-collections) modules + +##### 0.2.5 - 2014.12.20 +* `console` no longer shortcut for `console.log` (compatibility problems) +* some fixes + +##### 0.2.4 - 2014.12.17 +* better compliance of ES6 +* added [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) (IE10+) +* some fixes + +##### 0.2.3 - 2014.12.15 +* [Symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol): + * added option to disable addition setter to `Object.prototype` for Symbol polyfill: + * added `Symbol.useSimple` + * added `Symbol.useSetter` + * added cap for well-known Symbols: + * added `Symbol.hasInstance` + * added `Symbol.isConcatSpreadable` + * added `Symbol.match` + * added `Symbol.replace` + * added `Symbol.search` + * added `Symbol.species` + * added `Symbol.split` + * added `Symbol.toPrimitive` + * added `Symbol.unscopables` + +##### 0.2.2 - 2014.12.13 +* added [`RegExp#flags`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) ([December 2014 Draft Rev 29](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#december_6_2014_draft_rev_29)) +* added [`String.raw`](https://github.com/zloirock/core-js/#ecmascript-6-string) + +##### 0.2.1 - 2014.12.12 +* repair converting -0 to +0 in [native collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) + +##### 0.2.0 - 2014.12.06 +* added [`es7.proposals`](https://github.com/zloirock/core-js/#ecmascript-7) and [`es7.abstract-refs`](https://github.com/zenparsing/es-abstract-refs) modules +* added [`String#at`](https://github.com/zloirock/core-js/#ecmascript-7) +* added real [`String Iterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), older versions used Array Iterator +* added abstract references support: + * added `Symbol.referenceGet` + * added `Symbol.referenceSet` + * added `Symbol.referenceDelete` + * added `Function#@@referenceGet` + * added `Map#@@referenceGet` + * added `Map#@@referenceSet` + * added `Map#@@referenceDelete` + * added `WeakMap#@@referenceGet` + * added `WeakMap#@@referenceSet` + * added `WeakMap#@@referenceDelete` + * added `Dict.{...methods}[@@referenceGet]` +* removed deprecated `.contains` methods +* some fixes + +##### 0.1.5 - 2014.12.01 +* added [`Array#copyWithin`](https://github.com/zloirock/core-js/#ecmascript-6-array) +* added [`String#codePointAt`](https://github.com/zloirock/core-js/#ecmascript-6-string) +* added [`String.fromCodePoint`](https://github.com/zloirock/core-js/#ecmascript-6-string) + +##### 0.1.4 - 2014.11.27 +* added [`Dict.mapPairs`](https://github.com/zloirock/core-js/#dict) + +##### 0.1.3 - 2014.11.20 +* [TC39 November meeting](https://github.com/rwaldron/tc39-notes/tree/master/es6/2014-11): + * [`.contains` -> `.includes`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-18.md#51--44-arrayprototypecontains-and-stringprototypecontains) + * `String#contains` -> [`String#includes`](https://github.com/zloirock/core-js/#ecmascript-6-string) + * `Array#contains` -> [`Array#includes`](https://github.com/zloirock/core-js/#ecmascript-7) + * `Dict.contains` -> [`Dict.includes`](https://github.com/zloirock/core-js/#dict) + * [removed `WeakMap#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm) + * [removed `WeakSet#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm) + +##### 0.1.2 - 2014.11.19 +* `Map` & `Set` bug fix + +##### 0.1.1 - 2014.11.18 +* public release \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/Gruntfile.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/Gruntfile.js new file mode 100644 index 00000000..afbcd948 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/Gruntfile.js @@ -0,0 +1,2 @@ +require('LiveScript'); +module.exports = require('./build/Gruntfile'); \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/LICENSE b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/LICENSE new file mode 100644 index 00000000..669bcc98 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Denis Pushkarev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/bower.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/bower.json new file mode 100644 index 00000000..05688197 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/bower.json @@ -0,0 +1,34 @@ +{ + "name": "core.js", + "main": "client/core.js", + "version": "1.2.7", + "description": "Standard Library", + "keywords": [ + "ES6", + "ECMAScript 6", + "ES7", + "ECMAScript 7", + "Map", + "Set", + "WeakMap", + "WeakSet", + "Dict", + "Promise", + "Symbol", + "console" + ], + "authors": [ + "Denis Pushkarev (http://zloirock.ru/)" + ], + "license": "MIT", + "homepage": "https://github.com/zloirock/core-js", + "repository": { + "type": "git", + "url": "https://github.com/zloirock/core-js.git" + }, + "ignore": [ + "build", + "node_modules", + "tests" + ] +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/Gruntfile.ls b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/Gruntfile.ls new file mode 100644 index 00000000..61518424 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/Gruntfile.ls @@ -0,0 +1,84 @@ +require! <[./build fs ./config]> +library-tests = <[client/library.js tests/helpers.js tests/library.js]>map -> src: it +module.exports = (grunt)-> + grunt.loadNpmTasks \grunt-contrib-clean + grunt.loadNpmTasks \grunt-contrib-copy + grunt.loadNpmTasks \grunt-contrib-uglify + grunt.loadNpmTasks \grunt-contrib-watch + grunt.loadNpmTasks \grunt-livescript + grunt.loadNpmTasks \grunt-karma + grunt.initConfig do + pkg: grunt.file.readJSON './package.json' + uglify: build: + files: '<%=grunt.option("path")%>.min.js': '<%=grunt.option("path")%>.js' + options: + mangle: {+sort, +keep_fnames} + compress: {+pure_getters, +keep_fargs, +keep_fnames} + sourceMap: on + banner: config.banner + livescript: src: files: + './tests/helpers.js': './tests/helpers/*' + './tests/tests.js': './tests/tests/*' + './tests/library.js': './tests/library/*' + './tests/es.js': './tests/tests/es*' + './tests/experimental.js': './tests/experimental/*' + './build/index.js': './build/build.ls*' + clean: <[./library]> + copy: lib: files: + * expand: on + cwd: './' + src: <[es5/** es6/** es7/** js/** web/** core/** fn/** index.js shim.js]> + dest: './library/' + * expand: on + cwd: './' + src: <[modules/*]> + dest: './library/' + filter: \isFile + * expand: on + cwd: './modules/library/' + src: '*' + dest: './library/modules/' + watch: + core: + files: './modules/*' + tasks: \default + tests: + files: './tests/tests/*' + tasks: \livescript + karma: + 'options': + configFile: './tests/karma.conf.js' + browsers: <[PhantomJS]> + singleRun: on + 'continuous': {} + 'continuous-library': + files: library-tests + grunt.registerTask \build (options)-> + done = @async! + err, it <- build { + modules: (options || 'es5,es6,es7,js,web,core')split \, + blacklist: (grunt.option(\blacklist) || '')split \, + library: !!grunt.option \library + } + if err + console.error err + process.exit 1 + grunt.option(\path) || grunt.option(\path, './custom') + fs.writeFile grunt.option(\path) + '.js', it, done + grunt.registerTask \client -> + grunt.option \library '' + grunt.option \path './client/core' + grunt.task.run <[build:es5,es6,es7,js,web,core uglify]> + grunt.registerTask \library -> + grunt.option \library 'true' + grunt.option \path './client/library' + grunt.task.run <[build:es5,es6,es7,js,web,core uglify]> + grunt.registerTask \shim -> + grunt.option \library '' + grunt.option \path './client/shim' + grunt.task.run <[build:es5,es6,es7,js,web uglify]> + grunt.registerTask \e -> + grunt.option \library ''> + grunt.option \path './client/core' + grunt.task.run <[build:es5,es6,es7,js,web,core,exp uglify]> + grunt.registerTask \default <[clean copy client library shim]> \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/build.ls b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/build.ls new file mode 100644 index 00000000..274ffc42 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/build.ls @@ -0,0 +1,218 @@ +require! {'./config': {banner}, fs: {readFile, writeFile, unlink}, path, webpack} + +list = <[ + es5 + es6.symbol + es6.object.assign + es6.object.is + es6.object.set-prototype-of + es6.object.to-string + es6.object.freeze + es6.object.seal + es6.object.prevent-extensions + es6.object.is-frozen + es6.object.is-sealed + es6.object.is-extensible + es6.object.get-own-property-descriptor + es6.object.get-prototype-of + es6.object.keys + es6.object.get-own-property-names + es6.function.name + es6.function.has-instance + es6.number.constructor + es6.number.epsilon + es6.number.is-finite + es6.number.is-integer + es6.number.is-nan + es6.number.is-safe-integer + es6.number.max-safe-integer + es6.number.min-safe-integer + es6.number.parse-float + es6.number.parse-int + es6.math.acosh + es6.math.asinh + es6.math.atanh + es6.math.cbrt + es6.math.clz32 + es6.math.cosh + es6.math.expm1 + es6.math.fround + es6.math.hypot + es6.math.imul + es6.math.log10 + es6.math.log1p + es6.math.log2 + es6.math.sign + es6.math.sinh + es6.math.tanh + es6.math.trunc + es6.string.from-code-point + es6.string.raw + es6.string.trim + es6.string.code-point-at + es6.string.ends-with + es6.string.includes + es6.string.repeat + es6.string.starts-with + es6.string.iterator + es6.array.from + es6.array.of + es6.array.iterator + es6.array.species + es6.array.copy-within + es6.array.fill + es6.array.find + es6.array.find-index + es6.regexp.constructor + es6.regexp.flags + es6.regexp.match + es6.regexp.replace + es6.regexp.search + es6.regexp.split + es6.promise + es6.map + es6.set + es6.weak-map + es6.weak-set + es6.reflect.apply + es6.reflect.construct + es6.reflect.define-property + es6.reflect.delete-property + es6.reflect.enumerate + es6.reflect.get + es6.reflect.get-own-property-descriptor + es6.reflect.get-prototype-of + es6.reflect.has + es6.reflect.is-extensible + es6.reflect.own-keys + es6.reflect.prevent-extensions + es6.reflect.set + es6.reflect.set-prototype-of + es6.date.to-string + es6.typed.array-buffer + es6.typed.data-view + es6.typed.int8-array + es6.typed.uint8-array + es6.typed.uint8-clamped-array + es6.typed.int16-array + es6.typed.uint16-array + es6.typed.int32-array + es6.typed.uint32-array + es6.typed.float32-array + es6.typed.float64-array + es7.array.includes + es7.string.at + es7.string.pad-left + es7.string.pad-right + es7.string.trim-left + es7.string.trim-right + es7.regexp.escape + es7.object.get-own-property-descriptors + es7.object.values + es7.object.entries + es7.map.to-json + es7.set.to-json + web.immediate + web.dom.iterable + web.timers + core.dict + core.get-iterator-method + core.get-iterator + core.is-iterable + core.delay + core.function.part + core.object.is-object + core.object.classof + core.object.define + core.object.make + core.number.iterator + core.string.escape-html + core.string.unescape-html + core.log + js.array.statics +]> + +experimental = <[ + es6.date.to-string + es6.typed.array-buffer + es6.typed.data-view + es6.typed.int8-array + es6.typed.uint8-array + es6.typed.uint8-clamped-array + es6.typed.int16-array + es6.typed.uint16-array + es6.typed.int32-array + es6.typed.uint32-array + es6.typed.float32-array + es6.typed.float64-array +]> + +libraryBlacklist = <[ + es6.object.to-string + es6.function.name + es6.regexp.constructor + es6.regexp.flags + es6.regexp.match + es6.regexp.replace + es6.regexp.search + es6.regexp.split + es6.number.constructor +]> + +es5SpecialCase = <[ + es6.object.freeze + es6.object.seal + es6.object.prevent-extensions + es6.object.is-frozen + es6.object.is-sealed + es6.object.is-extensible + es6.string.trim +]> + +module.exports = ({modules = [], blacklist = [], library = no}, next)!-> + let @ = modules.reduce ((memo, it)-> memo[it] = on; memo), {} + check = (err)-> + if err + next err, '' + on + + if @exp => for experimental => @[..] = on + if @es5 => for es5SpecialCase => @[..] = on + for ns of @ + if @[ns] + for name in list + if name.indexOf("#ns.") is 0 and name not in experimental + @[name] = on + + if library => blacklist ++= libraryBlacklist + for ns in blacklist + for name in list + if name is ns or name.indexOf("#ns.") is 0 + @[name] = no + + TARGET = "./__tmp#{ Math.random! }__.js" + err, info <~! webpack do + entry: list.filter(~> @[it]).map ~> + path.join(__dirname, '../', "#{ if library => '/library' else '' }/modules/#it") + output: + path: '' + filename: TARGET + if check err => return + err, script <~! readFile TARGET + if check err => return + err <~! unlink TARGET + if check err => return + + next null """ + #banner + !function(__e, __g, undefined){ + 'use strict'; + #script + // CommonJS export + if(typeof module != 'undefined' && module.exports)module.exports = __e; + // RequireJS export + else if(typeof define == 'function' && define.amd)define(function(){return __e}); + // Export to global object + else __g.core = __e; + }(1, 1); + """ diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/config.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/config.js new file mode 100644 index 00000000..8df3dc6e --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/config.js @@ -0,0 +1,8 @@ +module.exports = { + banner: '/**\n' + + ' * core-js ' + require('../package').version + '\n' + + ' * https://github.com/zloirock/core-js\n' + + ' * License: http://rock.mit-license.org\n' + + ' * © ' + new Date().getFullYear() + ' Denis Pushkarev\n' + + ' */' +}; \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/index.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/index.js new file mode 100644 index 00000000..d9cf11f3 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/build/index.js @@ -0,0 +1,98 @@ +// Generated by LiveScript 1.3.1 +(function(){ + var banner, ref$, readFile, writeFile, unlink, path, webpack, list, experimental, libraryBlacklist, es5SpecialCase; + banner = require('./config').banner; + ref$ = require('fs'), readFile = ref$.readFile, writeFile = ref$.writeFile, unlink = ref$.unlink; + path = require('path'); + webpack = require('webpack'); + list = ['es5', 'es6.symbol', 'es6.object.assign', 'es6.object.is', 'es6.object.set-prototype-of', 'es6.object.to-string', 'es6.object.freeze', 'es6.object.seal', 'es6.object.prevent-extensions', 'es6.object.is-frozen', 'es6.object.is-sealed', 'es6.object.is-extensible', 'es6.object.get-own-property-descriptor', 'es6.object.get-prototype-of', 'es6.object.keys', 'es6.object.get-own-property-names', 'es6.function.name', 'es6.function.has-instance', 'es6.number.constructor', 'es6.number.epsilon', 'es6.number.is-finite', 'es6.number.is-integer', 'es6.number.is-nan', 'es6.number.is-safe-integer', 'es6.number.max-safe-integer', 'es6.number.min-safe-integer', 'es6.number.parse-float', 'es6.number.parse-int', 'es6.math.acosh', 'es6.math.asinh', 'es6.math.atanh', 'es6.math.cbrt', 'es6.math.clz32', 'es6.math.cosh', 'es6.math.expm1', 'es6.math.fround', 'es6.math.hypot', 'es6.math.imul', 'es6.math.log10', 'es6.math.log1p', 'es6.math.log2', 'es6.math.sign', 'es6.math.sinh', 'es6.math.tanh', 'es6.math.trunc', 'es6.string.from-code-point', 'es6.string.raw', 'es6.string.trim', 'es6.string.code-point-at', 'es6.string.ends-with', 'es6.string.includes', 'es6.string.repeat', 'es6.string.starts-with', 'es6.string.iterator', 'es6.array.from', 'es6.array.of', 'es6.array.iterator', 'es6.array.species', 'es6.array.copy-within', 'es6.array.fill', 'es6.array.find', 'es6.array.find-index', 'es6.regexp.constructor', 'es6.regexp.flags', 'es6.regexp.match', 'es6.regexp.replace', 'es6.regexp.search', 'es6.regexp.split', 'es6.promise', 'es6.map', 'es6.set', 'es6.weak-map', 'es6.weak-set', 'es6.reflect.apply', 'es6.reflect.construct', 'es6.reflect.define-property', 'es6.reflect.delete-property', 'es6.reflect.enumerate', 'es6.reflect.get', 'es6.reflect.get-own-property-descriptor', 'es6.reflect.get-prototype-of', 'es6.reflect.has', 'es6.reflect.is-extensible', 'es6.reflect.own-keys', 'es6.reflect.prevent-extensions', 'es6.reflect.set', 'es6.reflect.set-prototype-of', 'es6.date.to-string', 'es6.typed.array-buffer', 'es6.typed.data-view', 'es6.typed.int8-array', 'es6.typed.uint8-array', 'es6.typed.uint8-clamped-array', 'es6.typed.int16-array', 'es6.typed.uint16-array', 'es6.typed.int32-array', 'es6.typed.uint32-array', 'es6.typed.float32-array', 'es6.typed.float64-array', 'es7.array.includes', 'es7.string.at', 'es7.string.pad-left', 'es7.string.pad-right', 'es7.string.trim-left', 'es7.string.trim-right', 'es7.regexp.escape', 'es7.object.get-own-property-descriptors', 'es7.object.values', 'es7.object.entries', 'es7.map.to-json', 'es7.set.to-json', 'web.immediate', 'web.dom.iterable', 'web.timers', 'core.dict', 'core.get-iterator-method', 'core.get-iterator', 'core.is-iterable', 'core.delay', 'core.function.part', 'core.object.is-object', 'core.object.classof', 'core.object.define', 'core.object.make', 'core.number.iterator', 'core.string.escape-html', 'core.string.unescape-html', 'core.log', 'js.array.statics']; + experimental = ['es6.date.to-string', 'es6.typed.array-buffer', 'es6.typed.data-view', 'es6.typed.int8-array', 'es6.typed.uint8-array', 'es6.typed.uint8-clamped-array', 'es6.typed.int16-array', 'es6.typed.uint16-array', 'es6.typed.int32-array', 'es6.typed.uint32-array', 'es6.typed.float32-array', 'es6.typed.float64-array']; + libraryBlacklist = ['es6.object.to-string', 'es6.function.name', 'es6.regexp.constructor', 'es6.regexp.flags', 'es6.regexp.match', 'es6.regexp.replace', 'es6.regexp.search', 'es6.regexp.split', 'es6.number.constructor']; + es5SpecialCase = ['es6.object.freeze', 'es6.object.seal', 'es6.object.prevent-extensions', 'es6.object.is-frozen', 'es6.object.is-sealed', 'es6.object.is-extensible', 'es6.string.trim']; + module.exports = function(arg$, next){ + var modules, ref$, blacklist, library; + modules = (ref$ = arg$.modules) != null + ? ref$ + : [], blacklist = (ref$ = arg$.blacklist) != null + ? ref$ + : [], library = (ref$ = arg$.library) != null ? ref$ : false; + (function(){ + var check, i$, x$, ref$, len$, y$, ns, name, j$, len1$, TARGET, this$ = this; + check = function(err){ + if (err) { + next(err, ''); + return true; + } + }; + if (this.exp) { + for (i$ = 0, len$ = (ref$ = experimental).length; i$ < len$; ++i$) { + x$ = ref$[i$]; + this[x$] = true; + } + } + if (this.es5) { + for (i$ = 0, len$ = (ref$ = es5SpecialCase).length; i$ < len$; ++i$) { + y$ = ref$[i$]; + this[y$] = true; + } + } + for (ns in this) { + if (this[ns]) { + for (i$ = 0, len$ = (ref$ = list).length; i$ < len$; ++i$) { + name = ref$[i$]; + if (name.indexOf(ns + ".") === 0 && !in$(name, experimental)) { + this[name] = true; + } + } + } + } + if (library) { + blacklist = blacklist.concat(libraryBlacklist); + } + for (i$ = 0, len$ = blacklist.length; i$ < len$; ++i$) { + ns = blacklist[i$]; + for (j$ = 0, len1$ = (ref$ = list).length; j$ < len1$; ++j$) { + name = ref$[j$]; + if (name === ns || name.indexOf(ns + ".") === 0) { + this[name] = false; + } + } + } + TARGET = "./__tmp" + Math.random() + "__.js"; + webpack({ + entry: list.filter(function(it){ + return this$[it]; + }).map(function(it){ + return path.join(__dirname, '../', (library ? '/library' : '') + "/modules/" + it); + }), + output: { + path: '', + filename: TARGET + } + }, function(err, info){ + if (check(err)) { + return; + } + readFile(TARGET, function(err, script){ + if (check(err)) { + return; + } + unlink(TARGET, function(err){ + if (check(err)) { + return; + } + next(null, "" + banner + "\n!function(__e, __g, undefined){\n'use strict';\n" + script + "\n// CommonJS export\nif(typeof module != 'undefined' && module.exports)module.exports = __e;\n// RequireJS export\nelse if(typeof define == 'function' && define.amd)define(function(){return __e});\n// Export to global object\nelse __g.core = __e;\n}(1, 1);"); + }); + }); + }); + }.call(modules.reduce(function(memo, it){ + memo[it] = true; + return memo; + }, {}))); + }; + function in$(x, xs){ + var i = -1, l = xs.length >>> 0; + while (++i < l) if (x === xs[i]) return true; + return false; + } +}).call(this); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/client/core.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/client/core.js new file mode 100644 index 00000000..b9bac6c5 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/core-js/client/core.js @@ -0,0 +1,4910 @@ +/** + * core-js 1.2.7 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2016 Denis Pushkarev + */ +!function(__e, __g, undefined){ +'use strict'; +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(1); + __webpack_require__(34); + __webpack_require__(40); + __webpack_require__(42); + __webpack_require__(44); + __webpack_require__(46); + __webpack_require__(48); + __webpack_require__(50); + __webpack_require__(51); + __webpack_require__(52); + __webpack_require__(53); + __webpack_require__(54); + __webpack_require__(55); + __webpack_require__(56); + __webpack_require__(57); + __webpack_require__(58); + __webpack_require__(59); + __webpack_require__(60); + __webpack_require__(61); + __webpack_require__(64); + __webpack_require__(65); + __webpack_require__(66); + __webpack_require__(68); + __webpack_require__(69); + __webpack_require__(70); + __webpack_require__(71); + __webpack_require__(72); + __webpack_require__(73); + __webpack_require__(74); + __webpack_require__(76); + __webpack_require__(77); + __webpack_require__(78); + __webpack_require__(80); + __webpack_require__(81); + __webpack_require__(82); + __webpack_require__(84); + __webpack_require__(85); + __webpack_require__(86); + __webpack_require__(87); + __webpack_require__(88); + __webpack_require__(89); + __webpack_require__(90); + __webpack_require__(91); + __webpack_require__(92); + __webpack_require__(93); + __webpack_require__(94); + __webpack_require__(95); + __webpack_require__(96); + __webpack_require__(97); + __webpack_require__(99); + __webpack_require__(103); + __webpack_require__(104); + __webpack_require__(106); + __webpack_require__(107); + __webpack_require__(111); + __webpack_require__(116); + __webpack_require__(117); + __webpack_require__(120); + __webpack_require__(122); + __webpack_require__(124); + __webpack_require__(126); + __webpack_require__(127); + __webpack_require__(128); + __webpack_require__(130); + __webpack_require__(131); + __webpack_require__(133); + __webpack_require__(134); + __webpack_require__(135); + __webpack_require__(136); + __webpack_require__(143); + __webpack_require__(146); + __webpack_require__(147); + __webpack_require__(149); + __webpack_require__(150); + __webpack_require__(151); + __webpack_require__(152); + __webpack_require__(153); + __webpack_require__(154); + __webpack_require__(155); + __webpack_require__(156); + __webpack_require__(157); + __webpack_require__(158); + __webpack_require__(159); + __webpack_require__(160); + __webpack_require__(162); + __webpack_require__(163); + __webpack_require__(164); + __webpack_require__(165); + __webpack_require__(166); + __webpack_require__(167); + __webpack_require__(169); + __webpack_require__(170); + __webpack_require__(171); + __webpack_require__(172); + __webpack_require__(174); + __webpack_require__(175); + __webpack_require__(177); + __webpack_require__(178); + __webpack_require__(180); + __webpack_require__(181); + __webpack_require__(182); + __webpack_require__(183); + __webpack_require__(186); + __webpack_require__(114); + __webpack_require__(188); + __webpack_require__(187); + __webpack_require__(189); + __webpack_require__(190); + __webpack_require__(191); + __webpack_require__(192); + __webpack_require__(193); + __webpack_require__(195); + __webpack_require__(196); + __webpack_require__(197); + __webpack_require__(198); + __webpack_require__(199); + module.exports = __webpack_require__(200); + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(2) + , $export = __webpack_require__(3) + , DESCRIPTORS = __webpack_require__(8) + , createDesc = __webpack_require__(7) + , html = __webpack_require__(14) + , cel = __webpack_require__(15) + , has = __webpack_require__(17) + , cof = __webpack_require__(18) + , invoke = __webpack_require__(19) + , fails = __webpack_require__(9) + , anObject = __webpack_require__(20) + , aFunction = __webpack_require__(13) + , isObject = __webpack_require__(16) + , toObject = __webpack_require__(21) + , toIObject = __webpack_require__(23) + , toInteger = __webpack_require__(25) + , toIndex = __webpack_require__(26) + , toLength = __webpack_require__(27) + , IObject = __webpack_require__(24) + , IE_PROTO = __webpack_require__(11)('__proto__') + , createArrayMethod = __webpack_require__(28) + , arrayIndexOf = __webpack_require__(33)(false) + , ObjectProto = Object.prototype + , ArrayProto = Array.prototype + , arraySlice = ArrayProto.slice + , arrayJoin = ArrayProto.join + , defineProperty = $.setDesc + , getOwnDescriptor = $.getDesc + , defineProperties = $.setDescs + , factories = {} + , IE8_DOM_DEFINE; + + if(!DESCRIPTORS){ + IE8_DOM_DEFINE = !fails(function(){ + return defineProperty(cel('div'), 'a', {get: function(){ return 7; }}).a != 7; + }); + $.setDesc = function(O, P, Attributes){ + if(IE8_DOM_DEFINE)try { + return defineProperty(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)anObject(O)[P] = Attributes.value; + return O; + }; + $.getDesc = function(O, P){ + if(IE8_DOM_DEFINE)try { + return getOwnDescriptor(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]); + }; + $.setDescs = defineProperties = function(O, Properties){ + anObject(O); + var keys = $.getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)$.setDesc(O, P = keys[i++], Properties[P]); + return O; + }; + } + $export($export.S + $export.F * !DESCRIPTORS, 'Object', { + // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $.getDesc, + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + defineProperty: $.setDesc, + // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) + defineProperties: defineProperties + }); + + // IE 8- don't enum bug keys + var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' + + 'toLocaleString,toString,valueOf').split(',') + // Additional keys for getOwnPropertyNames + , keys2 = keys1.concat('length', 'prototype') + , keysLen1 = keys1.length; + + // Create object with `null` prototype: use iframe Object with cleared prototype + var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = cel('iframe') + , i = keysLen1 + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(' +``` + +Note that the [es5-shim](https://github.com/es-shims/es5-shim) must be loaded before this library to support browsers pre IE9. + +```html + +``` + +## Usage + +The example below shows how you can load the promise library (in a way that works on both client and server using node or browserify). It then demonstrates creating a promise from scratch. You simply call `new Promise(fn)`. There is a complete specification for what is returned by this method in [Promises/A+](http://promises-aplus.github.com/promises-spec/). + +```javascript +var Promise = require('promise'); + +var promise = new Promise(function (resolve, reject) { + get('http://www.google.com', function (err, res) { + if (err) reject(err); + else resolve(res); + }); +}); +``` + +If you need [domains](https://iojs.org/api/domain.html) support, you should instead use: + +```js +var Promise = require('promise/domains'); +``` + +If you are in an environment that implements `setImmediate` and don't want the optimisations provided by asap, you can use: + +```js +var Promise = require('promise/setimmediate'); +``` + +If you only want part of the features, e.g. just a pure ES6 polyfill: + +```js +var Promise = require('promise/lib/es6-extensions'); +// or require('promise/domains/es6-extensions'); +// or require('promise/setimmediate/es6-extensions'); +``` + +## Unhandled Rejections + +By default, promises silence any unhandled rejections. + +You can enable logging of unhandled ReferenceErrors and TypeErrors via: + +```js +require('promise/lib/rejection-tracking').enable(); +``` + +Due to the performance cost, you should only do this during development. + +You can enable logging of all unhandled rejections if you need to debug an exception you think is being swallowed by promises: + +```js +require('promise/lib/rejection-tracking').enable( + {allRejections: true} +); +``` + +Due to the high probability of false positives, I only recommend using this when debugging specific issues that you think may be being swallowed. For the preferred debugging method, see `Promise#done(onFulfilled, onRejected)`. + +`rejection-tracking.enable(options)` takes the following options: + + - allRejections (`boolean`) - track all exceptions, not just reference errors and type errors. Note that this has a high probability of resulting in false positives if your code loads data optimisticly + - whitelist (`Array`) - this defaults to `[ReferenceError, TypeError]` but you can override it with your own list of error constructors to track. + - `onUnhandled(id, error)` and `onHandled(id, error)` - you can use these to provide your own customised display for errors. Note that if possible you should indicate that the error was a false positive if `onHandled` is called. `onHandled` is only called if `onUnhandled` has already been called. + +To reduce the chance of false-positives there is a delay of up to 2 seconds before errors are logged. This means that if you attach an error handler within 2 seconds, it won't be logged as a false positive. ReferenceErrors and TypeErrors are only subject to a 100ms delay due to the higher likelihood that the error is due to programmer error. + +## API + +Before all examples, you will need: + +```js +var Promise = require('promise'); +``` + +### new Promise(resolver) + +This creates and returns a new promise. `resolver` must be a function. The `resolver` function is passed two arguments: + + 1. `resolve` should be called with a single argument. If it is called with a non-promise value then the promise is fulfilled with that value. If it is called with a promise (A) then the returned promise takes on the state of that new promise (A). + 2. `reject` should be called with a single argument. The returned promise will be rejected with that argument. + +### Static Functions + + These methods are invoked by calling `Promise.methodName`. + +#### Promise.resolve(value) + +(deprecated aliases: `Promise.from(value)`, `Promise.cast(value)`) + +Converts values and foreign promises into Promises/A+ promises. If you pass it a value then it returns a Promise for that value. If you pass it something that is close to a promise (such as a jQuery attempt at a promise) it returns a Promise that takes on the state of `value` (rejected or fulfilled). + +#### Promise.reject(value) + +Returns a rejected promise with the given value. + +#### Promise.all(array) + +Returns a promise for an array. If it is called with a single argument that `Array.isArray` then this returns a promise for a copy of that array with any promises replaced by their fulfilled values. e.g. + +```js +Promise.all([Promise.resolve('a'), 'b', Promise.resolve('c')]) + .then(function (res) { + assert(res[0] === 'a') + assert(res[1] === 'b') + assert(res[2] === 'c') + }) +``` + +#### Promise.denodeify(fn) + +_Non Standard_ + +Takes a function which accepts a node style callback and returns a new function that returns a promise instead. + +e.g. + +```javascript +var fs = require('fs') + +var read = Promise.denodeify(fs.readFile) +var write = Promise.denodeify(fs.writeFile) + +var p = read('foo.json', 'utf8') + .then(function (str) { + return write('foo.json', JSON.stringify(JSON.parse(str), null, ' '), 'utf8') + }) +``` + +#### Promise.nodeify(fn) + +_Non Standard_ + +The twin to `denodeify` is useful when you want to export an API that can be used by people who haven't learnt about the brilliance of promises yet. + +```javascript +module.exports = Promise.nodeify(awesomeAPI) +function awesomeAPI(a, b) { + return download(a, b) +} +``` + +If the last argument passed to `module.exports` is a function, then it will be treated like a node.js callback and not parsed on to the child function, otherwise the API will just return a promise. + +### Prototype Methods + +These methods are invoked on a promise instance by calling `myPromise.methodName` + +### Promise#then(onFulfilled, onRejected) + +This method follows the [Promises/A+ spec](http://promises-aplus.github.io/promises-spec/). It explains things very clearly so I recommend you read it. + +Either `onFulfilled` or `onRejected` will be called and they will not be called more than once. They will be passed a single argument and will always be called asynchronously (in the next turn of the event loop). + +If the promise is fulfilled then `onFulfilled` is called. If the promise is rejected then `onRejected` is called. + +The call to `.then` also returns a promise. If the handler that is called returns a promise, the promise returned by `.then` takes on the state of that returned promise. If the handler that is called returns a value that is not a promise, the promise returned by `.then` will be fulfilled with that value. If the handler that is called throws an exception then the promise returned by `.then` is rejected with that exception. + +#### Promise#catch(onRejected) + +Sugar for `Promise#then(null, onRejected)`, to mirror `catch` in synchronous code. + +#### Promise#done(onFulfilled, onRejected) + +_Non Standard_ + +The same semantics as `.then` except that it does not return a promise and any exceptions are re-thrown so that they can be logged (crashing the application in non-browser environments) + +#### Promise#nodeify(callback) + +_Non Standard_ + +If `callback` is `null` or `undefined` it just returns `this`. If `callback` is a function it is called with rejection reason as the first argument and result as the second argument (as per the node.js convention). + +This lets you write API functions that look like: + +```javascript +function awesomeAPI(foo, bar, callback) { + return internalAPI(foo, bar) + .then(parseResult) + .then(null, retryErrors) + .nodeify(callback) +} +``` + +People who use typical node.js style callbacks will be able to just pass a callback and get the expected behavior. The enlightened people can not pass a callback and will get awesome promises. + +## License + + MIT diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/build.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/build.js new file mode 100644 index 00000000..1e028e9a --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/build.js @@ -0,0 +1,69 @@ +'use strict'; + +var fs = require('fs'); +var rimraf = require('rimraf'); +var acorn = require('acorn'); +var walk = require('acorn/dist/walk'); + +var ids = []; +var names = {}; + +function getIdFor(name) { + if (name in names) return names[name]; + var id; + do { + id = '_' + Math.floor(Math.random() * 100); + } while (ids.indexOf(id) !== -1) + ids.push(id); + names[name] = id; + return id; +} + +function fixup(src) { + var ast = acorn.parse(src); + src = src.split(''); + walk.simple(ast, { + MemberExpression: function (node) { + if (node.computed) return; + if (node.property.type !== 'Identifier') return; + if (node.property.name[0] !== '_') return; + replace(node.property, getIdFor(node.property.name)); + } + }); + function source(node) { + return src.slice(node.start, node.end).join(''); + } + function replace(node, str) { + for (var i = node.start; i < node.end; i++) { + src[i] = ''; + } + src[node.start] = str; + } + return src.join(''); +} +rimraf.sync(__dirname + '/lib/'); +fs.mkdirSync(__dirname + '/lib/'); +fs.readdirSync(__dirname + '/src').forEach(function (filename) { + var src = fs.readFileSync(__dirname + '/src/' + filename, 'utf8'); + var out = fixup(src); + fs.writeFileSync(__dirname + '/lib/' + filename, out); +}); + +rimraf.sync(__dirname + '/domains/'); +fs.mkdirSync(__dirname + '/domains/'); +fs.readdirSync(__dirname + '/src').forEach(function (filename) { + var src = fs.readFileSync(__dirname + '/src/' + filename, 'utf8'); + var out = fixup(src); + out = out.replace(/require\(\'asap\/raw\'\)/g, "require('asap')"); + fs.writeFileSync(__dirname + '/domains/' + filename, out); +}); + +rimraf.sync(__dirname + '/setimmediate/'); +fs.mkdirSync(__dirname + '/setimmediate/'); +fs.readdirSync(__dirname + '/src').forEach(function (filename) { + var src = fs.readFileSync(__dirname + '/src/' + filename, 'utf8'); + var out = fixup(src); + out = out.replace(/var asap \= require\(\'([a-z\/]+)\'\);/g, ''); + out = out.replace(/asap/g, "setImmediate"); + fs.writeFileSync(__dirname + '/setimmediate/' + filename, out); +}); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/core.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/core.js new file mode 100644 index 00000000..5f332a20 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/core.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./lib/core.js'); + +console.error('require("promise/core") is deprecated, use require("promise/lib/core") instead.'); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/core.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/core.js new file mode 100644 index 00000000..aea44148 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/core.js @@ -0,0 +1,213 @@ +'use strict'; + +var asap = require('asap'); + +function noop() {} + +// States: +// +// 0 - pending +// 1 - fulfilled with _value +// 2 - rejected with _value +// 3 - adopted the state of another promise, _value +// +// once the state is no longer pending (0) it is immutable + +// All `_` prefixed properties will be reduced to `_{random number}` +// at build time to obfuscate them and discourage their use. +// We don't use symbols or Object.defineProperty to fully hide them +// because the performance isn't good enough. + + +// to avoid using try/catch inside critical functions, we +// extract them to here. +var LAST_ERROR = null; +var IS_ERROR = {}; +function getThen(obj) { + try { + return obj.then; + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} + +function tryCallOne(fn, a) { + try { + return fn(a); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} +function tryCallTwo(fn, a, b) { + try { + fn(a, b); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} + +module.exports = Promise; + +function Promise(fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); + } + if (typeof fn !== 'function') { + throw new TypeError('Promise constructor\'s argument is not a function'); + } + this._40 = 0; + this._65 = 0; + this._55 = null; + this._72 = null; + if (fn === noop) return; + doResolve(fn, this); +} +Promise._37 = null; +Promise._87 = null; +Promise._61 = noop; + +Promise.prototype.then = function(onFulfilled, onRejected) { + if (this.constructor !== Promise) { + return safeThen(this, onFulfilled, onRejected); + } + var res = new Promise(noop); + handle(this, new Handler(onFulfilled, onRejected, res)); + return res; +}; + +function safeThen(self, onFulfilled, onRejected) { + return new self.constructor(function (resolve, reject) { + var res = new Promise(noop); + res.then(resolve, reject); + handle(self, new Handler(onFulfilled, onRejected, res)); + }); +} +function handle(self, deferred) { + while (self._65 === 3) { + self = self._55; + } + if (Promise._37) { + Promise._37(self); + } + if (self._65 === 0) { + if (self._40 === 0) { + self._40 = 1; + self._72 = deferred; + return; + } + if (self._40 === 1) { + self._40 = 2; + self._72 = [self._72, deferred]; + return; + } + self._72.push(deferred); + return; + } + handleResolved(self, deferred); +} + +function handleResolved(self, deferred) { + asap(function() { + var cb = self._65 === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + if (self._65 === 1) { + resolve(deferred.promise, self._55); + } else { + reject(deferred.promise, self._55); + } + return; + } + var ret = tryCallOne(cb, self._55); + if (ret === IS_ERROR) { + reject(deferred.promise, LAST_ERROR); + } else { + resolve(deferred.promise, ret); + } + }); +} +function resolve(self, newValue) { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) { + return reject( + self, + new TypeError('A promise cannot be resolved with itself.') + ); + } + if ( + newValue && + (typeof newValue === 'object' || typeof newValue === 'function') + ) { + var then = getThen(newValue); + if (then === IS_ERROR) { + return reject(self, LAST_ERROR); + } + if ( + then === self.then && + newValue instanceof Promise + ) { + self._65 = 3; + self._55 = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(then.bind(newValue), self); + return; + } + } + self._65 = 1; + self._55 = newValue; + finale(self); +} + +function reject(self, newValue) { + self._65 = 2; + self._55 = newValue; + if (Promise._87) { + Promise._87(self, newValue); + } + finale(self); +} +function finale(self) { + if (self._40 === 1) { + handle(self, self._72); + self._72 = null; + } + if (self._40 === 2) { + for (var i = 0; i < self._72.length; i++) { + handle(self, self._72[i]); + } + self._72 = null; + } +} + +function Handler(onFulfilled, onRejected, promise){ + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; +} + +/** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ +function doResolve(fn, promise) { + var done = false; + var res = tryCallTwo(fn, function (value) { + if (done) return; + done = true; + resolve(promise, value); + }, function (reason) { + if (done) return; + done = true; + reject(promise, reason); + }); + if (!done && res === IS_ERROR) { + done = true; + reject(promise, LAST_ERROR); + } +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/done.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/done.js new file mode 100644 index 00000000..f879317d --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/done.js @@ -0,0 +1,13 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.prototype.done = function (onFulfilled, onRejected) { + var self = arguments.length ? this.then.apply(this, arguments) : this; + self.then(null, function (err) { + setTimeout(function () { + throw err; + }, 0); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/es6-extensions.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/es6-extensions.js new file mode 100644 index 00000000..8ab26669 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/es6-extensions.js @@ -0,0 +1,107 @@ +'use strict'; + +//This file contains the ES6 extensions to the core Promises/A+ API + +var Promise = require('./core.js'); + +module.exports = Promise; + +/* Static Functions */ + +var TRUE = valuePromise(true); +var FALSE = valuePromise(false); +var NULL = valuePromise(null); +var UNDEFINED = valuePromise(undefined); +var ZERO = valuePromise(0); +var EMPTYSTRING = valuePromise(''); + +function valuePromise(value) { + var p = new Promise(Promise._61); + p._65 = 1; + p._55 = value; + return p; +} +Promise.resolve = function (value) { + if (value instanceof Promise) return value; + + if (value === null) return NULL; + if (value === undefined) return UNDEFINED; + if (value === true) return TRUE; + if (value === false) return FALSE; + if (value === 0) return ZERO; + if (value === '') return EMPTYSTRING; + + if (typeof value === 'object' || typeof value === 'function') { + try { + var then = value.then; + if (typeof then === 'function') { + return new Promise(then.bind(value)); + } + } catch (ex) { + return new Promise(function (resolve, reject) { + reject(ex); + }); + } + } + return valuePromise(value); +}; + +Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + + return new Promise(function (resolve, reject) { + if (args.length === 0) return resolve([]); + var remaining = args.length; + function res(i, val) { + if (val && (typeof val === 'object' || typeof val === 'function')) { + if (val instanceof Promise && val.then === Promise.prototype.then) { + while (val._65 === 3) { + val = val._55; + } + if (val._65 === 1) return res(i, val._55); + if (val._65 === 2) reject(val._55); + val.then(function (val) { + res(i, val); + }, reject); + return; + } else { + var then = val.then; + if (typeof then === 'function') { + var p = new Promise(then.bind(val)); + p.then(function (val) { + res(i, val); + }, reject); + return; + } + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); +}; + +Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); +}; + +Promise.race = function (values) { + return new Promise(function (resolve, reject) { + values.forEach(function(value){ + Promise.resolve(value).then(resolve, reject); + }); + }); +}; + +/* Prototype Methods */ + +Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/finally.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/finally.js new file mode 100644 index 00000000..f5ee0b98 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/finally.js @@ -0,0 +1,16 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.prototype['finally'] = function (f) { + return this.then(function (value) { + return Promise.resolve(f()).then(function () { + return value; + }); + }, function (err) { + return Promise.resolve(f()).then(function () { + throw err; + }); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/index.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/index.js new file mode 100644 index 00000000..6e674f38 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = require('./core.js'); +require('./done.js'); +require('./finally.js'); +require('./es6-extensions.js'); +require('./node-extensions.js'); +require('./synchronous.js'); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/node-extensions.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/node-extensions.js new file mode 100644 index 00000000..157cddc2 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/node-extensions.js @@ -0,0 +1,130 @@ +'use strict'; + +// This file contains then/promise specific extensions that are only useful +// for node.js interop + +var Promise = require('./core.js'); +var asap = require('asap'); + +module.exports = Promise; + +/* Static Functions */ + +Promise.denodeify = function (fn, argumentCount) { + if ( + typeof argumentCount === 'number' && argumentCount !== Infinity + ) { + return denodeifyWithCount(fn, argumentCount); + } else { + return denodeifyWithoutCount(fn); + } +}; + +var callbackFn = ( + 'function (err, res) {' + + 'if (err) { rj(err); } else { rs(res); }' + + '}' +); +function denodeifyWithCount(fn, argumentCount) { + var args = []; + for (var i = 0; i < argumentCount; i++) { + args.push('a' + i); + } + var body = [ + 'return function (' + args.join(',') + ') {', + 'var self = this;', + 'return new Promise(function (rs, rj) {', + 'var res = fn.call(', + ['self'].concat(args).concat([callbackFn]).join(','), + ');', + 'if (res &&', + '(typeof res === "object" || typeof res === "function") &&', + 'typeof res.then === "function"', + ') {rs(res);}', + '});', + '};' + ].join(''); + return Function(['Promise', 'fn'], body)(Promise, fn); +} +function denodeifyWithoutCount(fn) { + var fnLength = Math.max(fn.length - 1, 3); + var args = []; + for (var i = 0; i < fnLength; i++) { + args.push('a' + i); + } + var body = [ + 'return function (' + args.join(',') + ') {', + 'var self = this;', + 'var args;', + 'var argLength = arguments.length;', + 'if (arguments.length > ' + fnLength + ') {', + 'args = new Array(arguments.length + 1);', + 'for (var i = 0; i < arguments.length; i++) {', + 'args[i] = arguments[i];', + '}', + '}', + 'return new Promise(function (rs, rj) {', + 'var cb = ' + callbackFn + ';', + 'var res;', + 'switch (argLength) {', + args.concat(['extra']).map(function (_, index) { + return ( + 'case ' + (index) + ':' + + 'res = fn.call(' + ['self'].concat(args.slice(0, index)).concat('cb').join(',') + ');' + + 'break;' + ); + }).join(''), + 'default:', + 'args[argLength] = cb;', + 'res = fn.apply(self, args);', + '}', + + 'if (res &&', + '(typeof res === "object" || typeof res === "function") &&', + 'typeof res.then === "function"', + ') {rs(res);}', + '});', + '};' + ].join(''); + + return Function( + ['Promise', 'fn'], + body + )(Promise, fn); +} + +Promise.nodeify = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + var callback = + typeof args[args.length - 1] === 'function' ? args.pop() : null; + var ctx = this; + try { + return fn.apply(this, arguments).nodeify(callback, ctx); + } catch (ex) { + if (callback === null || typeof callback == 'undefined') { + return new Promise(function (resolve, reject) { + reject(ex); + }); + } else { + asap(function () { + callback.call(ctx, ex); + }) + } + } + } +}; + +Promise.prototype.nodeify = function (callback, ctx) { + if (typeof callback != 'function') return this; + + this.then(function (value) { + asap(function () { + callback.call(ctx, null, value); + }); + }, function (err) { + asap(function () { + callback.call(ctx, err); + }); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/rejection-tracking.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/rejection-tracking.js new file mode 100644 index 00000000..10ccce30 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/rejection-tracking.js @@ -0,0 +1,113 @@ +'use strict'; + +var Promise = require('./core'); + +var DEFAULT_WHITELIST = [ + ReferenceError, + TypeError, + RangeError +]; + +var enabled = false; +exports.disable = disable; +function disable() { + enabled = false; + Promise._37 = null; + Promise._87 = null; +} + +exports.enable = enable; +function enable(options) { + options = options || {}; + if (enabled) disable(); + enabled = true; + var id = 0; + var displayId = 0; + var rejections = {}; + Promise._37 = function (promise) { + if ( + promise._65 === 2 && // IS REJECTED + rejections[promise._51] + ) { + if (rejections[promise._51].logged) { + onHandled(promise._51); + } else { + clearTimeout(rejections[promise._51].timeout); + } + delete rejections[promise._51]; + } + }; + Promise._87 = function (promise, err) { + if (promise._40 === 0) { // not yet handled + promise._51 = id++; + rejections[promise._51] = { + displayId: null, + error: err, + timeout: setTimeout( + onUnhandled.bind(null, promise._51), + // For reference errors and type errors, this almost always + // means the programmer made a mistake, so log them after just + // 100ms + // otherwise, wait 2 seconds to see if they get handled + matchWhitelist(err, DEFAULT_WHITELIST) + ? 100 + : 2000 + ), + logged: false + }; + } + }; + function onUnhandled(id) { + if ( + options.allRejections || + matchWhitelist( + rejections[id].error, + options.whitelist || DEFAULT_WHITELIST + ) + ) { + rejections[id].displayId = displayId++; + if (options.onUnhandled) { + rejections[id].logged = true; + options.onUnhandled( + rejections[id].displayId, + rejections[id].error + ); + } else { + rejections[id].logged = true; + logError( + rejections[id].displayId, + rejections[id].error + ); + } + } + } + function onHandled(id) { + if (rejections[id].logged) { + if (options.onHandled) { + options.onHandled(rejections[id].displayId, rejections[id].error); + } else if (!rejections[id].onUnhandled) { + console.warn( + 'Promise Rejection Handled (id: ' + rejections[id].displayId + '):' + ); + console.warn( + ' This means you can ignore any previous messages of the form "Possible Unhandled Promise Rejection" with id ' + + rejections[id].displayId + '.' + ); + } + } + } +} + +function logError(id, error) { + console.warn('Possible Unhandled Promise Rejection (id: ' + id + '):'); + var errStr = (error && (error.stack || error)) + ''; + errStr.split('\n').forEach(function (line) { + console.warn(' ' + line); + }); +} + +function matchWhitelist(error, list) { + return list.some(function (cls) { + return error instanceof cls; + }); +} \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/synchronous.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/synchronous.js new file mode 100644 index 00000000..49399644 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/domains/synchronous.js @@ -0,0 +1,62 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.enableSynchronous = function () { + Promise.prototype.isPending = function() { + return this.getState() == 0; + }; + + Promise.prototype.isFulfilled = function() { + return this.getState() == 1; + }; + + Promise.prototype.isRejected = function() { + return this.getState() == 2; + }; + + Promise.prototype.getValue = function () { + if (this._65 === 3) { + return this._55.getValue(); + } + + if (!this.isFulfilled()) { + throw new Error('Cannot get a value of an unfulfilled promise.'); + } + + return this._55; + }; + + Promise.prototype.getReason = function () { + if (this._65 === 3) { + return this._55.getReason(); + } + + if (!this.isRejected()) { + throw new Error('Cannot get a rejection reason of a non-rejected promise.'); + } + + return this._55; + }; + + Promise.prototype.getState = function () { + if (this._65 === 3) { + return this._55.getState(); + } + if (this._65 === -1 || this._65 === -2) { + return 0; + } + + return this._65; + }; +}; + +Promise.disableSynchronous = function() { + Promise.prototype.isPending = undefined; + Promise.prototype.isFulfilled = undefined; + Promise.prototype.isRejected = undefined; + Promise.prototype.getValue = undefined; + Promise.prototype.getReason = undefined; + Promise.prototype.getState = undefined; +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/index.d.ts b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/index.d.ts new file mode 100644 index 00000000..a199cbc9 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/index.d.ts @@ -0,0 +1,256 @@ +interface Thenable { + /** + * Attaches callbacks for the resolution and/or rejection of the ThenPromise. + * @param onfulfilled The callback to execute when the ThenPromise is resolved. + * @param onrejected The callback to execute when the ThenPromise is rejected. + * @returns A ThenPromise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | Thenable) | undefined | null, onrejected?: ((reason: any) => TResult2 | Thenable) | undefined | null): Thenable; +} + +/** + * Represents the completion of an asynchronous operation + */ +interface ThenPromise { + /** + * Attaches callbacks for the resolution and/or rejection of the ThenPromise. + * @param onfulfilled The callback to execute when the ThenPromise is resolved. + * @param onrejected The callback to execute when the ThenPromise is rejected. + * @returns A ThenPromise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | Thenable) | undefined | null, onrejected?: ((reason: any) => TResult2 | Thenable) | undefined | null): ThenPromise; + + /** + * Attaches a callback for only the rejection of the ThenPromise. + * @param onrejected The callback to execute when the ThenPromise is rejected. + * @returns A ThenPromise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | Thenable) | undefined | null): ThenPromise; + + // Extensions specific to then/promise + + /** + * Attaches callbacks for the resolution and/or rejection of the ThenPromise, without returning a new promise. + * @param onfulfilled The callback to execute when the ThenPromise is resolved. + * @param onrejected The callback to execute when the ThenPromise is rejected. + */ + done(onfulfilled?: ((value: T) => any) | undefined | null, onrejected?: ((reason: any) => any) | undefined | null): void; + + + /** + * Calls a node.js style callback. If none is provided, the promise is returned. + */ + nodeify(callback: void | null): ThenPromise; + nodeify(callback: (err: Error, value: T) => void): void; +} + +interface ThenPromiseConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: ThenPromise; + + /** + * Creates a new ThenPromise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new (executor: (resolve: (value?: T | Thenable) => void, reject: (reason?: any) => void) => any): ThenPromise; + + /** + * Creates a ThenPromise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any ThenPromise is rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable, T10 | Thenable]): ThenPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + + /** + * Creates a ThenPromise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any ThenPromise is rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable]): ThenPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + + /** + * Creates a ThenPromise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any ThenPromise is rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable]): ThenPromise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + + /** + * Creates a ThenPromise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any ThenPromise is rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable]): ThenPromise<[T1, T2, T3, T4, T5, T6, T7]>; + + /** + * Creates a ThenPromise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any ThenPromise is rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable]): ThenPromise<[T1, T2, T3, T4, T5, T6]>; + + /** + * Creates a ThenPromise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any ThenPromise is rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable]): ThenPromise<[T1, T2, T3, T4, T5]>; + + /** + * Creates a ThenPromise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any ThenPromise is rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable ]): ThenPromise<[T1, T2, T3, T4]>; + + /** + * Creates a ThenPromise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any ThenPromise is rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable]): ThenPromise<[T1, T2, T3]>; + + /** + * Creates a ThenPromise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any ThenPromise is rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + all(values: [T1 | Thenable, T2 | Thenable]): ThenPromise<[T1, T2]>; + + /** + * Creates a ThenPromise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any ThenPromise is rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + all(values: (T | Thenable)[]): ThenPromise; + + /** + * Creates a ThenPromise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + race(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable, T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable, T10 | Thenable]): ThenPromise; + + /** + * Creates a ThenPromise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + race(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable, T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable]): ThenPromise; + + /** + * Creates a ThenPromise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + race(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable, T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable]): ThenPromise; + + /** + * Creates a ThenPromise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + race(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable, T5 | Thenable, T6 | Thenable, T7 | Thenable]): ThenPromise; + + /** + * Creates a ThenPromise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + race(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable, T5 | Thenable, T6 | Thenable]): ThenPromise; + + /** + * Creates a ThenPromise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + race(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable, T5 | Thenable]): ThenPromise; + + /** + * Creates a ThenPromise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + race(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable]): ThenPromise; + + /** + * Creates a ThenPromise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + race(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable]): ThenPromise; + + /** + * Creates a ThenPromise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + race(values: [T1 | Thenable, T2 | Thenable]): ThenPromise; + + /** + * Creates a ThenPromise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new ThenPromise. + */ + race(values: (T | Thenable)[]): ThenPromise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected ThenPromise. + */ + reject(reason: any): ThenPromise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected ThenPromise. + */ + reject(reason: any): ThenPromise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | Thenable): ThenPromise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): ThenPromise; + + // Extensions specific to then/promise + + denodeify: (fn: Function) => (...args: any[]) => ThenPromise; + nodeify: (fn: Function) => Function; +} + +declare var ThenPromise: ThenPromiseConstructor; + +export = ThenPromise; \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/index.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/index.js new file mode 100644 index 00000000..1c38e467 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib') diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/core.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/core.js new file mode 100644 index 00000000..aefc987b --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/core.js @@ -0,0 +1,213 @@ +'use strict'; + +var asap = require('asap/raw'); + +function noop() {} + +// States: +// +// 0 - pending +// 1 - fulfilled with _value +// 2 - rejected with _value +// 3 - adopted the state of another promise, _value +// +// once the state is no longer pending (0) it is immutable + +// All `_` prefixed properties will be reduced to `_{random number}` +// at build time to obfuscate them and discourage their use. +// We don't use symbols or Object.defineProperty to fully hide them +// because the performance isn't good enough. + + +// to avoid using try/catch inside critical functions, we +// extract them to here. +var LAST_ERROR = null; +var IS_ERROR = {}; +function getThen(obj) { + try { + return obj.then; + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} + +function tryCallOne(fn, a) { + try { + return fn(a); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} +function tryCallTwo(fn, a, b) { + try { + fn(a, b); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} + +module.exports = Promise; + +function Promise(fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); + } + if (typeof fn !== 'function') { + throw new TypeError('Promise constructor\'s argument is not a function'); + } + this._40 = 0; + this._65 = 0; + this._55 = null; + this._72 = null; + if (fn === noop) return; + doResolve(fn, this); +} +Promise._37 = null; +Promise._87 = null; +Promise._61 = noop; + +Promise.prototype.then = function(onFulfilled, onRejected) { + if (this.constructor !== Promise) { + return safeThen(this, onFulfilled, onRejected); + } + var res = new Promise(noop); + handle(this, new Handler(onFulfilled, onRejected, res)); + return res; +}; + +function safeThen(self, onFulfilled, onRejected) { + return new self.constructor(function (resolve, reject) { + var res = new Promise(noop); + res.then(resolve, reject); + handle(self, new Handler(onFulfilled, onRejected, res)); + }); +} +function handle(self, deferred) { + while (self._65 === 3) { + self = self._55; + } + if (Promise._37) { + Promise._37(self); + } + if (self._65 === 0) { + if (self._40 === 0) { + self._40 = 1; + self._72 = deferred; + return; + } + if (self._40 === 1) { + self._40 = 2; + self._72 = [self._72, deferred]; + return; + } + self._72.push(deferred); + return; + } + handleResolved(self, deferred); +} + +function handleResolved(self, deferred) { + asap(function() { + var cb = self._65 === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + if (self._65 === 1) { + resolve(deferred.promise, self._55); + } else { + reject(deferred.promise, self._55); + } + return; + } + var ret = tryCallOne(cb, self._55); + if (ret === IS_ERROR) { + reject(deferred.promise, LAST_ERROR); + } else { + resolve(deferred.promise, ret); + } + }); +} +function resolve(self, newValue) { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) { + return reject( + self, + new TypeError('A promise cannot be resolved with itself.') + ); + } + if ( + newValue && + (typeof newValue === 'object' || typeof newValue === 'function') + ) { + var then = getThen(newValue); + if (then === IS_ERROR) { + return reject(self, LAST_ERROR); + } + if ( + then === self.then && + newValue instanceof Promise + ) { + self._65 = 3; + self._55 = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(then.bind(newValue), self); + return; + } + } + self._65 = 1; + self._55 = newValue; + finale(self); +} + +function reject(self, newValue) { + self._65 = 2; + self._55 = newValue; + if (Promise._87) { + Promise._87(self, newValue); + } + finale(self); +} +function finale(self) { + if (self._40 === 1) { + handle(self, self._72); + self._72 = null; + } + if (self._40 === 2) { + for (var i = 0; i < self._72.length; i++) { + handle(self, self._72[i]); + } + self._72 = null; + } +} + +function Handler(onFulfilled, onRejected, promise){ + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; +} + +/** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ +function doResolve(fn, promise) { + var done = false; + var res = tryCallTwo(fn, function (value) { + if (done) return; + done = true; + resolve(promise, value); + }, function (reason) { + if (done) return; + done = true; + reject(promise, reason); + }); + if (!done && res === IS_ERROR) { + done = true; + reject(promise, LAST_ERROR); + } +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/done.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/done.js new file mode 100644 index 00000000..f879317d --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/done.js @@ -0,0 +1,13 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.prototype.done = function (onFulfilled, onRejected) { + var self = arguments.length ? this.then.apply(this, arguments) : this; + self.then(null, function (err) { + setTimeout(function () { + throw err; + }, 0); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/es6-extensions.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/es6-extensions.js new file mode 100644 index 00000000..8ab26669 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/es6-extensions.js @@ -0,0 +1,107 @@ +'use strict'; + +//This file contains the ES6 extensions to the core Promises/A+ API + +var Promise = require('./core.js'); + +module.exports = Promise; + +/* Static Functions */ + +var TRUE = valuePromise(true); +var FALSE = valuePromise(false); +var NULL = valuePromise(null); +var UNDEFINED = valuePromise(undefined); +var ZERO = valuePromise(0); +var EMPTYSTRING = valuePromise(''); + +function valuePromise(value) { + var p = new Promise(Promise._61); + p._65 = 1; + p._55 = value; + return p; +} +Promise.resolve = function (value) { + if (value instanceof Promise) return value; + + if (value === null) return NULL; + if (value === undefined) return UNDEFINED; + if (value === true) return TRUE; + if (value === false) return FALSE; + if (value === 0) return ZERO; + if (value === '') return EMPTYSTRING; + + if (typeof value === 'object' || typeof value === 'function') { + try { + var then = value.then; + if (typeof then === 'function') { + return new Promise(then.bind(value)); + } + } catch (ex) { + return new Promise(function (resolve, reject) { + reject(ex); + }); + } + } + return valuePromise(value); +}; + +Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + + return new Promise(function (resolve, reject) { + if (args.length === 0) return resolve([]); + var remaining = args.length; + function res(i, val) { + if (val && (typeof val === 'object' || typeof val === 'function')) { + if (val instanceof Promise && val.then === Promise.prototype.then) { + while (val._65 === 3) { + val = val._55; + } + if (val._65 === 1) return res(i, val._55); + if (val._65 === 2) reject(val._55); + val.then(function (val) { + res(i, val); + }, reject); + return; + } else { + var then = val.then; + if (typeof then === 'function') { + var p = new Promise(then.bind(val)); + p.then(function (val) { + res(i, val); + }, reject); + return; + } + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); +}; + +Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); +}; + +Promise.race = function (values) { + return new Promise(function (resolve, reject) { + values.forEach(function(value){ + Promise.resolve(value).then(resolve, reject); + }); + }); +}; + +/* Prototype Methods */ + +Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/finally.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/finally.js new file mode 100644 index 00000000..f5ee0b98 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/finally.js @@ -0,0 +1,16 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.prototype['finally'] = function (f) { + return this.then(function (value) { + return Promise.resolve(f()).then(function () { + return value; + }); + }, function (err) { + return Promise.resolve(f()).then(function () { + throw err; + }); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/index.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/index.js new file mode 100644 index 00000000..6e674f38 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = require('./core.js'); +require('./done.js'); +require('./finally.js'); +require('./es6-extensions.js'); +require('./node-extensions.js'); +require('./synchronous.js'); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/node-extensions.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/node-extensions.js new file mode 100644 index 00000000..157cddc2 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/node-extensions.js @@ -0,0 +1,130 @@ +'use strict'; + +// This file contains then/promise specific extensions that are only useful +// for node.js interop + +var Promise = require('./core.js'); +var asap = require('asap'); + +module.exports = Promise; + +/* Static Functions */ + +Promise.denodeify = function (fn, argumentCount) { + if ( + typeof argumentCount === 'number' && argumentCount !== Infinity + ) { + return denodeifyWithCount(fn, argumentCount); + } else { + return denodeifyWithoutCount(fn); + } +}; + +var callbackFn = ( + 'function (err, res) {' + + 'if (err) { rj(err); } else { rs(res); }' + + '}' +); +function denodeifyWithCount(fn, argumentCount) { + var args = []; + for (var i = 0; i < argumentCount; i++) { + args.push('a' + i); + } + var body = [ + 'return function (' + args.join(',') + ') {', + 'var self = this;', + 'return new Promise(function (rs, rj) {', + 'var res = fn.call(', + ['self'].concat(args).concat([callbackFn]).join(','), + ');', + 'if (res &&', + '(typeof res === "object" || typeof res === "function") &&', + 'typeof res.then === "function"', + ') {rs(res);}', + '});', + '};' + ].join(''); + return Function(['Promise', 'fn'], body)(Promise, fn); +} +function denodeifyWithoutCount(fn) { + var fnLength = Math.max(fn.length - 1, 3); + var args = []; + for (var i = 0; i < fnLength; i++) { + args.push('a' + i); + } + var body = [ + 'return function (' + args.join(',') + ') {', + 'var self = this;', + 'var args;', + 'var argLength = arguments.length;', + 'if (arguments.length > ' + fnLength + ') {', + 'args = new Array(arguments.length + 1);', + 'for (var i = 0; i < arguments.length; i++) {', + 'args[i] = arguments[i];', + '}', + '}', + 'return new Promise(function (rs, rj) {', + 'var cb = ' + callbackFn + ';', + 'var res;', + 'switch (argLength) {', + args.concat(['extra']).map(function (_, index) { + return ( + 'case ' + (index) + ':' + + 'res = fn.call(' + ['self'].concat(args.slice(0, index)).concat('cb').join(',') + ');' + + 'break;' + ); + }).join(''), + 'default:', + 'args[argLength] = cb;', + 'res = fn.apply(self, args);', + '}', + + 'if (res &&', + '(typeof res === "object" || typeof res === "function") &&', + 'typeof res.then === "function"', + ') {rs(res);}', + '});', + '};' + ].join(''); + + return Function( + ['Promise', 'fn'], + body + )(Promise, fn); +} + +Promise.nodeify = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + var callback = + typeof args[args.length - 1] === 'function' ? args.pop() : null; + var ctx = this; + try { + return fn.apply(this, arguments).nodeify(callback, ctx); + } catch (ex) { + if (callback === null || typeof callback == 'undefined') { + return new Promise(function (resolve, reject) { + reject(ex); + }); + } else { + asap(function () { + callback.call(ctx, ex); + }) + } + } + } +}; + +Promise.prototype.nodeify = function (callback, ctx) { + if (typeof callback != 'function') return this; + + this.then(function (value) { + asap(function () { + callback.call(ctx, null, value); + }); + }, function (err) { + asap(function () { + callback.call(ctx, err); + }); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/rejection-tracking.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/rejection-tracking.js new file mode 100644 index 00000000..10ccce30 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/rejection-tracking.js @@ -0,0 +1,113 @@ +'use strict'; + +var Promise = require('./core'); + +var DEFAULT_WHITELIST = [ + ReferenceError, + TypeError, + RangeError +]; + +var enabled = false; +exports.disable = disable; +function disable() { + enabled = false; + Promise._37 = null; + Promise._87 = null; +} + +exports.enable = enable; +function enable(options) { + options = options || {}; + if (enabled) disable(); + enabled = true; + var id = 0; + var displayId = 0; + var rejections = {}; + Promise._37 = function (promise) { + if ( + promise._65 === 2 && // IS REJECTED + rejections[promise._51] + ) { + if (rejections[promise._51].logged) { + onHandled(promise._51); + } else { + clearTimeout(rejections[promise._51].timeout); + } + delete rejections[promise._51]; + } + }; + Promise._87 = function (promise, err) { + if (promise._40 === 0) { // not yet handled + promise._51 = id++; + rejections[promise._51] = { + displayId: null, + error: err, + timeout: setTimeout( + onUnhandled.bind(null, promise._51), + // For reference errors and type errors, this almost always + // means the programmer made a mistake, so log them after just + // 100ms + // otherwise, wait 2 seconds to see if they get handled + matchWhitelist(err, DEFAULT_WHITELIST) + ? 100 + : 2000 + ), + logged: false + }; + } + }; + function onUnhandled(id) { + if ( + options.allRejections || + matchWhitelist( + rejections[id].error, + options.whitelist || DEFAULT_WHITELIST + ) + ) { + rejections[id].displayId = displayId++; + if (options.onUnhandled) { + rejections[id].logged = true; + options.onUnhandled( + rejections[id].displayId, + rejections[id].error + ); + } else { + rejections[id].logged = true; + logError( + rejections[id].displayId, + rejections[id].error + ); + } + } + } + function onHandled(id) { + if (rejections[id].logged) { + if (options.onHandled) { + options.onHandled(rejections[id].displayId, rejections[id].error); + } else if (!rejections[id].onUnhandled) { + console.warn( + 'Promise Rejection Handled (id: ' + rejections[id].displayId + '):' + ); + console.warn( + ' This means you can ignore any previous messages of the form "Possible Unhandled Promise Rejection" with id ' + + rejections[id].displayId + '.' + ); + } + } + } +} + +function logError(id, error) { + console.warn('Possible Unhandled Promise Rejection (id: ' + id + '):'); + var errStr = (error && (error.stack || error)) + ''; + errStr.split('\n').forEach(function (line) { + console.warn(' ' + line); + }); +} + +function matchWhitelist(error, list) { + return list.some(function (cls) { + return error instanceof cls; + }); +} \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/synchronous.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/synchronous.js new file mode 100644 index 00000000..49399644 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/lib/synchronous.js @@ -0,0 +1,62 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.enableSynchronous = function () { + Promise.prototype.isPending = function() { + return this.getState() == 0; + }; + + Promise.prototype.isFulfilled = function() { + return this.getState() == 1; + }; + + Promise.prototype.isRejected = function() { + return this.getState() == 2; + }; + + Promise.prototype.getValue = function () { + if (this._65 === 3) { + return this._55.getValue(); + } + + if (!this.isFulfilled()) { + throw new Error('Cannot get a value of an unfulfilled promise.'); + } + + return this._55; + }; + + Promise.prototype.getReason = function () { + if (this._65 === 3) { + return this._55.getReason(); + } + + if (!this.isRejected()) { + throw new Error('Cannot get a rejection reason of a non-rejected promise.'); + } + + return this._55; + }; + + Promise.prototype.getState = function () { + if (this._65 === 3) { + return this._55.getState(); + } + if (this._65 === -1 || this._65 === -2) { + return 0; + } + + return this._65; + }; +}; + +Promise.disableSynchronous = function() { + Promise.prototype.isPending = undefined; + Promise.prototype.isFulfilled = undefined; + Promise.prototype.isRejected = undefined; + Promise.prototype.getValue = undefined; + Promise.prototype.getReason = undefined; + Promise.prototype.getState = undefined; +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/package.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/package.json new file mode 100644 index 00000000..c4f8a8ab --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/package.json @@ -0,0 +1,66 @@ +{ + "_from": "promise@^7.1.1", + "_id": "promise@7.3.1", + "_inBundle": false, + "_integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "_location": "/react-dropzone/promise", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "promise@^7.1.1", + "name": "promise", + "escapedName": "promise", + "rawSpec": "^7.1.1", + "saveSpec": null, + "fetchSpec": "^7.1.1" + }, + "_requiredBy": [ + "/react-dropzone/fbjs" + ], + "_resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "_shasum": "064b72602b18f90f29192b8b1bc418ffd1ebd3bf", + "_spec": "promise@^7.1.1", + "_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI\\node_modules\\react-dropzone\\node_modules\\fbjs", + "author": { + "name": "ForbesLindesay" + }, + "bugs": { + "url": "https://github.com/then/promise/issues" + }, + "bundleDependencies": false, + "dependencies": { + "asap": "~2.0.3" + }, + "deprecated": false, + "description": "Bare bones Promises/A+ implementation", + "devDependencies": { + "acorn": "^1.0.1", + "better-assert": "*", + "istanbul": "^0.3.13", + "mocha": "*", + "promises-aplus-tests": "*", + "rimraf": "^2.3.2" + }, + "homepage": "https://github.com/then/promise#readme", + "license": "MIT", + "main": "index.js", + "name": "promise", + "repository": { + "type": "git", + "url": "git+https://github.com/then/promise.git" + }, + "scripts": { + "coverage": "istanbul cover node_modules/mocha/bin/_mocha -- --bail --timeout 200 --slow 99999 -R dot", + "prepublish": "node build", + "pretest": "node build", + "pretest-extensions": "node build", + "pretest-memory-leak": "node build", + "pretest-resolve": "node build", + "test": "mocha --bail --timeout 200 --slow 99999 -R dot && npm run test-memory-leak", + "test-extensions": "mocha test/extensions-tests.js --timeout 200 --slow 999999", + "test-memory-leak": "node --expose-gc test/memory-leak.js", + "test-resolve": "mocha test/resolver-tests.js --timeout 200 --slow 999999" + }, + "version": "7.3.1" +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/polyfill-done.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/polyfill-done.js new file mode 100644 index 00000000..e50b4c0e --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/polyfill-done.js @@ -0,0 +1,12 @@ +// should work in any browser without browserify + +if (typeof Promise.prototype.done !== 'function') { + Promise.prototype.done = function (onFulfilled, onRejected) { + var self = arguments.length ? this.then.apply(this, arguments) : this + self.then(null, function (err) { + setTimeout(function () { + throw err + }, 0) + }) + } +} \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/polyfill.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/polyfill.js new file mode 100644 index 00000000..db099f8e --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/polyfill.js @@ -0,0 +1,10 @@ +// not "use strict" so we can declare global "Promise" + +var asap = require('asap'); + +if (typeof Promise === 'undefined') { + Promise = require('./lib/core.js') + require('./lib/es6-extensions.js') +} + +require('./polyfill-done.js'); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/core.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/core.js new file mode 100644 index 00000000..a84fb3da --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/core.js @@ -0,0 +1,213 @@ +'use strict'; + + + +function noop() {} + +// States: +// +// 0 - pending +// 1 - fulfilled with _value +// 2 - rejected with _value +// 3 - adopted the state of another promise, _value +// +// once the state is no longer pending (0) it is immutable + +// All `_` prefixed properties will be reduced to `_{random number}` +// at build time to obfuscate them and discourage their use. +// We don't use symbols or Object.defineProperty to fully hide them +// because the performance isn't good enough. + + +// to avoid using try/catch inside critical functions, we +// extract them to here. +var LAST_ERROR = null; +var IS_ERROR = {}; +function getThen(obj) { + try { + return obj.then; + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} + +function tryCallOne(fn, a) { + try { + return fn(a); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} +function tryCallTwo(fn, a, b) { + try { + fn(a, b); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} + +module.exports = Promise; + +function Promise(fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); + } + if (typeof fn !== 'function') { + throw new TypeError('Promise constructor\'s argument is not a function'); + } + this._40 = 0; + this._65 = 0; + this._55 = null; + this._72 = null; + if (fn === noop) return; + doResolve(fn, this); +} +Promise._37 = null; +Promise._87 = null; +Promise._61 = noop; + +Promise.prototype.then = function(onFulfilled, onRejected) { + if (this.constructor !== Promise) { + return safeThen(this, onFulfilled, onRejected); + } + var res = new Promise(noop); + handle(this, new Handler(onFulfilled, onRejected, res)); + return res; +}; + +function safeThen(self, onFulfilled, onRejected) { + return new self.constructor(function (resolve, reject) { + var res = new Promise(noop); + res.then(resolve, reject); + handle(self, new Handler(onFulfilled, onRejected, res)); + }); +} +function handle(self, deferred) { + while (self._65 === 3) { + self = self._55; + } + if (Promise._37) { + Promise._37(self); + } + if (self._65 === 0) { + if (self._40 === 0) { + self._40 = 1; + self._72 = deferred; + return; + } + if (self._40 === 1) { + self._40 = 2; + self._72 = [self._72, deferred]; + return; + } + self._72.push(deferred); + return; + } + handleResolved(self, deferred); +} + +function handleResolved(self, deferred) { + setImmediate(function() { + var cb = self._65 === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + if (self._65 === 1) { + resolve(deferred.promise, self._55); + } else { + reject(deferred.promise, self._55); + } + return; + } + var ret = tryCallOne(cb, self._55); + if (ret === IS_ERROR) { + reject(deferred.promise, LAST_ERROR); + } else { + resolve(deferred.promise, ret); + } + }); +} +function resolve(self, newValue) { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) { + return reject( + self, + new TypeError('A promise cannot be resolved with itself.') + ); + } + if ( + newValue && + (typeof newValue === 'object' || typeof newValue === 'function') + ) { + var then = getThen(newValue); + if (then === IS_ERROR) { + return reject(self, LAST_ERROR); + } + if ( + then === self.then && + newValue instanceof Promise + ) { + self._65 = 3; + self._55 = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(then.bind(newValue), self); + return; + } + } + self._65 = 1; + self._55 = newValue; + finale(self); +} + +function reject(self, newValue) { + self._65 = 2; + self._55 = newValue; + if (Promise._87) { + Promise._87(self, newValue); + } + finale(self); +} +function finale(self) { + if (self._40 === 1) { + handle(self, self._72); + self._72 = null; + } + if (self._40 === 2) { + for (var i = 0; i < self._72.length; i++) { + handle(self, self._72[i]); + } + self._72 = null; + } +} + +function Handler(onFulfilled, onRejected, promise){ + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; +} + +/** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ +function doResolve(fn, promise) { + var done = false; + var res = tryCallTwo(fn, function (value) { + if (done) return; + done = true; + resolve(promise, value); + }, function (reason) { + if (done) return; + done = true; + reject(promise, reason); + }); + if (!done && res === IS_ERROR) { + done = true; + reject(promise, LAST_ERROR); + } +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/done.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/done.js new file mode 100644 index 00000000..f879317d --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/done.js @@ -0,0 +1,13 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.prototype.done = function (onFulfilled, onRejected) { + var self = arguments.length ? this.then.apply(this, arguments) : this; + self.then(null, function (err) { + setTimeout(function () { + throw err; + }, 0); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/es6-extensions.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/es6-extensions.js new file mode 100644 index 00000000..8ab26669 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/es6-extensions.js @@ -0,0 +1,107 @@ +'use strict'; + +//This file contains the ES6 extensions to the core Promises/A+ API + +var Promise = require('./core.js'); + +module.exports = Promise; + +/* Static Functions */ + +var TRUE = valuePromise(true); +var FALSE = valuePromise(false); +var NULL = valuePromise(null); +var UNDEFINED = valuePromise(undefined); +var ZERO = valuePromise(0); +var EMPTYSTRING = valuePromise(''); + +function valuePromise(value) { + var p = new Promise(Promise._61); + p._65 = 1; + p._55 = value; + return p; +} +Promise.resolve = function (value) { + if (value instanceof Promise) return value; + + if (value === null) return NULL; + if (value === undefined) return UNDEFINED; + if (value === true) return TRUE; + if (value === false) return FALSE; + if (value === 0) return ZERO; + if (value === '') return EMPTYSTRING; + + if (typeof value === 'object' || typeof value === 'function') { + try { + var then = value.then; + if (typeof then === 'function') { + return new Promise(then.bind(value)); + } + } catch (ex) { + return new Promise(function (resolve, reject) { + reject(ex); + }); + } + } + return valuePromise(value); +}; + +Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + + return new Promise(function (resolve, reject) { + if (args.length === 0) return resolve([]); + var remaining = args.length; + function res(i, val) { + if (val && (typeof val === 'object' || typeof val === 'function')) { + if (val instanceof Promise && val.then === Promise.prototype.then) { + while (val._65 === 3) { + val = val._55; + } + if (val._65 === 1) return res(i, val._55); + if (val._65 === 2) reject(val._55); + val.then(function (val) { + res(i, val); + }, reject); + return; + } else { + var then = val.then; + if (typeof then === 'function') { + var p = new Promise(then.bind(val)); + p.then(function (val) { + res(i, val); + }, reject); + return; + } + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); +}; + +Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); +}; + +Promise.race = function (values) { + return new Promise(function (resolve, reject) { + values.forEach(function(value){ + Promise.resolve(value).then(resolve, reject); + }); + }); +}; + +/* Prototype Methods */ + +Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/finally.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/finally.js new file mode 100644 index 00000000..f5ee0b98 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/finally.js @@ -0,0 +1,16 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.prototype['finally'] = function (f) { + return this.then(function (value) { + return Promise.resolve(f()).then(function () { + return value; + }); + }, function (err) { + return Promise.resolve(f()).then(function () { + throw err; + }); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/index.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/index.js new file mode 100644 index 00000000..6e674f38 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = require('./core.js'); +require('./done.js'); +require('./finally.js'); +require('./es6-extensions.js'); +require('./node-extensions.js'); +require('./synchronous.js'); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/node-extensions.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/node-extensions.js new file mode 100644 index 00000000..f03e861d --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/node-extensions.js @@ -0,0 +1,130 @@ +'use strict'; + +// This file contains then/promise specific extensions that are only useful +// for node.js interop + +var Promise = require('./core.js'); + + +module.exports = Promise; + +/* Static Functions */ + +Promise.denodeify = function (fn, argumentCount) { + if ( + typeof argumentCount === 'number' && argumentCount !== Infinity + ) { + return denodeifyWithCount(fn, argumentCount); + } else { + return denodeifyWithoutCount(fn); + } +}; + +var callbackFn = ( + 'function (err, res) {' + + 'if (err) { rj(err); } else { rs(res); }' + + '}' +); +function denodeifyWithCount(fn, argumentCount) { + var args = []; + for (var i = 0; i < argumentCount; i++) { + args.push('a' + i); + } + var body = [ + 'return function (' + args.join(',') + ') {', + 'var self = this;', + 'return new Promise(function (rs, rj) {', + 'var res = fn.call(', + ['self'].concat(args).concat([callbackFn]).join(','), + ');', + 'if (res &&', + '(typeof res === "object" || typeof res === "function") &&', + 'typeof res.then === "function"', + ') {rs(res);}', + '});', + '};' + ].join(''); + return Function(['Promise', 'fn'], body)(Promise, fn); +} +function denodeifyWithoutCount(fn) { + var fnLength = Math.max(fn.length - 1, 3); + var args = []; + for (var i = 0; i < fnLength; i++) { + args.push('a' + i); + } + var body = [ + 'return function (' + args.join(',') + ') {', + 'var self = this;', + 'var args;', + 'var argLength = arguments.length;', + 'if (arguments.length > ' + fnLength + ') {', + 'args = new Array(arguments.length + 1);', + 'for (var i = 0; i < arguments.length; i++) {', + 'args[i] = arguments[i];', + '}', + '}', + 'return new Promise(function (rs, rj) {', + 'var cb = ' + callbackFn + ';', + 'var res;', + 'switch (argLength) {', + args.concat(['extra']).map(function (_, index) { + return ( + 'case ' + (index) + ':' + + 'res = fn.call(' + ['self'].concat(args.slice(0, index)).concat('cb').join(',') + ');' + + 'break;' + ); + }).join(''), + 'default:', + 'args[argLength] = cb;', + 'res = fn.apply(self, args);', + '}', + + 'if (res &&', + '(typeof res === "object" || typeof res === "function") &&', + 'typeof res.then === "function"', + ') {rs(res);}', + '});', + '};' + ].join(''); + + return Function( + ['Promise', 'fn'], + body + )(Promise, fn); +} + +Promise.nodeify = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + var callback = + typeof args[args.length - 1] === 'function' ? args.pop() : null; + var ctx = this; + try { + return fn.apply(this, arguments).nodeify(callback, ctx); + } catch (ex) { + if (callback === null || typeof callback == 'undefined') { + return new Promise(function (resolve, reject) { + reject(ex); + }); + } else { + setImmediate(function () { + callback.call(ctx, ex); + }) + } + } + } +}; + +Promise.prototype.nodeify = function (callback, ctx) { + if (typeof callback != 'function') return this; + + this.then(function (value) { + setImmediate(function () { + callback.call(ctx, null, value); + }); + }, function (err) { + setImmediate(function () { + callback.call(ctx, err); + }); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/rejection-tracking.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/rejection-tracking.js new file mode 100644 index 00000000..10ccce30 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/rejection-tracking.js @@ -0,0 +1,113 @@ +'use strict'; + +var Promise = require('./core'); + +var DEFAULT_WHITELIST = [ + ReferenceError, + TypeError, + RangeError +]; + +var enabled = false; +exports.disable = disable; +function disable() { + enabled = false; + Promise._37 = null; + Promise._87 = null; +} + +exports.enable = enable; +function enable(options) { + options = options || {}; + if (enabled) disable(); + enabled = true; + var id = 0; + var displayId = 0; + var rejections = {}; + Promise._37 = function (promise) { + if ( + promise._65 === 2 && // IS REJECTED + rejections[promise._51] + ) { + if (rejections[promise._51].logged) { + onHandled(promise._51); + } else { + clearTimeout(rejections[promise._51].timeout); + } + delete rejections[promise._51]; + } + }; + Promise._87 = function (promise, err) { + if (promise._40 === 0) { // not yet handled + promise._51 = id++; + rejections[promise._51] = { + displayId: null, + error: err, + timeout: setTimeout( + onUnhandled.bind(null, promise._51), + // For reference errors and type errors, this almost always + // means the programmer made a mistake, so log them after just + // 100ms + // otherwise, wait 2 seconds to see if they get handled + matchWhitelist(err, DEFAULT_WHITELIST) + ? 100 + : 2000 + ), + logged: false + }; + } + }; + function onUnhandled(id) { + if ( + options.allRejections || + matchWhitelist( + rejections[id].error, + options.whitelist || DEFAULT_WHITELIST + ) + ) { + rejections[id].displayId = displayId++; + if (options.onUnhandled) { + rejections[id].logged = true; + options.onUnhandled( + rejections[id].displayId, + rejections[id].error + ); + } else { + rejections[id].logged = true; + logError( + rejections[id].displayId, + rejections[id].error + ); + } + } + } + function onHandled(id) { + if (rejections[id].logged) { + if (options.onHandled) { + options.onHandled(rejections[id].displayId, rejections[id].error); + } else if (!rejections[id].onUnhandled) { + console.warn( + 'Promise Rejection Handled (id: ' + rejections[id].displayId + '):' + ); + console.warn( + ' This means you can ignore any previous messages of the form "Possible Unhandled Promise Rejection" with id ' + + rejections[id].displayId + '.' + ); + } + } + } +} + +function logError(id, error) { + console.warn('Possible Unhandled Promise Rejection (id: ' + id + '):'); + var errStr = (error && (error.stack || error)) + ''; + errStr.split('\n').forEach(function (line) { + console.warn(' ' + line); + }); +} + +function matchWhitelist(error, list) { + return list.some(function (cls) { + return error instanceof cls; + }); +} \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/synchronous.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/synchronous.js new file mode 100644 index 00000000..49399644 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/setimmediate/synchronous.js @@ -0,0 +1,62 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.enableSynchronous = function () { + Promise.prototype.isPending = function() { + return this.getState() == 0; + }; + + Promise.prototype.isFulfilled = function() { + return this.getState() == 1; + }; + + Promise.prototype.isRejected = function() { + return this.getState() == 2; + }; + + Promise.prototype.getValue = function () { + if (this._65 === 3) { + return this._55.getValue(); + } + + if (!this.isFulfilled()) { + throw new Error('Cannot get a value of an unfulfilled promise.'); + } + + return this._55; + }; + + Promise.prototype.getReason = function () { + if (this._65 === 3) { + return this._55.getReason(); + } + + if (!this.isRejected()) { + throw new Error('Cannot get a rejection reason of a non-rejected promise.'); + } + + return this._55; + }; + + Promise.prototype.getState = function () { + if (this._65 === 3) { + return this._55.getState(); + } + if (this._65 === -1 || this._65 === -2) { + return 0; + } + + return this._65; + }; +}; + +Promise.disableSynchronous = function() { + Promise.prototype.isPending = undefined; + Promise.prototype.isFulfilled = undefined; + Promise.prototype.isRejected = undefined; + Promise.prototype.getValue = undefined; + Promise.prototype.getReason = undefined; + Promise.prototype.getState = undefined; +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/core.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/core.js new file mode 100644 index 00000000..312010d9 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/core.js @@ -0,0 +1,213 @@ +'use strict'; + +var asap = require('asap/raw'); + +function noop() {} + +// States: +// +// 0 - pending +// 1 - fulfilled with _value +// 2 - rejected with _value +// 3 - adopted the state of another promise, _value +// +// once the state is no longer pending (0) it is immutable + +// All `_` prefixed properties will be reduced to `_{random number}` +// at build time to obfuscate them and discourage their use. +// We don't use symbols or Object.defineProperty to fully hide them +// because the performance isn't good enough. + + +// to avoid using try/catch inside critical functions, we +// extract them to here. +var LAST_ERROR = null; +var IS_ERROR = {}; +function getThen(obj) { + try { + return obj.then; + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} + +function tryCallOne(fn, a) { + try { + return fn(a); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} +function tryCallTwo(fn, a, b) { + try { + fn(a, b); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} + +module.exports = Promise; + +function Promise(fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); + } + if (typeof fn !== 'function') { + throw new TypeError('Promise constructor\'s argument is not a function'); + } + this._deferredState = 0; + this._state = 0; + this._value = null; + this._deferreds = null; + if (fn === noop) return; + doResolve(fn, this); +} +Promise._onHandle = null; +Promise._onReject = null; +Promise._noop = noop; + +Promise.prototype.then = function(onFulfilled, onRejected) { + if (this.constructor !== Promise) { + return safeThen(this, onFulfilled, onRejected); + } + var res = new Promise(noop); + handle(this, new Handler(onFulfilled, onRejected, res)); + return res; +}; + +function safeThen(self, onFulfilled, onRejected) { + return new self.constructor(function (resolve, reject) { + var res = new Promise(noop); + res.then(resolve, reject); + handle(self, new Handler(onFulfilled, onRejected, res)); + }); +} +function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (Promise._onHandle) { + Promise._onHandle(self); + } + if (self._state === 0) { + if (self._deferredState === 0) { + self._deferredState = 1; + self._deferreds = deferred; + return; + } + if (self._deferredState === 1) { + self._deferredState = 2; + self._deferreds = [self._deferreds, deferred]; + return; + } + self._deferreds.push(deferred); + return; + } + handleResolved(self, deferred); +} + +function handleResolved(self, deferred) { + asap(function() { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + if (self._state === 1) { + resolve(deferred.promise, self._value); + } else { + reject(deferred.promise, self._value); + } + return; + } + var ret = tryCallOne(cb, self._value); + if (ret === IS_ERROR) { + reject(deferred.promise, LAST_ERROR); + } else { + resolve(deferred.promise, ret); + } + }); +} +function resolve(self, newValue) { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) { + return reject( + self, + new TypeError('A promise cannot be resolved with itself.') + ); + } + if ( + newValue && + (typeof newValue === 'object' || typeof newValue === 'function') + ) { + var then = getThen(newValue); + if (then === IS_ERROR) { + return reject(self, LAST_ERROR); + } + if ( + then === self.then && + newValue instanceof Promise + ) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(then.bind(newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); +} + +function reject(self, newValue) { + self._state = 2; + self._value = newValue; + if (Promise._onReject) { + Promise._onReject(self, newValue); + } + finale(self); +} +function finale(self) { + if (self._deferredState === 1) { + handle(self, self._deferreds); + self._deferreds = null; + } + if (self._deferredState === 2) { + for (var i = 0; i < self._deferreds.length; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } +} + +function Handler(onFulfilled, onRejected, promise){ + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; +} + +/** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ +function doResolve(fn, promise) { + var done = false; + var res = tryCallTwo(fn, function (value) { + if (done) return; + done = true; + resolve(promise, value); + }, function (reason) { + if (done) return; + done = true; + reject(promise, reason); + }); + if (!done && res === IS_ERROR) { + done = true; + reject(promise, LAST_ERROR); + } +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/done.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/done.js new file mode 100644 index 00000000..f879317d --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/done.js @@ -0,0 +1,13 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.prototype.done = function (onFulfilled, onRejected) { + var self = arguments.length ? this.then.apply(this, arguments) : this; + self.then(null, function (err) { + setTimeout(function () { + throw err; + }, 0); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/es6-extensions.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/es6-extensions.js new file mode 100644 index 00000000..04358131 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/es6-extensions.js @@ -0,0 +1,107 @@ +'use strict'; + +//This file contains the ES6 extensions to the core Promises/A+ API + +var Promise = require('./core.js'); + +module.exports = Promise; + +/* Static Functions */ + +var TRUE = valuePromise(true); +var FALSE = valuePromise(false); +var NULL = valuePromise(null); +var UNDEFINED = valuePromise(undefined); +var ZERO = valuePromise(0); +var EMPTYSTRING = valuePromise(''); + +function valuePromise(value) { + var p = new Promise(Promise._noop); + p._state = 1; + p._value = value; + return p; +} +Promise.resolve = function (value) { + if (value instanceof Promise) return value; + + if (value === null) return NULL; + if (value === undefined) return UNDEFINED; + if (value === true) return TRUE; + if (value === false) return FALSE; + if (value === 0) return ZERO; + if (value === '') return EMPTYSTRING; + + if (typeof value === 'object' || typeof value === 'function') { + try { + var then = value.then; + if (typeof then === 'function') { + return new Promise(then.bind(value)); + } + } catch (ex) { + return new Promise(function (resolve, reject) { + reject(ex); + }); + } + } + return valuePromise(value); +}; + +Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + + return new Promise(function (resolve, reject) { + if (args.length === 0) return resolve([]); + var remaining = args.length; + function res(i, val) { + if (val && (typeof val === 'object' || typeof val === 'function')) { + if (val instanceof Promise && val.then === Promise.prototype.then) { + while (val._state === 3) { + val = val._value; + } + if (val._state === 1) return res(i, val._value); + if (val._state === 2) reject(val._value); + val.then(function (val) { + res(i, val); + }, reject); + return; + } else { + var then = val.then; + if (typeof then === 'function') { + var p = new Promise(then.bind(val)); + p.then(function (val) { + res(i, val); + }, reject); + return; + } + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); +}; + +Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); +}; + +Promise.race = function (values) { + return new Promise(function (resolve, reject) { + values.forEach(function(value){ + Promise.resolve(value).then(resolve, reject); + }); + }); +}; + +/* Prototype Methods */ + +Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/finally.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/finally.js new file mode 100644 index 00000000..f5ee0b98 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/finally.js @@ -0,0 +1,16 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.prototype['finally'] = function (f) { + return this.then(function (value) { + return Promise.resolve(f()).then(function () { + return value; + }); + }, function (err) { + return Promise.resolve(f()).then(function () { + throw err; + }); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/index.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/index.js new file mode 100644 index 00000000..6e674f38 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = require('./core.js'); +require('./done.js'); +require('./finally.js'); +require('./es6-extensions.js'); +require('./node-extensions.js'); +require('./synchronous.js'); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/node-extensions.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/node-extensions.js new file mode 100644 index 00000000..157cddc2 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/node-extensions.js @@ -0,0 +1,130 @@ +'use strict'; + +// This file contains then/promise specific extensions that are only useful +// for node.js interop + +var Promise = require('./core.js'); +var asap = require('asap'); + +module.exports = Promise; + +/* Static Functions */ + +Promise.denodeify = function (fn, argumentCount) { + if ( + typeof argumentCount === 'number' && argumentCount !== Infinity + ) { + return denodeifyWithCount(fn, argumentCount); + } else { + return denodeifyWithoutCount(fn); + } +}; + +var callbackFn = ( + 'function (err, res) {' + + 'if (err) { rj(err); } else { rs(res); }' + + '}' +); +function denodeifyWithCount(fn, argumentCount) { + var args = []; + for (var i = 0; i < argumentCount; i++) { + args.push('a' + i); + } + var body = [ + 'return function (' + args.join(',') + ') {', + 'var self = this;', + 'return new Promise(function (rs, rj) {', + 'var res = fn.call(', + ['self'].concat(args).concat([callbackFn]).join(','), + ');', + 'if (res &&', + '(typeof res === "object" || typeof res === "function") &&', + 'typeof res.then === "function"', + ') {rs(res);}', + '});', + '};' + ].join(''); + return Function(['Promise', 'fn'], body)(Promise, fn); +} +function denodeifyWithoutCount(fn) { + var fnLength = Math.max(fn.length - 1, 3); + var args = []; + for (var i = 0; i < fnLength; i++) { + args.push('a' + i); + } + var body = [ + 'return function (' + args.join(',') + ') {', + 'var self = this;', + 'var args;', + 'var argLength = arguments.length;', + 'if (arguments.length > ' + fnLength + ') {', + 'args = new Array(arguments.length + 1);', + 'for (var i = 0; i < arguments.length; i++) {', + 'args[i] = arguments[i];', + '}', + '}', + 'return new Promise(function (rs, rj) {', + 'var cb = ' + callbackFn + ';', + 'var res;', + 'switch (argLength) {', + args.concat(['extra']).map(function (_, index) { + return ( + 'case ' + (index) + ':' + + 'res = fn.call(' + ['self'].concat(args.slice(0, index)).concat('cb').join(',') + ');' + + 'break;' + ); + }).join(''), + 'default:', + 'args[argLength] = cb;', + 'res = fn.apply(self, args);', + '}', + + 'if (res &&', + '(typeof res === "object" || typeof res === "function") &&', + 'typeof res.then === "function"', + ') {rs(res);}', + '});', + '};' + ].join(''); + + return Function( + ['Promise', 'fn'], + body + )(Promise, fn); +} + +Promise.nodeify = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + var callback = + typeof args[args.length - 1] === 'function' ? args.pop() : null; + var ctx = this; + try { + return fn.apply(this, arguments).nodeify(callback, ctx); + } catch (ex) { + if (callback === null || typeof callback == 'undefined') { + return new Promise(function (resolve, reject) { + reject(ex); + }); + } else { + asap(function () { + callback.call(ctx, ex); + }) + } + } + } +}; + +Promise.prototype.nodeify = function (callback, ctx) { + if (typeof callback != 'function') return this; + + this.then(function (value) { + asap(function () { + callback.call(ctx, null, value); + }); + }, function (err) { + asap(function () { + callback.call(ctx, err); + }); + }); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/rejection-tracking.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/rejection-tracking.js new file mode 100644 index 00000000..33a59a19 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/rejection-tracking.js @@ -0,0 +1,113 @@ +'use strict'; + +var Promise = require('./core'); + +var DEFAULT_WHITELIST = [ + ReferenceError, + TypeError, + RangeError +]; + +var enabled = false; +exports.disable = disable; +function disable() { + enabled = false; + Promise._onHandle = null; + Promise._onReject = null; +} + +exports.enable = enable; +function enable(options) { + options = options || {}; + if (enabled) disable(); + enabled = true; + var id = 0; + var displayId = 0; + var rejections = {}; + Promise._onHandle = function (promise) { + if ( + promise._state === 2 && // IS REJECTED + rejections[promise._rejectionId] + ) { + if (rejections[promise._rejectionId].logged) { + onHandled(promise._rejectionId); + } else { + clearTimeout(rejections[promise._rejectionId].timeout); + } + delete rejections[promise._rejectionId]; + } + }; + Promise._onReject = function (promise, err) { + if (promise._deferredState === 0) { // not yet handled + promise._rejectionId = id++; + rejections[promise._rejectionId] = { + displayId: null, + error: err, + timeout: setTimeout( + onUnhandled.bind(null, promise._rejectionId), + // For reference errors and type errors, this almost always + // means the programmer made a mistake, so log them after just + // 100ms + // otherwise, wait 2 seconds to see if they get handled + matchWhitelist(err, DEFAULT_WHITELIST) + ? 100 + : 2000 + ), + logged: false + }; + } + }; + function onUnhandled(id) { + if ( + options.allRejections || + matchWhitelist( + rejections[id].error, + options.whitelist || DEFAULT_WHITELIST + ) + ) { + rejections[id].displayId = displayId++; + if (options.onUnhandled) { + rejections[id].logged = true; + options.onUnhandled( + rejections[id].displayId, + rejections[id].error + ); + } else { + rejections[id].logged = true; + logError( + rejections[id].displayId, + rejections[id].error + ); + } + } + } + function onHandled(id) { + if (rejections[id].logged) { + if (options.onHandled) { + options.onHandled(rejections[id].displayId, rejections[id].error); + } else if (!rejections[id].onUnhandled) { + console.warn( + 'Promise Rejection Handled (id: ' + rejections[id].displayId + '):' + ); + console.warn( + ' This means you can ignore any previous messages of the form "Possible Unhandled Promise Rejection" with id ' + + rejections[id].displayId + '.' + ); + } + } + } +} + +function logError(id, error) { + console.warn('Possible Unhandled Promise Rejection (id: ' + id + '):'); + var errStr = (error && (error.stack || error)) + ''; + errStr.split('\n').forEach(function (line) { + console.warn(' ' + line); + }); +} + +function matchWhitelist(error, list) { + return list.some(function (cls) { + return error instanceof cls; + }); +} \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/synchronous.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/synchronous.js new file mode 100644 index 00000000..38b228f5 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/promise/src/synchronous.js @@ -0,0 +1,62 @@ +'use strict'; + +var Promise = require('./core.js'); + +module.exports = Promise; +Promise.enableSynchronous = function () { + Promise.prototype.isPending = function() { + return this.getState() == 0; + }; + + Promise.prototype.isFulfilled = function() { + return this.getState() == 1; + }; + + Promise.prototype.isRejected = function() { + return this.getState() == 2; + }; + + Promise.prototype.getValue = function () { + if (this._state === 3) { + return this._value.getValue(); + } + + if (!this.isFulfilled()) { + throw new Error('Cannot get a value of an unfulfilled promise.'); + } + + return this._value; + }; + + Promise.prototype.getReason = function () { + if (this._state === 3) { + return this._value.getReason(); + } + + if (!this.isRejected()) { + throw new Error('Cannot get a rejection reason of a non-rejected promise.'); + } + + return this._value; + }; + + Promise.prototype.getState = function () { + if (this._state === 3) { + return this._value.getState(); + } + if (this._state === -1 || this._state === -2) { + return 0; + } + + return this._state; + }; +}; + +Promise.disableSynchronous = function() { + Promise.prototype.isPending = undefined; + Promise.prototype.isFulfilled = undefined; + Promise.prototype.isRejected = undefined; + Promise.prototype.getValue = undefined; + Promise.prototype.getReason = undefined; + Promise.prototype.getState = undefined; +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/CHANGELOG.md b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/CHANGELOG.md new file mode 100644 index 00000000..f921c8b6 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/CHANGELOG.md @@ -0,0 +1,70 @@ +## 15.6.0 + +* Switch from BSD + Patents to MIT license +* Add PropTypes.exact, like PropTypes.shape but warns on extra object keys. ([@thejameskyle](https://github.com/thejameskyle) and [@aweary](https://github.com/aweary) in [#41](https://github.com/reactjs/prop-types/pull/41) and [#87](https://github.com/reactjs/prop-types/pull/87)) + +## 15.5.10 + +* Fix a false positive warning when using a production UMD build of a third-party library with a DEV version of React. ([@gaearon](https://github.com/gaearon) in [#50](https://github.com/reactjs/prop-types/pull/50)) + +## 15.5.9 + +* Add `loose-envify` Browserify transform for users who don't envify globally. ([@mridgway](https://github.com/mridgway) in [#45](https://github.com/reactjs/prop-types/pull/45)) + +## 15.5.8 + +* Limit the manual PropTypes call warning count because it has false positives with React versions earlier than 15.2.0 in the 15.x branch and 0.14.9 in the 0.14.x branch. ([@gaearon](https://github.com/gaearon) in [#26](https://github.com/reactjs/prop-types/pull/26)) + +## 15.5.7 + +* **Critical Bugfix:** Fix an accidental breaking change that caused errors in production when used through `React.PropTypes`. ([@gaearon](https://github.com/gaearon) in [#20](https://github.com/reactjs/prop-types/pull/20)) +* Improve the size of production UMD build. ([@aweary](https://github.com/aweary) in [38ba18](https://github.com/reactjs/prop-types/commit/38ba18a4a8f705f4b2b33c88204573ddd604f2d6) and [7882a7](https://github.com/reactjs/prop-types/commit/7882a7285293db5f284bcf559b869fd2cd4c44d4)) + +## 15.5.6 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Fix a markdown issue in README. ([@bvaughn](https://github.com/bvaughn) in [174f77](https://github.com/reactjs/prop-types/commit/174f77a50484fa628593e84b871fb40eed78b69a)) + +## 15.5.5 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Add missing documentation and license files. ([@bvaughn](https://github.com/bvaughn) in [0a53d3](https://github.com/reactjs/prop-types/commit/0a53d3a34283ae1e2d3aa396632b6dc2a2061e6a)) + +## 15.5.4 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Reduce the size of the UMD Build. ([@acdlite](https://github.com/acdlite) in [31e9344](https://github.com/reactjs/prop-types/commit/31e9344ca3233159928da66295da17dad82db1a8)) +* Remove bad package url. ([@ljharb](https://github.com/ljharb) in [158198f](https://github.com/reactjs/prop-types/commit/158198fd6c468a3f6f742e0e355e622b3914048a)) +* Remove the accidentally included typechecking code from the production build. + +## 15.5.3 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Remove the accidentally included React package code from the UMD bundle. ([@acdlite](https://github.com/acdlite) in [df318bb](https://github.com/reactjs/prop-types/commit/df318bba8a89bc5aadbb0292822cf4ed71d27ace)) + +## 15.5.2 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Remove dependency on React for CommonJS entry point. ([@acdlite](https://github.com/acdlite) in [cae72bb](https://github.com/reactjs/prop-types/commit/cae72bb281a3766c765e3624f6088c3713567e6d)) + + +## 15.5.1 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Remove accidental uncompiled ES6 syntax in the published package. ([@acdlite](https://github.com/acdlite) in [e191963](https://github.com/facebook/react/commit/e1919638b39dd65eedd250a8bb649773ca61b6f1)) + +## 15.5.0 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Initial release. + +## Before 15.5.0 + +PropTypes was previously included in React, but is now a separate package. For earlier history of PropTypes [see the React change log.](https://github.com/facebook/react/blob/master/CHANGELOG.md) diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/LICENSE b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/LICENSE new file mode 100644 index 00000000..188fb2b0 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013-present, Facebook, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/README.md b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/README.md new file mode 100644 index 00000000..8ac77c3c --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/README.md @@ -0,0 +1,262 @@ +# prop-types + +Runtime type checking for React props and similar objects. + +You can use prop-types to document the intended types of properties passed to +components. React (and potentially other libraries—see the checkPropTypes() +reference below) will check props passed to your components against those +definitions, and warn in development if they don’t match. + +## Installation + +```shell +npm install --save prop-types +``` + +## Importing + +```js +import PropTypes from 'prop-types'; // ES6 +var PropTypes = require('prop-types'); // ES5 with npm +``` + +If you prefer a ` + + + +``` + +## Usage + +PropTypes was originally exposed as part of the React core module, and is +commonly used with React components. +Here is an example of using PropTypes with a React component, which also +documents the different validators provided: + +```js +import React from 'react'; +import PropTypes from 'prop-types'; + +class MyComponent extends React.Component { + render() { + // ... do things with the props + } +} + +MyComponent.propTypes = { + // You can declare that a prop is a specific JS primitive. By default, these + // are all optional. + optionalArray: PropTypes.array, + optionalBool: PropTypes.bool, + optionalFunc: PropTypes.func, + optionalNumber: PropTypes.number, + optionalObject: PropTypes.object, + optionalString: PropTypes.string, + optionalSymbol: PropTypes.symbol, + + // Anything that can be rendered: numbers, strings, elements or an array + // (or fragment) containing these types. + optionalNode: PropTypes.node, + + // A React element. + optionalElement: PropTypes.element, + + // You can also declare that a prop is an instance of a class. This uses + // JS's instanceof operator. + optionalMessage: PropTypes.instanceOf(Message), + + // You can ensure that your prop is limited to specific values by treating + // it as an enum. + optionalEnum: PropTypes.oneOf(['News', 'Photos']), + + // An object that could be one of many types + optionalUnion: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.number, + PropTypes.instanceOf(Message) + ]), + + // An array of a certain type + optionalArrayOf: PropTypes.arrayOf(PropTypes.number), + + // An object with property values of a certain type + optionalObjectOf: PropTypes.objectOf(PropTypes.number), + + // An object taking on a particular shape + optionalObjectWithShape: PropTypes.shape({ + color: PropTypes.string, + fontSize: PropTypes.number + }), + + // You can chain any of the above with `isRequired` to make sure a warning + // is shown if the prop isn't provided. + requiredFunc: PropTypes.func.isRequired, + + // A value of any data type + requiredAny: PropTypes.any.isRequired, + + // You can also specify a custom validator. It should return an Error + // object if the validation fails. Don't `console.warn` or throw, as this + // won't work inside `oneOfType`. + customProp: function(props, propName, componentName) { + if (!/matchme/.test(props[propName])) { + return new Error( + 'Invalid prop `' + propName + '` supplied to' + + ' `' + componentName + '`. Validation failed.' + ); + } + }, + + // You can also supply a custom validator to `arrayOf` and `objectOf`. + // It should return an Error object if the validation fails. The validator + // will be called for each key in the array or object. The first two + // arguments of the validator are the array or object itself, and the + // current item's key. + customArrayProp: PropTypes.arrayOf(function(propValue, key, componentName, location, propFullName) { + if (!/matchme/.test(propValue[key])) { + return new Error( + 'Invalid prop `' + propFullName + '` supplied to' + + ' `' + componentName + '`. Validation failed.' + ); + } + }) +}; +``` + +Refer to the [React documentation](https://facebook.github.io/react/docs/typechecking-with-proptypes.html) for more information. + +## Migrating from React.PropTypes + +Check out [Migrating from React.PropTypes](https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) for details on how to migrate to `prop-types` from `React.PropTypes`. + +Note that this blog posts **mentions a codemod script that performs the conversion automatically**. + +There are also important notes below. + +## How to Depend on This Package? + +For apps, we recommend putting it in `dependencies` with a caret range. +For example: + +```js + "dependencies": { + "prop-types": "^15.5.7" + } +``` + +For libraries, we *also* recommend leaving it in `dependencies`: + +```js + "dependencies": { + "prop-types": "^15.5.7" + }, + "peerDependencies": { + "react": "^15.5.0" + } +``` + +**Note:** there are known issues in versions before 15.5.7 so we recommend using it as the minimal version. + +Make sure that the version range uses a caret (`^`) and thus is broad enough for npm to efficiently deduplicate packages. + +For UMD bundles of your components, make sure you **don’t** include `PropTypes` in the build. Usually this is done by marking it as an external (the specifics depend on your bundler), just like you do with React. + +## Compatibility + +### React 0.14 + +This package is compatible with **React 0.14.9**. Compared to 0.14.8 (which was released a year ago), there are no other changes in 0.14.9, so it should be a painless upgrade. + +```shell +# ATTENTION: Only run this if you still use React 0.14! +npm install --save react@^0.14.9 react-dom@^0.14.9 +``` + +### React 15+ + +This package is compatible with **React 15.3.0** and higher. + +``` +npm install --save react@^15.3.0 react-dom@^15.3.0 +``` + +### What happens on other React versions? + +It outputs warnings with the message below even though the developer doesn’t do anything wrong. Unfortunately there is no solution for this other than updating React to either 15.3.0 or higher, or 0.14.9 if you’re using React 0.14. + +## Difference from `React.PropTypes`: Don’t Call Validator Functions + +First of all, **which version of React are you using**? You might be seeing this message because a component library has updated to use `prop-types` package, but your version of React is incompatible with it. See the [above section](#compatibility) for more details. + +Are you using either React 0.14.9 or a version higher than React 15.3.0? Read on. + +When you migrate components to use the standalone `prop-types`, **all validator functions will start throwing an error if you call them directly**. This makes sure that nobody relies on them in production code, and it is safe to strip their implementations to optimize the bundle size. + +Code like this is still fine: + +```js +MyComponent.propTypes = { + myProp: PropTypes.bool +}; +``` + +However, code like this will not work with the `prop-types` package: + +```js +// Will not work with `prop-types` package! +var errorOrNull = PropTypes.bool(42, 'myProp', 'MyComponent', 'prop'); +``` + +It will throw an error: + +``` +Calling PropTypes validators directly is not supported by the `prop-types` package. +Use PropTypes.checkPropTypes() to call them. +``` + +(If you see **a warning** rather than an error with this message, please check the [above section about compatibility](#compatibility).) + +This is new behavior, and you will only encounter it when you migrate from `React.PropTypes` to the `prop-types` package. For the vast majority of components, this doesn’t matter, and if you didn’t see [this warning](https://facebook.github.io/react/warnings/dont-call-proptypes.html) in your components, your code is safe to migrate. This is not a breaking change in React because you are only opting into this change for a component by explicitly changing your imports to use `prop-types`. If you temporarily need the old behavior, you can keep using `React.PropTypes` until React 16. + +**If you absolutely need to trigger the validation manually**, call `PropTypes.checkPropTypes()`. Unlike the validators themselves, this function is safe to call in production, as it will be replaced by an empty function: + +```js +// Works with standalone PropTypes +PropTypes.checkPropTypes(MyComponent.propTypes, props, 'prop', 'MyComponent'); +``` +See below for more info. + +**You might also see this error** if you’re calling a `PropTypes` validator from your own custom `PropTypes` validator. In this case, the fix is to make sure that you are passing *all* of the arguments to the inner function. There is a more in-depth explanation of how to fix it [on this page](https://facebook.github.io/react/warnings/dont-call-proptypes.html#fixing-the-false-positive-in-third-party-proptypes). Alternatively, you can temporarily keep using `React.PropTypes` until React 16, as it would still only warn in this case. + +If you use a bundler like Browserify or Webpack, don’t forget to [follow these instructions](https://facebook.github.io/react/docs/installation.html#development-and-production-versions) to correctly bundle your application in development or production mode. Otherwise you’ll ship unnecessary code to your users. + +## PropTypes.checkPropTypes + +React will automatically check the propTypes you set on the component, but if +you are using PropTypes without React then you may want to manually call +`PropTypes.checkPropTypes`, like so: + +```js +const myPropTypes = { + name: PropTypes.string, + age: PropTypes.number, + // ... define your prop validations +}; + +const props = { + name: 'hello', // is valid + age: 'world', // not valid +}; + +// Let's say your component is called 'MyComponent' + +// Works with standalone PropTypes +PropTypes.checkPropTypes(myPropTypes, props, 'prop', 'MyComponent'); +// This will warn as follows: +// Warning: Failed prop type: Invalid prop `age` of type `string` supplied to +// `MyComponent`, expected `number`. +``` diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/checkPropTypes.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/checkPropTypes.js new file mode 100644 index 00000000..0802c360 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/checkPropTypes.js @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== 'production') { + var invariant = require('fbjs/lib/invariant'); + var warning = require('fbjs/lib/warning'); + var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + var loggedTypeFailures = {}; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); + } + } + } + } +} + +module.exports = checkPropTypes; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/factory.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/factory.js new file mode 100644 index 00000000..abdf8e6d --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/factory.js @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +// React 15.5 references this module, and assumes PropTypes are still callable in production. +// Therefore we re-export development-only version with all the PropTypes checks here. +// However if one is migrating to the `prop-types` npm library, they will go through the +// `index.js` entry point, and it will branch depending on the environment. +var factory = require('./factoryWithTypeCheckers'); +module.exports = function(isValidElement) { + // It is still allowed in 15.5. + var throwOnDirectAccess = false; + return factory(isValidElement, throwOnDirectAccess); +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/factoryWithThrowingShims.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/factoryWithThrowingShims.js new file mode 100644 index 00000000..2b3c9242 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/factoryWithThrowingShims.js @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim + }; + + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/factoryWithTypeCheckers.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/factoryWithTypeCheckers.js new file mode 100644 index 00000000..7c962b16 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/factoryWithTypeCheckers.js @@ -0,0 +1,542 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); +var assign = require('object-assign'); + +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); +var checkPropTypes = require('./checkPropTypes'); + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + warning( + false, + 'You are manually calling a React.PropTypes validation ' + + 'function for the `%s` prop on `%s`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', + propFullName, + componentName + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + warning( + false, + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received %s at index %s.', + getPostfixForTypeWarning(checker), + i + ); + return emptyFunction.thatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/index.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/index.js new file mode 100644 index 00000000..11bfceab --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/index.js @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +if (process.env.NODE_ENV !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = require('./factoryWithThrowingShims')(); +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/lib/ReactPropTypesSecret.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/lib/ReactPropTypesSecret.js new file mode 100644 index 00000000..f54525e7 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/lib/ReactPropTypesSecret.js @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/package.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/package.json new file mode 100644 index 00000000..044e36d0 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/package.json @@ -0,0 +1,83 @@ +{ + "_from": "prop-types@^15.5.7", + "_id": "prop-types@15.6.0", + "_inBundle": false, + "_integrity": "sha1-zq8IMCL8RrSjX2nhPvda7Q1jmFY=", + "_location": "/react-dropzone/prop-types", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "prop-types@^15.5.7", + "name": "prop-types", + "escapedName": "prop-types", + "rawSpec": "^15.5.7", + "saveSpec": null, + "fetchSpec": "^15.5.7" + }, + "_requiredBy": [ + "/react-dropzone" + ], + "_resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.0.tgz", + "_shasum": "ceaf083022fc46b4a35f69e13ef75aed0d639856", + "_spec": "prop-types@^15.5.7", + "_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI\\node_modules\\react-dropzone", + "browserify": { + "transform": [ + "loose-envify" + ] + }, + "bugs": { + "url": "https://github.com/reactjs/prop-types/issues" + }, + "bundleDependencies": false, + "dependencies": { + "fbjs": "^0.8.16", + "loose-envify": "^1.3.1", + "object-assign": "^4.1.1" + }, + "deprecated": false, + "description": "Runtime type checking for React props and similar objects.", + "devDependencies": { + "babel-jest": "^19.0.0", + "babel-preset-react": "^6.24.1", + "browserify": "^14.3.0", + "bundle-collapser": "^1.2.1", + "envify": "^4.0.0", + "jest": "^19.0.2", + "react": "^15.5.1", + "uglifyify": "^3.0.4", + "uglifyjs": "^2.4.10" + }, + "files": [ + "LICENSE", + "README.md", + "checkPropTypes.js", + "factory.js", + "factoryWithThrowingShims.js", + "factoryWithTypeCheckers.js", + "index.js", + "prop-types.js", + "prop-types.min.js", + "lib" + ], + "homepage": "https://facebook.github.io/react/", + "keywords": [ + "react" + ], + "license": "MIT", + "main": "index.js", + "name": "prop-types", + "repository": { + "type": "git", + "url": "git+https://github.com/reactjs/prop-types.git" + }, + "scripts": { + "build": "yarn umd && yarn umd-min", + "prepublish": "yarn build", + "test": "jest", + "umd": "NODE_ENV=development browserify index.js -t envify --standalone PropTypes -o prop-types.js", + "umd-min": "NODE_ENV=production browserify index.js -t envify -t uglifyify --standalone PropTypes -p bundle-collapser/plugin -o | uglifyjs --compress unused,dead_code -o prop-types.min.js" + }, + "version": "15.6.0" +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/prop-types.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/prop-types.js new file mode 100644 index 00000000..ba55170c --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/prop-types.js @@ -0,0 +1,965 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PropTypes = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; + })(); +} + +module.exports = warning; +},{"./emptyFunction":6}],9:[function(require,module,exports){ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + +},{}]},{},[4])(4) +}); \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/prop-types.min.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/prop-types.min.js new file mode 100644 index 00000000..71af27b7 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/prop-types/prop-types.min.js @@ -0,0 +1 @@ +!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.PropTypes=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o element; its readystatechange event will be fired asynchronously once it is inserted + // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. + var script = doc.createElement("script"); + script.onreadystatechange = function () { + runIfPresent(handle); + script.onreadystatechange = null; + html.removeChild(script); + script = null; + }; + html.appendChild(script); + }; + } + + function installSetTimeoutImplementation() { + registerImmediate = function(handle) { + setTimeout(runIfPresent, 0, handle); + }; + } + + // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live. + var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global); + attachTo = attachTo && attachTo.setTimeout ? attachTo : global; + + // Don't get fooled by e.g. browserify environments. + if ({}.toString.call(global.process) === "[object process]") { + // For Node.js before 0.9 + installNextTickImplementation(); + + } else if (canUsePostMessage()) { + // For non-IE10 modern browsers + installPostMessageImplementation(); + + } else if (global.MessageChannel) { + // For web workers, where supported + installMessageChannelImplementation(); + + } else if (doc && "onreadystatechange" in doc.createElement("script")) { + // For IE 6–8 + installReadyStateChangeImplementation(); + + } else { + // For older browsers + installSetTimeoutImplementation(); + } + + attachTo.setImmediate = setImmediate; + attachTo.clearImmediate = clearImmediate; +}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/.npmignore b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/.npmignore new file mode 100644 index 00000000..154d1f06 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/.npmignore @@ -0,0 +1,24 @@ +node_modules/ +npm-debug.log +### vim ### +.*.s[a-w][a-z] +*.un~ +Session.vim +.netrwhist +*~ +.versions + +### OSX ### +.DS_Store +.AppleDouble +.LSOverride +Icon + + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes +.idea diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/.travis.yml b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/.travis.yml new file mode 100644 index 00000000..4d23aa06 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/.travis.yml @@ -0,0 +1,13 @@ +language: node_js +node_js: + - stable + - "0.10" + +notifications: + email: false + +cache: + directories: + - node_modules + +sudo: false diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/bower.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/bower.json new file mode 100644 index 00000000..69e9aaa8 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/bower.json @@ -0,0 +1,17 @@ +{ + "name": "ua-parser-js", + "version": "0.7.17", + "authors": [ + "Faisal Salman " + ], + "private": false, + "main": "src/ua-parser.js", + "ignore": [ + "build", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": {} +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/dist/ua-parser.html b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/dist/ua-parser.html new file mode 100644 index 00000000..1e530bb1 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/dist/ua-parser.html @@ -0,0 +1 @@ + diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/dist/ua-parser.min.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/dist/ua-parser.min.js new file mode 100644 index 00000000..49d763e1 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/dist/ua-parser.min.js @@ -0,0 +1,9 @@ +/** + * UAParser.js v0.7.17 + * Lightweight JavaScript-based User-Agent string parser + * https://github.com/faisalman/ua-parser-js + * + * Copyright © 2012-2016 Faisal Salman + * Dual licensed under GPLv2 & MIT + */ +(function(window,undefined){"use strict";var LIBVERSION="0.7.17",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded";var util={extend:function(regexes,extensions){var margedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){margedRegexes[i]=extensions[i].concat(regexes[i])}else{margedRegexes[i]=regexes[i]}}return margedRegexes},has:function(str1,str2){if(typeof str1==="string"){return str2.toLowerCase().indexOf(str1.toLowerCase())!==-1}else{return false}},lowerize:function(str){return str.toLowerCase()},major:function(version){return typeof version===STR_TYPE?version.replace(/[^\d\.]/g,"").split(".")[0]:undefined},trim:function(str){return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}};var mapper={rgx:function(ua,arrays){var i=0,j,k,p,q,matches,match;while(i0){if(q.length==2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length==3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length==4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},str:function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j + * Dual licensed under GPLv2 & MIT + */ +!function(i,s){"use strict";var e="0.7.17",o="",r="?",n="function",a="undefined",d="object",t="string",l="major",w="model",u="name",c="type",m="vendor",b="version",p="architecture",g="console",f="mobile",h="tablet",v="smarttv",x="wearable",k="embedded",y={extend:function(i,s){var e={};for(var o in i)s[o]&&s[o].length%2===0?e[o]=s[o].concat(i[o]):e[o]=i[o];return e},has:function(i,s){return"string"==typeof i&&s.toLowerCase().indexOf(i.toLowerCase())!==-1},lowerize:function(i){return i.toLowerCase()},major:function(i){return typeof i===t?i.replace(/[^\d\.]/g,"").split(".")[0]:s},trim:function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},T={rgx:function(i,e){for(var o,r,a,t,l,w,u=0;u0?2==t.length?typeof t[1]==n?this[t[0]]=t[1].call(this,w):this[t[0]]=t[1]:3==t.length?typeof t[1]!==n||t[1].exec&&t[1].test?this[t[0]]=w?w.replace(t[1],t[2]):s:this[t[0]]=w?t[1].call(this,w,t[2]):s:4==t.length&&(this[t[0]]=w?t[3].call(this,w.replace(t[1],t[2])):s):this[t]=w?w:s;u+=2}},str:function(i,e){for(var o in e)if(typeof e[o]===d&&e[o].length>0){for(var n=0;n> +* Demo : http://faisalman.github.io/ua-parser-js +* Source : https://github.com/faisalman/ua-parser-js + +# Constructor + +* `new UAParser([uastring][,extensions])` + * returns new instance + +* `UAParser([uastring][,extensions])` + * returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }` + +# Methods + +* `getBrowser()` + * returns `{ name: '', version: '' }` + +``` +# Possible 'browser.name': +Amaya, Android Browser, Arora, Avant, Baidu, Blazer, Bolt, Bowser, Camino, Chimera, +Chrome [WebView], Chromium, Comodo Dragon, Conkeror, Dillo, Dolphin, Doris, Edge, +Epiphany, Fennec, Firebird, Firefox, Flock, GoBrowser, iCab, ICE Browser, IceApe, +IceCat, IceDragon, Iceweasel, IE[Mobile], Iron, Jasmine, K-Meleon, Konqueror, Kindle, +Links, Lunascape, Lynx, Maemo, Maxthon, Midori, Minimo, MIUI Browser, [Mobile] Safari, +Mosaic, Mozilla, Netfront, Netscape, NetSurf, Nokia, OmniWeb, Opera [Mini/Mobi/Tablet], +PhantomJS, Phoenix, Polaris, QQBrowser, RockMelt, Silk, Skyfire, SeaMonkey, Sleipnir, +SlimBrowser, Swiftfox, Tizen, UCBrowser, Vivaldi, w3m, WeChat, Yandex + +# 'browser.version' determined dynamically +``` + +* `getDevice()` + * returns `{ model: '', type: '', vendor: '' }` + +``` +# Possible 'device.type': +console, mobile, tablet, smarttv, wearable, embedded + +# Possible 'device.vendor': +Acer, Alcatel, Amazon, Apple, Archos, Asus, BenQ, BlackBerry, Dell, GeeksPhone, +Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Microsoft, Motorola, Nexian, +Nintendo, Nokia, Nvidia, OnePlus, Ouya, Palm, Panasonic, Pebble, Polytron, RIM, +Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE + +# 'device.model' determined dynamically +``` + +* `getEngine()` + * returns `{ name: '', version: '' }` + +``` +# Possible 'engine.name' +Amaya, EdgeHTML, Gecko, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto, +Tasman, Trident, w3m, WebKit + +# 'engine.version' determined dynamically +``` + +* `getOS()` + * returns `{ name: '', version: '' }` + +``` +# Possible 'os.name' +AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki, +Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS, +Joli, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD, +Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, PCLinuxOS, Plan9, Playstation, QNX, RedHat, +RIM Tablet OS, RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen, +Ubuntu, UNIX, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk + +# 'os.version' determined dynamically +``` + +* `getCPU()` + * returns `{ architecture: '' }` + +``` +# Possible 'cpu.architecture' +68k, amd64, arm[64], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64] +``` + +* `getResult()` + * returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }` + +* `getUA()` + * returns UA string of current instance + +* `setUA(uastring)` + * set UA string to parse + * returns current instance + + +# Example + +```html + + + + + + + + + +``` + +## Using node.js + +```sh +$ npm install ua-parser-js +``` + +```js +var http = require('http'); +var parser = require('ua-parser-js'); + +http.createServer(function (req, res) { + // get user-agent header + var ua = parser(req.headers['user-agent']); + // write the result as response + res.end(JSON.stringify(ua, null, ' ')); +}) +.listen(1337, '127.0.0.1'); + +console.log('Server running at http://127.0.0.1:1337/'); +``` + +## Using requirejs + +```js +requirejs.config({ + baseUrl : 'js/lib', // path to your script directory + paths : { + 'ua-parser-js' : 'ua-parser.min' + } +}); + +requirejs(['ua-parser-js'], function(UAParser) { + var parser = new UAParser(); + console.log(parser.getResult()); +}); +``` + +## Using CDN + +```html + +``` + +## Using bower + +```sh +$ bower install ua-parser-js +``` + +## Using meteor + +```sh +$ meteor add faisalman:ua-parser-js +``` + +## Using CLI + +```sh +$ node ua-parser.min.js "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)" +# multiple args +$ node ua-parser.min.js "Opera/1.2" "Opera/3.4" +# piped args +$ echo "Opera/1.2" | node ua-parser.min.js +# log file +$ cat ua.log | node ua-parser.min.js +``` + +## Using jQuery/Zepto ($.ua) + +Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery/Zepto is present and create `$.ua` object based on browser's user-agent (although in case you need, `window.UAParser` constructor is still present). To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`. + +```js +// In browser with default user-agent: 'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0': + +// Do some tests +console.log($.ua.device); // {vendor: "HTC", model: "Evo Shift 4G", type: "mobile"} +console.log($.ua.os); // {name: "Android", version: "2.3.4"} +console.log($.ua.os.name); // "Android" +console.log($.ua.get()); // "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0" + +// reset to custom user-agent +$.ua.set('Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; Xoom Build/HWI69) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13'); + +// Test again +console.log($.ua.browser.name); // "Safari" +console.log($.ua.engine.name); // "Webkit" +console.log($.ua.device); // {vendor: "Motorola", model: "Xoom", type: "tablet"} +console.log(parseInt($.ua.browser.version.split('.')[0], 10)); // 4 + +// Add class to tag +// +$('body').addClass('ua-browser-' + $.ua.browser.name + ' ua-devicetype-' + $.ua.device.type); +``` + +## Extending regex patterns + +* `UAParser([uastring,] extensions)` + +Pass your own regexes to extend the limited matching rules. + +```js +// Example: +var myOwnRegex = [[/(myownbrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]]; +var myParser = new UAParser({ browser: myOwnRegex }); +var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3'; +console.log(myParser.setUA(uaString).getBrowser()); // {name: "MyOwnBrowser", version: "1.3"} +``` + + +# Development + +## Contribute + +* Fork and clone this repository +* Make some changes as required +* Write a unit test to showcase your feature +* Run the test suites to make sure the changes you made didn't break anything `$ npm run test` +* Commit and push to your own repository +* Submit a pull request to this repository under `develop` branch +* Profit? $$$ + +## Build + +Build a minified & packed script + +```sh +$ npm run build +``` + + +# Donate + +Do you use & like UAParser.js but you don’t find a way to show some love? If yes, please consider donating to support this project. Otherwise, no worries, regardless of whether there is support or not, I will keep maintaining this project. Still, if you buy me a cup of coffee I would be more than happy though :) + +[![Support via Pledgie](https://pledgie.com/campaigns/34252.png?skin_name=chrome)](https://pledgie.com/campaigns/34252) + + +# License + +Dual licensed under GPLv2 & MIT + +Copyright © 2012-2016 Faisal Salman <> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/src/ua-parser.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/src/ua-parser.js new file mode 100644 index 00000000..64e64540 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/src/ua-parser.js @@ -0,0 +1,1072 @@ +/** + * UAParser.js v0.7.17 + * Lightweight JavaScript-based User-Agent string parser + * https://github.com/faisalman/ua-parser-js + * + * Copyright © 2012-2016 Faisal Salman + * Dual licensed under GPLv2 & MIT + */ + +(function (window, undefined) { + + 'use strict'; + + ////////////// + // Constants + ///////////// + + + var LIBVERSION = '0.7.17', + EMPTY = '', + UNKNOWN = '?', + FUNC_TYPE = 'function', + UNDEF_TYPE = 'undefined', + OBJ_TYPE = 'object', + STR_TYPE = 'string', + MAJOR = 'major', // deprecated + MODEL = 'model', + NAME = 'name', + TYPE = 'type', + VENDOR = 'vendor', + VERSION = 'version', + ARCHITECTURE= 'architecture', + CONSOLE = 'console', + MOBILE = 'mobile', + TABLET = 'tablet', + SMARTTV = 'smarttv', + WEARABLE = 'wearable', + EMBEDDED = 'embedded'; + + + /////////// + // Helper + ////////// + + + var util = { + extend : function (regexes, extensions) { + var margedRegexes = {}; + for (var i in regexes) { + if (extensions[i] && extensions[i].length % 2 === 0) { + margedRegexes[i] = extensions[i].concat(regexes[i]); + } else { + margedRegexes[i] = regexes[i]; + } + } + return margedRegexes; + }, + has : function (str1, str2) { + if (typeof str1 === "string") { + return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; + } else { + return false; + } + }, + lowerize : function (str) { + return str.toLowerCase(); + }, + major : function (version) { + return typeof(version) === STR_TYPE ? version.replace(/[^\d\.]/g,'').split(".")[0] : undefined; + }, + trim : function (str) { + return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + } + }; + + + /////////////// + // Map helper + ////////////// + + + var mapper = { + + rgx : function (ua, arrays) { + + //var result = {}, + var i = 0, j, k, p, q, matches, match;//, args = arguments; + + /*// construct object barebones + for (p = 0; p < args[1].length; p++) { + q = args[1][p]; + result[typeof q === OBJ_TYPE ? q[0] : q] = undefined; + }*/ + + // loop through all regexes maps + while (i < arrays.length && !matches) { + + var regex = arrays[i], // even sequence (0,2,4,..) + props = arrays[i + 1]; // odd sequence (1,3,5,..) + j = k = 0; + + // try matching uastring with regexes + while (j < regex.length && !matches) { + + matches = regex[j++].exec(ua); + + if (!!matches) { + for (p = 0; p < props.length; p++) { + match = matches[++k]; + q = props[p]; + // check if given property is actually array + if (typeof q === OBJ_TYPE && q.length > 0) { + if (q.length == 2) { + if (typeof q[1] == FUNC_TYPE) { + // assign modified match + this[q[0]] = q[1].call(this, match); + } else { + // assign given value, ignore regex match + this[q[0]] = q[1]; + } + } else if (q.length == 3) { + // check whether function or regex + if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) { + // call function (usually string mapper) + this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; + } else { + // sanitize match using given regex + this[q[0]] = match ? match.replace(q[1], q[2]) : undefined; + } + } else if (q.length == 4) { + this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; + } + } else { + this[q] = match ? match : undefined; + } + } + } + } + i += 2; + } + // console.log(this); + //return this; + }, + + str : function (str, map) { + + for (var i in map) { + // check if array + if (typeof map[i] === OBJ_TYPE && map[i].length > 0) { + for (var j = 0; j < map[i].length; j++) { + if (util.has(map[i][j], str)) { + return (i === UNKNOWN) ? undefined : i; + } + } + } else if (util.has(map[i], str)) { + return (i === UNKNOWN) ? undefined : i; + } + } + return str; + } + }; + + + /////////////// + // String map + ////////////// + + + var maps = { + + browser : { + oldsafari : { + version : { + '1.0' : '/8', + '1.2' : '/1', + '1.3' : '/3', + '2.0' : '/412', + '2.0.2' : '/416', + '2.0.3' : '/417', + '2.0.4' : '/419', + '?' : '/' + } + } + }, + + device : { + amazon : { + model : { + 'Fire Phone' : ['SD', 'KF'] + } + }, + sprint : { + model : { + 'Evo Shift 4G' : '7373KT' + }, + vendor : { + 'HTC' : 'APA', + 'Sprint' : 'Sprint' + } + } + }, + + os : { + windows : { + version : { + 'ME' : '4.90', + 'NT 3.11' : 'NT3.51', + 'NT 4.0' : 'NT4.0', + '2000' : 'NT 5.0', + 'XP' : ['NT 5.1', 'NT 5.2'], + 'Vista' : 'NT 6.0', + '7' : 'NT 6.1', + '8' : 'NT 6.2', + '8.1' : 'NT 6.3', + '10' : ['NT 6.4', 'NT 10.0'], + 'RT' : 'ARM' + } + } + } + }; + + + ////////////// + // Regex map + ///////////// + + + var regexes = { + + browser : [[ + + // Presto based + /(opera\smini)\/([\w\.-]+)/i, // Opera Mini + /(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet + /(opera).+version\/([\w\.]+)/i, // Opera > 9.80 + /(opera)[\/\s]+([\w\.]+)/i // Opera < 9.80 + ], [NAME, VERSION], [ + + /(opios)[\/\s]+([\w\.]+)/i // Opera mini on iphone >= 8.0 + ], [[NAME, 'Opera Mini'], VERSION], [ + + /\s(opr)\/([\w\.]+)/i // Opera Webkit + ], [[NAME, 'Opera'], VERSION], [ + + // Mixed + /(kindle)\/([\w\.]+)/i, // Kindle + /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i, + // Lunascape/Maxthon/Netfront/Jasmine/Blazer + + // Trident based + /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i, + // Avant/IEMobile/SlimBrowser/Baidu + /(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer + + // Webkit/KHTML based + /(rekonq)\/([\w\.]+)*/i, // Rekonq + /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser)\/([\w\.-]+)/i + // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser + ], [NAME, VERSION], [ + + /(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11 + ], [[NAME, 'IE'], VERSION], [ + + /(edge)\/((\d+)?[\w\.]+)/i // Microsoft Edge + ], [NAME, VERSION], [ + + /(yabrowser)\/([\w\.]+)/i // Yandex + ], [[NAME, 'Yandex'], VERSION], [ + + /(puffin)\/([\w\.]+)/i // Puffin + ], [[NAME, 'Puffin'], VERSION], [ + + /((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i + // UCBrowser + ], [[NAME, 'UCBrowser'], VERSION], [ + + /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon + ], [[NAME, /_/g, ' '], VERSION], [ + + /(micromessenger)\/([\w\.]+)/i // WeChat + ], [[NAME, 'WeChat'], VERSION], [ + + /(QQ)\/([\d\.]+)/i // QQ, aka ShouQ + ], [NAME, VERSION], [ + + /m?(qqbrowser)[\/\s]?([\w\.]+)/i // QQBrowser + ], [NAME, VERSION], [ + + /xiaomi\/miuibrowser\/([\w\.]+)/i // MIUI Browser + ], [VERSION, [NAME, 'MIUI Browser']], [ + + /;fbav\/([\w\.]+);/i // Facebook App for iOS & Android + ], [VERSION, [NAME, 'Facebook']], [ + + /headlesschrome(?:\/([\w\.]+)|\s)/i // Chrome Headless + ], [VERSION, [NAME, 'Chrome Headless']], [ + + /\swv\).+(chrome)\/([\w\.]+)/i // Chrome WebView + ], [[NAME, /(.+)/, '$1 WebView'], VERSION], [ + + /((?:oculus|samsung)browser)\/([\w\.]+)/i + ], [[NAME, /(.+(?:g|us))(.+)/, '$1 $2'], VERSION], [ // Oculus / Samsung Browser + + /android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i // Android Browser + ], [VERSION, [NAME, 'Android Browser']], [ + + /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i + // Chrome/OmniWeb/Arora/Tizen/Nokia + ], [NAME, VERSION], [ + + /(dolfin)\/([\w\.]+)/i // Dolphin + ], [[NAME, 'Dolphin'], VERSION], [ + + /((?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS + ], [[NAME, 'Chrome'], VERSION], [ + + /(coast)\/([\w\.]+)/i // Opera Coast + ], [[NAME, 'Opera Coast'], VERSION], [ + + /fxios\/([\w\.-]+)/i // Firefox for iOS + ], [VERSION, [NAME, 'Firefox']], [ + + /version\/([\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari + ], [VERSION, [NAME, 'Mobile Safari']], [ + + /version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile + ], [VERSION, NAME], [ + + /webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Google Search Appliance on iOS + ], [[NAME, 'GSA'], VERSION], [ + + /webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 + ], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [ + + /(konqueror)\/([\w\.]+)/i, // Konqueror + /(webkit|khtml)\/([\w\.]+)/i + ], [NAME, VERSION], [ + + // Gecko based + /(navigator|netscape)\/([\w\.-]+)/i // Netscape + ], [[NAME, 'Netscape'], VERSION], [ + /(swiftfox)/i, // Swiftfox + /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, + // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror + /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i, + // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix + /(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla + + // Other + /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i, + // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir + /(links)\s\(([\w\.]+)/i, // Links + /(gobrowser)\/?([\w\.]+)*/i, // GoBrowser + /(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser + /(mosaic)[\/\s]([\w\.]+)/i // Mosaic + ], [NAME, VERSION] + + /* ///////////////////// + // Media players BEGIN + //////////////////////// + + , [ + + /(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, // Generic Apple CoreMedia + /(coremedia) v((\d+)[\w\._]+)/i + ], [NAME, VERSION], [ + + /(aqualung|lyssna|bsplayer)\/((\d+)?[\w\.-]+)/i // Aqualung/Lyssna/BSPlayer + ], [NAME, VERSION], [ + + /(ares|ossproxy)\s((\d+)[\w\.-]+)/i // Ares/OSSProxy + ], [NAME, VERSION], [ + + /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, + // Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC + // NSPlayer/PSP-InternetRadioPlayer/Videos + /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, // Clementine/MPD + /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, + /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i // NexPlayer/LG Player + ], [NAME, VERSION], [ + /(nexplayer)\s((\d+)[\w\.-]+)/i // Nexplayer + ], [NAME, VERSION], [ + + /(flrp)\/((\d+)[\w\.-]+)/i // Flip Player + ], [[NAME, 'Flip Player'], VERSION], [ + + /(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i + // FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit + ], [NAME], [ + + /(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i + // Gstreamer + ], [NAME, VERSION], [ + + /(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, // HTC Streaming Player + /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, + // Java/urllib/requests/wget/cURL + /(lavf)((\d+)[\d\.]+)/i // Lavf (FFMPEG) + ], [NAME, VERSION], [ + + /(htc_one_s)\/((\d+)[\d\.]+)/i // HTC One S + ], [[NAME, /_/g, ' '], VERSION], [ + + /(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i + // MPlayer SVN + ], [NAME, VERSION], [ + + /(mplayer)(?:\s|\/|[unkow-]+)((\d+)[\w\.-]+)/i // MPlayer + ], [NAME, VERSION], [ + + /(mplayer)/i, // MPlayer (no other info) + /(yourmuze)/i, // YourMuze + /(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime + ], [NAME], [ + + /(nero (?:home|scout))\/((\d+)[\w\.-]+)/i // Nero Home/Nero Scout + ], [NAME, VERSION], [ + + /(nokia\d+)\/((\d+)[\w\.-]+)/i // Nokia + ], [NAME, VERSION], [ + + /\s(songbird)\/((\d+)[\w\.-]+)/i // Songbird/Philips-Songbird + ], [NAME, VERSION], [ + + /(winamp)3 version ((\d+)[\w\.-]+)/i, // Winamp + /(winamp)\s((\d+)[\w\.-]+)/i, + /(winamp)mpeg\/((\d+)[\w\.-]+)/i + ], [NAME, VERSION], [ + + /(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info) + // inlight radio + ], [NAME], [ + + /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i + // QuickTime/RealMedia/RadioApp/RadioClientApplication/ + // SoundTap/Totem/Stagefright/Streamium + ], [NAME, VERSION], [ + + /(smp)((\d+)[\d\.]+)/i // SMP + ], [NAME, VERSION], [ + + /(vlc) media player - version ((\d+)[\w\.]+)/i, // VLC Videolan + /(vlc)\/((\d+)[\w\.-]+)/i, + /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp + /(foobar2000)\/((\d+)[\d\.]+)/i, // Foobar2000 + /(itunes)\/((\d+)[\d\.]+)/i // iTunes + ], [NAME, VERSION], [ + + /(wmplayer)\/((\d+)[\w\.-]+)/i, // Windows Media Player + /(windows-media-player)\/((\d+)[\w\.-]+)/i + ], [[NAME, /-/g, ' '], VERSION], [ + + /windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i + // Windows Media Server + ], [VERSION, [NAME, 'Windows']], [ + + /(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i // RiseUP Radio Alarm + ], [NAME, VERSION], [ + + /(rad.io)\s((\d+)[\d\.]+)/i, // Rad.io + /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i + ], [[NAME, 'rad.io'], VERSION] + + ////////////////////// + // Media players END + ////////////////////*/ + + ], + + cpu : [[ + + /(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i // AMD64 + ], [[ARCHITECTURE, 'amd64']], [ + + /(ia32(?=;))/i // IA32 (quicktime) + ], [[ARCHITECTURE, util.lowerize]], [ + + /((?:i[346]|x)86)[;\)]/i // IA32 + ], [[ARCHITECTURE, 'ia32']], [ + + // PocketPC mistakenly identified as PowerPC + /windows\s(ce|mobile);\sppc;/i + ], [[ARCHITECTURE, 'arm']], [ + + /((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i // PowerPC + ], [[ARCHITECTURE, /ower/, '', util.lowerize]], [ + + /(sun4\w)[;\)]/i // SPARC + ], [[ARCHITECTURE, 'sparc']], [ + + /((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i + // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC + ], [[ARCHITECTURE, util.lowerize]] + ], + + device : [[ + + /\((ipad|playbook);[\w\s\);-]+(rim|apple)/i // iPad/PlayBook + ], [MODEL, VENDOR, [TYPE, TABLET]], [ + + /applecoremedia\/[\w\.]+ \((ipad)/ // iPad + ], [MODEL, [VENDOR, 'Apple'], [TYPE, TABLET]], [ + + /(apple\s{0,1}tv)/i // Apple TV + ], [[MODEL, 'Apple TV'], [VENDOR, 'Apple']], [ + + /(archos)\s(gamepad2?)/i, // Archos + /(hp).+(touchpad)/i, // HP TouchPad + /(hp).+(tablet)/i, // HP Tablet + /(kindle)\/([\w\.]+)/i, // Kindle + /\s(nook)[\w\s]+build\/(\w+)/i, // Nook + /(dell)\s(strea[kpr\s\d]*[\dko])/i // Dell Streak + ], [VENDOR, MODEL, [TYPE, TABLET]], [ + + /(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i // Kindle Fire HD + ], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [ + /(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i // Fire Phone + ], [[MODEL, mapper.str, maps.device.amazon.model], [VENDOR, 'Amazon'], [TYPE, MOBILE]], [ + + /\((ip[honed|\s\w*]+);.+(apple)/i // iPod/iPhone + ], [MODEL, VENDOR, [TYPE, MOBILE]], [ + /\((ip[honed|\s\w*]+);/i // iPod/iPhone + ], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [ + + /(blackberry)[\s-]?(\w+)/i, // BlackBerry + /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i, + // BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron + /(hp)\s([\w\s]+\w)/i, // HP iPAQ + /(asus)-?(\w+)/i // Asus + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + /\(bb10;\s(\w+)/i // BlackBerry 10 + ], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [ + // Asus Tablets + /android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i + ], [MODEL, [VENDOR, 'Asus'], [TYPE, TABLET]], [ + + /(sony)\s(tablet\s[ps])\sbuild\//i, // Sony + /(sony)?(?:sgp.+)\sbuild\//i + ], [[VENDOR, 'Sony'], [MODEL, 'Xperia Tablet'], [TYPE, TABLET]], [ + /android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i + ], [MODEL, [VENDOR, 'Sony'], [TYPE, MOBILE]], [ + + /\s(ouya)\s/i, // Ouya + /(nintendo)\s([wids3u]+)/i // Nintendo + ], [VENDOR, MODEL, [TYPE, CONSOLE]], [ + + /android.+;\s(shield)\sbuild/i // Nvidia + ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [ + + /(playstation\s[34portablevi]+)/i // Playstation + ], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [ + + /(sprint\s(\w+))/i // Sprint Phones + ], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [ + + /(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i // Lenovo tablets + ], [VENDOR, MODEL, [TYPE, TABLET]], [ + + /(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC + /(zte)-(\w+)*/i, // ZTE + /(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i + // Alcatel/GeeksPhone/Lenovo/Nexian/Panasonic/Sony + ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [ + + /(nexus\s9)/i // HTC Nexus 9 + ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [ + + /d\/huawei([\w\s-]+)[;\)]/i, + /(nexus\s6p)/i // Huawei + ], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [ + + /(microsoft);\s(lumia[\s\w]+)/i // Microsoft Lumia + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + + /[\s\(;](xbox(?:\sone)?)[\s\);]/i // Microsoft Xbox + ], [MODEL, [VENDOR, 'Microsoft'], [TYPE, CONSOLE]], [ + /(kin\.[onetw]{3})/i // Microsoft Kin + ], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [ + + // Motorola + /\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i, + /mot[\s-]?(\w+)*/i, + /(XT\d{3,4}) build\//i, + /(nexus\s6)/i + ], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [ + /android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i + ], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [ + + /hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i // HbbTV devices + ], [[VENDOR, util.trim], [MODEL, util.trim], [TYPE, SMARTTV]], [ + + /hbbtv.+maple;(\d+)/i + ], [[MODEL, /^/, 'SmartTV'], [VENDOR, 'Samsung'], [TYPE, SMARTTV]], [ + + /\(dtv[\);].+(aquos)/i // Sharp + ], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [ + + /android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i, + /((SM-T\w+))/i + ], [[VENDOR, 'Samsung'], MODEL, [TYPE, TABLET]], [ // Samsung + /smart-tv.+(samsung)/i + ], [VENDOR, [TYPE, SMARTTV], MODEL], [ + /((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i, + /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, + /sec-((sgh\w+))/i + ], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [ + + /sie-(\w+)*/i // Siemens + ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [ + + /(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia + /(nokia)[\s_-]?([\w-]+)*/i + ], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [ + + /android\s3\.[\s\w;-]{10}(a\d{3})/i // Acer + ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [ + + /android.+([vl]k\-?\d{3})\s+build/i // LG Tablet + ], [MODEL, [VENDOR, 'LG'], [TYPE, TABLET]], [ + /android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet + ], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [ + /(lg) netcast\.tv/i // LG SmartTV + ], [VENDOR, MODEL, [TYPE, SMARTTV]], [ + /(nexus\s[45])/i, // LG + /lg[e;\s\/-]+(\w+)*/i, + /android.+lg(\-?[\d\w]+)\s+build/i + ], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [ + + /android.+(ideatab[a-z0-9\-\s]+)/i // Lenovo + ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [ + + /linux;.+((jolla));/i // Jolla + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + + /((pebble))app\/[\d\.]+\s/i // Pebble + ], [VENDOR, MODEL, [TYPE, WEARABLE]], [ + + /android.+;\s(oppo)\s?([\w\s]+)\sbuild/i // OPPO + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + + /crkey/i // Google Chromecast + ], [[MODEL, 'Chromecast'], [VENDOR, 'Google']], [ + + /android.+;\s(glass)\s\d/i // Google Glass + ], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [ + + /android.+;\s(pixel c)\s/i // Google Pixel C + ], [MODEL, [VENDOR, 'Google'], [TYPE, TABLET]], [ + + /android.+;\s(pixel xl|pixel)\s/i // Google Pixel + ], [MODEL, [VENDOR, 'Google'], [TYPE, MOBILE]], [ + + /android.+(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models + /android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Hongmi + /android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Mi + /android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+)?)\s+build/i // Redmi Phones + ], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [ + /android.+(mi[\s\-_]*(?:pad)?(?:[\s_]*[\w\s]+)?)\s+build/i // Mi Pad tablets + ],[[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, TABLET]], [ + /android.+;\s(m[1-5]\snote)\sbuild/i // Meizu Tablet + ], [MODEL, [VENDOR, 'Meizu'], [TYPE, TABLET]], [ + + /android.+a000(1)\s+build/i // OnePlus + ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [ + + /android.+[;\/]\s*(RCT[\d\w]+)\s+build/i // RCA Tablets + ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [ + + /android.+[;\/]\s*(Venue[\d\s]*)\s+build/i // Dell Venue Tablets + ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [ + + /android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i // Verizon Tablet + ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [ + + /android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i // Barnes & Noble Tablet + ], [[VENDOR, 'Barnes & Noble'], MODEL, [TYPE, TABLET]], [ + + /android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i // Barnes & Noble Tablet + ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [ + + /android.+[;\/]\s*(zte)?.+(k\d{2})\s+build/i // ZTE K Series Tablet + ], [[VENDOR, 'ZTE'], MODEL, [TYPE, TABLET]], [ + + /android.+[;\/]\s*(gen\d{3})\s+build.*49h/i // Swiss GEN Mobile + ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [ + + /android.+[;\/]\s*(zur\d{3})\s+build/i // Swiss ZUR Tablet + ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [ + + /android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i // Zeki Tablets + ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [ + + /(android).+[;\/]\s+([YR]\d{2}x?.*)\s+build/i, + /android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(.+)\s+build/i // Dragon Touch Tablet + ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [ + + /android.+[;\/]\s*(NS-?.+)\s+build/i // Insignia Tablets + ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [ + + /android.+[;\/]\s*((NX|Next)-?.+)\s+build/i // NextBook Tablets + ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [ + + /android.+[;\/]\s*(Xtreme\_?)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i + ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [ // Voice Xtreme Phones + + /android.+[;\/]\s*(LVTEL\-?)?(V1[12])\s+build/i // LvTel Phones + ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [ + + /android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i // Envizen Tablets + ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [ + + /android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(.*\b)\s+build/i // Le Pan Tablets + ], [VENDOR, MODEL, [TYPE, TABLET]], [ + + /android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i // MachSpeed Tablets + ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [ + + /android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i // Trinity Tablets + ], [VENDOR, MODEL, [TYPE, TABLET]], [ + + /android.+[;\/]\s*TU_(1491)\s+build/i // Rotor Tablets + ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [ + + /android.+(KS(.+))\s+build/i // Amazon Kindle Tablets + ], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [ + + /android.+(Gigaset)[\s\-]+(Q.+)\s+build/i // Gigaset Tablets + ], [VENDOR, MODEL, [TYPE, TABLET]], [ + + /\s(tablet|tab)[;\/]/i, // Unidentifiable Tablet + /\s(mobile)(?:[;\/]|\ssafari)/i // Unidentifiable Mobile + ], [[TYPE, util.lowerize], VENDOR, MODEL], [ + + /(android.+)[;\/].+build/i // Generic Android Device + ], [MODEL, [VENDOR, 'Generic']] + + + /*////////////////////////// + // TODO: move to string map + //////////////////////////// + + /(C6603)/i // Sony Xperia Z C6603 + ], [[MODEL, 'Xperia Z C6603'], [VENDOR, 'Sony'], [TYPE, MOBILE]], [ + /(C6903)/i // Sony Xperia Z 1 + ], [[MODEL, 'Xperia Z 1'], [VENDOR, 'Sony'], [TYPE, MOBILE]], [ + + /(SM-G900[F|H])/i // Samsung Galaxy S5 + ], [[MODEL, 'Galaxy S5'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ + /(SM-G7102)/i // Samsung Galaxy Grand 2 + ], [[MODEL, 'Galaxy Grand 2'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ + /(SM-G530H)/i // Samsung Galaxy Grand Prime + ], [[MODEL, 'Galaxy Grand Prime'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ + /(SM-G313HZ)/i // Samsung Galaxy V + ], [[MODEL, 'Galaxy V'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ + /(SM-T805)/i // Samsung Galaxy Tab S 10.5 + ], [[MODEL, 'Galaxy Tab S 10.5'], [VENDOR, 'Samsung'], [TYPE, TABLET]], [ + /(SM-G800F)/i // Samsung Galaxy S5 Mini + ], [[MODEL, 'Galaxy S5 Mini'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ + /(SM-T311)/i // Samsung Galaxy Tab 3 8.0 + ], [[MODEL, 'Galaxy Tab 3 8.0'], [VENDOR, 'Samsung'], [TYPE, TABLET]], [ + + /(T3C)/i // Advan Vandroid T3C + ], [MODEL, [VENDOR, 'Advan'], [TYPE, TABLET]], [ + /(ADVAN T1J\+)/i // Advan Vandroid T1J+ + ], [[MODEL, 'Vandroid T1J+'], [VENDOR, 'Advan'], [TYPE, TABLET]], [ + /(ADVAN S4A)/i // Advan Vandroid S4A + ], [[MODEL, 'Vandroid S4A'], [VENDOR, 'Advan'], [TYPE, MOBILE]], [ + + /(V972M)/i // ZTE V972M + ], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [ + + /(i-mobile)\s(IQ\s[\d\.]+)/i // i-mobile IQ + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + /(IQ6.3)/i // i-mobile IQ IQ 6.3 + ], [[MODEL, 'IQ 6.3'], [VENDOR, 'i-mobile'], [TYPE, MOBILE]], [ + /(i-mobile)\s(i-style\s[\d\.]+)/i // i-mobile i-STYLE + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + /(i-STYLE2.1)/i // i-mobile i-STYLE 2.1 + ], [[MODEL, 'i-STYLE 2.1'], [VENDOR, 'i-mobile'], [TYPE, MOBILE]], [ + + /(mobiistar touch LAI 512)/i // mobiistar touch LAI 512 + ], [[MODEL, 'Touch LAI 512'], [VENDOR, 'mobiistar'], [TYPE, MOBILE]], [ + + ///////////// + // END TODO + ///////////*/ + + ], + + engine : [[ + + /windows.+\sedge\/([\w\.]+)/i // EdgeHTML + ], [VERSION, [NAME, 'EdgeHTML']], [ + + /(presto)\/([\w\.]+)/i, // Presto + /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m + /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links + /(icab)[\/\s]([23]\.[\d\.]+)/i // iCab + ], [NAME, VERSION], [ + + /rv\:([\w\.]+).*(gecko)/i // Gecko + ], [VERSION, NAME] + ], + + os : [[ + + // Windows based + /microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes) + ], [NAME, VERSION], [ + /(windows)\snt\s6\.2;\s(arm)/i, // Windows RT + /(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s]+\w)*/i, // Windows Phone + /(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i + ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [ + /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i + ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [ + + // Mobile/Embedded OS + /\((bb)(10);/i // BlackBerry 10 + ], [[NAME, 'BlackBerry'], VERSION], [ + /(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry + /(tizen)[\/\s]([\w\.]+)/i, // Tizen + /(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i, + // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki + /linux;.+(sailfish);/i // Sailfish OS + ], [NAME, VERSION], [ + /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian + ], [[NAME, 'Symbian'], VERSION], [ + /\((series40);/i // Series 40 + ], [NAME], [ + /mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS + ], [[NAME, 'Firefox OS'], VERSION], [ + + // Console + /(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation + + // GNU/Linux based + /(mint)[\/\s\(]?(\w+)*/i, // Mint + /(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux + /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]+)*/i, + // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware + // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus + /(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux + /(gnu)\s?([\w\.]+)*/i // GNU + ], [NAME, VERSION], [ + + /(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS + ], [[NAME, 'Chromium OS'], VERSION],[ + + // Solaris + /(sunos)\s?([\w\.]+\d)*/i // Solaris + ], [[NAME, 'Solaris'], VERSION], [ + + // BSD based + /\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly + ], [NAME, VERSION],[ + + /(haiku)\s(\w+)/i // Haiku + ], [NAME, VERSION],[ + + /cfnetwork\/.+darwin/i, + /ip[honead]+(?:.*os\s([\w]+)\slike\smac|;\sopera)/i // iOS + ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [ + + /(mac\sos\sx)\s?([\w\s\.]+\w)*/i, + /(macintosh|mac(?=_powerpc)\s)/i // Mac OS + ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [ + + // Other + /((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, // Solaris + /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX + /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i, + // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS + /(unix)\s?([\w\.]+)*/i // UNIX + ], [NAME, VERSION] + ] + }; + + + ///////////////// + // Constructor + //////////////// + /* + var Browser = function (name, version) { + this[NAME] = name; + this[VERSION] = version; + }; + var CPU = function (arch) { + this[ARCHITECTURE] = arch; + }; + var Device = function (vendor, model, type) { + this[VENDOR] = vendor; + this[MODEL] = model; + this[TYPE] = type; + }; + var Engine = Browser; + var OS = Browser; + */ + var UAParser = function (uastring, extensions) { + + if (typeof uastring === 'object') { + extensions = uastring; + uastring = undefined; + } + + if (!(this instanceof UAParser)) { + return new UAParser(uastring, extensions).getResult(); + } + + var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); + var rgxmap = extensions ? util.extend(regexes, extensions) : regexes; + //var browser = new Browser(); + //var cpu = new CPU(); + //var device = new Device(); + //var engine = new Engine(); + //var os = new OS(); + + this.getBrowser = function () { + var browser = { name: undefined, version: undefined }; + mapper.rgx.call(browser, ua, rgxmap.browser); + browser.major = util.major(browser.version); // deprecated + return browser; + }; + this.getCPU = function () { + var cpu = { architecture: undefined }; + mapper.rgx.call(cpu, ua, rgxmap.cpu); + return cpu; + }; + this.getDevice = function () { + var device = { vendor: undefined, model: undefined, type: undefined }; + mapper.rgx.call(device, ua, rgxmap.device); + return device; + }; + this.getEngine = function () { + var engine = { name: undefined, version: undefined }; + mapper.rgx.call(engine, ua, rgxmap.engine); + return engine; + }; + this.getOS = function () { + var os = { name: undefined, version: undefined }; + mapper.rgx.call(os, ua, rgxmap.os); + return os; + }; + this.getResult = function () { + return { + ua : this.getUA(), + browser : this.getBrowser(), + engine : this.getEngine(), + os : this.getOS(), + device : this.getDevice(), + cpu : this.getCPU() + }; + }; + this.getUA = function () { + return ua; + }; + this.setUA = function (uastring) { + ua = uastring; + //browser = new Browser(); + //cpu = new CPU(); + //device = new Device(); + //engine = new Engine(); + //os = new OS(); + return this; + }; + return this; + }; + + UAParser.VERSION = LIBVERSION; + UAParser.BROWSER = { + NAME : NAME, + MAJOR : MAJOR, // deprecated + VERSION : VERSION + }; + UAParser.CPU = { + ARCHITECTURE : ARCHITECTURE + }; + UAParser.DEVICE = { + MODEL : MODEL, + VENDOR : VENDOR, + TYPE : TYPE, + CONSOLE : CONSOLE, + MOBILE : MOBILE, + SMARTTV : SMARTTV, + TABLET : TABLET, + WEARABLE: WEARABLE, + EMBEDDED: EMBEDDED + }; + UAParser.ENGINE = { + NAME : NAME, + VERSION : VERSION + }; + UAParser.OS = { + NAME : NAME, + VERSION : VERSION + }; + //UAParser.Utils = util; + + /////////// + // Export + ////////// + + + // check js environment + if (typeof(exports) !== UNDEF_TYPE) { + // nodejs env + if (typeof module !== UNDEF_TYPE && module.exports) { + exports = module.exports = UAParser; + } + // TODO: test!!!!!!!! + /* + if (require && require.main === module && process) { + // cli + var jsonize = function (arr) { + var res = []; + for (var i in arr) { + res.push(new UAParser(arr[i]).getResult()); + } + process.stdout.write(JSON.stringify(res, null, 2) + '\n'); + }; + if (process.stdin.isTTY) { + // via args + jsonize(process.argv.slice(2)); + } else { + // via pipe + var str = ''; + process.stdin.on('readable', function() { + var read = process.stdin.read(); + if (read !== null) { + str += read; + } + }); + process.stdin.on('end', function () { + jsonize(str.replace(/\n$/, '').split('\n')); + }); + } + } + */ + exports.UAParser = UAParser; + } else { + // requirejs env (optional) + if (typeof(define) === FUNC_TYPE && define.amd) { + define(function () { + return UAParser; + }); + } else if (window) { + // browser env + window.UAParser = UAParser; + } + } + + // jQuery/Zepto specific (optional) + // Note: + // In AMD env the global scope should be kept clean, but jQuery is an exception. + // jQuery always exports to global scope, unless jQuery.noConflict(true) is used, + // and we should catch that. + var $ = window && (window.jQuery || window.Zepto); + if (typeof $ !== UNDEF_TYPE) { + var parser = new UAParser(); + $.ua = parser.getResult(); + $.ua.get = function () { + return parser.getUA(); + }; + $.ua.set = function (uastring) { + parser.setUA(uastring); + var result = parser.getResult(); + for (var prop in result) { + $.ua[prop] = result[prop]; + } + }; + } + +})(typeof window === 'object' ? window : this); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/browser-test.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/browser-test.json new file mode 100644 index 00000000..3efba3ff --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/browser-test.json @@ -0,0 +1,982 @@ +[ + { + "desc" : "Android Browser on Galaxy Nexus", + "ua" : "Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect" : + { + "name" : "Android Browser", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "Android Browser on Galaxy S3", + "ua" : "Mozilla/5.0 (Linux; Android 4.4.4; en-us; SAMSUNG GT-I9300I Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36", + "expect" : + { + "name" : "Android Browser", + "version" : "1.5", + "major" : "1" + } + }, + { + "desc" : "Android Browser on HTC Flyer (P510E)", + "ua" : "Mozilla/5.0 (Linux; U; Android 3.2.1; ru-ru; HTC Flyer P510e Build/HTK75C) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13", + "expect" : + { + "name" : "Android Browser", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "Android Browser on Huawei Honor Glory II (U9508)", + "ua" : "Mozilla/5.0 (Linux; U; Android 4.0.4; ru-by; HUAWEI U9508 Build/HuaweiU9508) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 ACHEETAHI/2100050044", + "expect" : + { + "name" : "Android Browser", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "Android Browser on Huawei P8 (H891L)", + "ua" : "Mozilla/5.0 (Linux; Android 4.4.4; HUAWEI H891L Build/HuaweiH891L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36", + "expect" : + { + "name" : "Android Browser", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "Android Browser on Samsung S6 (SM-G925F)", + "ua" : "Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-G925F Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.0 Chrome/38.0.2125.102 Mobile Safari/537.36", + "expect" : + { + "name" : "Samsung Browser", + "version" : "3.0", + "major" : "3" + } + }, + { + "desc" : "Arora", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; de-CH) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.2", + "expect" : + { + "name" : "Arora", + "version" : "0.2", + "major" : "0" + } + }, + { + "desc" : "Avant", + "ua" : "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB5; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", + "expect" : + { + "name" : "Avant ", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Baidu", + "ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; baidubrowser 1.x)", + "expect" : + { + "name" : "baidu", + "version" : "1.x", + "major" : "1" + } + }, + { + "desc" : "Bolt", + "ua" : "Mozilla/5.0 (X11; 78; CentOS; US-en) AppleWebKit/527+ (KHTML, like Gecko) Bolt/0.862 Version/3.0 Safari/523.15", + "expect" : + { + "name" : "Bolt", + "version" : "0.862", + "major" : "0" + } + }, + { + "desc" : "Bowser", + "ua" : "Mozilla/5.0 (iOS; like Mac OS X) AppleWebKit/536.36 (KHTML, like Gecko) not Chrome/27.0.1500.95 Mobile/10B141 Safari/537.36 Bowser/0.2.1", + "expect" : + { + "name" : "Bowser", + "version" : "0.2.1", + "major" : "0" + } + }, + { + "desc" : "Camino", + "ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en; rv:1.9.0.19) Gecko/2011091218 Camino/2.0.9 (like Firefox/3.0.19)", + "expect" : + { + "name" : "Camino", + "version" : "2.0.9", + "major" : "2" + } + }, + { + "desc" : "Chimera", + "ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-PL; rv:1.0.1) Gecko/20021111 Chimera/0.6", + "expect" : + { + "name" : "Chimera", + "version" : "0.6", + "major" : "0" + } + }, + { + "desc" : "Chrome", + "ua" : "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6", + "expect" : + { + "name" : "Chrome", + "version" : "20.0.1090.0", + "major" : "20" + } + }, + { + "desc" : "Chrome Headless", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36", + "expect" : + { + "name" : "Chrome Headless", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Chrome Headless", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/60.0.3112.113 Safari/537.36", + "expect" : + { + "name" : "Chrome Headless", + "version" : "60.0.3112.113", + "major" : "60" + } + }, + { + "desc" : "Chrome WebView", + "ua" : "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.65 Mobile Safari/537.36", + "expect" : + { + "name" : "Chrome WebView", + "version" : "43.0.2357.65", + "major" : "43" + } + }, + { + "desc" : "Chrome on iOS", + "ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3", + "expect" : + { + "name" : "Chrome", + "version" : "19.0.1084.60", + "major" : "19" + } + }, + { + "desc" : "Chromium", + "ua" : "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.7 (KHTML, like Gecko) Ubuntu/11.10 Chromium/16.0.912.21 Chrome/16.0.912.21 Safari/535.7", + "expect" : + { + "name" : "Chromium", + "version" : "16.0.912.21", + "major" : "16" + } + }, + { + "desc" : "Chrome on Android", + "ua" : "Mozilla/5.0 (Linux; U; Android-4.0.3; en-us; Galaxy Nexus Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7", + "expect" : + { + "name" : "Chrome", + "version" : "16.0.912.75", + "major" : "16" + } + }, + { + "desc" : "Dillo", + "ua" : "Dillo/2.2", + "expect" : + { + "name" : "Dillo", + "version" : "2.2", + "major" : "2" + } + }, + { + "desc" : "Dolphin", + "ua" : "Mozilla/5.0 (SCH-F859/F859DG12;U;NUCLEUS/2.1;Profile/MIDP-2.1 Configuration/CLDC-1.1;480*800;CTC/2.0) Dolfin/2.0", + "expect" : + { + "name" : "Dolphin", + "version" : "2.0", + "major" : "2" + } + }, + { + "desc" : "Doris", + "ua" : "Doris/1.15 [en] (Symbian)", + "expect" : + { + "name" : "Doris", + "version" : "1.15", + "major" : "1" + } + }, + { + "desc" : "Epiphany", + "ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6", + "expect" : + { + "name" : "Epiphany", + "version" : "1.2.6", + "major" : "1" + } + }, + { + "desc" : "Facebook in-App Browser for Android", + "ua" : "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/35.0.0.48.273;]", + "expect" : + { + "name" : "Facebook", + "version" : "35.0.0.48.273", + "major" : "35" + } + }, + { + "desc" : "Facebook in-App Browser for iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E304 [FBAN/FBIOS;FBAV/91.0.0.41.73;FBBV/57050710;FBDV/iPhone8,1;FBMD/iPhone;FBSN/iOS;FBSV/10.3.1;FBSS/2;FBCR/Telekom.de;FBID/phone;FBLC/de_DE;FBOP/5;FBRV/0])", + "expect" : + { + "name" : "Facebook", + "version" : "91.0.0.41.73", + "major" : "91" + } + }, + { + "desc" : "Firebird", + "ua" : "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031007 Firebird/0.7", + "expect" : + { + "name" : "Firebird", + "version" : "0.7", + "major" : "0" + } + }, + { + "desc" : "Firefox", + "ua" : "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120716 Firefox/15.0a2", + "expect" : + { + "name" : "Firefox", + "version" : "15.0a2", + "major" : "15" + } + }, + { + "desc" : "Fennec", + "ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1", + "expect" : + { + "name" : "Fennec", + "version" : "1.0a1", + "major" : "1" + } + }, + { + "desc" : "Flock", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008100716 Firefox/3.0.3 Flock/2.0", + "expect" : + { + "name" : "Flock", + "version" : "2.0", + "major" : "2" + } + }, + { + "desc" : "GoBrowser", + "ua" : "Nokia5700XpressMusic/GoBrowser/1.6.91", + "expect" : + { + "name" : "GoBrowser", + "version" : "1.6.91", + "major" : "1" + } + }, + { + "desc" : "IceApe", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.19) Gecko/20110817 Iceape/2.0.14", + "expect" : + { + "name" : "Iceape", + "version" : "2.0.14", + "major" : "2" + } + }, + { + "desc" : "IceCat", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092921 IceCat/3.0.3-g1", + "expect" : + { + "name" : "IceCat", + "version" : "3.0.3-g1", + "major" : "3" + } + }, + { + "desc" : "Iceweasel", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.16) Gecko/2009121610 Iceweasel/3.0.6 (Debian-3.0.6-3)", + "expect" : + { + "name" : "Iceweasel", + "version" : "3.0.6", + "major" : "3" + } + }, + { + "desc" : "iCab", + "ua" : "iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)", + "expect" : + { + "name" : "iCab", + "version" : "2.9.5", + "major" : "2" + } + }, + { + "desc" : "IEMobile", + "ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11) 320x240; VZW; Motorola-Q9c; Windows Mobile 6.1 Standard", + "expect" : + { + "name" : "IEMobile", + "version" : "7.11", + "major" : "7" + } + }, + { + "desc" : "IE 11 with IE token", + "ua" : "Mozilla/5.0 (IE 11.0; Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko", + "expect" : + { + "name" : "IE", + "version" : "11.0", + "major" : "11" + } + }, + { + "desc" : "IE 11 without IE token", + "ua" : "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko", + "expect" : + { + "name" : "IE", + "version" : "11.0", + "major" : "11" + } + }, + { + "desc" : "K-Meleon", + "ua" : "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031016 K-Meleon/0.8.2", + "expect" : + { + "name" : "K-Meleon", + "version" : "0.8.2", + "major" : "0" + } + }, + { + "desc" : "Kindle Browser", + "ua" : "Mozilla/4.0 (compatible; Linux 2.6.22) NetFront/3.4 Kindle/2.5 (screen 600x800; rotate)", + "expect" : + { + "name" : "Kindle", + "version" : "2.5", + "major" : "2" + } + }, + { + "desc" : "Konqueror", + "ua" : "Mozilla/5.0 (compatible; Konqueror/3.5; Linux; X11; x86_64) KHTML/3.5.6 (like Gecko) (Kubuntu)", + "expect" : + { + "name" : "Konqueror", + "version" : "3.5", + "major" : "3" + } + }, + { + "desc" : "Lunascape", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090804 Firefox/3.5.2 Lunascape/5.1.4.5", + "expect" : + { + "name" : "Lunascape", + "version" : "5.1.4.5", + "major" : "5" + } + }, + { + "desc" : "Lynx", + "ua" : "Lynx/2.8.5dev.16 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6b", + "expect" : + { + "name" : "Lynx", + "version" : "2.8.5dev.16", + "major" : "2" + } + }, + { + "desc" : "Maemo Browser", + "ua" : "Mozilla/5.0 (X11; U; Linux armv7l; ru-RU; rv:1.9.2.3pre) Gecko/20100723 Firefox/3.5 Maemo Browser 1.7.4.8 RX-51 N900", + "expect" : + { + "name" : "Maemo Browser", + "version" : "1.7.4.8", + "major" : "1" + } + }, + { + "desc" : "Maxthon", + "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)", + "expect" : + { + "name" : "Maxthon", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Midori", + "ua" : "Midori/0.2.2 (X11; Linux i686; U; en-us) WebKit/531.2+", + "expect" : + { + "name" : "Midori", + "version" : "0.2.2", + "major" : "0" + } + }, + { + "desc" : "Minimo", + "ua" : "Mozilla/5.0 (X11; U; Linux armv6l; rv 1.8.1.5pre) Gecko/20070619 Minimo/0.020", + "expect" : + { + "name" : "Minimo", + "version" : "0.020", + "major" : "0" + } + }, + { + "desc" : "MIUI Browser on Xiaomi Hongmi WCDMA (HM2013023)", + "ua" : "Mozilla/5.0 (Linux; U; Android 4.2.2; ru-ru; 2013023 Build/HM2013023) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 XiaoMi/MiuiBrowser/1.0", + "expect" : + { + "name" : "MIUI Browser", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "Mobile Safari", + "ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7", + "expect" : + { + "name" : "Mobile Safari", + "version" : "4.0.5", + "major" : "4" + } + }, + { + "desc" : "Mosaic", + "ua" : "NCSA_Mosaic/2.6 (X11; SunOS 4.1.3 sun4m)", + "expect" : + { + "name" : "Mosaic", + "version" : "2.6", + "major" : "2" + } + }, + { + "desc" : "Mozilla", + "ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20070606", + "expect" : + { + "name" : "Mozilla", + "version" : "5.0", + "major" : "5" + } + }, + { + "desc" : "MSIE", + "ua" : "Mozilla/4.0 (compatible; MSIE 5.0b1; Mac_PowerPC)", + "expect" : + { + "name" : "IE", + "version" : "5.0b1", + "major" : "5" + } + }, + { + "desc" : "NetFront", + "ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0", + "expect" : + { + "name" : "NetFront", + "version" : "3.0", + "major" : "3" + } + }, + { + "desc" : "Netscape on Windows ME", + "ua" : "Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.8.1.8pre) Gecko/20071015 Firefox/2.0.0.7 Navigator/9.0", + "expect" : + { + "name" : "Netscape", + "version" : "9.0", + "major" : "9" + } + }, + { + "desc" : "Netscape on Windows 2000", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20050519 Netscape/8.0.1", + "expect" : + { + "name" : "Netscape", + "version" : "8.0.1", + "major" : "8" + } + }, + { + "desc" : "Nokia Browser", + "ua" : "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaN8-00/025.007; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.37 Mobile Safari/533.4 3gpp-gba", + "expect" : + { + "name" : "NokiaBrowser", + "version" : "7.3.1.37", + "major" : "7" + } + }, + { + "desc" : "Oculus Browser", + "ua" : "Mozilla/5.0 (Linux; Android 7.0; SM-G920I Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/3.4.9 SamsungBrowser/4.0 Chrome/57.0.2987.146 Mobile VR Safari/537.36", + "expect" : + { + "name" : "Oculus Browser", + "version" : "3.4.9", + "major" : "3" + } + }, + { + "desc" : "OmniWeb", + "ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.48", + "expect" : + { + "name" : "OmniWeb", + "version" : "558.48", + "major" : "558" + } + }, + { + "desc" : "Opera > 9.80", + "ua" : "Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10", + "expect" : + { + "name" : "Opera", + "version" : "10.10", + "major" : "10" + } + }, + { + "desc" : "Opera < 9.80 on Windows", + "ua" : "Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 6.01 [en]", + "expect" : + { + "name" : "Opera", + "version" : "6.01", + "major" : "6" + } + }, + { + "desc" : "Opera < 9.80 on OSX", + "ua" : "Opera/8.5 (Macintosh; PPC Mac OS X; U; en)", + "expect" : + { + "name" : "Opera", + "version" : "8.5", + "major" : "8" + } + }, + { + "desc" : "Opera Mobile", + "ua" : "Opera/9.80 (Android 2.3.5; Linux; Opera Mobi/ADR-1111101157; U; de) Presto/2.9.201 Version/11.50", + "expect" : + { + "name" : "Opera Mobi", + "version" : "11.50", + "major" : "11" + } + }, + { + "desc" : "Opera Webkit", + "ua" : "Mozilla/5.0 AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315", + "expect" : + { + "name" : "Opera", + "version" : "14.0.1025.52315", + "major" : "14" + } + }, + { + "desc" : "Opera Mini", + "ua" : "Opera/9.80 (J2ME/MIDP; Opera Mini/5.1.21214/19.916; U; en) Presto/2.5.25", + "expect" : + { + "name" : "Opera Mini", + "version" : "5.1.21214", + "major" : "5" + } + }, + { + "desc" : "Opera Mini 8 above on iPhone", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) OPiOS/12.1.1.98980 Mobile/13C75 Safari/9537.53", + "expect" : + { + "name" : "Opera Mini", + "version" : "12.1.1.98980", + "major" : "12" + } + }, + { + "desc" : "Opera Tablet", + "ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1", + "expect" : + { + "name" : "Opera Tablet", + "version" : "11.1", + "major" : "11" + } + }, + { + "desc" : "Opera Coast", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X; en) AppleWebKit/601.1.46 (KHTML, like Gecko) Coast/5.04.110603 Mobile/13F69 Safari/7534.48.3", + "expect" : + { + "name" : "Opera Coast", + "version" : "5.04.110603", + "major" : "5" + } + }, + { + "desc" : "PhantomJS", + "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34", + "expect" : + { + "name" : "PhantomJS", + "version" : "1.9.2", + "major" : "1" + } + }, + { + "desc" : "Phoenix", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021029 Phoenix/0.4", + "expect" : + { + "name" : "Phoenix", + "version" : "0.4", + "major" : "0" + } + }, + { + "desc" : "Polaris", + "ua" : "LG-LX600 Polaris/6.0 MMP/2.0 Profile/MIDP-2.1 Configuration/CLDC-1.1", + "expect" : + { + "name" : "Polaris", + "version" : "6.0", + "major" : "6" + } + }, + { + "desc" : "QQ", + "ua" : "Mozilla/5.0 (Linux; U; Android 4.4.4; zh-cn; OPPO R7s Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.1 Mobile Safari/537.36", + "expect" : + { + "name" : "QQBrowser", + "version" : "7.1", + "major" : "7" + } + }, + { + "desc" : "RockMelt", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) RockMelt/0.8.36.78 Chrome/7.0.517.44 Safari/534.7", + "expect" : + { + "name" : "RockMelt", + "version" : "0.8.36.78", + "major" : "0" + } + }, + { + "desc" : "Safari", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8", + "expect" : + { + "name" : "Safari", + "version" : "5.0.1", + "major" : "5" + } + }, + { + "desc" : "Safari < 3.0", + "ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; sv-se) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3", + "expect" : + { + "name" : "Safari", + "version" : "2.0.4", + "major" : "2" + } + }, + { + "desc" : "Samsung Browser", + "ua" : "Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG-SM-G925A Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/44.0.2403.133 Mobile Safari/537.36", + "expect" : + { + "name" : "Samsung Browser", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "SeaMonkey", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre", + "expect" : + { + "name" : "SeaMonkey", + "version" : "2.0b1pre", + "major" : "2" + } + }, + { + "desc" : "Silk Browser", + "ua" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84)", + "expect" : + { + "name" : "Silk", + "version" : "1.1.0-84", + "major" : "1" + } + }, + { + "desc" : "Skyfire", + "ua" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17 Skyfire/2.0", + "expect" : + { + "name" : "Skyfire", + "version" : "2.0", + "major" : "2" + } + }, + { + "desc" : "SlimBrowser", + "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SlimBrowser)", + "expect" : + { + "name" : "Slim", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Swiftfox", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061024 Firefox/2.0 (Swiftfox)", + "expect" : + { + "name" : "Swiftfox", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Tizen Browser", + "ua" : "Mozilla/5.0 (Linux; U; Tizen/1.0 like Android; en-us; AppleWebKit/534.46 (KHTML, like Gecko) Tizen Browser/1.0 Mobile", + "expect" : + { + "name" : "Tizen Browser", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "UC Browser", + "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 UBrowser/5.6.12860.7 Safari/537.36", + "expect" : + { + "name" : "UCBrowser", + "version" : "5.6.12860.7", + "major" : "5" + } + }, + { + "desc" : "UC Browser", + "ua" : "Mozilla/5.0 (Linux; U; Android 6.0.1; en-US; Lenovo P2a42 Build/MMB29M) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/11.2.0.915 U3/0.8.0 Mobile Safari/534.30", + "expect" : + { + "name" : "UCBrowser", + "version" : "11.2.0.915", + "major" : "11" + } + }, + { + "desc" : "UC Browser on Samsung", + "ua" : "Mozilla/5.0 (Java; U; Pt-br; samsung-gt-s5620) UCBrowser8.2.1.144/69/352/UCWEB Mobile UNTRUSTED/1.0", + "expect" : + { + "name" : "UCBrowser", + "version" : "8.2.1.144", + "major" : "8" + } + }, + { + "desc" : "UC Browser on Nokia", + "ua" : "Mozilla/5.0 (S60V3; U; en-in; NokiaN73)/UC Browser8.4.0.159/28/351/UCWEB Mobile", + "expect" : + { + "name" : "UCBrowser", + "version" : "8.4.0.159", + "major" : "8" + } + }, + { + "desc" : "UC Browser J2ME", + "ua" : "UCWEB/2.0 (MIDP-2.0; U; zh-CN; HTC EVO 3D X515m) U2/1.0.0 UCBrowser/10.4.0.558 U2/1.0.0 Mobile", + "expect" : + { + "name" : "UCBrowser", + "version" : "10.4.0.558", + "major" : "10" + } + }, + { + "desc" : "UC Browser J2ME 2", + "ua" : "JUC (Linux; U; 2.3.5; zh-cn; GT-I9100; 480*800) UCWEB7.9.0.94/139/800", + "expect" : + { + "name" : "UCBrowser", + "version" : "7.9.0.94", + "major" : "7" + } + }, + { + "desc": "WeChat on iOS", + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H321 MicroMessenger/6.3.6 NetType/WIFI Language/zh_CN", + "expect": + { + "name": "WeChat", + "version": "6.3.6", + "major": "6" + } + }, + { + "desc": "WeChat on Android", + "ua": "Mozilla/5.0 (Linux; U; Android 5.1; zh-cn; Lenovo K50-t5 Build/LMY47D) AppleWebKit/533.1 (KHTML, like Gecko)Version/4.0 MQQBrowser/5.4 TBS/025478 Mobile Safari/533.1 MicroMessenger/6.3.5.50_r1573191.640 NetType/WIFI Language/zh_CN", + "expect": + { + "name": "WeChat", + "version": "6.3.5.50_r1573191.640", + "major": "6" + } + }, + { + "desc" : "Vivaldi", + "ua" : "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Vivaldi/1.0.83.38 Safari/537.36", + "expect" : + { + "name" : "Vivaldi", + "version" : "1.0.83.38", + "major" : "1" + } + }, + { + "desc" : "Yandex", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.5 (KHTML, like Gecko) YaBrowser/1.0.1084.5402 Chrome/19.0.1084.5402 Safari/536.5", + "expect" : + { + "name" : "Yandex", + "version" : "1.0.1084.5402", + "major" : "1" + } + }, + { + "desc" : "Puffin", + "ua" : "Mozilla/5.0 (Linux; Android 6.0.1; Lenovo P2a42 Build/MMB29M; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Puffin/6.0.8.15804AP", + "expect" : + { + "name" : "Puffin", + "version" : "6.0.8.15804AP", + "major" : "6" + } + }, + { + "desc" : "Microsoft Edge", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0", + "expect" : + { + "name" : "Edge", + "version" : "12.0", + "major" : "12" + } + }, + { + "desc" : "Iridium", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Iridium/43.8 Safari/537.36 Chrome/43.0.2357.132", + "expect" : + { + "name" : "Iridium", + "version" : "43.8", + "major" : "43" + } + }, + { + "desc" : "Firefox iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) FxiOS/1.1 Mobile/13B143 Safari/601.1.46", + "expect" : + { + "name" : "Firefox", + "version" : "1.1", + "major" : "1" + } + }, + { + "desc" : "QQ on iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456 QQ/6.5.3.410 V1_IPH_SQ_6.5.3_1_APP_A Pixel/1080 Core/UIWebView NetType/WIFI Mem/26", + "expect" : + { + "name" : "QQ", + "version" : "6.5.3.410", + "major" : "6" + } + }, + { + "desc" : "QQ on Android", + "ua" : "Mozilla/5.0 (Linux; Android 6.0; PRO 6 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/37.0.0.0 Mobile MQQBrowser/6.8 TBS/036824 Safari/537.36 V1_AND_SQ_6.5.8_422_YYB_D PA QQ/6.5.8.2910 NetType/WIFI WebP/0.3.0 Pixel/1080", + "expect" : + { + "name" : "QQ", + "version" : "6.5.8.2910", + "major" : "6" + } + }, + { + "desc" : "GSA on iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) GSA/30.1.161623614 Mobile/14F89 Safari/602.1", + "expect" : + { + "name" : "GSA", + "version" : "30.1.161623614", + "major" : "30" + } + } +] diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/cpu-test.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/cpu-test.json new file mode 100644 index 00000000..8e9befcc --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/cpu-test.json @@ -0,0 +1,106 @@ +[ + { + "desc" : "i686", + "ua" : "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0", + "expect" : + { + "architecture" : "ia32" + } + }, + { + "desc" : "i386", + "ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6", + "expect" : + { + "architecture" : "ia32" + } + }, + { + "desc" : "x86-64", + "ua" : "Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10", + "expect" : + { + "architecture" : "amd64" + } + }, + { + "desc" : "win64", + "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)", + "expect" : + { + "architecture" : "amd64" + } + }, + { + "desc" : "WOW64", + "ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)", + "expect" : + { + "architecture" : "amd64" + } + }, + { + "desc" : "ARMv6", + "ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1", + "expect" : + { + "architecture" : "arm" + } + }, + { + "desc" : "Pocket PC", + "ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1", + "expect" : + { + "architecture" : "arm" + } + }, + { + "desc" : "Mac PowerPC", + "ua" : "Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)", + "expect" : + { + "architecture" : "ppc" + } + }, + { + "desc" : "Mac PowerPC", + "ua" : "Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC Mac OS; en)", + "expect" : + { + "architecture" : "ppc" + } + }, + { + "desc" : "Mac PowerPC", + "ua" : "iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)", + "expect" : + { + "architecture" : "ppc" + } + }, + { + "desc" : "UltraSPARC", + "ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5", + "expect" : + { + "architecture" : "sparc" + } + }, + { + "desc" : "QuickTime", + "ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)", + "expect" : + { + "architecture" : "ia32" + } + }, + { + "desc" : "XBMC", + "ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)", + "expect" : + { + "architecture" : "amd64" + } + } +] diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/device-test.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/device-test.json new file mode 100644 index 00000000..c1a3075a --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/device-test.json @@ -0,0 +1,819 @@ +[{ + "desc": "Asus Nexus 7", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 7 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Safari/537.36", + "expect": { + "vendor": "Asus", + "model": "Nexus 7", + "type": "tablet" + } + }, + { + "desc": "Asus Padfone", + "ua": "Mozilla/5.0 (Linux; Android 4.1.1; PadFone 2 Build/JRO03L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.117 Safari/537.36", + "expect": { + "vendor": "Asus", + "model": "PadFone", + "type": "tablet" + } + }, + { + "desc": "Desktop (IE11 with Tablet string)", + "ua": "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; Tablet PC 2.0; GWX:MANAGED; rv:11.0) like Gecko", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "undefined" + } + }, + { + "desc": "HTC Evo Shift 4G", + "ua": "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0", + "expect": { + "vendor": "HTC", + "model": "Evo Shift 4G", + "type": "mobile" + } + }, + { + "desc": "HTC Nexus 9", + "ua": "Mozilla/5.0 (Linux; Android 5.0; Nexus 9 Build/LRX21R) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Mobile Crosswalk/7.36.154.13 Safari/537.36", + "expect": { + "vendor": "HTC", + "model": "Nexus 9", + "type": "tablet" + } + }, + { + "desc": "Huawei Honor", + "ua": "Mozilla/5.0 (Linux; U; Android 2.3; xx-xx; U8860 Build/HuaweiU8860) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", + "expect": { + "vendor": "Huawei", + "model": "U8860", + "type": "mobile" + } + }, + { + "desc": "Huawei Nexus 6P", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MTC19V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Mobile Safari/537", + "expect": { + "vendor": "Huawei", + "model": "Nexus 6P", + "type": "mobile" + } + }, + { + "desc": "Huawei P10", + "ua": "Mozilla/5.0 (Linux; Android 7.0; VTR-L09 Build/HUAWEIVTR-L09; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/56.0.2924.87 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "VTR-L09", + "type": "mobile" + } + }, + { + "desc": "Huawei Y3II", + "ua": "Mozilla/5.0 (Linux; U; Android 5.1; xx-xx; HUAWEI LUA-L03 Build/HUAWEILUA-L03) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "LUA-L03", + "type": "mobile" + } + }, + { + "desc": "iPod", + "ua": "Mozilla/5.0 (iPod touch; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53", + "expect": { + "vendor": "Apple", + "model": "iPod touch", + "type": "mobile" + } + }, + { + "desc": "LG Nexus 4", + "ua": "Mozilla/5.0 (Linux; Android 4.2.1; Nexus 4 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19", + "expect": { + "vendor": "LG", + "model": "Nexus 4", + "type": "mobile" + } + }, + { + "desc": "LG Nexus 5", + "ua": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19", + "expect": { + "vendor": "LG", + "model": "Nexus 5", + "type": "mobile" + } + }, + { + "desc": "Meizu M5 Note", + "ua": "Mozilla/5.0 (Linux; Android 6.0; M5 Note Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043024 Safari/537.36 MicroMessenger/6.5.7.1040 NetType/WIFI Language/zh_CN", + "expect": { + "vendor": "Meizu", + "model": "M5 Note", + "type": "tablet" + } + }, + { + "desc": "Microsoft Lumia 950", + "ua": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/13.10586", + "expect": { + "vendor": "Microsoft", + "model": "Lumia 950", + "type": "mobile" + } + }, + { + "desc": "Motorola Moto X", + "ua": "Mozilla/5.0 (Linux; Android 4.4.4; XT1097 Build/KXE21.187-38) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.109 Mobile Safari/537.36", + "expect": { + "vendor": "Motorola", + "model": "XT1097", + "type": "mobile" + } + }, + { + "desc": "Motorola Nexus 6", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.20 Mobile Safari/537.36", + "expect": { + "vendor": "Motorola", + "model": "Nexus 6", + "type": "mobile" + } + }, + { + "desc": "Motorola Droid RAZR 4G", + "ua": "Mozilla/5.0 (Linux; U; Android 2.3; xx-xx; DROID RAZR 4G Build/6.5.1-73_DHD-11_M1-29) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", + "expect": { + "vendor": "Motorola", + "model": "DROID RAZR 4G", + "type": "mobile" + } + }, + { + "desc": "iPhone", + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53", + "expect": { + "vendor": "Apple", + "model": "iPhone", + "type": "mobile" + } + }, + { + "desc": "Motorola Droid RAZR 4G", + "ua": "Mozilla/5.0 (iPod touch; CPU iPhone OS 7_0_2 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A501 Safari/9537.53", + "expect": { + "vendor": "Apple", + "model": "iPod touch", + "type": "mobile" + } + }, + { + "desc": "Moto X", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2; xx-xx; XT1058 Build/13.9.0Q2.X-70-GHOST-ATT_LE-2) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Motorola", + "model": "XT1058", + "type": "mobile" + } + }, + { + "desc": "Nokia3xx", + "ua": "Nokia303/14.87 CLDC-1.1", + "expect": { + "vendor": "Nokia", + "model": "303", + "type": "mobile" + } + }, + { + "desc": "OnePlus One", + "ua": "Mozilla/5.0 (Linux; Android 4.4.4; A0001 Build/KTU84Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.59 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "1", + "type": "mobile" + } + }, + { + "desc": "OPPO R7s", + "ua": "Mozilla/5.0 (Linux; U; Android 4.4.4; zh-cn; OPPO R7s Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.1 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "R7s", + "type": "mobile" + } + }, + { + "desc": "Philips SmartTV", + "ua": "Opera/9.80 HbbTV/1.1.1 (; Philips; ; ; ; ) NETTV/4.0.2; en) Version/11.60", + "expect": { + "vendor": "Philips", + "model": "", + "type": "smarttv" + } + }, + { + "desc": "Kindle Fire HD", + "ua": "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true", + "expect": { + "vendor": "Amazon", + "model": "KFTT", + "type": "tablet" + } + }, + { + "desc": "Samsung Galaxy Note 8", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; GT-N5100 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "GT-N5100", + "type": "tablet" + } + }, + { + "desc": "Samsung SM-C5000", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; SM-C5000 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Mobile Safari/537.36 wkbrowser 4.1.35 3065", + "expect": { + "vendor": "Samsung", + "model": "SM-C5000", + "type": "mobile" + } + }, + { + "desc": "Samsung SM-T231", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-T231 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-T231", + "type": "tablet" + } + }, + { + "desc": "Samsung SM-T700", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-T700 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-T700", + "type": "tablet" + } + }, + { + "desc": "Samsung SM-T520", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-T520 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-T520", + "type": "tablet" + } + }, + { + "desc": "Samsung SmartTV2011", + "ua": "HbbTV/1.1.1 (;;;;;) Maple;2011", + "expect": { + "vendor": "Samsung", + "model": "SmartTV2011", + "type": "smarttv" + } + }, + { + "desc": "Samsung SmartTV2012", + "ua": "HbbTV/1.1.1 (;Samsung;SmartTV2012;;;) WebKit", + "expect": { + "vendor": "Samsung", + "model": "SmartTV2012", + "type": "smarttv" + } + }, + { + "desc": "Samsung SmartTV2014", + "ua": "HbbTV/1.1.1 (;Samsung;SmartTV2014;T-NT14UDEUC-1060.4;;) WebKit", + "expect": { + "vendor": "Samsung", + "model": "SmartTV2014", + "type": "smarttv" + } + }, + { + "desc": "Samsung SmartTV", + "ua": "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.3) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.0 TV Safari/538.1", + "expect": { + "vendor": "Samsung", + "model": "undefined", + "type": "smarttv" + } + }, + { + "desc": "Sony C5303 (Xperia SP)", + "ua": "Mozilla/5.0 (Linux; Android 4.3; C5303 Build/12.1.A.1.205) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.93 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "C5303", + "type": "mobile" + } + }, + { + "desc": "Sony SO-02F (Xperia Z1 F)", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; SO-02F Build/14.1.H.2.119) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "SO-02F", + "type": "mobile" + } + }, + { + "desc": "Sony D6653 (Xperia Z3)", + "ua": "Mozilla/5.0 (Linux; Android 4.4; D6653 Build/23.0.A.0.376) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "D6653", + "type": "mobile" + } + }, + { + "desc": "Sony Xperia SOL25 (ZL2)", + "ua": "Mozilla/5.0 (Linux; U; Android 4.4; SOL25 Build/17.1.1.C.1.64) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Sony", + "model": "SOL25", + "type": "mobile" + } + }, + { + "desc": "Sony Xperia SP", + "ua": "Mozilla/5.0 (Linux; Android 4.3; C5302 Build/12.1.A.1.201) AppleWebkit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "C5302", + "type": "mobile" + } + }, + { + "desc": "Sony SGP521 (Xperia Z2 Tablet)", + "ua": "Mozilla/5.0 (Linux; Android 4.4; SGP521 Build/17.1.A.0.432) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "Xperia Tablet", + "type": "tablet" + } + }, + { + "desc": "Sony Tablet S", + "ua": "Mozilla/5.0 (Linux; U; Android 3.1; Sony Tablet S Build/THMAS10000) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13", + "expect": { + "vendor": "Sony", + "model": "Xperia Tablet", + "type": "tablet" + } + }, + { + "desc": "Sony Tablet Z LTE", + "ua": "Mozilla/5.0 (Linux; U; Android 4.1; SonySGP321 Build/10.2.C.0.143) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30", + "expect": { + "vendor": "Sony", + "model": "Xperia Tablet", + "type": "tablet" + } + }, + { + "desc": "Xiaomi 2013023", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; en-US; 2013023 Build/HM2013023) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 UCBrowser/10.0.1.512 U3/0.8.0 Mobile Safari/533.1", + "expect": { + "vendor": "Xiaomi", + "model": "2013023", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Hongmi Note 1W", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; zh-CN; HM NOTE 1W Build/JDQ39) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 UCBrowser/9.7.9.439 U3/0.8.0 Mobile Safari/533.1", + "expect": { + "vendor": "Xiaomi", + "model": "HM NOTE 1W", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi 3C", + "ua": "Mozilla/5.0 (Linux; U; Android 4.3; zh-CN; MI 3C Build/JLS36C) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 UCBrowser/9.7.9.439 U3/0.8.0 Mobile Safari/533.1", + "expect": { + "vendor": "Xiaomi", + "model": "MI 3C", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi Note", + "ua": "Mozilla/5.0 (Linux; Android 4.4.4; MI NOTE LTE Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "MI NOTE LTE", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi One Plus", + "ua": "Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; MI-ONE Plus Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Xiaomi", + "model": "MI-ONE Plus", + "type": "mobile" + } + }, + { + "desc": "PlayStation 4", + "ua": "Mozilla/5.0 (PlayStation 4 3.00) AppleWebKit/537.73 (KHTML, like Gecko)", + "expect": { + "vendor": "Sony", + "model": "PlayStation 4", + "type": "console" + } + }, + { + "desc": "Galaxy Nexus", + "ua": "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19", + "expect": { + "vendor": "Samsung", + "model": "Galaxy Nexus", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy S5", + "ua": "Mozilla/5.0 (Linux; Android 5.0; SM-G900F Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.78 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-G900F", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy S6", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-G920I Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-G920I", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy S6 Edge", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-G925I Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-G925I", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy Note 5 Chrome", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; SM-N920C Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.91 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-N920C", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy Note 5 Samsung Browser", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; SAMSUNG SM-N920C Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/44.0.2403.133 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-N920C", + "type": "mobile" + } + }, + { + "desc": "Google Chromecast", + "ua": "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.84 Safari/537.36 CrKey/1.22.79313", + "expect": { + "vendor": "Google", + "model": "Chromecast" + } + }, + { + "desc": "Google Pixel C", + "ua": "Mozilla/5.0 (Linux; Android 7.0; Pixel C Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel C", + "type": "tablet" + } + }, + { + "desc": "Google Pixel", + "ua": "Mozilla/5.0 (Linux; Android 7.1; Pixel Build/NDE63V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel", + "type": "mobile" + } + }, + { + "desc": "Google Pixel", + "ua": "Mozilla/5.0 (Linux; Android 7.1; Pixel XL Build/NDE63X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel XL", + "type": "mobile" + } + }, + + { + "desc": "Generic Android Device", + "ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; i980 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Generic", + "model": "Android 6.0.1" + } + }, + { + "desc": "LG VK Series Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.0.2; VK700 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.84 Safari/537.36", + "expect": { + "vendor": "LG", + "model": "VK700", + "type": "tablet" + } + }, + { + "desc": "LG LK Series Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.0.1; LGLK430 Build/LRX21Y) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/38.0.2125.102 Safari/537.36", + "expect": { + "vendor": "LG", + "model": "LK430", + "type": "tablet" + } + }, + { + "desc": "RCA Voyager III Tablet", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; RCT6973W43 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "RCA", + "model": "RCT6973W43", + "type": "tablet" + } + }, + { + "desc": "RCA Voyager II Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.0; RCT6773W22B Build/LRX21M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "RCA", + "model": "RCT6773W22B", + "type": "tablet" + } + }, + { + "desc": "Verizon Quanta Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; QMV7B Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Verizon", + "model": "QMV7B", + "type": "tablet" + } + }, + { + "desc": "Verizon Ellipsis 8 Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; QTAQZ3 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Verizon", + "model": "QTAQZ3", + "type": "tablet" + } + }, + { + "desc": "Verizon Ellipsis 8HD Tablet", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; QTASUN1 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Safari/537.36", + "expect": { + "vendor": "Verizon", + "model": "QTASUN1", + "type": "tablet" + } + }, + { + "desc": "Dell Venue 8 Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Venue 8 3830 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Dell", + "model": "Venue 8 3830", + "type": "tablet" + } + }, + { + "desc": "Dell Venue 7 Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Venue 7 3730 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Dell", + "model": "Venue 7 3730", + "type": "tablet" + } + }, + { + "desc": "Barnes & Noble Nook HD+ Tablet", + "ua": "Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; Barnes & Noble Nook HD+ Build/JZO54K; CyanogenMod-10) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Barnes & Noble", + "model": "Nook HD+", + "type": "tablet" + } + }, + { + "desc": "Barnes & Noble V400 Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.0.4; BNTV400 Build/IMM76L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Safari/537.36", + "expect": { + "vendor": "Barnes & Noble", + "model": "V400", + "type": "tablet" + } + }, + { + "desc": "NuVision TM101A540N Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.1; TM101A540N Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/50.0.2661.86 Safari/537.36", + "expect": { + "vendor": "NuVision", + "model": "TM101A540N", + "type": "tablet" + } + }, + { + "desc": "ZTE K Series Tablet", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; K88 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "ZTE", + "model": "K88", + "type": "tablet" + } + }, + { + "desc": "Swizz GEN610", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; GEN610 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36", + "expect": { + "vendor": "Swiss", + "model": "GEN610", + "type": "mobile" + } + }, + { + "desc": "Swizz ZUR700", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; ZUR700 Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Safari/537.36", + "expect": { + "vendor": "Swiss", + "model": "ZUR700", + "type": "tablet" + } + }, + { + "desc": "Zeki TB782b Tablet", + "ua": "Mozilla/5.0 (Linux; U; Android 4.0.4; en-US; TB782B Build/IMM76D) AppleWebKit/534.31 (KHTML, like Gecko) UCBrowser/9.0.2.299 U3/0.8.0 Mobile Safari/534.31", + "expect": { + "vendor": "Zeki", + "model": "TB782B", + "type": "tablet" + } + }, + { + "desc": "Dragon Touch Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.0.4; DT9138B Build/IMM76D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.72 Mobile Safari/537.36", + "expect": { + "vendor": "Dragon Touch", + "model": "9138B", + "type": "tablet" + } + }, + { + "desc": "Insignia Tablet", + "ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; NS-P08A7100 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Insignia", + "model": "NS-P08A7100", + "type": "tablet" + } + }, + { + "desc": "Voice Xtreme V75", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2.1; en-us; V75 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Voice", + "model": "V75", + "type": "mobile" + } + }, + { + "desc": "LvTel V11", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; V11 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Safari/537.36", + "expect": { + "vendor": "LvTel", + "model": "V11", + "type": "mobile" + } + }, + { + "desc": "Envizen Tablet V100MD", + "ua": "Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; V100MD Build/V100MD.20130816) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30", + "expect": { + "vendor": "Envizen", + "model": "V100MD", + "type": "tablet" + } + }, + { + "desc": "Rotor Tablet", + "ua": "mozilla/5.0 (linux; android 5.0.1; tu_1491 build/lrx22c) applewebkit/537.36 (khtml, like gecko) chrome/43.0.2357.93 safari/537.36", + "expect": { + "vendor": "Rotor", + "model": "1491", + "type": "tablet" + } + }, + { + "desc": "MachSpeed Tablets", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Trio 7.85 vQ Build/Trio_7.85_vQ) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36", + "expect": { + "vendor": "MachSpeed", + "model": "Trio 7.85 vQ", + "type": "tablet" + } + }, + { + "desc": "Trinity Tablets", + "ua": "Mozilla/5.0 (Linux; Android 5.0.1; Trinity T101 Build/LRX22C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Safari/537.36", + "expect": { + "vendor": "Trinity", + "model": "T101", + "type": "tablet" + } + }, + { + "desc": "NextBook Next7", + "ua": "Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Next7P12 Build/IMM76I) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30", + "expect": { + "vendor": "NextBook", + "model": "Next7P12", + "type": "tablet" + } + }, + { + "desc": "NextBook Tablets", + "ua": "Mozilla/5.0 (Linux; Android 5.0; NXA8QC116 Build/LRX21V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "NextBook", + "model": "NXA8QC116", + "type": "tablet" + } + }, + { + "desc": "Le Pan Tablets", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; Le Pan TC802A Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Le Pan", + "model": "TC802A", + "type": "tablet" + } + }, + { + "desc": "Le Pan Tablets", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; Le Pan TC802A Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Le Pan", + "model": "TC802A", + "type": "tablet" + } + }, + { + "desc": "Amazon Kindle Fire Tablet", + "ua": "Mozilla/5.0 (Linux; U; Android 4.4.3; en-us; KFSAWI Build/KTU84M) AppleWebKit/537.36 (KHTML, like Gecko) Silk/3.66 like Chrome/39.0.2171.93 Safari/537.36", + "expect": { + "vendor": "Amazon", + "model": "KFSAWI", + "type": "tablet" + } + }, + { + "desc": "Gigaset Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; Gigaset QV830 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Gigaset", + "model": "QV830", + "type": "tablet" + } + }, + { + "desc": "Redmi Note 3", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; Redmi Note 3 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.116 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Redmi Note 3", + "type": "mobile" + } + }, + { + "desc": "MI PAD 2", + "ua": "Mozilla/5.0 (Linux; Android 5.1; MI PAD 2 Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/60.0.3112.107 Safari/537.36 [FB_IAB/FB4A;FBAV/137.0.0.24.91;]", + "expect": { + "vendor": "Xiaomi", + "model": "MI PAD 2", + "type": "tablet" + } + } +] diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/engine-test.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/engine-test.json new file mode 100644 index 00000000..875057da --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/engine-test.json @@ -0,0 +1,74 @@ +[ + { + "desc" : "EdgeHTML", + "ua" : "Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Edge/12.0", + "expect" : + { + "name" : "EdgeHTML", + "version" : "12.0" + } + }, + { + "desc" : "Gecko", + "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre", + "expect" : + { + "name" : "Gecko", + "version" : "2.0b9pre" + } + }, + { + "desc" : "KHTML", + "ua" : "Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)", + "expect" : + { + "name" : "KHTML", + "version" : "4.5.4" + } + }, + { + "desc" : "NetFront", + "ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0", + "expect" : + { + "name" : "NetFront", + "version" : "3.0" + } + }, + { + "desc" : "Presto", + "ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1", + "expect" : + { + "name" : "Presto", + "version" : "2.8.149" + } + }, + { + "desc" : "Tasman", + "ua" : "Mozilla/4.0 (compatible; MSIE 6.0; PPC Mac OS X 10.4.7; Tasman 1.0)", + "expect" : + { + "name" : "Tasman", + "version" : "1.0" + } + }, + { + "desc" : "Trident", + "ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)", + "expect" : + { + "name" : "Trident", + "version" : "6.0" + } + }, + { + "desc" : "WebKit", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4", + "expect" : + { + "name" : "WebKit", + "version" : "533.19.4" + } + } +] diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/mediaplayer-test.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/mediaplayer-test.json new file mode 100644 index 00000000..d40ba04f --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/mediaplayer-test.json @@ -0,0 +1,582 @@ +[ + { + "desc" : "Coremedia", + "ua" : "Apple Mac OS X v10.6.4 CoreMedia v1.0.0.10F2108", + "expect" : + { + "name" : "CoreMedia", + "version" : "1.0.0.10F2108", + "major" : "1" + } + }, + { + "desc" : "AppleCoreMedia", + "ua" : "AppleCoreMedia/1.0.0.10A403 (iPad; U; CPU OS 6_0 like Mac OS X; it_it)", + "expect" : + { + "name" : "AppleCoreMedia", + "version" : "1.0.0.10A403", + "major" : "1" + } + }, + { + "desc" : "AppleTv", + "ua" : "AppleTV/3.0.2 (Macintosh; Intel Mac OS X 10.4.7) AppleWebKit/528.18", + "expect" : + { + "name" : "WebKit", + "version" : "528.18", + "major" : "528" + } + }, + { + "desc" : "Aqualung", + "ua" : "Aqualung/R-1114", + "expect" : + { + "name" : "Aqualung", + "version" : "R-1114", + "major" : "undefined" + } + }, + { + "desc" : "Ares", + "ua" : "Ares 2.2.4.3048", + "expect" : + { + "name" : "Ares", + "version" : "2.2.4.3048", + "major" : "2" + } + }, + { + "desc" : "Audacious", + "ua" : "Audacious/3.2.2 neon/0.29.3", + "expect" : + { + "name" : "Audacious", + "version" : "3.2.2", + "major" : "3" + } + }, + { + "desc" : "AudiMusicStream", + "ua" : "AudiMusicStream/3020.130826151911", + "expect" : + { + "name" : "AudiMusicStream", + "version" : "3020.130826151911", + "major" : "3020" + } + }, + { + "desc" : "BASS", + "ua" : "BASS/2.4", + "expect" : + { + "name" : "BASS", + "version" : "2.4", + "major" : "2" + } + }, + { + "desc" : "BSPlayer", + "ua" : "BSPlayer/2", + "expect" : + { + "name" : "BSPlayer", + "version" : "2", + "major" : "2" + } + }, + { + "desc" : "Core", + "ua" : "CORE/6.506.4.1", + "expect" : + { + "name" : "CORE", + "version" : "6.506.4.1", + "major" : "6" + } + }, + { + "desc" : "Clementine", + "ua" : "Clementine 1.1", + "expect" : + { + "name" : "Clementine", + "version" : "1.1", + "major" : "1" + } + }, + { + "desc" : "Dalvik", + "ua" : "Dalvik/1.2.0 (Linux; U; Android 2.2.1; GT-S5830L Build/FROYO)", + "expect" : + { + "name" : "Dalvik", + "version" : "1.2.0", + "major" : "1" + } + }, + { + "desc" : "NexPlayer", + "ua" : "E97510d/ Player/NexPlayer 4.0", + "expect" : + { + "name" : "NexPlayer", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "FLRP", + "ua" : "FLRP/2.5 CFNetwork/609.1.4 Darwin/13.0.0", + "expect" : + { + "name" : "Flip Player", + "version" : "2.5", + "major" : "2" + } + }, + { + "desc" : "FStream", + "ua" : "FStream", + "expect" : + { + "name" : "FStream", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "GStreamer", + "ua" : "GStreamer souphttpsrc (compatible; LG NetCast.TV-2012) libsoup/2.34.2", + "expect" : + { + "name" : "GStreamer", + "version" : "2.34.2", + "major" : "2" + } + }, + { + "desc" : "GnomeMplayer", + "ua" : "GnomeMplayer/1.0.2", + "expect" : + { + "name" : "GnomeMplayer", + "version" : "1.0.2", + "major" : "1" + } + }, + { + "desc" : "HTC Streaming Player", + "ua" : "HTC Streaming Player htc_asia_wwe / 1.0 / endeavoru / 4.1.1", + "expect" : + { + "name" : "HTC Streaming Player", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "HTC One S", + "ua" : "HTC_One_S/3.16.111.10", + "expect" : + { + "name" : "HTC One S", + "version" : "3.16.111.10", + "major" : "3" + } + }, + { + "desc" : "Java", + "ua" : "Java/1.4.1_04", + "expect" : + { + "name" : "Java", + "version" : "1.4.1_04", + "major" : "1" + } + }, + { + "desc" : "LG Player", + "ua" : "LG Player 1.0; Android", + "expect" : + { + "name" : "LG Player", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "NexPlayer", + "ua" : "LG-P700/V10k-DEC-12-2012 Player/NexPlayer 4.0 for Android", + "expect" : + { + "name" : "NexPlayer", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "LG Player", + "ua" : "LGE400/V10b Player/LG Player 1.0", + "expect" : + { + "name" : "LG Player", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "Lavf", + "ua" : "Lavf52.111.0", + "expect" : + { + "name" : "Lavf", + "version" : "52.111.0", + "major" : "52" + } + }, + { + "desc" : "Lyssna", + "ua" : "Lyssna/46 CFNetwork/609.1.4 Darwin/13.0.0", + "expect" : + { + "name" : "Lyssna", + "version" : "46", + "major" : "46" + } + }, + { + "desc" : "MPlayer", + "ua" : "MPlayer 1.1-4.2.1", + "expect" : + { + "name" : "MPlayer", + "version" : "1.1-4.2.1", + "major" : "" + } + }, + { + "desc" : "MPlayer SVN", + "ua" : "MPlayer SVN-r33713-4.6.1", + "expect" : + { + "name" : "MPlayer", + "version" : "r33713-4.6.1", + "major" : "undefined" + } + }, + { + "desc" : "MPlayer ubuntu", + "ua" : "MPlayer svn r34540 (Ubuntu), built with gcc-4.6", + "expect" : + { + "name" : "MPlayer", + "version" : "r34540", + "major" : "undefined" + } + }, + { + "desc" : "MoC", + "ua" : "Music On Console/2.5.0-beta1", + "expect" : + { + "name" : "Music On Console", + "version" : "2.5.0-beta1", + "major" : "2" + } + }, + { + "desc" : "MPD", + "ua" : "Music Player Daemon 0.17.4", + "expect" : + { + "name" : "Music Player Daemon", + "version" : "0.17.4", + "major" : "0" + } + }, + { + "desc" : "NSPlayer", + "ua" : "NSPlayer/11.0.5358.4827 WMFSDK/11.0", + "expect" : + { + "name" : "NSPlayer", + "version" : "11.0.5358.4827", + "major" : "11" + } + }, + { + "desc" : "Nero Home", + "ua" : "Nero Home/1.5.3.0 (compatible; Nero AG; Nero Home 1.5.3.0)", + "expect" : + { + "name" : "Nero Home", + "version" : "1.5.3.0", + "major" : "1" + } + }, + { + "desc" : "NexPlayer", + "ua" : "NexPlayer 4.0 for Android( stagefright alternative )", + "expect" : + { + "name" : "NexPlayer", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "Nokia3xx", + "ua" : "Nokia303/14.87 CLDC-1.1", + "expect" : + { + "name" : "Nokia303", + "version" : "14.87", + "major" : "14" + } + }, + { + "desc" : "MPlayer SVN Sherpya", + "ua" : "MPlayer Sherpya-SVN-r33124-4.2.5", + "expect" : + { + "name" : "MPlayer", + "version" : "r33124-4.2.5", + "major" : "undefined" + } + }, + { + "desc" : "Philips Songbird", + "ua" : "NotMoz/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.2.3) Gecko/20101207 Philips-Songbird/5.4.1980 Songbird/1.9.4 (20110302030555)", + "expect" : + { + "name" : "Songbird", + "version" : "1.9.4", + "major" : "1" + } + }, + { + "desc" : "Ossproxy", + "ua" : "OSSProxy 1.3.336.320 (Build 336.320 Win32 en-us)(Aug 16 2013 17:38:43)", + "expect" : + { + "name" : "OSSProxy", + "version" : "1.3.336.320", + "major" : "1" + } + }, + { + "desc" : "Winamp3", + "ua" : "Nullsoft Winamp3 version 3.0 (compatible)", + "expect" : + { + "name" : "Winamp", + "version" : "3.0", + "major" : "3" + } + }, + { + "desc" : "PSP", + "ua" : "PSP-InternetRadioPlayer/1.00", + "expect" : + { + "name" : "PSP-InternetRadioPlayer", + "version" : "1.00", + "major" : "1" + } + }, + { + "desc" : "urllib", + "ua" : "Python-urllib/2.7", + "expect" : + { + "name" : "Python-urllib", + "version" : "2.7", + "major" : "2" + } + }, + { + "desc" : "QuickTime", + "ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)", + "expect" : + { + "name" : "QuickTime", + "version" : "7.5.6", + "major" : "7" + } + }, + { + "desc" : "RMA", + "ua" : "RMA/1.0 (compatible; RealMedia)", + "expect" : + { + "name" : "RMA", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "RadioApp", + "ua" : "RadioApp/1.0 CFNetwork/609.1.4 Darwin/11.4.2", + "expect" : + { + "name" : "RadioApp", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "RadioClientApplication", + "ua" : "RadioClientApplication/20 CFNetwork/609.1.4 Darwin/13.0.0", + "expect" : + { + "name" : "RadioClientApplication", + "version" : "20", + "major" : "undefined" + } + }, + { + "desc" : "stagefright", + "ua" : "Samsung GT-I9070 stagefright/1.1 (Linux;Android 2.3.6)", + "expect" : + { + "name" : "stagefright", + "version" : "1.1", + "major" : "1" + } + }, + { + "desc" : "Soundtap", + "ua" : "Soundtap/1.2.4 CFNetwork/672.0.2 Darwin/14.0.0", + "expect" : + { + "name" : "Soundtap", + "version" : "1.2.4", + "major" : "1" + } + }, + { + "desc" : "Streamium", + "ua" : "Streamium/1.0", + "expect" : + { + "name" : "Streamium", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "Totem", + "ua" : "Totem/3.0.1", + "expect" : + { + "name" : "Totem", + "version" : "3.0.1", + "major" : "3" + } + }, + { + "desc" : "VLC", + "ua" : "VLC media player - version 0.8.6c Janus - (c) 1996-2007 the VideoLAN team", + "expect" : + { + "name" : "VLC", + "version" : "0.8.6c", + "major" : "0" + } + }, + { + "desc" : "VLC", + "ua" : "VLC/2.0.0 LibVLC/2.0.0", + "expect" : + { + "name" : "VLC", + "version" : "2.0.0", + "major" : "2" + } + }, + { + "desc" : "Videos", + "ua" : "Videos/3.8.2", + "expect" : + { + "name" : "Video", + "version" : "3.8.2", + "major" : "3" + } + }, + { + "desc" : "Wget", + "ua" : "Wget/1.12 (darwin10.7.0)", + "expect" : + { + "name" : "Wget", + "version" : "1.12", + "major" : "1" + } + }, + { + "desc" : "Winamp", + "ua" : "Winamp 2.81", + "expect" : + { + "name" : "Winamp", + "version" : "2.81", + "major" : "2" + } + }, + { + "desc" : "Winamp", + "ua" : "WinampMPEG/2.00", + "expect" : + { + "name" : "Winamp", + "version" : "2.00", + "major" : "2" + } + }, + { + "desc" : "Windows Media Player", + "ua" : "Windows-Media-Player/10.00.00.4019", + "expect" : + { + "name" : "Windows Media Player", + "version" : "10.00.00.4019", + "major" : "10" + } + }, + { + "desc" : "XBMC", + "ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)", + "expect" : + { + "name" : "XBMC", + "version" : "12.0", + "major" : "12" + } + }, + { + "desc" : "rad.io", + "ua" : "rad.io 1.18.1 rv:593 (iPhone 4S; iPhone OS 7.0.4; it_IT)", + "expect" : + { + "name" : "rad.io", + "version" : "1.18.1", + "major" : "1" + } + }, + { + "desc" : "BE-Test", + "ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)", + "expect" : + { + "name" : "BE Test", + "version" : "1.0", + "major" : "1" + } + } +] diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/os-test.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/os-test.json new file mode 100644 index 00000000..86aa837b --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/os-test.json @@ -0,0 +1,641 @@ +[ + { + "desc" : "Windows 95", + "ua" : "Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)", + "expect" : + { + "name" : "Windows", + "version" : "95" + } + }, + { + "desc" : "Windows 98", + "ua" : "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)", + "expect" : + { + "name" : "Windows", + "version" : "98" + } + }, + { + "desc" : "Windows ME", + "ua" : "Mozilla/5.0 (Windows; U; Win 9x 4.90) Gecko/20020502 CS 2000 7.0/7.0", + "expect" : + { + "name" : "Windows", + "version" : "ME" + } + }, + { + "desc" : "Windows 2000", + "ua" : "Mozilla/3.0 (compatible; MSIE 3.0; Windows NT 5.0)", + "expect" : + { + "name" : "Windows", + "version" : "2000" + } + }, + { + "desc" : "Windows XP", + "ua" : "Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 5.2)", + "expect" : + { + "name" : "Windows", + "version" : "XP" + } + }, + { + "desc" : "Windows Vista", + "ua" : "Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; fr-FR)", + "expect" : + { + "name" : "Windows", + "version" : "Vista" + } + }, + { + "desc" : "Windows 7", + "ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)", + "expect" : + { + "name" : "Windows", + "version" : "7" + } + }, + { + "desc" : "Windows 8", + "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)", + "expect" : + { + "name" : "Windows", + "version" : "8" + } + }, + { + "desc" : "Windows 10", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0", + "expect" : + { + "name" : "Windows", + "version" : "10" + } + }, + { + "desc" : "Windows RT", + "ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)", + "expect" : + { + "name" : "Windows", + "version" : "RT" + } + }, + { + "desc" : "Windows CE", + "ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)", + "expect" : + { + "name" : "Windows", + "version" : "CE" + } + }, + { + "desc" : "Windows Mobile", + "ua" : "Mozilla/5.0 (ZTE-E_N72/N72V1.0.0B02;U;Windows Mobile/6.1;Profile/MIDP-2.0 Configuration/CLDC-1.1;320*240;CTC/2.0) IE/6.0 (compatible; MSIE 4.01; Windows CE; PPC)/UC Browser7.7.1.88", + "expect" : + { + "name" : "Windows Mobile", + "version" : "6.1" + } + }, + { + "desc" : "Windows Phone", + "ua" : "Opera/9.80 (Windows Phone; Opera Mini/7.6.8/35.7518; U; ru) Presto/2.8.119 Version/11.10", + "expect" : + { + "name" : "Windows Phone", + "version" : "undefined" + } + }, + { + "desc" : "Windows Phone OS", + "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DELL; Venue Pro)", + "expect" : + { + "name" : "Windows Phone OS", + "version" : "7.0" + } + }, + { + "desc" : "Windows Phone 8", + "ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; HTC; Windows Phone 8X by HTC)", + "expect" : + { + "name" : "Windows Phone", + "version" : "8.0" + } + }, + { + "desc" : "BlackBerry", + "ua" : "BlackBerry9300/5.0.0.912 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/378", + "expect" : + { + "name" : "BlackBerry", + "version" : "5.0.0.912" + } + }, + { + "desc" : "BlackBerry 10", + "ua" : "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.3+ (KHTML, like Gecko) Version/10.0.9.386 Mobile Safari/537.3+", + "expect" : + { + "name" : "BlackBerry", + "version" : "10" + } + }, + { + "desc" : "Tizen", + "ua" : "Mozilla/5.0 (Linux; Tizen 2.3; SAMSUNG SM-Z130H) AppleWebKit/537.3 (KHTML, like Gecko) Version/2.3 Mobile Safari/537.3", + "expect" : + { + "name" : "Tizen", + "version" : "2.3" + } + }, + { + "desc" : "Android", + "ua" : "Mozilla/5.0 (Linux; U; Android 2.2.2; en-us; VM670 Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko)", + "expect" : + { + "name" : "Android", + "version" : "2.2.2" + } + }, + { + "desc" : "WebOS", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Palm OS", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "QNX", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Bada", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "RIM Tablet OS", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "MeeGo", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Symbian", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Firefox OS", + "ua" : "Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0", + "expect" : + { + "name" : "Firefox OS", + "version" : "undefined" + } + }, + { + "desc" : "Nintendo", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "PlayStation", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "PlayStation 4", + "ua" : "Mozilla/5.0 (PlayStation 4 3.00) AppleWebKit/537.73 (KHTML, like Gecko)", + "expect" : + { + "name" : "PlayStation", + "version" : "4" + } + }, + { + "desc" : "Mint", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Joli", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Ubuntu", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.22+ (KHTML, like Gecko) Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/535.22+ Ubuntu/12.04 (3.4.1-0ubuntu1) Epiphany/3.4.1", + "expect" : + { + "name" : "Ubuntu", + "version" : "12.04" + } + }, + { + "desc" : "Ubuntu", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.63 Chrome/31.0.1650.63 Safari/537.36", + "expect" : + { + "name" : "Ubuntu", + "version" : "undefined" + } + }, + { + "desc" : "Debian", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "OpenSUSE", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Gentoo", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Arch", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Slackware", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Fedora", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Mandriva", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "CentOS", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "PCLinuxOS", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "RedHat", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Zenwalk", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Hurd", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Linux", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "GNU", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Chromium OS", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Solaris", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "FreeBSD", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "OpenBSD", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "NetBSD", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "DragonFly", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "iOS in App", + "ua" : "AppName/version CFNetwork/version Darwin/version", + "expect" : + { + "name" : "iOS", + "version" : "undefined" + } + }, + { + "desc" : "iOS with Chrome", + "ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3", + "expect" : + { + "name" : "iOS", + "version" : "5.1.1" + } + }, + { + "desc" : "iOS with Opera Mini", + "ua" : "Opera/9.80 (iPhone; Opera Mini/7.1.32694/27.1407; U; en) Presto/2.8.119 Version/11.10", + "expect" : + { + "name" : "iOS", + "version" : "undefined" + } + }, + { + "desc" : "Mac OS", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36", + "expect" : + { + "name" : "Mac OS", + "version" : "10.6.8" + } + }, + { + "desc" : "Haiku", + "ua" : "Mozilla/5.0 (Macintosh; Intel Haiku R1 x86) AppleWebKit/602.1.1 (KHTML, like Gecko) WebPositive/1.2 Version/8.0 Safari/602.1.1", + "expect" : + { + "name" : "Haiku", + "version" : "R1" + } + }, + { + "desc" : "AIX", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Plan9", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "Minix", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "BeOS", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "OS/2", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "AmigaOS", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "MorphOS", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "UNIX", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "iTunes Windows Vista", + "ua" : "iTunes/10.7 (Windows; Microsoft Windows Vista Home Premium Edition Service Pack 1 (Build 6001)) AppleWebKit/536.26.9", + "expect" : + { + "name" : "Windows", + "version" : "Vista" + } + }, + { + "desc" : "", + "ua" : "", + "expect" : + { + "name" : "", + "version" : "" + } + }, + { + "desc" : "iOS BE App", + "ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)", + "expect" : + { + "name" : "iOS", + "version" : "7.0.2" + } + }, + { + "desc" : "KTB-Nexus 5", + "ua" : "APP-My App/1.0 (Linux; Android 4.2.1; Nexus 5 Build/JOP40D)", + "expect" : + { + "name" : "Android", + "version" : "4.2.1" + } + } +] diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/test.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/test.js new file mode 100644 index 00000000..99e53ffb --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/ua-parser-js/test/test.js @@ -0,0 +1,113 @@ +var assert = require('assert'); +var requirejs = require('requirejs'); +var UAParser = require('./../src/ua-parser'); +var browsers = require('./browser-test.json'); +var cpus = require('./cpu-test.json'); +var devices = require('./device-test.json'); +var engines = require('./engine-test.json'); +var os = require('./os-test.json'); +var parser = new UAParser(); +var methods = [ + { + title : 'getBrowser', + label : 'browser', + list : browsers, + properties : ['name', 'major', 'version'] + }, + { + title : 'getCPU', + label : 'cpu', + list : cpus, + properties : ['architecture'] + }, + { + title : 'getDevice', + label : 'device', + list : devices, + properties : ['model', 'type', 'vendor'] + }, + { + title : 'getEngine', + label : 'engine', + list : engines, + properties : ['name', 'version'] + }, + { + title : 'getOS', + label : 'os', + list : os, + properties : ['name', 'version'] +}]; + +describe('UAParser()', function () { + var ua = 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6'; + assert.deepEqual(UAParser(ua), new UAParser().setUA(ua).getResult()); +}); + +for (var i in methods) { + describe(methods[i]['title'], function () { + for (var j in methods[i]['list']) { + if (!!methods[i]['list'][j].ua) { + describe('[' + methods[i]['list'][j].desc + ']', function () { + describe('"' + methods[i]['list'][j].ua + '"', function () { + var expect = methods[i]['list'][j].expect; + var result = parser.setUA(methods[i]['list'][j].ua).getResult()[methods[i]['label']]; + + methods[i]['properties'].forEach(function(m) { + it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () { + assert.equal(result[m], expect[m] != 'undefined' ? expect[m] : undefined); + }); + }); + }); + }); + } + } + }); +} + +describe('Returns', function () { + it('getResult() should returns JSON', function(done) { + assert.deepEqual(new UAParser('').getResult(), + { + ua : '', + browser: { name: undefined, version: undefined, major: undefined }, + cpu: { architecture: undefined }, + device: { vendor: undefined, model: undefined, type: undefined }, + engine: { name: undefined, version: undefined}, + os: { name: undefined, version: undefined } + }); + done(); + }); +}); + +describe('Extending Regex', function () { + var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3'; + var myOwnBrowser = [[/(myownbrowser)\/((\d+)?[\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, UAParser.BROWSER.MAJOR]]; + + var parser1 = new UAParser(uaString, {browser: myOwnBrowser}); + assert.equal(parser1.getBrowser().name, 'MyOwnBrowser'); + assert.equal(parser1.getBrowser().version, '1.3'); + assert.equal(parser1.getBrowser().major, '1'); + + var parser2 = new UAParser({browser: myOwnBrowser}); + assert.equal(parser2.getBrowser().name, undefined); + parser2.setUA(uaString); + assert.equal(parser2.getBrowser().name, 'MyOwnBrowser'); + assert.equal(parser1.getBrowser().version, '1.3'); +}); + +describe('Using Require.js', function () { + it('should loaded automatically', function(done) { + requirejs.config({ + baseUrl : 'dist', + paths : { + 'ua-parser-js' : 'ua-parser.min' + } + }); + requirejs(['ua-parser-js'], function(ua) { + var parser = new ua('Dillo/1.0'); + assert.deepEqual(parser.getBrowser().name, 'Dillo'); + done(); + }); + }); +}); \ No newline at end of file diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/LICENSE b/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/LICENSE new file mode 100644 index 00000000..0e319d55 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2014-2016 GitHub, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/README.md b/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/README.md new file mode 100644 index 00000000..328cb490 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/README.md @@ -0,0 +1,282 @@ +# window.fetch polyfill + +The `fetch()` function is a Promise-based mechanism for programmatically making +web requests in the browser. This project is a polyfill that implements a subset +of the standard [Fetch specification][], enough to make `fetch` a viable +replacement for most uses of XMLHttpRequest in traditional web applications. + +This project adheres to the [Open Code of Conduct][]. By participating, you are +expected to uphold this code. + +## Table of Contents + +* [Read this first](#read-this-first) +* [Installation](#installation) +* [Usage](#usage) + * [HTML](#html) + * [JSON](#json) + * [Response metadata](#response-metadata) + * [Post form](#post-form) + * [Post JSON](#post-json) + * [File upload](#file-upload) + * [Caveats](#caveats) + * [Handling HTTP error statuses](#handling-http-error-statuses) + * [Sending cookies](#sending-cookies) + * [Receiving cookies](#receiving-cookies) + * [Obtaining the Response URL](#obtaining-the-response-url) +* [Browser Support](#browser-support) + +## Read this first + +* If you believe you found a bug with how `fetch` behaves in Chrome or Firefox, + please **avoid opening an issue in this repository**. This project is a + _polyfill_, and since Chrome and Firefox both implement the `window.fetch` + function natively, no code from this project actually takes any effect in + these browsers. See [Browser support](#browser-support) for detailed + information. + +* If you have trouble **making a request to another domain** (a different + subdomain or port number also constitutes as another domain), please + familiarize yourself with all the intricacies and limitations of [CORS][] + requests. Because CORS requires participation of the server by implementing + specific HTTP response headers, it is often nontrivial to set up or debug. + CORS is exclusively handled by the browser's internal mechanisms which this + polyfill cannot influence. + +* If you have trouble **maintaining the user's session** or [CSRF][] protection + through `fetch` requests, please ensure that you've read and understood the + [Sending cookies](#sending-cookies) section. + +* If this polyfill **doesn't work under Node.js environments**, that is expected, + because this project is meant for web browsers only. You should ensure that your + application doesn't try to package and run this on the server. + +* If you have an idea for a new feature of `fetch`, please understand that we + are only ever going to add features and APIs that are a part of the + [Fetch specification][]. You should **submit your feature requests** to the + [repository of the specification](https://github.com/whatwg/fetch/issues) + itself, rather than this repository. + +## Installation + +* `npm install whatwg-fetch --save`; or + +* `bower install fetch`. + +You will also need a Promise polyfill for [older browsers](http://caniuse.com/#feat=promises). +We recommend [taylorhakes/promise-polyfill](https://github.com/taylorhakes/promise-polyfill) +for its small size and Promises/A+ compatibility. + +For use with webpack, add this package in the `entry` configuration option +before your application entry point: + +```javascript +entry: ['whatwg-fetch', ...] +``` + +For Babel and ES2015+, make sure to import the file: + +```javascript +import 'whatwg-fetch' +``` + +## Usage + +For a more comprehensive API reference that this polyfill supports, refer to +https://github.github.io/fetch/. + +### HTML + +```javascript +fetch('/users.html') + .then(function(response) { + return response.text() + }).then(function(body) { + document.body.innerHTML = body + }) +``` + +### JSON + +```javascript +fetch('/users.json') + .then(function(response) { + return response.json() + }).then(function(json) { + console.log('parsed json', json) + }).catch(function(ex) { + console.log('parsing failed', ex) + }) +``` + +### Response metadata + +```javascript +fetch('/users.json').then(function(response) { + console.log(response.headers.get('Content-Type')) + console.log(response.headers.get('Date')) + console.log(response.status) + console.log(response.statusText) +}) +``` + +### Post form + +```javascript +var form = document.querySelector('form') + +fetch('/users', { + method: 'POST', + body: new FormData(form) +}) +``` + +### Post JSON + +```javascript +fetch('/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + name: 'Hubot', + login: 'hubot', + }) +}) +``` + +### File upload + +```javascript +var input = document.querySelector('input[type="file"]') + +var data = new FormData() +data.append('file', input.files[0]) +data.append('user', 'hubot') + +fetch('/avatars', { + method: 'POST', + body: data +}) +``` + +### Caveats + +The `fetch` specification differs from `jQuery.ajax()` in mainly two ways that +bear keeping in mind: + +* The Promise returned from `fetch()` **won't reject on HTTP error status** + even if the response is an HTTP 404 or 500. Instead, it will resolve normally, + and it will only reject on network failure or if anything prevented the + request from completing. + +* By default, `fetch` **won't send or receive any cookies** from the server, + resulting in unauthenticated requests if the site relies on maintaining a user + session. See [Sending cookies](#sending-cookies) for how to opt into cookie + handling. + +#### Handling HTTP error statuses + +To have `fetch` Promise reject on HTTP error statuses, i.e. on any non-2xx +status, define a custom response handler: + +```javascript +function checkStatus(response) { + if (response.status >= 200 && response.status < 300) { + return response + } else { + var error = new Error(response.statusText) + error.response = response + throw error + } +} + +function parseJSON(response) { + return response.json() +} + +fetch('/users') + .then(checkStatus) + .then(parseJSON) + .then(function(data) { + console.log('request succeeded with JSON response', data) + }).catch(function(error) { + console.log('request failed', error) + }) +``` + +#### Sending cookies + +To automatically send cookies for the current domain, the `credentials` option +must be provided: + +```javascript +fetch('/users', { + credentials: 'same-origin' +}) +``` + +The "same-origin" value makes `fetch` behave similarly to XMLHttpRequest with +regards to cookies. Otherwise, cookies won't get sent, resulting in these +requests not preserving the authentication session. + +For [CORS][] requests, use the "include" value to allow sending credentials to +other domains: + +```javascript +fetch('https://example.com:1234/users', { + credentials: 'include' +}) +``` + +#### Receiving cookies + +As with XMLHttpRequest, the `Set-Cookie` response header returned from the +server is a [forbidden header name][] and therefore can't be programmatically +read with `response.headers.get()`. Instead, it's the browser's responsibility +to handle new cookies being set (if applicable to the current URL). Unless they +are HTTP-only, new cookies will be available through `document.cookie`. + +Bear in mind that the default behavior of `fetch` is to ignore the `Set-Cookie` +header completely. To opt into accepting cookies from the server, you must use +the `credentials` option. + +#### Obtaining the Response URL + +Due to limitations of XMLHttpRequest, the `response.url` value might not be +reliable after HTTP redirects on older browsers. + +The solution is to configure the server to set the response HTTP header +`X-Request-URL` to the current URL after any redirect that might have happened. +It should be safe to set it unconditionally. + +``` ruby +# Ruby on Rails controller example +response.headers['X-Request-URL'] = request.url +``` + +This server workaround is necessary if you need reliable `response.url` in +Firefox < 32, Chrome < 37, Safari, or IE. + +## Browser Support + +- Chrome +- Firefox +- Safari 6.1+ +- Internet Explorer 10+ + +Note: modern browsers such as Chrome, Firefox, and Microsoft Edge contain native +implementations of `window.fetch`, therefore the code from this polyfill doesn't +have any effect on those browsers. If you believe you've encountered an error +with how `window.fetch` is implemented in any of these browsers, you should file +an issue with that browser vendor instead of this project. + + + [fetch specification]: https://fetch.spec.whatwg.org + [open code of conduct]: http://todogroup.org/opencodeofconduct/#fetch/opensource@github.com + [cors]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS + "Cross-origin resource sharing" + [csrf]: https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet + "Cross-site request forgery" + [forbidden header name]: https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/fetch.js b/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/fetch.js new file mode 100644 index 00000000..6bac6b39 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/fetch.js @@ -0,0 +1,461 @@ +(function(self) { + 'use strict'; + + if (self.fetch) { + return + } + + var support = { + searchParams: 'URLSearchParams' in self, + iterable: 'Symbol' in self && 'iterator' in Symbol, + blob: 'FileReader' in self && 'Blob' in self && (function() { + try { + new Blob() + return true + } catch(e) { + return false + } + })(), + formData: 'FormData' in self, + arrayBuffer: 'ArrayBuffer' in self + } + + if (support.arrayBuffer) { + var viewClasses = [ + '[object Int8Array]', + '[object Uint8Array]', + '[object Uint8ClampedArray]', + '[object Int16Array]', + '[object Uint16Array]', + '[object Int32Array]', + '[object Uint32Array]', + '[object Float32Array]', + '[object Float64Array]' + ] + + var isDataView = function(obj) { + return obj && DataView.prototype.isPrototypeOf(obj) + } + + var isArrayBufferView = ArrayBuffer.isView || function(obj) { + return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 + } + } + + function normalizeName(name) { + if (typeof name !== 'string') { + name = String(name) + } + if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { + throw new TypeError('Invalid character in header field name') + } + return name.toLowerCase() + } + + function normalizeValue(value) { + if (typeof value !== 'string') { + value = String(value) + } + return value + } + + // Build a destructive iterator for the value list + function iteratorFor(items) { + var iterator = { + next: function() { + var value = items.shift() + return {done: value === undefined, value: value} + } + } + + if (support.iterable) { + iterator[Symbol.iterator] = function() { + return iterator + } + } + + return iterator + } + + function Headers(headers) { + this.map = {} + + if (headers instanceof Headers) { + headers.forEach(function(value, name) { + this.append(name, value) + }, this) + } else if (Array.isArray(headers)) { + headers.forEach(function(header) { + this.append(header[0], header[1]) + }, this) + } else if (headers) { + Object.getOwnPropertyNames(headers).forEach(function(name) { + this.append(name, headers[name]) + }, this) + } + } + + Headers.prototype.append = function(name, value) { + name = normalizeName(name) + value = normalizeValue(value) + var oldValue = this.map[name] + this.map[name] = oldValue ? oldValue+','+value : value + } + + Headers.prototype['delete'] = function(name) { + delete this.map[normalizeName(name)] + } + + Headers.prototype.get = function(name) { + name = normalizeName(name) + return this.has(name) ? this.map[name] : null + } + + Headers.prototype.has = function(name) { + return this.map.hasOwnProperty(normalizeName(name)) + } + + Headers.prototype.set = function(name, value) { + this.map[normalizeName(name)] = normalizeValue(value) + } + + Headers.prototype.forEach = function(callback, thisArg) { + for (var name in this.map) { + if (this.map.hasOwnProperty(name)) { + callback.call(thisArg, this.map[name], name, this) + } + } + } + + Headers.prototype.keys = function() { + var items = [] + this.forEach(function(value, name) { items.push(name) }) + return iteratorFor(items) + } + + Headers.prototype.values = function() { + var items = [] + this.forEach(function(value) { items.push(value) }) + return iteratorFor(items) + } + + Headers.prototype.entries = function() { + var items = [] + this.forEach(function(value, name) { items.push([name, value]) }) + return iteratorFor(items) + } + + if (support.iterable) { + Headers.prototype[Symbol.iterator] = Headers.prototype.entries + } + + function consumed(body) { + if (body.bodyUsed) { + return Promise.reject(new TypeError('Already read')) + } + body.bodyUsed = true + } + + function fileReaderReady(reader) { + return new Promise(function(resolve, reject) { + reader.onload = function() { + resolve(reader.result) + } + reader.onerror = function() { + reject(reader.error) + } + }) + } + + function readBlobAsArrayBuffer(blob) { + var reader = new FileReader() + var promise = fileReaderReady(reader) + reader.readAsArrayBuffer(blob) + return promise + } + + function readBlobAsText(blob) { + var reader = new FileReader() + var promise = fileReaderReady(reader) + reader.readAsText(blob) + return promise + } + + function readArrayBufferAsText(buf) { + var view = new Uint8Array(buf) + var chars = new Array(view.length) + + for (var i = 0; i < view.length; i++) { + chars[i] = String.fromCharCode(view[i]) + } + return chars.join('') + } + + function bufferClone(buf) { + if (buf.slice) { + return buf.slice(0) + } else { + var view = new Uint8Array(buf.byteLength) + view.set(new Uint8Array(buf)) + return view.buffer + } + } + + function Body() { + this.bodyUsed = false + + this._initBody = function(body) { + this._bodyInit = body + if (!body) { + this._bodyText = '' + } else if (typeof body === 'string') { + this._bodyText = body + } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { + this._bodyBlob = body + } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { + this._bodyFormData = body + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this._bodyText = body.toString() + } else if (support.arrayBuffer && support.blob && isDataView(body)) { + this._bodyArrayBuffer = bufferClone(body.buffer) + // IE 10-11 can't handle a DataView body. + this._bodyInit = new Blob([this._bodyArrayBuffer]) + } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { + this._bodyArrayBuffer = bufferClone(body) + } else { + throw new Error('unsupported BodyInit type') + } + + if (!this.headers.get('content-type')) { + if (typeof body === 'string') { + this.headers.set('content-type', 'text/plain;charset=UTF-8') + } else if (this._bodyBlob && this._bodyBlob.type) { + this.headers.set('content-type', this._bodyBlob.type) + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8') + } + } + } + + if (support.blob) { + this.blob = function() { + var rejected = consumed(this) + if (rejected) { + return rejected + } + + if (this._bodyBlob) { + return Promise.resolve(this._bodyBlob) + } else if (this._bodyArrayBuffer) { + return Promise.resolve(new Blob([this._bodyArrayBuffer])) + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as blob') + } else { + return Promise.resolve(new Blob([this._bodyText])) + } + } + + this.arrayBuffer = function() { + if (this._bodyArrayBuffer) { + return consumed(this) || Promise.resolve(this._bodyArrayBuffer) + } else { + return this.blob().then(readBlobAsArrayBuffer) + } + } + } + + this.text = function() { + var rejected = consumed(this) + if (rejected) { + return rejected + } + + if (this._bodyBlob) { + return readBlobAsText(this._bodyBlob) + } else if (this._bodyArrayBuffer) { + return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as text') + } else { + return Promise.resolve(this._bodyText) + } + } + + if (support.formData) { + this.formData = function() { + return this.text().then(decode) + } + } + + this.json = function() { + return this.text().then(JSON.parse) + } + + return this + } + + // HTTP methods whose capitalization should be normalized + var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'] + + function normalizeMethod(method) { + var upcased = method.toUpperCase() + return (methods.indexOf(upcased) > -1) ? upcased : method + } + + function Request(input, options) { + options = options || {} + var body = options.body + + if (input instanceof Request) { + if (input.bodyUsed) { + throw new TypeError('Already read') + } + this.url = input.url + this.credentials = input.credentials + if (!options.headers) { + this.headers = new Headers(input.headers) + } + this.method = input.method + this.mode = input.mode + if (!body && input._bodyInit != null) { + body = input._bodyInit + input.bodyUsed = true + } + } else { + this.url = String(input) + } + + this.credentials = options.credentials || this.credentials || 'omit' + if (options.headers || !this.headers) { + this.headers = new Headers(options.headers) + } + this.method = normalizeMethod(options.method || this.method || 'GET') + this.mode = options.mode || this.mode || null + this.referrer = null + + if ((this.method === 'GET' || this.method === 'HEAD') && body) { + throw new TypeError('Body not allowed for GET or HEAD requests') + } + this._initBody(body) + } + + Request.prototype.clone = function() { + return new Request(this, { body: this._bodyInit }) + } + + function decode(body) { + var form = new FormData() + body.trim().split('&').forEach(function(bytes) { + if (bytes) { + var split = bytes.split('=') + var name = split.shift().replace(/\+/g, ' ') + var value = split.join('=').replace(/\+/g, ' ') + form.append(decodeURIComponent(name), decodeURIComponent(value)) + } + }) + return form + } + + function parseHeaders(rawHeaders) { + var headers = new Headers() + rawHeaders.split(/\r?\n/).forEach(function(line) { + var parts = line.split(':') + var key = parts.shift().trim() + if (key) { + var value = parts.join(':').trim() + headers.append(key, value) + } + }) + return headers + } + + Body.call(Request.prototype) + + function Response(bodyInit, options) { + if (!options) { + options = {} + } + + this.type = 'default' + this.status = 'status' in options ? options.status : 200 + this.ok = this.status >= 200 && this.status < 300 + this.statusText = 'statusText' in options ? options.statusText : 'OK' + this.headers = new Headers(options.headers) + this.url = options.url || '' + this._initBody(bodyInit) + } + + Body.call(Response.prototype) + + Response.prototype.clone = function() { + return new Response(this._bodyInit, { + status: this.status, + statusText: this.statusText, + headers: new Headers(this.headers), + url: this.url + }) + } + + Response.error = function() { + var response = new Response(null, {status: 0, statusText: ''}) + response.type = 'error' + return response + } + + var redirectStatuses = [301, 302, 303, 307, 308] + + Response.redirect = function(url, status) { + if (redirectStatuses.indexOf(status) === -1) { + throw new RangeError('Invalid status code') + } + + return new Response(null, {status: status, headers: {location: url}}) + } + + self.Headers = Headers + self.Request = Request + self.Response = Response + + self.fetch = function(input, init) { + return new Promise(function(resolve, reject) { + var request = new Request(input, init) + var xhr = new XMLHttpRequest() + + xhr.onload = function() { + var options = { + status: xhr.status, + statusText: xhr.statusText, + headers: parseHeaders(xhr.getAllResponseHeaders() || '') + } + options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL') + var body = 'response' in xhr ? xhr.response : xhr.responseText + resolve(new Response(body, options)) + } + + xhr.onerror = function() { + reject(new TypeError('Network request failed')) + } + + xhr.ontimeout = function() { + reject(new TypeError('Network request failed')) + } + + xhr.open(request.method, request.url, true) + + if (request.credentials === 'include') { + xhr.withCredentials = true + } + + if ('responseType' in xhr && support.blob) { + xhr.responseType = 'blob' + } + + request.headers.forEach(function(value, name) { + xhr.setRequestHeader(name, value) + }) + + xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit) + }) + } + self.fetch.polyfill = true +})(typeof self !== 'undefined' ? self : this); diff --git a/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/package.json b/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/package.json new file mode 100644 index 00000000..2447f2b8 --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/node_modules/whatwg-fetch/package.json @@ -0,0 +1,55 @@ +{ + "_from": "whatwg-fetch@>=0.10.0", + "_id": "whatwg-fetch@2.0.3", + "_inBundle": false, + "_integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ=", + "_location": "/react-dropzone/whatwg-fetch", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "whatwg-fetch@>=0.10.0", + "name": "whatwg-fetch", + "escapedName": "whatwg-fetch", + "rawSpec": ">=0.10.0", + "saveSpec": null, + "fetchSpec": ">=0.10.0" + }, + "_requiredBy": [ + "/react-dropzone/isomorphic-fetch" + ], + "_resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz", + "_shasum": "9c84ec2dcf68187ff00bc64e1274b442176e1c84", + "_spec": "whatwg-fetch@>=0.10.0", + "_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI\\node_modules\\react-dropzone\\node_modules\\isomorphic-fetch", + "bugs": { + "url": "https://github.com/github/fetch/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A window.fetch polyfill.", + "devDependencies": { + "chai": "1.10.0", + "jshint": "2.8.0", + "mocha": "2.1.0", + "mocha-phantomjs-core": "2.0.1", + "promise-polyfill": "6.0.2", + "url-search-params": "0.6.1" + }, + "files": [ + "LICENSE", + "fetch.js" + ], + "homepage": "https://github.com/github/fetch#readme", + "license": "MIT", + "main": "fetch.js", + "name": "whatwg-fetch", + "repository": { + "type": "git", + "url": "git+https://github.com/github/fetch.git" + }, + "scripts": { + "test": "make" + }, + "version": "2.0.3" +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/package.json b/goTorrentWebUI/node_modules/react-dropzone/package.json new file mode 100644 index 00000000..d10632cd --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/package.json @@ -0,0 +1,167 @@ +{ + "_from": "react-dropzone", + "_id": "react-dropzone@4.2.5", + "_inBundle": false, + "_integrity": "sha512-bZjPu7MwgyGiuDjlVS4MQeri3VI/wB59mfT5IoKug/WPw4DxFvrtsBagPkNVxfsMmu4fhrb1LY3s/6X1viDWHg==", + "_location": "/react-dropzone", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "react-dropzone", + "name": "react-dropzone", + "escapedName": "react-dropzone", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER" + ], + "_resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-4.2.5.tgz", + "_shasum": "61f4ea914ac8b0a8c7f39795c74c4718d03b13f1", + "_spec": "react-dropzone", + "_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI", + "author": { + "name": "Param Aggarwal" + }, + "bugs": { + "url": "https://github.com/react-dropzone/react-dropzone/issues" + }, + "bundleDependencies": false, + "config": { + "commitizen": { + "path": "@commitlint/prompt" + } + }, + "contributors": [ + { + "name": "Andrey Okonetchnikov", + "email": "andrey@okonet.ru", + "url": "http://okonet.ru" + }, + { + "name": "Mike Olson", + "email": "me@mwolson.org" + }, + { + "name": "Param Aggarwal" + }, + { + "name": "Tyler Waters", + "email": "tyler.waters@gmail.com" + } + ], + "dependencies": { + "attr-accept": "^1.0.3", + "prop-types": "^15.5.7" + }, + "deprecated": false, + "description": "Simple HTML5 drag-drop zone with React.js", + "devDependencies": { + "@commitlint/cli": "^3.2.0", + "@commitlint/config-angular": "^3.0.3", + "@commitlint/prompt": "^3.2.0", + "@commitlint/prompt-cli": "^3.2.0", + "babel-cli": "^6.9.0", + "babel-core": "^6.9.1", + "babel-eslint": "^7.1.1", + "babel-jest": "^21.0.0", + "babel-loader": "^7.1.2", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-preset-env": "^1.6.0", + "babel-preset-react": "^6.3.13", + "babel-preset-stage-1": "^6.24.1", + "babel-register": "^6.9.0", + "commitizen": "^2.9.6", + "cross-env": "^5.1.3", + "css-loader": "^0.28.7", + "enzyme": "^2.6.0", + "eslint": "^4.6.1", + "eslint-config-okonet": "^5.0.1", + "eslint-config-prettier": "^2.4.0", + "eslint-plugin-prettier": "^2.2.0", + "husky": "^0.14.3", + "imagemin-cli": "^3.0.0", + "imagemin-pngquant": "^5.0.0", + "jest": "^21.0.1", + "jest-enzyme": "^3.8.2", + "lint-staged": "^4.1.0", + "markdownlint-cli": "^0.3.1", + "prettier": "^1.6.1", + "react": "^15.4.1", + "react-dom": "^15.4.1", + "react-styleguidist": "^6.0.23", + "react-test-renderer": "^15.6.1", + "rimraf": "^2.5.2", + "semantic-release": "^7.0.2", + "sinon": "^3.2.1", + "size-limit": "^0.11.0", + "style-loader": "^0.18.2", + "webpack": "^3.5.5" + }, + "homepage": "https://github.com/react-dropzone/react-dropzone", + "jest": { + "setupTestFrameworkScriptFile": "/testSetup.js" + }, + "keywords": [ + "react-component", + "react", + "drag", + "drop", + "upload" + ], + "license": "MIT", + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ], + "*.{svg,png}": [ + "imagemin", + "git add" + ] + }, + "main": "dist/index.js", + "module": "dist/es/index.js", + "name": "react-dropzone", + "peerDependencies": { + "react": ">=0.14.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/react-dropzone/react-dropzone.git" + }, + "scripts": { + "build": "npm run clean && npm run build:umd && npm run build:es", + "build:es": "cross-env BABEL_ENV=es babel ./src --out-dir ./dist/es --ignore spec.js", + "build:umd": "cross-env NODE_ENV=production webpack", + "ci": "git-cz", + "clean": "rimraf ./dist", + "commitmsg": "commitlint -e", + "eslint:src": "eslint ./src ./examples ./*.js", + "imagemin": "imagemin --out-dir=logo --plugin=pngquant --plugin=svgo", + "logo": "cd logo && sketchtool export artboards logo.sketch", + "precommit": "lint-staged", + "prepublish": "npm run build && npm run test:umd && npm run test:es", + "semantic-release": "semantic-release pre && npm publish && semantic-release post", + "size": "size-limit", + "size:why": "size-limit --why", + "start": "styleguidist server", + "styleguide": "styleguidist build", + "test": "npm run eslint:src && jest --coverage && npm run size", + "test:es": "cross-env JEST_TARGET=../dist/es/index jest --coverage", + "test:umd": "cross-env JEST_TARGET=../dist/index jest --coverage" + }, + "size-limit": [ + { + "path": "dist/index.js", + "limit": "6 KB" + }, + { + "path": "dist/es/index.js", + "limit": "3 KB" + } + ], + "version": "4.2.5" +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/src/__snapshots__/index.spec.js.snap b/goTorrentWebUI/node_modules/react-dropzone/src/__snapshots__/index.spec.js.snap new file mode 100644 index 00000000..0fcec9da --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/src/__snapshots__/index.spec.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Dropzone basics should render children 1`] = `"

some content

"`; + +exports[`Dropzone document drop protection does not prevent stray drops when preventDropOnDocument is false 1`] = `"
"`; + +exports[`Dropzone document drop protection installs hooks to prevent stray drops from taking over the browser window 1`] = `"

Content

"`; diff --git a/goTorrentWebUI/node_modules/react-dropzone/src/index.js b/goTorrentWebUI/node_modules/react-dropzone/src/index.js new file mode 100644 index 00000000..a31f83bd --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/src/index.js @@ -0,0 +1,585 @@ +/* eslint prefer-template: 0 */ + +import React from 'react' +import PropTypes from 'prop-types' +import { + supportMultiple, + fileAccepted, + allFilesAccepted, + fileMatchSize, + onDocumentDragOver, + getDataTransferItems +} from './utils' +import styles from './utils/styles' + +class Dropzone extends React.Component { + constructor(props, context) { + super(props, context) + this.composeHandlers = this.composeHandlers.bind(this) + this.onClick = this.onClick.bind(this) + this.onDocumentDrop = this.onDocumentDrop.bind(this) + this.onDragEnter = this.onDragEnter.bind(this) + this.onDragLeave = this.onDragLeave.bind(this) + this.onDragOver = this.onDragOver.bind(this) + this.onDragStart = this.onDragStart.bind(this) + this.onDrop = this.onDrop.bind(this) + this.onFileDialogCancel = this.onFileDialogCancel.bind(this) + this.onInputElementClick = this.onInputElementClick.bind(this) + + this.setRef = this.setRef.bind(this) + this.setRefs = this.setRefs.bind(this) + + this.isFileDialogActive = false + + this.state = { + draggedFiles: [], + acceptedFiles: [], + rejectedFiles: [] + } + } + + componentDidMount() { + const { preventDropOnDocument } = this.props + this.dragTargets = [] + + if (preventDropOnDocument) { + document.addEventListener('dragover', onDocumentDragOver, false) + document.addEventListener('drop', this.onDocumentDrop, false) + } + this.fileInputEl.addEventListener('click', this.onInputElementClick, false) + // Tried implementing addEventListener, but didn't work out + document.body.onfocus = this.onFileDialogCancel + } + + componentWillUnmount() { + const { preventDropOnDocument } = this.props + if (preventDropOnDocument) { + document.removeEventListener('dragover', onDocumentDragOver) + document.removeEventListener('drop', this.onDocumentDrop) + } + if (this.fileInputEl != null) { + this.fileInputEl.removeEventListener('click', this.onInputElementClick, false) + } + // Can be replaced with removeEventListener, if addEventListener works + if (document != null) { + document.body.onfocus = null + } + } + + composeHandlers(handler) { + if (this.props.disabled) { + return null + } + + return handler + } + + onDocumentDrop(evt) { + if (this.node && this.node.contains(evt.target)) { + // if we intercepted an event for our instance, let it propagate down to the instance's onDrop handler + return + } + evt.preventDefault() + this.dragTargets = [] + } + + onDragStart(evt) { + if (this.props.onDragStart) { + this.props.onDragStart.call(this, evt) + } + } + + onDragEnter(evt) { + evt.preventDefault() + + // Count the dropzone and any children that are entered. + if (this.dragTargets.indexOf(evt.target) === -1) { + this.dragTargets.push(evt.target) + } + + this.setState({ + isDragActive: true, // Do not rely on files for the drag state. It doesn't work in Safari. + draggedFiles: getDataTransferItems(evt) + }) + + if (this.props.onDragEnter) { + this.props.onDragEnter.call(this, evt) + } + } + + onDragOver(evt) { + // eslint-disable-line class-methods-use-this + evt.preventDefault() + evt.stopPropagation() + try { + // The file dialog on Chrome allows users to drag files from the dialog onto + // the dropzone, causing the browser the crash when the file dialog is closed. + // A drop effect of 'none' prevents the file from being dropped + evt.dataTransfer.dropEffect = this.isFileDialogActive ? 'none' : 'copy' // eslint-disable-line no-param-reassign + } catch (err) { + // continue regardless of error + } + + if (this.props.onDragOver) { + this.props.onDragOver.call(this, evt) + } + return false + } + + onDragLeave(evt) { + evt.preventDefault() + + // Only deactivate once the dropzone and all children have been left. + this.dragTargets = this.dragTargets.filter(el => el !== evt.target && this.node.contains(el)) + if (this.dragTargets.length > 0) { + return + } + + // Clear dragging files state + this.setState({ + isDragActive: false, + draggedFiles: [] + }) + + if (this.props.onDragLeave) { + this.props.onDragLeave.call(this, evt) + } + } + + onDrop(evt) { + const { onDrop, onDropAccepted, onDropRejected, multiple, disablePreview, accept } = this.props + const fileList = getDataTransferItems(evt) + const acceptedFiles = [] + const rejectedFiles = [] + + // Stop default browser behavior + evt.preventDefault() + + // Reset the counter along with the drag on a drop. + this.dragTargets = [] + this.isFileDialogActive = false + + fileList.forEach(file => { + if (!disablePreview) { + try { + file.preview = window.URL.createObjectURL(file) // eslint-disable-line no-param-reassign + } catch (err) { + if (process.env.NODE_ENV !== 'production') { + console.error('Failed to generate preview for file', file, err) // eslint-disable-line no-console + } + } + } + + if ( + fileAccepted(file, accept) && + fileMatchSize(file, this.props.maxSize, this.props.minSize) + ) { + acceptedFiles.push(file) + } else { + rejectedFiles.push(file) + } + }) + + if (!multiple) { + // if not in multi mode add any extra accepted files to rejected. + // This will allow end users to easily ignore a multi file drop in "single" mode. + rejectedFiles.push(...acceptedFiles.splice(1)) + } + + if (onDrop) { + onDrop.call(this, acceptedFiles, rejectedFiles, evt) + } + + if (rejectedFiles.length > 0 && onDropRejected) { + onDropRejected.call(this, rejectedFiles, evt) + } + + if (acceptedFiles.length > 0 && onDropAccepted) { + onDropAccepted.call(this, acceptedFiles, evt) + } + + // Clear files value + this.draggedFiles = null + + // Reset drag state + this.setState({ + isDragActive: false, + draggedFiles: [], + acceptedFiles, + rejectedFiles + }) + } + + onClick(evt) { + const { onClick, disableClick } = this.props + if (!disableClick) { + evt.stopPropagation() + + if (onClick) { + onClick.call(this, evt) + } + + // in IE11/Edge the file-browser dialog is blocking, ensure this is behind setTimeout + // this is so react can handle state changes in the onClick prop above above + // see: https://github.com/react-dropzone/react-dropzone/issues/450 + setTimeout(this.open.bind(this), 0) + } + } + + onInputElementClick(evt) { + evt.stopPropagation() + if (this.props.inputProps && this.props.inputProps.onClick) { + this.props.inputProps.onClick() + } + } + + onFileDialogCancel() { + // timeout will not recognize context of this method + const { onFileDialogCancel } = this.props + const { fileInputEl } = this + let { isFileDialogActive } = this + // execute the timeout only if the onFileDialogCancel is defined and FileDialog + // is opened in the browser + if (onFileDialogCancel && isFileDialogActive) { + setTimeout(() => { + // Returns an object as FileList + const FileList = fileInputEl.files + if (!FileList.length) { + isFileDialogActive = false + onFileDialogCancel() + } + }, 300) + } + } + + setRef(ref) { + this.node = ref + } + + setRefs(ref) { + this.fileInputEl = ref + } + /** + * Open system file upload dialog. + * + * @public + */ + open() { + this.isFileDialogActive = true + this.fileInputEl.value = null + this.fileInputEl.click() + } + + renderChildren = (children, isDragActive, isDragAccept, isDragReject) => { + if (typeof children === 'function') { + return children({ + ...this.state, + isDragActive, + isDragAccept, + isDragReject + }) + } + return children + } + + render() { + const { + accept, + acceptClassName, + activeClassName, + children, + disabled, + disabledClassName, + inputProps, + multiple, + name, + rejectClassName, + ...rest + } = this.props + + let { + acceptStyle, + activeStyle, + className = '', + disabledStyle, + rejectStyle, + style, + ...props // eslint-disable-line prefer-const + } = rest + + const { isDragActive, draggedFiles } = this.state + const filesCount = draggedFiles.length + const isMultipleAllowed = multiple || filesCount <= 1 + const isDragAccept = filesCount > 0 && allFilesAccepted(draggedFiles, this.props.accept) + const isDragReject = filesCount > 0 && (!isDragAccept || !isMultipleAllowed) + const noStyles = + !className && !style && !activeStyle && !acceptStyle && !rejectStyle && !disabledStyle + + if (isDragActive && activeClassName) { + className += ' ' + activeClassName + } + if (isDragAccept && acceptClassName) { + className += ' ' + acceptClassName + } + if (isDragReject && rejectClassName) { + className += ' ' + rejectClassName + } + if (disabled && disabledClassName) { + className += ' ' + disabledClassName + } + + if (noStyles) { + style = styles.default + activeStyle = styles.active + acceptStyle = style.active + rejectStyle = styles.rejected + disabledStyle = styles.disabled + } + + let appliedStyle = { ...style } + if (activeStyle && isDragActive) { + appliedStyle = { + ...style, + ...activeStyle + } + } + if (acceptStyle && isDragAccept) { + appliedStyle = { + ...appliedStyle, + ...acceptStyle + } + } + if (rejectStyle && isDragReject) { + appliedStyle = { + ...appliedStyle, + ...rejectStyle + } + } + if (disabledStyle && disabled) { + appliedStyle = { + ...style, + ...disabledStyle + } + } + + const inputAttributes = { + accept, + disabled, + type: 'file', + style: { display: 'none' }, + multiple: supportMultiple && multiple, + ref: this.setRefs, + onChange: this.onDrop, + autoComplete: 'off' + } + + if (name && name.length) { + inputAttributes.name = name + } + + // Destructure custom props away from props used for the div element + const { + acceptedFiles, + preventDropOnDocument, + disablePreview, + disableClick, + onDropAccepted, + onDropRejected, + onFileDialogCancel, + maxSize, + minSize, + ...divProps + } = props + + return ( +
+ {this.renderChildren(children, isDragActive, isDragAccept, isDragReject)} + +
+ ) + } +} + +export default Dropzone + +Dropzone.propTypes = { + /** + * Allow specific types of files. See https://github.com/okonet/attr-accept for more information. + * Keep in mind that mime type determination is not reliable across platforms. CSV files, + * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under + * Windows. In some cases there might not be a mime type set at all. + * See: https://github.com/react-dropzone/react-dropzone/issues/276 + */ + accept: PropTypes.string, + + /** + * Contents of the dropzone + */ + children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), + + /** + * Disallow clicking on the dropzone container to open file dialog + */ + disableClick: PropTypes.bool, + + /** + * Enable/disable the dropzone entirely + */ + disabled: PropTypes.bool, + + /** + * Enable/disable preview generation + */ + disablePreview: PropTypes.bool, + + /** + * If false, allow dropped items to take over the current browser window + */ + preventDropOnDocument: PropTypes.bool, + + /** + * Pass additional attributes to the `` tag + */ + inputProps: PropTypes.object, + + /** + * Allow dropping multiple files + */ + multiple: PropTypes.bool, + + /** + * `name` attribute for the input tag + */ + name: PropTypes.string, + + /** + * Maximum file size + */ + maxSize: PropTypes.number, + + /** + * Minimum file size + */ + minSize: PropTypes.number, + + /** + * className + */ + className: PropTypes.string, + + /** + * className for active state + */ + activeClassName: PropTypes.string, + + /** + * className for accepted state + */ + acceptClassName: PropTypes.string, + + /** + * className for rejected state + */ + rejectClassName: PropTypes.string, + + /** + * className for disabled state + */ + disabledClassName: PropTypes.string, + + /** + * CSS styles to apply + */ + style: PropTypes.object, + + /** + * CSS styles to apply when drag is active + */ + activeStyle: PropTypes.object, + + /** + * CSS styles to apply when drop will be accepted + */ + acceptStyle: PropTypes.object, + + /** + * CSS styles to apply when drop will be rejected + */ + rejectStyle: PropTypes.object, + + /** + * CSS styles to apply when dropzone is disabled + */ + disabledStyle: PropTypes.object, + + /** + * onClick callback + * @param {Event} event + */ + onClick: PropTypes.func, + + /** + * onDrop callback + */ + onDrop: PropTypes.func, + + /** + * onDropAccepted callback + */ + onDropAccepted: PropTypes.func, + + /** + * onDropRejected callback + */ + onDropRejected: PropTypes.func, + + /** + * onDragStart callback + */ + onDragStart: PropTypes.func, + + /** + * onDragEnter callback + */ + onDragEnter: PropTypes.func, + + /** + * onDragOver callback + */ + onDragOver: PropTypes.func, + + /** + * onDragLeave callback + */ + onDragLeave: PropTypes.func, + + /** + * Provide a callback on clicking the cancel button of the file dialog + */ + onFileDialogCancel: PropTypes.func +} + +Dropzone.defaultProps = { + preventDropOnDocument: true, + disabled: false, + disablePreview: false, + disableClick: false, + multiple: true, + maxSize: Infinity, + minSize: 0 +} diff --git a/goTorrentWebUI/node_modules/react-dropzone/src/index.spec.js b/goTorrentWebUI/node_modules/react-dropzone/src/index.spec.js new file mode 100644 index 00000000..edea701b --- /dev/null +++ b/goTorrentWebUI/node_modules/react-dropzone/src/index.spec.js @@ -0,0 +1,1108 @@ +import React from 'react' +import { mount, render } from 'enzyme' +import { spy, stub } from 'sinon' +import { onDocumentDragOver } from './utils' + +const Dropzone = require(process.env.JEST_TARGET ? process.env.JEST_TARGET : './index') // eslint-disable-line import/no-dynamic-require +const DummyChildComponent = () => null + +let files +let images + +const rejectColor = 'red' +const acceptColor = 'green' + +const rejectStyle = { + color: rejectColor, + borderColor: 'black' +} + +const acceptStyle = { + color: acceptColor, + borderWidth: '5px' +} + +describe('Dropzone', () => { + beforeEach(() => { + files = [ + { + name: 'file1.pdf', + size: 1111, + type: 'application/pdf' + } + ] + + images = [ + { + name: 'cats.gif', + size: 1234, + type: 'image/gif' + }, + { + name: 'dogs.jpg', + size: 2345, + type: 'image/jpeg' + } + ] + }) + + describe('basics', () => { + it('should render children', () => { + const dropzone = mount( + +

some content

+
+ ) + expect(dropzone.html()).toMatchSnapshot() + }) + + it('should render an input HTML element', () => { + const dropzone = mount( + +

some content

+
+ ) + expect(dropzone.find('input').length).toEqual(1) + }) + + it('sets ref properly', () => { + const dropzone = mount() + expect(dropzone.instance().fileInputEl).not.toBeUndefined() + expect(dropzone.instance().fileInputEl.tagName).toEqual('INPUT') + }) + + it('renders dynamic props on the root element', () => { + const component = mount(