From 728e19c03b2502d848c07772202bf4e6d2414128 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 27 Jul 2020 09:26:58 -0400 Subject: [PATCH] v1.1.0 --- CHANGELOG.md | 72 +++++++++++-- osmauth.js | 274 +++++++++++++++++++++++++++++-------------------- osmauth.min.js | 2 +- package.json | 7 +- 4 files changed, 229 insertions(+), 126 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a80bea5..9d41b22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,64 +1,118 @@ -:warning: = Breaking change +# What's New + +**osm-auth** is an open source project. You can submit bug reports, help out, +or learn more by visiting our project page on GitHub: :octocat: https://github.com/osmlab/osm-auth + +Please star our project on GitHub to show your support! :star: + +_Breaking changes, which may affect downstream projects, are marked with a_ :warning: + + + +## 1.1.0 +##### 2020-Jul-27 +* ([#67]) Improve interaction with popup window +* Add function `bringPopupWindowToFront()` + +[#67]: https://github.com/osmlab/osm-auth/issues/67 + ## 1.0.2 ##### 2017-Jun-25 -* Use HTTPS protocol by default for openstreetmap.org (#20, thanks @kewang!) +* ([#20]) Use HTTPS protocol by default for openstreetmap.org + +[#20]: https://github.com/osmlab/osm-auth/issues/20 + ## 1.0.1 ##### 2016-Oct-24 -* Bugfix: Properly sign requests that include a querystring (#17) +* ([#17]) Bugfix: Properly sign requests that include a querystring + +[#17]: https://github.com/osmlab/osm-auth/issues/17 + ## 1.0.0 ##### 2016-Oct-23 * Upgrade all dependencies -* xhr should return an XMLHttpRequest (#16) +* ([#16]) xhr should return an XMLHttpRequest + +[#16]: https://github.com/osmlab/osm-auth/issues/16 + ## 0.2.9 ##### 2016-Aug-01 * Update ohauth dependency + ## 0.2.8 ##### 2015-Apr-01 * Update xtend to fix unpublished object-keys + ## 0.2.7 ##### 2014-Nov-26 * Add prefix option for non-http://openstreetmap.org urls + ## 0.2.6 ##### 2014-Aug-20 -* Strip querystring as well (#6) +* ([#6]) Strip querystring as well * Reverse key and secret order to reflect osm.org ordering * Update ohauth dependency +[#6]: https://github.com/osmlab/osm-auth/issues/6 + + ## 0.2.5 ##### 2013-Nov-21 -* Fix non-form-urlencoded POST parameters case (#11) +* ([#11]) Fix non-form-urlencoded POST parameters case + +[#11]: https://github.com/osmlab/osm-auth/issues/11 + ## 0.2.4 ##### 2013-Nov-21 -* Better failure mode if localStorage is paranoid/full (#10) +* ([#10]) Better failure mode if localStorage is paranoid/full + +[#10]: https://github.com/osmlab/osm-auth/issues/10 + ## 0.2.3 ##### 2013-Jun-01 * Support querystring args + ## 0.2.2 ##### 2013-May-31 * Fix behavior with hash with nothing after it * Update store dependency + ## 0.2.1 ##### 2013-May-08 * Update ohauth dependency + ## 0.2.0 ##### 2013-Apr-17 -* :warning: Don't use a nested object for keys (#8) +* ([#8]) :warning: Don't use a nested object for keys + +[#8]: https://github.com/osmlab/osm-auth/issues/8 + ## 0.1.1 ##### 2013-Apr-17 -* Update ohauth dependency (#7) +* ([#7]) Update ohauth dependency + +[#7]: https://github.com/osmlab/osm-auth/issues/7 + ## 0.1.0 ##### 2013-Mar-28 diff --git a/osmauth.js b/osmauth.js index ffa8ddb..93c4883 100644 --- a/osmauth.js +++ b/osmauth.js @@ -53,6 +53,14 @@ module.exports = function(o) { return x.join('='); }).join(','), popup = window.open('about:blank', 'oauth_window', settings); + + oauth.popupWindow = popup; + + if (!popup) { + var error = new Error('Popup was blocked'); + error.status = 'popup-blocked'; + throw error; + } } // Request a request token. When this is complete, the popup @@ -117,6 +125,21 @@ module.exports = function(o) { } }; + oauth.bringPopupWindowToFront = function() { + var brougtPopupToFront = false; + try { + // This may cause a cross-origin error: + // `DOMException: Blocked a frame with origin "..." from accessing a cross-origin frame.` + if (oauth.popupWindow && !oauth.popupWindow.closed) { + oauth.popupWindow.focus(); + brougtPopupToFront = true; + } + } catch (err) { + // Bringing popup window to front failed (probably because of the cross-origin error mentioned above) + } + return brougtPopupToFront; + }; + oauth.bootstrapToken = function(oauth_token, callback) { // ## Getting an request token // At this point we have an `oauth_token`, brought in from a function @@ -548,7 +571,7 @@ module.exports = function(o) { * @property {String} version * @readonly */ - VERSION: '1.0.5', + VERSION: '1.0.6', /** * @member Hashes * @class Base64 @@ -715,7 +738,7 @@ module.exports = function(o) { * See {@link Hashes.MD5#method-setUpperCase} and {@link Hashes.SHA1#method-setUpperCase} */ var hexcase = (options && typeof options.uppercase === 'boolean') ? options.uppercase : false, // hexadecimal output case format. false - lowercase; true - uppercase - b64pad = (options && typeof options.pad === 'string') ? options.pda : '=', // base-64 pad character. Defaults to '=' for strict RFC compliance + b64pad = (options && typeof options.pad === 'string') ? options.pad : '=', // base-64 pad character. Defaults to '=' for strict RFC compliance utf8 = (options && typeof options.utf8 === 'boolean') ? options.utf8 : true; // enable/disable utf8 encoding // privileged (public) methods @@ -952,7 +975,7 @@ module.exports = function(o) { * See {@link Hashes.MD5#method-setUpperCase} and {@link Hashes.SHA1#method-setUpperCase} */ var hexcase = (options && typeof options.uppercase === 'boolean') ? options.uppercase : false, // hexadecimal output case format. false - lowercase; true - uppercase - b64pad = (options && typeof options.pad === 'string') ? options.pda : '=', // base-64 pad character. Defaults to '=' for strict RFC compliance + b64pad = (options && typeof options.pad === 'string') ? options.pad : '=', // base-64 pad character. Defaults to '=' for strict RFC compliance utf8 = (options && typeof options.utf8 === 'boolean') ? options.utf8 : true; // enable/disable utf8 encoding // public methods @@ -1071,7 +1094,7 @@ module.exports = function(o) { x[((len + 64 >> 9) << 4) + 15] = len; for (i = 0; i < x.length; i += 16) { - olda = a, + olda = a; oldb = b; oldc = c; oldd = d; @@ -1146,7 +1169,7 @@ module.exports = function(o) { * @see this.setPad() method */ var hexcase = (options && typeof options.uppercase === 'boolean') ? options.uppercase : false, // hexadecimal output case format. false - lowercase; true - uppercase */ - b64pad = (options && typeof options.pad === 'string') ? options.pda : '=', + b64pad = (options && typeof options.pad === 'string') ? options.pad : '=', /* base-64 pad character. Default '=' for strict RFC compliance */ utf8 = (options && typeof options.utf8 === 'boolean') ? options.utf8 : true, /* enable/disable utf8 encoding */ @@ -1390,7 +1413,7 @@ module.exports = function(o) { */ var hexcase = (options && typeof options.uppercase === 'boolean') ? options.uppercase : false, /* hexadecimal output case format. false - lowercase; true - uppercase */ - b64pad = (options && typeof options.pad === 'string') ? options.pda : '=', + b64pad = (options && typeof options.pad === 'string') ? options.pad : '=', /* base-64 pad character. Default '=' for strict RFC compliance */ utf8 = (options && typeof options.utf8 === 'boolean') ? options.utf8 : true, /* enable/disable utf8 encoding */ @@ -1768,7 +1791,7 @@ module.exports = function(o) { */ var hexcase = (options && typeof options.uppercase === 'boolean') ? options.uppercase : false, /* hexadecimal output case format. false - lowercase; true - uppercase */ - b64pad = (options && typeof options.pad === 'string') ? options.pda : '=', + b64pad = (options && typeof options.pad === 'string') ? options.pa : '=', /* base-64 pad character. Default '=' for strict RFC compliance */ utf8 = (options && typeof options.utf8 === 'boolean') ? options.utf8 : true, /* enable/disable utf8 encoding */ @@ -2245,6 +2268,8 @@ function json2Plugin() { } },{"./lib/json2":7}],7:[function(require,module,exports){ +/* eslint-disable */ + // json2.js // 2016-10-28 // Public Domain. @@ -2756,76 +2781,24 @@ var util = require('./util') var slice = util.slice var pluck = util.pluck var each = util.each +var bind = util.bind var create = util.create var isList = util.isList var isFunction = util.isFunction var isObject = util.isObject module.exports = { - createStore: createStore, + createStore: createStore } var storeAPI = { - version: '2.0.4', + version: '2.0.12', enabled: false, - storage: null, - - // addStorage adds another storage to this store. The store - // will use the first storage it receives that is enabled, so - // call addStorage in the order of preferred storage. - addStorage: function(storage) { - if (this.enabled) { return } - if (this._testStorage(storage)) { - this._storage.resolved = storage - this.enabled = true - this.storage = storage.name - } - }, - - // addPlugin will add a plugin to this store. - addPlugin: function(plugin) { - var self = this - - // If the plugin is an array, then add all plugins in the array. - // This allows for a plugin to depend on other plugins. - if (isList(plugin)) { - each(plugin, function(plugin) { - self.addPlugin(plugin) - }) - return - } - - // Keep track of all plugins we've seen so far, so that we - // don't add any of them twice. - var seenPlugin = pluck(this._seenPlugins, function(seenPlugin) { return (plugin === seenPlugin) }) - if (seenPlugin) { - return - } - this._seenPlugins.push(plugin) - - // Check that the plugin is properly formed - if (!isFunction(plugin)) { - throw new Error('Plugins must be function values that return objects') - } - - var pluginProperties = plugin.call(this) - if (!isObject(pluginProperties)) { - throw new Error('Plugins must return an object of function properties') - } - - // Add the plugin function properties to this store instance. - each(pluginProperties, function(pluginFnProp, propName) { - if (!isFunction(pluginFnProp)) { - throw new Error('Bad plugin property: '+propName+' from plugin '+plugin.name+'. Plugins should only return functions.') - } - self._assignPluginFnProp(pluginFnProp, propName) - }) - }, - + // get returns the value of the given key. If that value // is undefined, it returns optionalDefaultValue instead. get: function(key, optionalDefaultValue) { - var data = this._storage().read(this._namespacePrefix + key) + var data = this.storage.read(this._namespacePrefix + key) return this._deserialize(data, optionalDefaultValue) }, @@ -2835,27 +2808,27 @@ var storeAPI = { if (value === undefined) { return this.remove(key) } - this._storage().write(this._namespacePrefix + key, this._serialize(value)) + this.storage.write(this._namespacePrefix + key, this._serialize(value)) return value }, // remove deletes the key and value stored at the given key. remove: function(key) { - this._storage().remove(this._namespacePrefix + key) + this.storage.remove(this._namespacePrefix + key) }, // each will call the given callback once for each key-value pair // in this store. each: function(callback) { var self = this - this._storage().each(function(val, namespacedKey) { - callback(self._deserialize(val), namespacedKey.replace(self._namespaceRegexp, '')) + this.storage.each(function(val, namespacedKey) { + callback.call(self, self._deserialize(val), (namespacedKey || '').replace(self._namespaceRegexp, '')) }) }, // clearAll will remove all the stored key-value pairs in this store. clearAll: function() { - this._storage().clearAll() + this.storage.clearAll() }, // additional functionality that can't live in plugins @@ -2866,43 +2839,50 @@ var storeAPI = { return (this._namespacePrefix == '__storejs_'+namespace+'_') }, - // namespace clones the current store and assigns it the given namespace - namespace: function(namespace) { - if (!this._legalNamespace.test(namespace)) { - throw new Error('store.js namespaces can only have alhpanumerics + underscores and dashes') - } - // create a prefix that is very unlikely to collide with un-namespaced keys - var namespacePrefix = '__storejs_'+namespace+'_' - return create(this, { - _namespacePrefix: namespacePrefix, - _namespaceRegexp: namespacePrefix ? new RegExp('^'+namespacePrefix) : null - }) - }, - // createStore creates a store.js instance with the first // functioning storage in the list of storage candidates, // and applies the the given mixins to the instance. - createStore: function(storages, plugins) { - return createStore(storages, plugins) + createStore: function() { + return createStore.apply(this, arguments) + }, + + addPlugin: function(plugin) { + this._addPlugin(plugin) }, + + namespace: function(namespace) { + return createStore(this.storage, this.plugins, namespace) + } } -function createStore(storages, plugins) { +function _warn() { + var _console = (typeof console == 'undefined' ? null : console) + if (!_console) { return } + var fn = (_console.warn ? _console.warn : _console.log) + fn.apply(_console, arguments) +} + +function createStore(storages, plugins, namespace) { + if (!namespace) { + namespace = '' + } + if (storages && !isList(storages)) { + storages = [storages] + } + if (plugins && !isList(plugins)) { + plugins = [plugins] + } + + var namespacePrefix = (namespace ? '__storejs_'+namespace+'_' : '') + var namespaceRegexp = (namespace ? new RegExp('^'+namespacePrefix) : null) + var legalNamespaces = /^[a-zA-Z0-9_\-]*$/ // alpha-numeric + underscore and dash + if (!legalNamespaces.test(namespace)) { + throw new Error('store.js namespaces can only have alphanumerics + underscores and dashes') + } + var _privateStoreProps = { - _seenPlugins: [], - _namespacePrefix: '', - _namespaceRegexp: null, - _legalNamespace: /^[a-zA-Z0-9_\-]+$/, // alpha-numeric + underscore and dash - - _storage: function() { - if (!this.enabled) { - throw new Error("store.js: No supported storage has been added! "+ - "Add one (e.g store.addStorage(require('store/storages/cookieStorage')) "+ - "or use a build with more built-in storages (e.g "+ - "https://github.com/marcuswestin/store.js/tree/master/dist/store.legacy.min.js)") - } - return this._storage.resolved - }, + _namespacePrefix: namespacePrefix, + _namespaceRegexp: namespaceRegexp, _testStorage: function(storage) { try { @@ -2957,14 +2937,80 @@ function createStore(storages, plugins) { return (val !== undefined ? val : defaultVal) }, + + _addStorage: function(storage) { + if (this.enabled) { return } + if (this._testStorage(storage)) { + this.storage = storage + this.enabled = true + } + }, + + _addPlugin: function(plugin) { + var self = this + + // If the plugin is an array, then add all plugins in the array. + // This allows for a plugin to depend on other plugins. + if (isList(plugin)) { + each(plugin, function(plugin) { + self._addPlugin(plugin) + }) + return + } + + // Keep track of all plugins we've seen so far, so that we + // don't add any of them twice. + var seenPlugin = pluck(this.plugins, function(seenPlugin) { + return (plugin === seenPlugin) + }) + if (seenPlugin) { + return + } + this.plugins.push(plugin) + + // Check that the plugin is properly formed + if (!isFunction(plugin)) { + throw new Error('Plugins must be function values that return objects') + } + + var pluginProperties = plugin.call(this) + if (!isObject(pluginProperties)) { + throw new Error('Plugins must return an object of function properties') + } + + // Add the plugin function properties to this store instance. + each(pluginProperties, function(pluginFnProp, propName) { + if (!isFunction(pluginFnProp)) { + throw new Error('Bad plugin property: '+propName+' from plugin '+plugin.name+'. Plugins should only return functions.') + } + self._assignPluginFnProp(pluginFnProp, propName) + }) + }, + + // Put deprecated properties in the private API, so as to not expose it to accidential + // discovery through inspection of the store object. + + // Deprecated: addStorage + addStorage: function(storage) { + _warn('store.addStorage(storage) is deprecated. Use createStore([storages])') + this._addStorage(storage) + } } - var store = create(_privateStoreProps, storeAPI) + var store = create(_privateStoreProps, storeAPI, { + plugins: [] + }) + store.raw = {} + each(store, function(prop, propName) { + if (isFunction(prop)) { + store.raw[propName] = bind(store, prop) + } + }) each(storages, function(storage) { - store.addStorage(storage) + store._addStorage(storage) }) each(plugins, function(plugin) { - store.addPlugin(plugin) + store._addPlugin(plugin) }) return store } @@ -2988,7 +3034,7 @@ module.exports = { isList: isList, isFunction: isFunction, isObject: isObject, - Global: Global, + Global: Global } function make_assign() { @@ -3045,8 +3091,8 @@ function slice(arr, index) { } function each(obj, fn) { - pluck(obj, function(key, val) { - fn(key, val) + pluck(obj, function(val, key) { + fn(val, key) return false }) } @@ -3092,15 +3138,15 @@ function isObject(val) { }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],10:[function(require,module,exports){ -module.exports = { +module.exports = [ // Listed in order of usage preference - 'localStorage': require('./localStorage'), - 'oldFF-globalStorage': require('./oldFF-globalStorage'), - 'oldIE-userDataStorage': require('./oldIE-userDataStorage'), - 'cookieStorage': require('./cookieStorage'), - 'sessionStorage': require('./sessionStorage'), - 'memoryStorage': require('./memoryStorage'), -} + require('./localStorage'), + require('./oldFF-globalStorage'), + require('./oldIE-userDataStorage'), + require('./cookieStorage'), + require('./sessionStorage'), + require('./memoryStorage') +] },{"./cookieStorage":11,"./localStorage":12,"./memoryStorage":13,"./oldFF-globalStorage":14,"./oldIE-userDataStorage":15,"./sessionStorage":16}],11:[function(require,module,exports){ // cookieStorage is useful Safari private browser mode, where localStorage @@ -3429,7 +3475,7 @@ module.exports = { write: write, each: each, remove: remove, - clearAll: clearAll, + clearAll: clearAll } function sessionStorage() { diff --git a/osmauth.min.js b/osmauth.min.js index f00d943..f73696e 100644 --- a/osmauth.min.js +++ b/osmauth.min.js @@ -1 +1 @@ -!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).osmAuth=f()}}(function(){var define,module,exports;return function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i>>6&31,128|63&x):x<=65535?output+=String.fromCharCode(224|x>>>12&15,128|x>>>6&63,128|63&x):x<=2097151&&(output+=String.fromCharCode(240|x>>>18&7,128|x>>>12&63,128|x>>>6&63,128|63&x));return output}function safe_add(x,y){var lsw=(65535&x)+(65535&y);return(x>>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function bit_rol(num,cnt){return num<>>32-cnt}function rstr2hex(input,hexcase){for(var x,hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef",output="",i=0,l=input.length;i>>4&15)+hex_tab.charAt(15&x);return output}function binb2rstr(input){var i,l=32*input.length,output="";for(i=0;i>5]>>>24-i%32&255);return output}function binl2rstr(input){var i,l=32*input.length,output="";for(i=0;i>5]>>>i%32&255);return output}function rstr2binl(input){var i,l=8*input.length,output=Array(input.length>>2),lo=output.length;for(i=0;i>5]|=(255&input.charCodeAt(i/8))<>2),lo=output.length;for(i=0;i>5]|=(255&input.charCodeAt(i/8))<<24-i%32;return output}function rstr2any(input,encoding){var i,q,x,ld,quotient,dividend,output,full_length,divisor=encoding.length,remainders=Array();for(ld=(dividend=Array(Math.ceil(input.length/2))).length,i=0;i8*input.length?output+=b64pad:output+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(triplet>>>6*(3-j)&63);return output}Hashes={VERSION:"1.0.5",Base64:function(){var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pad="=",utf8=!0;this.encode=function(input){var i,j,triplet,output="",len=input.length;for(pad=pad||"=",input=utf8?utf8Encode(input):input,i=0;i>>6*(3-j)&63);return output},this.decode=function(input){var i,o1,o2,o3,h3,h4,bits,ac,dec="",arr=[];if(!input)return input;for(i=ac=0,input=input.replace(new RegExp("\\"+pad,"gi"),"");o1=(bits=tab.indexOf(input.charAt(i+=1))<<18|tab.indexOf(input.charAt(i+=1))<<12|(h3=tab.indexOf(input.charAt(i+=1)))<<6|(h4=tab.indexOf(input.charAt(i+=1))))>>16&255,o2=bits>>8&255,o3=255&bits,arr[ac+=1]=64===h3?String.fromCharCode(o1):64===h4?String.fromCharCode(o1,o2):String.fromCharCode(o1,o2,o3),i>>8^"0x"+table.substr(9*y,8);return(-1^crc)>>>0},MD5:function(options){var hexcase=!(!options||"boolean"!=typeof options.uppercase)&&options.uppercase,b64pad=options&&"string"==typeof options.pad?options.pda:"=",utf8=!options||"boolean"!=typeof options.utf8||options.utf8;function rstr(s){return binl2rstr(binl(rstr2binl(s=utf8?utf8Encode(s):s),8*s.length))}function rstr_hmac(key,data){var bkey,ipad,opad,hash,i;for(key=utf8?utf8Encode(key):key,data=utf8?utf8Encode(data):data,16<(bkey=rstr2binl(key)).length&&(bkey=binl(bkey,8*key.length)),ipad=Array(16),opad=Array(16),i=0;i<16;i+=1)ipad[i]=909522486^bkey[i],opad[i]=1549556828^bkey[i];return hash=binl(ipad.concat(rstr2binl(data)),512+8*data.length),binl2rstr(binl(opad.concat(hash),640))}function binl(x,len){var i,olda,oldb,oldc,oldd,a=1732584193,b=-271733879,c=-1732584194,d=271733878;for(x[len>>5]|=128<>>9<<4)]=len,i=0;i>5]|=128<<24-len%32,x[15+(len+64>>9<<4)]=len,i=0;i>>n|X<<32-n}function sha256_R(X,n){return X>>>n}function sha256_Ch(x,y,z){return x&y^~x&z}function sha256_Maj(x,y,z){return x&y^x&z^y&z}function sha256_Sigma0256(x){return sha256_S(x,2)^sha256_S(x,13)^sha256_S(x,22)}function sha256_Sigma1256(x){return sha256_S(x,6)^sha256_S(x,11)^sha256_S(x,25)}function sha256_Gamma0256(x){return sha256_S(x,7)^sha256_S(x,18)^sha256_R(x,3)}function binb(m,l){var a,b,c,d,e,f,g,h,i,j,T1,T2,x,HASH=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],W=new Array(64);for(m[l>>5]|=128<<24-l%32,m[15+(l+64>>9<<4)]=l,i=0;i>5]|=128<<24-(31&len),x[31+(len+128>>10<<5)]=len,l=x.length,i=0;i>>shift|x.h<<32-shift,dst.h=x.h>>>shift|x.l<<32-shift}function int64revrrot(dst,x,shift){dst.l=x.h>>>shift|x.l<<32-shift,dst.h=x.l>>>shift|x.h<<32-shift}function int64shr(dst,x,shift){dst.l=x.l>>>shift|x.h<<32-shift,dst.h=x.h>>>shift}function int64add(dst,x,y){var w0=(65535&x.l)+(65535&y.l),w1=(x.l>>>16)+(y.l>>>16)+(w0>>>16),w2=(65535&x.h)+(65535&y.h)+(w1>>>16),w3=(x.h>>>16)+(y.h>>>16)+(w2>>>16);dst.l=65535&w0|w1<<16,dst.h=65535&w2|w3<<16}function int64add4(dst,a,b,c,d){var w0=(65535&a.l)+(65535&b.l)+(65535&c.l)+(65535&d.l),w1=(a.l>>>16)+(b.l>>>16)+(c.l>>>16)+(d.l>>>16)+(w0>>>16),w2=(65535&a.h)+(65535&b.h)+(65535&c.h)+(65535&d.h)+(w1>>>16),w3=(a.h>>>16)+(b.h>>>16)+(c.h>>>16)+(d.h>>>16)+(w2>>>16);dst.l=65535&w0|w1<<16,dst.h=65535&w2|w3<<16}function int64add5(dst,a,b,c,d,e){var w0=(65535&a.l)+(65535&b.l)+(65535&c.l)+(65535&d.l)+(65535&e.l),w1=(a.l>>>16)+(b.l>>>16)+(c.l>>>16)+(d.l>>>16)+(e.l>>>16)+(w0>>>16),w2=(65535&a.h)+(65535&b.h)+(65535&c.h)+(65535&d.h)+(65535&e.h)+(w1>>>16),w3=(a.h>>>16)+(b.h>>>16)+(c.h>>>16)+(d.h>>>16)+(e.h>>>16)+(w2>>>16);dst.l=65535&w0|w1<<16,dst.h=65535&w2|w3<<16}this.hex=function(s){return rstr2hex(rstr(s))},this.b64=function(s){return rstr2b64(rstr(s),b64pad)},this.any=function(s,e){return rstr2any(rstr(s),e)},this.raw=function(s){return rstr(s)},this.hex_hmac=function(k,d){return rstr2hex(rstr_hmac(k,d))},this.b64_hmac=function(k,d){return rstr2b64(rstr_hmac(k,d),b64pad)},this.any_hmac=function(k,d,e){return rstr2any(rstr_hmac(k,d),e)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(a){return"boolean"==typeof a&&a,this},this.setPad=function(a){return b64pad=a||b64pad,this},this.setUTF8=function(a){return"boolean"==typeof a&&(utf8=a),this}},RMD160:function(options){options&&"boolean"==typeof options.uppercase&&options.uppercase;var b64pad=options&&"string"==typeof options.pad?options.pda:"=",utf8=!options||"boolean"!=typeof options.utf8||options.utf8,rmd160_r1=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rmd160_r2=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],rmd160_s1=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],rmd160_s2=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function rstr(s){return binl2rstr(binl(rstr2binl(s=utf8?utf8Encode(s):s),8*s.length))}function rstr_hmac(key,data){key=utf8?utf8Encode(key):key,data=utf8?utf8Encode(data):data;var i,hash,bkey=rstr2binl(key),ipad=Array(16),opad=Array(16);for(16>5]>>>i%32&255);return output}function binl(x,len){var T,j,i,l,A1,B1,C1,D1,E1,A2,B2,C2,D2,E2,h0=1732584193,h1=4023233417,h2=2562383102,h3=271733878,h4=3285377520;for(x[len>>5]|=128<>>9<<4)]=len,l=x.length,i=0;idocument.w=window<\/script>'),storageContainer.close(),storageOwner=storageContainer.w.frames[0].document,storageEl=storageOwner.createElement("div")}catch(e){storageEl=doc.createElement("div"),storageOwner=doc.body}return function(storeFunction){var args=[].slice.call(arguments,0);args.unshift(storageEl),storageOwner.appendChild(storageEl),storageEl.addBehavior("#default#userData"),storageEl.load(storageName),storeFunction.apply(this,args),storageOwner.removeChild(storageEl)}}(),disable=(Global.navigator?Global.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(key){return key.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}},{"../src/util":9}],16:[function(require,module,exports){var Global=require("../src/util").Global;function sessionStorage(){return Global.sessionStorage}function read(key){return sessionStorage().getItem(key)}module.exports={name:"sessionStorage",read:read,write:function(key,data){return sessionStorage().setItem(key,data)},each:function(fn){for(var i=sessionStorage().length-1;0<=i;i--){var key=sessionStorage().key(i);fn(read(key),key)}},remove:function(key){return sessionStorage().removeItem(key)},clearAll:function(){return sessionStorage().clear()}}},{"../src/util":9}],17:[function(require,module,exports){module.exports=function(){for(var target={},i=0;i>>6&31,128|63&x):x<=65535?output+=String.fromCharCode(224|x>>>12&15,128|x>>>6&63,128|63&x):x<=2097151&&(output+=String.fromCharCode(240|x>>>18&7,128|x>>>12&63,128|x>>>6&63,128|63&x));return output}function safe_add(x,y){var lsw=(65535&x)+(65535&y);return(x>>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function bit_rol(num,cnt){return num<>>32-cnt}function rstr2hex(input,hexcase){for(var x,hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef",output="",i=0,l=input.length;i>>4&15)+hex_tab.charAt(15&x);return output}function binb2rstr(input){for(var l=32*input.length,output="",i=0;i>5]>>>24-i%32&255);return output}function binl2rstr(input){for(var l=32*input.length,output="",i=0;i>5]>>>i%32&255);return output}function rstr2binl(input){for(var l=8*input.length,output=Array(input.length>>2),lo=output.length,i=0;i>5]|=(255&input.charCodeAt(i/8))<>2),lo=output.length,i=0;i>5]|=(255&input.charCodeAt(i/8))<<24-i%32;return output}function rstr2any(input,encoding){for(var q,x,quotient,output,full_length,divisor=encoding.length,remainders=Array(),dividend=Array(Math.ceil(input.length/2)),ld=dividend.length,i=0;i8*input.length?output+=b64pad:output+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(triplet>>>6*(3-j)&63);return output}Hashes={VERSION:"1.0.6",Base64:function(){var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pad="=",utf8=!0;this.encode=function(input){var i,j,triplet,output="",len=input.length;for(pad=pad||"=",input=utf8?utf8Encode(input):input,i=0;i>>6*(3-j)&63);return output},this.decode=function(input){var i,o1,o2,o3,h3,h4,bits,ac,dec="",arr=[];if(!input)return input;for(i=ac=0,input=input.replace(new RegExp("\\"+pad,"gi"),"");o1=(bits=tab.indexOf(input.charAt(i+=1))<<18|tab.indexOf(input.charAt(i+=1))<<12|(h3=tab.indexOf(input.charAt(i+=1)))<<6|(h4=tab.indexOf(input.charAt(i+=1))))>>16&255,o2=bits>>8&255,o3=255&bits,arr[ac+=1]=64===h3?String.fromCharCode(o1):64===h4?String.fromCharCode(o1,o2):String.fromCharCode(o1,o2,o3),i>>8^"0x"+table.substr(9*y,8);return(-1^crc)>>>0},MD5:function(options){var hexcase=!(!options||"boolean"!=typeof options.uppercase)&&options.uppercase,b64pad=options&&"string"==typeof options.pad?options.pad:"=",utf8=!options||"boolean"!=typeof options.utf8||options.utf8;function rstr(s){return binl2rstr(binl(rstr2binl(s=utf8?utf8Encode(s):s),8*s.length))}function rstr_hmac(key,data){var bkey,ipad,opad,hash,i;for(key=utf8?utf8Encode(key):key,data=utf8?utf8Encode(data):data,16<(bkey=rstr2binl(key)).length&&(bkey=binl(bkey,8*key.length)),ipad=Array(16),opad=Array(16),i=0;i<16;i+=1)ipad[i]=909522486^bkey[i],opad[i]=1549556828^bkey[i];return hash=binl(ipad.concat(rstr2binl(data)),512+8*data.length),binl2rstr(binl(opad.concat(hash),640))}function binl(x,len){var i,olda,oldb,oldc,oldd,a=1732584193,b=-271733879,c=-1732584194,d=271733878;for(x[len>>5]|=128<>>9<<4)]=len,i=0;i>5]|=128<<24-len%32,x[15+(len+64>>9<<4)]=len,i=0;i>>n|X<<32-n}function binb(m,l){var a,b,c,d,e,f,g,h,i,j,T1,T2,x,HASH=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],W=new Array(64);for(m[l>>5]|=128<<24-l%32,m[15+(l+64>>9<<4)]=l,i=0;i>>10,W[j-7]),function(x){return sha256_S(x,7)^sha256_S(x,18)^x>>>3}(W[j-15])),W[j-16]),T1=safe_add(safe_add(safe_add(safe_add(h,function(x){return sha256_S(x,6)^sha256_S(x,11)^sha256_S(x,25)}(e)),function(x,y,z){return x&y^~x&z}(e,f,g)),sha256_K[j]),W[j]),T2=safe_add(function(x){return sha256_S(x,2)^sha256_S(x,13)^sha256_S(x,22)}(a),function(x,y,z){return x&y^x&z^y&z}(a,b,c)),h=g,g=f,f=e,e=safe_add(d,T1),d=c,c=b,b=a,a=safe_add(T1,T2);HASH[0]=safe_add(a,HASH[0]),HASH[1]=safe_add(b,HASH[1]),HASH[2]=safe_add(c,HASH[2]),HASH[3]=safe_add(d,HASH[3]),HASH[4]=safe_add(e,HASH[4]),HASH[5]=safe_add(f,HASH[5]),HASH[6]=safe_add(g,HASH[6]),HASH[7]=safe_add(h,HASH[7])}return HASH}this.hex=function(s){return rstr2hex(rstr(s,utf8))},this.b64=function(s){return rstr2b64(rstr(s,utf8),b64pad)},this.any=function(s,e){return rstr2any(rstr(s,utf8),e)},this.raw=function(s){return rstr(s,utf8)},this.hex_hmac=function(k,d){return rstr2hex(rstr_hmac(k,d))},this.b64_hmac=function(k,d){return rstr2b64(rstr_hmac(k,d),b64pad)},this.any_hmac=function(k,d,e){return rstr2any(rstr_hmac(k,d),e)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(a){return"boolean"==typeof a&&0,this},this.setPad=function(a){return b64pad=a||b64pad,this},this.setUTF8=function(a){return"boolean"==typeof a&&(utf8=a),this},sha256_K=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998]},SHA512:function(options){options&&"boolean"==typeof options.uppercase&&options.uppercase;var sha512_k,b64pad=options&&"string"==typeof options.pad?options.pad:"=",utf8=!options||"boolean"!=typeof options.utf8||options.utf8;function rstr(s){return binb2rstr(binb(rstr2binb(s=utf8?utf8Encode(s):s),8*s.length))}function rstr_hmac(key,data){key=utf8?utf8Encode(key):key,data=utf8?utf8Encode(data):data;var hash,i=0,bkey=rstr2binb(key),ipad=Array(32),opad=Array(32);for(32>5]|=128<<24-(31&len),x[31+(len+128>>10<<5)]=len,l=x.length,i=0;i>>16)+(b.l>>>16)+(c.l>>>16)+(d.l>>>16)+(w0>>>16),w2=(65535&a.h)+(65535&b.h)+(65535&c.h)+(65535&d.h)+(w1>>>16),w3=(a.h>>>16)+(b.h>>>16)+(c.h>>>16)+(d.h>>>16)+(w2>>>16);dst.l=65535&w0|w1<<16,dst.h=65535&w2|w3<<16}(W[j],s1,W[j-7],s0,W[j-16]);for(j=0;j<80;j+=1)Ch.l=e.l&f.l^~e.l&g.l,Ch.h=e.h&f.h^~e.h&g.h,int64rrot(r1,e,14),int64rrot(r2,e,18),int64revrrot(r3,e,9),s1.l=r1.l^r2.l^r3.l,s1.h=r1.h^r2.h^r3.h,int64rrot(r1,a,28),int64revrrot(r2,a,2),int64revrrot(r3,a,7),s0.l=r1.l^r2.l^r3.l,s0.h=r1.h^r2.h^r3.h,Maj.l=a.l&b.l^a.l&c.l^b.l&c.l,Maj.h=a.h&b.h^a.h&c.h^b.h&c.h,function(dst,a,b,c,d,e){var w0=(65535&a.l)+(65535&b.l)+(65535&c.l)+(65535&d.l)+(65535&e.l),w1=(a.l>>>16)+(b.l>>>16)+(c.l>>>16)+(d.l>>>16)+(e.l>>>16)+(w0>>>16),w2=(65535&a.h)+(65535&b.h)+(65535&c.h)+(65535&d.h)+(65535&e.h)+(w1>>>16),w3=(a.h>>>16)+(b.h>>>16)+(c.h>>>16)+(d.h>>>16)+(e.h>>>16)+(w2>>>16);dst.l=65535&w0|w1<<16,dst.h=65535&w2|w3<<16}(T1,h,s1,Ch,sha512_k[j],W[j]),int64add(T2,s0,Maj),int64copy(h,g),int64copy(g,f),int64copy(f,e),int64add(e,d,T1),int64copy(d,c),int64copy(c,b),int64copy(b,a),int64add(a,T1,T2);int64add(H[0],H[0],a),int64add(H[1],H[1],b),int64add(H[2],H[2],c),int64add(H[3],H[3],d),int64add(H[4],H[4],e),int64add(H[5],H[5],f),int64add(H[6],H[6],g),int64add(H[7],H[7],h)}for(i=0;i<8;i+=1)hash[2*i]=H[i].h,hash[2*i+1]=H[i].l;return hash}function int64(h,l){this.h=h,this.l=l}function int64copy(dst,src){dst.h=src.h,dst.l=src.l}function int64rrot(dst,x,shift){dst.l=x.l>>>shift|x.h<<32-shift,dst.h=x.h>>>shift|x.l<<32-shift}function int64revrrot(dst,x,shift){dst.l=x.h>>>shift|x.l<<32-shift,dst.h=x.l>>>shift|x.h<<32-shift}function int64shr(dst,x,shift){dst.l=x.l>>>shift|x.h<<32-shift,dst.h=x.h>>>shift}function int64add(dst,x,y){var w0=(65535&x.l)+(65535&y.l),w1=(x.l>>>16)+(y.l>>>16)+(w0>>>16),w2=(65535&x.h)+(65535&y.h)+(w1>>>16),w3=(x.h>>>16)+(y.h>>>16)+(w2>>>16);dst.l=65535&w0|w1<<16,dst.h=65535&w2|w3<<16}this.hex=function(s){return rstr2hex(rstr(s))},this.b64=function(s){return rstr2b64(rstr(s),b64pad)},this.any=function(s,e){return rstr2any(rstr(s),e)},this.raw=rstr,this.hex_hmac=function(k,d){return rstr2hex(rstr_hmac(k,d))},this.b64_hmac=function(k,d){return rstr2b64(rstr_hmac(k,d),b64pad)},this.any_hmac=function(k,d,e){return rstr2any(rstr_hmac(k,d),e)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(a){return"boolean"==typeof a&&0,this},this.setPad=function(a){return b64pad=a||b64pad,this},this.setUTF8=function(a){return"boolean"==typeof a&&(utf8=a),this}},RMD160:function(options){options&&"boolean"==typeof options.uppercase&&options.uppercase;var b64pad=options&&"string"==typeof options.pad?options.pa:"=",utf8=!options||"boolean"!=typeof options.utf8||options.utf8,rmd160_r1=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rmd160_r2=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],rmd160_s1=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],rmd160_s2=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function rstr(s){return binl2rstr(binl(rstr2binl(s=utf8?utf8Encode(s):s),8*s.length))}function rstr_hmac(key,data){key=utf8?utf8Encode(key):key,data=utf8?utf8Encode(data):data;var i,hash,bkey=rstr2binl(key),ipad=Array(16),opad=Array(16);for(16>5]>>>i%32&255);return output}function binl(x,len){var T,j,i,l,A1,B1,C1,D1,E1,A2,B2,C2,D2,E2,h0=1732584193,h1=4023233417,h2=2562383102,h3=271733878,h4=3285377520;for(x[len>>5]|=128<>>9<<4)]=len,l=x.length,i=0;idocument.w=window<\/script>'),storageContainer.close(),storageOwner=storageContainer.w.frames[0].document,storageEl=storageOwner.createElement("div")}catch(e){storageEl=doc.createElement("div"),storageOwner=doc.body}return function(storeFunction){var args=[].slice.call(arguments,0);args.unshift(storageEl),storageOwner.appendChild(storageEl),storageEl.addBehavior("#default#userData"),storageEl.load(storageName),storeFunction.apply(this,args),storageOwner.removeChild(storageEl)}}(),disable=(Global.navigator?Global.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(key){return key.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}},{"../src/util":9}],16:[function(require,module,exports){var Global=require("../src/util").Global;function sessionStorage(){return Global.sessionStorage}function read(key){return sessionStorage().getItem(key)}module.exports={name:"sessionStorage",read:read,write:function(key,data){return sessionStorage().setItem(key,data)},each:function(fn){for(var i=sessionStorage().length-1;0<=i;i--){var key=sessionStorage().key(i);fn(read(key),key)}},remove:function(key){return sessionStorage().removeItem(key)},clearAll:function(){return sessionStorage().clear()}}},{"../src/util":9}],17:[function(require,module,exports){module.exports=function(){for(var target={},i=0;i", + "contributors": [ + "Bryan Housel (https://github.com/bhousel)", + "Tom MacWright (https://github.com/tmcw)" + ], "license": "ISC", "keywords": [ "oauth",