weauthjs
Version:
WeYouMe Protocol Javascript SDK Library
184 lines (146 loc) • 359 kB
HTML
<!doctype html>
<meta charset="UTF-8">
<title>Webpack Visualizer</title>
<style>html {
background-color: #f7eedf;
color: #333;
}
body {
font-family: sans-serif;
margin: 10px auto 0;
width: 750px;
padding: 0 10px;
}
a,
.destyledButton {
color: #347AB7;
}
p {
margin-top: 0.5em;
}
svg {
vertical-align: middle;
}
h1 {
font-family: "Oswald", "HelveticaNeue-CondensedBold", "Arial Narrow", sans-serif;
font-weight: bold;
font-size: 70px;
text-transform: uppercase;
text-align: center;
}
hr {
border: 0 none;
border-top: 1px solid #aaa;
}
code {
font-size: 16px;
}
.breadcrumbs {
height: 1em;
margin: 1em 0;
}
.uploadArea {
position: relative;
margin: 0 auto;
min-height: 350px;
}
.uploadArea--needsUpload {
border: 2px dashed #AC9062;
border-radius: 10px;
cursor: pointer;
}
.uploadArea--dragging {
border-style: solid;
background-color: #E6D4B6;
}
.uploadArea-uploadMessage {
display: none;
font-size: 1.9em;
text-align: center;
margin-top: 100px;
pointer-events: none;
}
.uploadArea--needsUpload .uploadArea-uploadMessage {
display: block;
}
.uploadArea-uploadMessage small {
font-size: 0.5em;
}
.chart {
position: relative;
margin: 0 auto;
min-height: 350px;
}
.chart--large {
width: 950px;
margin-left: -100px;
}
.hiddenFileInput {
width: 0px;
height: 0px;
visibility: hidden;
}
.chart path {
stroke: #fff;
}
.details {
position: absolute;
top: 325px;
left: 50%;
width: 170px;
margin-left: -85px;
font-size: 14px;
text-align: center;
color: #666;
z-index: -1;
overflow: hidden;
text-overflow: ellipsis;
}
.chart--large .details {
top: 425px;
}
.details-size {
font-size: 0.9em;
margin-top: 1em;
}
.details-name {
font-weight: bold;
}
.details-subText {
min-height: 1.2em;
}
.details-percentage {
margin: 0.4em 0 0em;
font-size: 2.4em;
line-height: 1em;
}
.errorMessage {
margin-top: 2em;
padding: 0.8em 1em;
border: 1px solid #ab2222;
color: #ab2222;
}
footer {
margin-top: 4em;
}
footer h2 {
margin: 1.5em 0 0.5em;
font-size: 1.3em;
}
.destyledButton {
background: none;
border: 0 none;
cursor: pointer;
font-size: inherit;
padding: 0;
text-decoration: underline;
}
@font-face {
font-family: 'Oswald';
src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABJsABMAAAAALIAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABqAAAABwAAAAccclaRkdERUYAAAHEAAAAIgAAACYAJwBHR1BPUwAAAegAAAJTAAAVCp1yuQFHU1VCAAAEPAAAADIAAABAI5wkn09TLzIAAARwAAAAWAAAAGDCVrbVY21hcAAABMgAAACkAAABsoWZZThjdnQgAAAFbAAAAD4AAAA+GI4SvGZwZ20AAAWsAAABsQAAAmVTtC+nZ2FzcAAAB2AAAAAIAAAACAAAABBnbHlmAAAHaAAABp0AAAiw/4mcQWhlYWQAAA4IAAAAMQAAADYI/8NHaGhlYQAADjwAAAAeAAAAJA4yA65obXR4AAAOXAAAAGsAAACEaIUFlWxvY2EAAA7IAAAALAAAAEQvrDHqbWF4cAAADvQAAAAgAAAAIAE8AKduYW1lAAAPFAAAAjQAAAU6XvmydXBvc3QAABFIAAAAiAAAAOvdGs0GcHJlcAAAEdAAAACUAAAAy4m/FMN3ZWJmAAASZAAAAAYAAAAGC2lWEAAAAAEAAAAA0aD+SAAAAADN8qAVAAAAANI1u+h42mNgZGBg4AFiMQY5BiYGRiBUAGIWoAgTEDNCMAAKqgBvAAB42mNgZGBg4GJwYghgYHZx8wlhEEmuLMphUMhJLMlj0GFgAcoy/P/PAFKFi82YnVqUx8ABYoExCwMTmOZgYBKZAVIpEiFSATTLmmEAwf9/IAwmrwHxif+v/x+nirkP/z9B4v0B2/AHwh4Qf77GFPn/9f8rksx4Q1iEhj74RKw4csiTbdtmdNP/70eS/f7/GXLs4jHnK+3DBeRGEAlOY3/JD1fiQxgU86C4h5K3Qbnn/93/m8hy/08UrtT/6/8vM0ghxEH0/89g1koweQ/DhAdE2/X3fyNyGIFY/9N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XjzADa4LHZQp2RxDXN4o9jFHbxT7KGBD4ov4QSfFV9Gw1lUfAUbzrLiOdx0SsXzxB8VX6XPF8XX0HZ+Ka6jXbut+LrzorapeAH33U+Kv6Lhnir+hrb7U/EpFrwbir+j7mmeHy5uect4ihQZJsgRYx9DlPB5rxB3ea6gjQ5Xi3uX8i79fN4/oveYcWNKjzHADkYosMV1TJxQ84RWc3YRMP4hPSPaSqJZL3/q93ftWbTPyBJ7tB/yTMkyZkbL9IgeAR6gJ4xbjPOxJijn3qPV4Od6GyudcLfomPsSrUsivZU9rLBpncMxpuRTMtxyngPecMQzxwF1Kdme36mL6v/fjEJqDNNgOpEJM6fMau6QMfeENuMVsNcHF/b/N9MumsRHFX47U352otZmrLvMk1B+xGymu0ay9UbM2SSjmDWGjHtFr0IiTbyZ0DPJbhhsSvaIaHaGAeXX8paKive2TK8Uv1yirEfCM6Q8ljqmwiHxQGr6wiKS6JfoS6VMfGcz9ysZmtM5FdTbTnTIyqyhvPgM67jHz8zNdDSjrqC10D6k1O7TvsUafb7eiP3am1bryN+zzVuUwieU05dXYuawTusq9x4nczadntzH/mmJcDAo5yoqHXpPTUy96U/yB4cAybh42m3IuQrCUABE0ZlEE/ftDwQVC9GX5cVEsAhKPsJaUEHExsKPF1zelN7mwIWHX68jDvjXGKBHHz4mmGKGORZYYoUEFhlyFNhgyxrrDBiywSZbbLPDLnvsc8AhR8Hp+ryfo/Bxuxhj9s7SfI0/Q0YylolMpZWZXMtcFrJ0xpXTOm21ewOsDSmueNrbwfi/dQNjL4P3Bo6AiI2MjH2RG93YtCMUNwhEem8QCQIyGiJlN7Bpx0QwbGBWcN3ArO2ygV3BdRNzOJM2mMMG5LCbQTmsQA6bGpTDAuSwykI5HCA9K6EcTiCHIx3K4QJyOE0hHMYN3FA7eBRcdzFw1/9nYNLeyOxWBhThBarj0YVz+YBcXkUYN3KDiDYA+l459gABVhALaAAA) format('woff');
font-weight: bold;
font-style: normal;
}
</style>
<div id="App"></div>
<script>window.stats = {"errors":[],"warnings":[],"version":"3.12.0","hash":"463d0582a9e3a85413bc","publicPath":"","assetsByChunkName":{"path":"path.min.js"},"assets":[{"name":"path.min.js","size":63472,"chunks":[0],"chunkNames":["path"]}],"filteredAssets":0,"entrypoints":{"path":{"chunks":[0],"assets":["path.min.js"]}},"chunks":[{"id":0,"rendered":true,"initial":true,"entry":true,"extraAsync":false,"size":22240,"names":["path"],"files":["path.min.js"],"hash":"6e9bce224806eef91591","parents":[],"modules":[{"id":0,"identifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","name":"./src/browser.js","index":0,"index2":3,"size":246,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":null,"issuerId":null,"issuerName":null,"failed":false,"errors":0,"warnings":0,"reasons":[],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":0,"source":"'use strict';\n\n/* eslint-env browser */\n\nvar weauthjs = require('./index.js');\n\nif (typeof window !== 'undefined') {\n window.weauthjs = weauthjs;\n}\n\nif (typeof global !== 'undefined') {\n global.weauthjs = weauthjs;\n}\n\nmodule.exports = weauthjs;"},{"id":1,"identifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/webpack/buildin/global.js","name":"(webpack)/buildin/global.js","index":1,"index2":0,"size":509,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","issuerId":0,"issuerName":"./src/browser.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":0,"moduleIdentifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","module":"./src/browser.js","moduleName":"./src/browser.js","type":"cjs require","userRequest":"global","loc":"1:0-54"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n"},{"id":2,"identifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/index.js","name":"./src/index.js","index":2,"index2":2,"size":8246,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","issuerId":0,"issuerName":"./src/browser.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":0,"moduleIdentifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","module":"./src/browser.js","moduleName":"./src/browser.js","type":"cjs require","userRequest":"./index.js","loc":"5:15-36"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar fetch = require('cross-fetch');\n\nvar SDKError = function (_Error) {\n _inherits(SDKError, _Error);\n\n function SDKError(message, obj) {\n _classCallCheck(this, SDKError);\n\n var _this = _possibleConstructorReturn(this, (SDKError.__proto__ || Object.getPrototypeOf(SDKError)).call(this, message));\n\n _this.name = 'SDKError';\n _this.error = obj.error;\n _this.error_description = obj.error_description;\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(_this, _this.constructor);\n } else {\n _this.stack = new Error(message).stack;\n }\n return _this;\n }\n\n return SDKError;\n}(Error);\n\nfunction weauthjs() {\n this.options = {\n baseURL: 'https://auth.WeYouMe.io',\n app: '',\n callbackURL: '',\n scope: []\n };\n}\n\nweauthjs.prototype.setBaseURL = function setBaseURL(baseURL) {\n this.options.baseURL = baseURL;\n};\nweauthjs.prototype.setApp = function setApp(app) {\n this.options.app = app;\n};\nweauthjs.prototype.setCallbackURL = function setCallbackURL(callbackURL) {\n this.options.callbackURL = callbackURL;\n};\nweauthjs.prototype.setAccessToken = function setAccessToken(accessToken) {\n this.options.accessToken = accessToken;\n};\nweauthjs.prototype.removeAccessToken = function removeAccessToken() {\n this.options.accessToken = undefined;\n};\nweauthjs.prototype.setScope = function setScope(scope) {\n this.options.scope = scope;\n};\n\nweauthjs.prototype.getLoginURL = function getLoginURL(state) {\n var loginURL = this.options.baseURL + '/oauth2/authorize?client_id=' + this.options.app + '&redirect_uri=' + encodeURIComponent(this.options.callbackURL);\n loginURL += this.options.scope ? '&scope=' + this.options.scope.join(',') : '';\n loginURL += state ? '&state=' + encodeURIComponent(state) : '';\n return loginURL;\n};\n\nweauthjs.prototype.send = function send(route, method, body, cb) {\n var url = this.options.baseURL + '/api/' + route;\n var promise = fetch(url, {\n method: method,\n headers: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': 'application/json',\n Authorization: this.options.accessToken\n },\n body: JSON.stringify(body)\n }).then(function (res) {\n var json = res.json();\n // If the status is something other than 200 we need\n // to reject the result since the request is not considered as a fail\n if (res.status !== 200) {\n return json.then(function (result) {\n return Promise.reject(new SDKError('weauthjs error', result));\n });\n }\n return json;\n }).then(function (res) {\n if (res.error) {\n return Promise.reject(new SDKError('weauthjs error', res));\n }\n return res;\n });\n\n if (!cb) return promise;\n\n return promise.then(function (res) {\n return cb(null, res);\n }).catch(function (err) {\n return cb(err, null);\n });\n};\n\nweauthjs.prototype.broadcast = function broadcast(operations, cb) {\n return this.send('broadcast', 'POST', { operations: operations }, cb);\n};\n\nweauthjs.prototype.me = function me(cb) {\n return this.send('me', 'POST', {}, cb);\n};\n\nweauthjs.prototype.vote = function vote(voter, author, permlink, weight, cb) {\n var params = {\n voter: voter,\n author: author,\n permlink: permlink,\n weight: weight\n };\n return this.broadcast([['vote', params]], cb);\n};\n\nweauthjs.prototype.comment = function comment(parentAuthor, parentPermlink, author, permlink, title, body, json, cb) {\n var params = {\n parent_author: parentAuthor,\n parent_permlink: parentPermlink,\n author: author,\n permlink: permlink,\n title: title,\n body: body,\n json: JSON.stringify(json)\n };\n return this.broadcast([['comment', params]], cb);\n};\n\nweauthjs.prototype.reblog = function reblog(account, author, permlink, cb) {\n var params = {\n required_auths: [],\n required_posting_auths: [account],\n id: 'follow',\n json: JSON.stringify(['reblog', {\n account: account,\n author: author,\n permlink: permlink\n }])\n };\n return this.broadcast([['customJson', params]], cb);\n};\n\nweauthjs.prototype.follow = function follow(follower, following, cb) {\n var params = {\n required_auths: [],\n required_posting_auths: [follower],\n id: 'follow',\n json: JSON.stringify(['follow', { follower: follower, following: following, what: ['blog'] }])\n };\n return this.broadcast([['customJson', params]], cb);\n};\n\nweauthjs.prototype.unfollow = function unfollow(unfollower, unfollowing, cb) {\n var params = {\n required_auths: [],\n required_posting_auths: [unfollower],\n id: 'follow',\n json: JSON.stringify(['follow', { follower: unfollower, following: unfollowing, what: [] }])\n };\n return this.broadcast([['customJson', params]], cb);\n};\n\nweauthjs.prototype.ignore = function ignore(follower, following, cb) {\n var params = {\n required_auths: [],\n required_posting_auths: [follower],\n id: 'follow',\n json: JSON.stringify(['follow', { follower: follower, following: following, what: ['ignore'] }])\n };\n return this.broadcast([['customJson', params]], cb);\n};\n\nweauthjs.prototype.claimRewardBalance = function claimRewardBalance(account, TMEreward, TSDreward, SCOREreward, cb) {\n var params = {\n account: account,\n TMEreward: TMEreward,\n TSDreward: TSDreward,\n SCOREreward: SCOREreward\n };\n return this.broadcast([['claimRewardBalance', params]], cb);\n};\n\nweauthjs.prototype.revokeToken = function revokeToken(cb) {\n var _this2 = this;\n\n return this.send('oauth2/token/revoke', 'POST', { token: this.options.accessToken }, cb).then(function () {\n return _this2.removeAccessToken();\n });\n};\n\nweauthjs.prototype.updateUserMetadata = function updateUserMetadata() {\n var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var cb = arguments[1];\n\n return this.send('me', 'PUT', { user_metadata: metadata }, cb);\n};\n\nweauthjs.prototype.sign = function sign(name, params, redirectUri) {\n if (typeof name !== 'string' || (typeof params === 'undefined' ? 'undefined' : _typeof(params)) !== 'object') {\n return new SDKError('weauthjs error', {\n error: 'invalid_request',\n error_description: 'Request has an invalid format'\n });\n }\n var url = this.options.baseURL + '/sign/' + name + '?';\n url += Object.keys(params).map(function (key) {\n return key + '=' + encodeURIComponent(params[key]);\n }).join('&');\n url += redirectUri ? '&redirect_uri=' + encodeURIComponent(redirectUri) : '';\n return url;\n};\n\nexports.Initialize = function Initialize(config) {\n var instance = new weauthjs();\n\n if (!config) {\n throw new Error('You have to provide config');\n }\n\n if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) !== 'object') {\n throw new Error('Config must be an object');\n }\n\n if (config.baseURL) instance.setBaseURL(config.baseURL);\n if (config.app) instance.setApp(config.app);\n if (config.callbackURL) instance.setCallbackURL(config.callbackURL);\n if (config.accessToken) instance.setAccessToken(config.accessToken);\n if (config.scope) instance.setScope(config.scope);\n\n return instance;\n};"},{"id":3,"identifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/cross-fetch/dist/browser.js","name":"./node_modules/cross-fetch/dist/browser.js","index":3,"index2":1,"size":13239,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/index.js","issuerId":2,"issuerName":"./src/index.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":2,"moduleIdentifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/index.js","module":"./src/index.js","moduleName":"./src/index.js","type":"cjs require","userRequest":"cross-fetch","loc":"11:12-34"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"var self = {};\n(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isDataView = function(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n };\n\n var isArrayBufferView = ArrayBuffer.isView || function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue+','+value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) { items.push(name); });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) { items.push(value); });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) { items.push([name, value]); });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'omit';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, { body: this._bodyInit })\n };\n\n function decode(body) {\n var form = new FormData();\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n rawHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = 'status' in options ? options.status : 200;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n var xhr = new XMLHttpRequest();\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n };\n self.fetch.polyfill = true;\n})(typeof self !== 'undefined' ? self : this);\n\n/*\n * Rollup wraps up the whatwg-fetch code on ponyfill mode in\n * order to prevent it from adding fetch to the global object.\n */\n\n var fetch = self.fetch;\n\n fetch.fetch = fetch;\n fetch.Response = self.Response;\n fetch.Headers = self.Headers;\n fetch.Request = self.Request;\n\n // fetch now can be imported as the default object\n module.exports = fetch;\n \n"}],"filteredModules":0,"origins":[{"moduleId":0,"module":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","moduleIdentifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","moduleName":"./src/browser.js","loc":"","name":"path","reasons":[]}]}],"modules":[{"id":0,"identifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","name":"./src/browser.js","index":0,"index2":3,"size":246,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":null,"issuerId":null,"issuerName":null,"failed":false,"errors":0,"warnings":0,"reasons":[],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":0,"source":"'use strict';\n\n/* eslint-env browser */\n\nvar weauthjs = require('./index.js');\n\nif (typeof window !== 'undefined') {\n window.weauthjs = weauthjs;\n}\n\nif (typeof global !== 'undefined') {\n global.weauthjs = weauthjs;\n}\n\nmodule.exports = weauthjs;"},{"id":1,"identifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/webpack/buildin/global.js","name":"(webpack)/buildin/global.js","index":1,"index2":0,"size":509,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","issuerId":0,"issuerName":"./src/browser.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":0,"moduleIdentifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","module":"./src/browser.js","moduleName":"./src/browser.js","type":"cjs require","userRequest":"global","loc":"1:0-54"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n"},{"id":2,"identifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/index.js","name":"./src/index.js","index":2,"index2":2,"size":8246,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","issuerId":0,"issuerName":"./src/browser.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":0,"moduleIdentifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/browser.js","module":"./src/browser.js","moduleName":"./src/browser.js","type":"cjs require","userRequest":"./index.js","loc":"5:15-36"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar fetch = require('cross-fetch');\n\nvar SDKError = function (_Error) {\n _inherits(SDKError, _Error);\n\n function SDKError(message, obj) {\n _classCallCheck(this, SDKError);\n\n var _this = _possibleConstructorReturn(this, (SDKError.__proto__ || Object.getPrototypeOf(SDKError)).call(this, message));\n\n _this.name = 'SDKError';\n _this.error = obj.error;\n _this.error_description = obj.error_description;\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(_this, _this.constructor);\n } else {\n _this.stack = new Error(message).stack;\n }\n return _this;\n }\n\n return SDKError;\n}(Error);\n\nfunction weauthjs() {\n this.options = {\n baseURL: 'https://auth.WeYouMe.io',\n app: '',\n callbackURL: '',\n scope: []\n };\n}\n\nweauthjs.prototype.setBaseURL = function setBaseURL(baseURL) {\n this.options.baseURL = baseURL;\n};\nweauthjs.prototype.setApp = function setApp(app) {\n this.options.app = app;\n};\nweauthjs.prototype.setCallbackURL = function setCallbackURL(callbackURL) {\n this.options.callbackURL = callbackURL;\n};\nweauthjs.prototype.setAccessToken = function setAccessToken(accessToken) {\n this.options.accessToken = accessToken;\n};\nweauthjs.prototype.removeAccessToken = function removeAccessToken() {\n this.options.accessToken = undefined;\n};\nweauthjs.prototype.setScope = function setScope(scope) {\n this.options.scope = scope;\n};\n\nweauthjs.prototype.getLoginURL = function getLoginURL(state) {\n var loginURL = this.options.baseURL + '/oauth2/authorize?client_id=' + this.options.app + '&redirect_uri=' + encodeURIComponent(this.options.callbackURL);\n loginURL += this.options.scope ? '&scope=' + this.options.scope.join(',') : '';\n loginURL += state ? '&state=' + encodeURIComponent(state) : '';\n return loginURL;\n};\n\nweauthjs.prototype.send = function send(route, method, body, cb) {\n var url = this.options.baseURL + '/api/' + route;\n var promise = fetch(url, {\n method: method,\n headers: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': 'application/json',\n Authorization: this.options.accessToken\n },\n body: JSON.stringify(body)\n }).then(function (res) {\n var json = res.json();\n // If the status is something other than 200 we need\n // to reject the result since the request is not considered as a fail\n if (res.status !== 200) {\n return json.then(function (result) {\n return Promise.reject(new SDKError('weauthjs error', result));\n });\n }\n return json;\n }).then(function (res) {\n if (res.error) {\n return Promise.reject(new SDKError('weauthjs error', res));\n }\n return res;\n });\n\n if (!cb) return promise;\n\n return promise.then(function (res) {\n return cb(null, res);\n }).catch(function (err) {\n return cb(err, null);\n });\n};\n\nweauthjs.prototype.broadcast = function broadcast(operations, cb) {\n return this.send('broadcast', 'POST', { operations: operations }, cb);\n};\n\nweauthjs.prototype.me = function me(cb) {\n return this.send('me', 'POST', {}, cb);\n};\n\nweauthjs.prototype.vote = function vote(voter, author, permlink, weight, cb) {\n var params = {\n voter: voter,\n author: author,\n permlink: permlink,\n weight: weight\n };\n return this.broadcast([['vote', params]], cb);\n};\n\nweauthjs.prototype.comment = function comment(parentAuthor, parentPermlink, author, permlink, title, body, json, cb) {\n var params = {\n parent_author: parentAuthor,\n parent_permlink: parentPermlink,\n author: author,\n permlink: permlink,\n title: title,\n body: body,\n json: JSON.stringify(json)\n };\n return this.broadcast([['comment', params]], cb);\n};\n\nweauthjs.prototype.reblog = function reblog(account, author, permlink, cb) {\n var params = {\n required_auths: [],\n required_posting_auths: [account],\n id: 'follow',\n json: JSON.stringify(['reblog', {\n account: account,\n author: author,\n permlink: permlink\n }])\n };\n return this.broadcast([['customJson', params]], cb);\n};\n\nweauthjs.prototype.follow = function follow(follower, following, cb) {\n var params = {\n required_auths: [],\n required_posting_auths: [follower],\n id: 'follow',\n json: JSON.stringify(['follow', { follower: follower, following: following, what: ['blog'] }])\n };\n return this.broadcast([['customJson', params]], cb);\n};\n\nweauthjs.prototype.unfollow = function unfollow(unfollower, unfollowing, cb) {\n var params = {\n required_auths: [],\n required_posting_auths: [unfollower],\n id: 'follow',\n json: JSON.stringify(['follow', { follower: unfollower, following: unfollowing, what: [] }])\n };\n return this.broadcast([['customJson', params]], cb);\n};\n\nweauthjs.prototype.ignore = function ignore(follower, following, cb) {\n var params = {\n required_auths: [],\n required_posting_auths: [follower],\n id: 'follow',\n json: JSON.stringify(['follow', { follower: follower, following: following, what: ['ignore'] }])\n };\n return this.broadcast([['customJson', params]], cb);\n};\n\nweauthjs.prototype.claimRewardBalance = function claimRewardBalance(account, TMEreward, TSDreward, SCOREreward, cb) {\n var params = {\n account: account,\n TMEreward: TMEreward,\n TSDreward: TSDreward,\n SCOREreward: SCOREreward\n };\n return this.broadcast([['claimRewardBalance', params]], cb);\n};\n\nweauthjs.prototype.revokeToken = function revokeToken(cb) {\n var _this2 = this;\n\n return this.send('oauth2/token/revoke', 'POST', { token: this.options.accessToken }, cb).then(function () {\n return _this2.removeAccessToken();\n });\n};\n\nweauthjs.prototype.updateUserMetadata = function updateUserMetadata() {\n var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var cb = arguments[1];\n\n return this.send('me', 'PUT', { user_metadata: metadata }, cb);\n};\n\nweauthjs.prototype.sign = function sign(name, params, redirectUri) {\n if (typeof name !== 'string' || (typeof params === 'undefined' ? 'undefined' : _typeof(params)) !== 'object') {\n return new SDKError('weauthjs error', {\n error: 'invalid_request',\n error_description: 'Request has an invalid format'\n });\n }\n var url = this.options.baseURL + '/sign/' + name + '?';\n url += Object.keys(params).map(function (key) {\n return key + '=' + encodeURIComponent(params[key]);\n }).join('&');\n url += redirectUri ? '&redirect_uri=' + encodeURIComponent(redirectUri) : '';\n return url;\n};\n\nexports.Initialize = function Initialize(config) {\n var instance = new weauthjs();\n\n if (!config) {\n throw new Error('You have to provide config');\n }\n\n if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) !== 'object') {\n throw new Error('Config must be an object');\n }\n\n if (config.baseURL) instance.setBaseURL(config.baseURL);\n if (config.app) instance.setApp(config.app);\n if (config.callbackURL) instance.setCallbackURL(config.callbackURL);\n if (config.accessToken) instance.setAccessToken(config.accessToken);\n if (config.scope) instance.setScope(config.scope);\n\n return instance;\n};"},{"id":3,"identifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/cross-fetch/dist/browser.js","name":"./node_modules/cross-fetch/dist/browser.js","index":3,"index2":1,"size":13239,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/index.js","issuerId":2,"issuerName":"./src/index.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":2,"moduleIdentifier":"/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/node_modules/babel-loader/lib/index.js!/Users/lopu/Dropbox/git/weyoume/weauthjs/dev-weauthjs/src/index.js","module":"./src/index.js","moduleName":"./src/index.js","type":"cjs require","userRequest":"cross-fetch","loc":"11:12-34"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"var self = {};\n(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Arra