New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blockv/sdk

Package Overview
Dependencies
Maintainers
4
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blockv/sdk - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

4

dist/blockv-sdk.min.js

@@ -1,2 +0,2 @@

var Blockv=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=7)}([function(e,t,n){(function(t){function r(){}function o(){p.log.apply(p,arguments)}function i(){p.log.apply(p,arguments)}function u(){p.warn.apply(p,arguments)}function s(e){g[e]=v()}function a(e){var t=g[e];if(!t)throw new Error("No such label: "+e);var n=v()-t;p.log(e+": "+n+"ms")}function c(){var e=new Error;e.name="Trace",e.message=h.format.apply(null,arguments),p.error(e.stack)}function f(e){p.log(h.inspect(e)+"\n")}function l(e){if(!e){var t=y.call(arguments,1);d.ok(!1,h.format.apply(null,t))}}var p,h=n(2),d=n(4),v=n(14),y=Array.prototype.slice,g={};p=void 0!==t&&t.console?t.console:"undefined"!=typeof window&&window.console?window.console:{};for(var k=[[r,"log"],[o,"info"],[i,"warn"],[u,"error"],[s,"time"],[a,"timeEnd"],[c,"trace"],[f,"dir"],[l,"assert"]],m=0;m<k.length;m++){var w=k[m],b=w[0],T=w[1];p[T]||(p[T]=b)}e.exports=p}).call(t,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(e,r,o){function i(e,n){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&t._extend(r,n),T(r.showHidden)&&(r.showHidden=!1),T(r.depth)&&(r.depth=2),T(r.colors)&&(r.colors=!1),T(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),c(r,e,r.depth)}function u(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function c(e,n,r){if(e.customInspect&&n&&_(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return w(o)||(o=c(e,o,r)),o}var i=f(e,n);if(i)return i;var u=Object.keys(n),s=a(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(n)),S(n)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return l(n);if(0===u.length){if(_(n)){var y=n.name?": "+n.name:"";return e.stylize("[Function"+y+"]","special")}if(O(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(S(n))return l(n)}var g="",k=!1,m=["{","}"];if(v(n)&&(k=!0,m=["[","]"]),_(n)){g=" [Function"+(n.name?": "+n.name:"")+"]"}if(O(n)&&(g=" "+RegExp.prototype.toString.call(n)),E(n)&&(g=" "+Date.prototype.toUTCString.call(n)),S(n)&&(g=" "+l(n)),0===u.length&&(!k||0==n.length))return m[0]+g+m[1];if(r<0)return O(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var b;return b=k?p(e,n,r,s,u):u.map(function(t){return h(e,n,r,s,t,k)}),e.seen.pop(),d(b,g,m)}function f(e,t){if(T(t))return e.stylize("undefined","undefined");if(w(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,o){for(var i=[],u=0,s=t.length;u<s;++u)q(t,String(u))?i.push(h(e,t,n,r,String(u),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(h(e,t,n,r,o,!0))}),i}function h(e,t,n,r,o,i){var u,s,a;if(a=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},a.get?s=a.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):a.set&&(s=e.stylize("[Setter]","special")),q(r,o)||(u="["+o+"]"),s||(e.seen.indexOf(a.value)<0?(s=g(n)?c(e,a.value,null):c(e,a.value,n-1),s.indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),T(u)){if(i&&o.match(/^\d+$/))return s;u=JSON.stringify(""+o),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+s}function d(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function v(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function g(e){return null===e}function k(e){return null==e}function m(e){return"number"==typeof e}function w(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function T(e){return void 0===e}function O(e){return A(e)&&"[object RegExp]"===U(e)}function A(e){return"object"==typeof e&&null!==e}function E(e){return A(e)&&"[object Date]"===U(e)}function S(e){return A(e)&&("[object Error]"===U(e)||e instanceof Error)}function _(e){return"function"==typeof e}function x(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function U(e){return Object.prototype.toString.call(e)}function P(e){return e<10?"0"+e.toString(10):e.toString(10)}function j(){var e=new Date,t=[P(e.getHours()),P(e.getMinutes()),P(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],t].join(" ")}function q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var D=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,u=String(e).replace(D,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),s=r[n];n<o;s=r[++n])g(s)||!A(s)?u+=" "+s:u+=" "+i(s);return u},t.deprecate=function(n,i){function u(){if(!s){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?o.trace(i):o.error(i),s=!0}return n.apply(this,arguments)}if(T(e.process))return function(){return t.deprecate(n,i).apply(this,arguments)};if(!0===r.noDeprecation)return n;var s=!1;return u};var I,C={};t.debuglog=function(e){if(T(I)&&(I=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!C[e])if(new RegExp("\\b"+e+"\\b","i").test(I)){var n=r.pid;C[e]=function(){var r=t.format.apply(t,arguments);o.error("%s %d: %s",e,n,r)}}else C[e]=function(){};return C[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=v,t.isBoolean=y,t.isNull=g,t.isNullOrUndefined=k,t.isNumber=m,t.isString=w,t.isSymbol=b,t.isUndefined=T,t.isRegExp=O,t.isObject=A,t.isDate=E,t.isError=S,t.isFunction=_,t.isPrimitive=x,t.isBuffer=n(20);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){o.log("%s - %s",j(),t.format.apply(t,arguments))},t.inherits=n(19),t._extend=function(e,t){if(!t||!A(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(t,n(1),n(18),n(0))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),u=r(i),s=n(5),a=r(s),c=n(9),f=r(c),l=n(10),p=r(l),h=n(6),d=r(h),v=n(8),y=r(v),g=function e(t){o(this,e);var n=t.prefix||t.appID;this.store=new u.default(n),this.store.appID=t.appID,this.store.server=t.server,this.store.websocketAddress=t.websocketAddress;var r=new y.default(this.store),i=new f.default(r,this.store),s=new p.default(r);this.UserManager=new a.default(i,this.store),this.Vatoms=new d.default(s)};t.default=g},function(e,t,n){"use strict";(function(t){/*!
var Blockv=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=16)}([function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){(function(t){function n(){}function o(){h.log.apply(h,arguments)}function i(){h.log.apply(h,arguments)}function s(){h.warn.apply(h,arguments)}function u(e){g[e]=y()}function a(e){var t=g[e];if(!t)throw new Error("No such label: "+e);var r=y()-t;h.log(e+": "+r+"ms")}function c(){var e=new Error;e.name="Trace",e.message=p.format.apply(null,arguments),h.error(e.stack)}function f(e){h.log(p.inspect(e)+"\n")}function l(e){if(!e){var t=v.call(arguments,1);d.ok(!1,p.format.apply(null,t))}}var h,p=r(11),d=r(13),y=r(23),v=Array.prototype.slice,g={};h=void 0!==t&&t.console?t.console:"undefined"!=typeof window&&window.console?window.console:{};for(var m=[[n,"log"],[o,"info"],[i,"warn"],[s,"error"],[u,"time"],[a,"timeEnd"],[c,"trace"],[f,"dir"],[l,"assert"]],b=0;b<m.length;b++){var w=m[b],k=w[0],O=w[1];h[O]||(h[O]=k)}e.exports=h}).call(t,r(0))},function(e,t,r){"use strict";function n(e){var t=e.toLowerCase();return"referrer"===t?"referer":t}function o(e){return null==e?null:e.split(/ *; */,1)[0]}function i(e,t){return null==e?t:Array.isArray(e)?e.concat(t):[e,t]}Object.defineProperty(t,"__esModule",{value:!0});var s=r(39),u=r(4),a=r(10),c=function(){function e(e){var t=e.url,r=e.headers,n=e.rawHeaders,o=e.query;if(this.Url={},this.rawHeaders=[],null!=t&&(this.url=t),null!=o&&(this.query=Object.assign(this.query,"string"==typeof o?u.parse(o):o)),n){if(n.length%2==1)throw new TypeError("Expected raw headers length to be even, was "+n.length);this.rawHeaders=n.slice(0)}else this.headers=r}return Object.defineProperty(e.prototype,"url",{get:function(){return s.format(this.Url)},set:function(e){this.Url=s.parse(e,!0,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this.Url.query},set:function(e){this.Url.query="string"==typeof e?u.parse(e):e,this.Url.search=null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){for(var e={},t=0;t<this.rawHeaders.length;t+=2){var r=n(this.rawHeaders[t]),o=i(e[r],this.rawHeaders[t+1]);e[r]=o}return e},set:function(e){if(this.rawHeaders=[],e)for(var t=0,r=Object.keys(e);t<r.length;t++){var n=r[t];this.append(n,e[n])}},enumerable:!0,configurable:!0}),e.prototype.toHeaders=function(){for(var e={},t=0;t<this.rawHeaders.length;t+=2){var r=this.rawHeaders[t],n=i(e[r],this.rawHeaders[t+1]);e[r]=n}return e},e.prototype.set=function(e,t){return this.remove(e),this.append(e,t),this},e.prototype.append=function(e,t){if(Array.isArray(t))for(var r=0,n=t;r<n.length;r++){var o=n[r];null!=o&&this.rawHeaders.push(e,o)}else null!=t&&this.rawHeaders.push(e,t);return this},e.prototype.name=function(e){for(var t=n(e),r=0;r<this.rawHeaders.length;r+=2)if(n(this.rawHeaders[r])===t)return this.rawHeaders[r]},e.prototype.get=function(e){for(var t=n(e),r=0;r<this.rawHeaders.length;r+=2)if(n(this.rawHeaders[r])===t)return this.rawHeaders[r+1]},e.prototype.getAll=function(e){for(var t=n(e),r=[],o=0;o<this.rawHeaders.length;o+=2)n(this.rawHeaders[o])===t&&r.push(this.rawHeaders[o+1]);return r},e.prototype.remove=function(e){for(var t=n(e),r=0;r<this.rawHeaders.length;r+=2)n(this.rawHeaders[r])===t&&a.splice(this.rawHeaders,r,2);return this},e.prototype.type=function(e){return 0===arguments.length?o(this.get("Content-Type")):this.set("Content-Type",e)},e}();t.Base=c},function(e,t,r){"use strict";e.exports=FormData},function(e,t,r){"use strict";t.decode=t.parse=r(37),t.encode=t.stringify=r(38)},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=r(27),i=function(e){function t(t,r,n,o){var i=e.call(this,t,n)||this;return i.name="PopsicleError",i.code=r,i.popsicle=o,i}return n(t,e),t}(o.BaseError);t.default=i},function(e,t,r){"use strict";function n(e){var t=new o;return e&&Object.keys(e).forEach(function(r){t.append(r,e[r])}),t}Object.defineProperty(t,"__esModule",{value:!0});var o=r(3);t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(33))},function(e,t,r){"use strict";function n(e,t,r){var n=!1,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n||(n=!0,e.off(t,r),0===o.length?r.call(e):r.apply(e,o))};return o.listener=r,o}function o(e){function t(n){if(n<=r)throw new TypeError("`next()` called multiple times");if(e.aborted)return Promise.reject(e.error("Request aborted","EABORT"));r=n;var o=e.middleware[n]||function(){return e.handle()};return new Promise(function(r){return r(o(e,function(){return t(n+1)}))})}var r=-1;return t(0)}var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),u=r(10),a=r(5),c=function(e){function t(t){var r=e.call(this,t)||this;return r.middleware=[],r.opened=!1,r.aborted=!1,r.uploaded=0,r.downloaded=0,r.timeout=0|t.timeout,r.method=(t.method||"GET").toUpperCase(),r.body=t.body,r.events=t.events||Object.create(null),r.transport=Object.assign({},t.transport),r.use(t.use||r.transport.use),r._promise=Promise.resolve().then(function(){return o(r)}),r.once("abort",function(){1!==r.completed&&(r.aborted=!0)}),r}return i(t,e),t.prototype.error=function(e,t,r){return new a.default(e,t,r,this)},t.prototype.then=function(e,t){return this._promise.then(e,t)},t.prototype.catch=function(e){return this._promise.then(null,e)},t.prototype.exec=function(e){this.then(function(t){return e(null,t)},e)},t.prototype.toOptions=function(){return{url:this.url,method:this.method,body:this.body,transport:this.transport,timeout:this.timeout,rawHeaders:this.rawHeaders,use:this.middleware,events:this.events}},t.prototype.toJSON=function(){return{url:this.url,method:this.method,headers:this.headers,body:this.body,timeout:this.timeout}},t.prototype.clone=function(){return new t(this.toOptions())},t.prototype.use=function(e){return Array.isArray(e)?(t=this.middleware).push.apply(t,e):this.middleware.push(e),this;var t},t.prototype.on=function(e,t){return Object.prototype.hasOwnProperty.call(this.events,e)?this.events[e].push(t):this.events[e]=[t],this},t.prototype.off=function(e,t){if(Object.prototype.hasOwnProperty.call(this.events,e)){for(var r=this.events[e],n=-1,o=0;o<r.length;o++)if(r[o]===t||r[o].listener===t){n=o;break}n>-1&&(1===r.length?delete this.events[e]:u.splice(this.events[e],n))}return this},t.prototype.once=function(e,t){return this.on(e,n(this,e,t))},t.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!Object.prototype.hasOwnProperty.call(this.events,e))return this;var n=this.events[e];if(1===n.length)0===t.length?n[0].call(this):n[0].apply(this,t);else for(var o=0,i=n.slice();o<i.length;o++){var s=i[o];0===t.length?s.call(this):s.apply(this,t)}return this},t.prototype.abort=function(){return this.emit("abort")},t.prototype.handle=function(){var e=this;if(this.opened=!0,/^https?\:\/*(?:[~#\\\?;\:]|$)/.test(this.url))return Promise.reject(this.error('Refused to connect to invalid URL "'+this.url+'"',"EINVALID"));var t,r=this.timeout,n=new Promise(function(n,o){r>0&&(t=setTimeout(function(){o(e.error("Timeout of "+r+"ms exceeded","ETIMEOUT")),e.abort()},r)),e.once("abort",function(){e.emit("progress"),o(e.error("Request aborted","EABORT")),e.transport.abort&&e.transport.abort(e)}),Promise.resolve(e.transport.open(e)).then(function(e){return n(e)},function(e){return o(e)})});return r>0&&n.then(function(){return clearTimeout(t)},function(){return clearTimeout(t)}),n},Object.defineProperty(t.prototype,"completed",{get:function(){return(this.uploaded+this.downloaded)/2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"completedBytes",{get:function(){return this.uploadedBytes+this.downloadedBytes},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"totalBytes",{get:function(){return this.uploadLength+this.downloadLength},enumerable:!0,configurable:!0}),t.prototype._setUploadedBytes=function(e,t){e!==this.uploadedBytes&&(this.uploaded=t||e/this.uploadLength,this.uploadedBytes=e,this.emit("progress"))},t.prototype._setDownloadedBytes=function(e,t){e!==this.downloadedBytes&&(this.downloaded=t||e/this.downloadLength,this.downloadedBytes=e,this.emit("progress"))},t}(s.Base);t.Request=c},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),i=function(e){function t(t){var r=e.call(this,t)||this;return r.body=t.body,r.status=t.status,r.statusText=t.statusText,r}return n(t,e),t.prototype.statusType=function(){return~~(this.status/100)},t.prototype.toJSON=function(){return{url:this.url,headers:this.headers,body:this.body,status:this.status,statusText:this.statusText}},t}(o.Base);t.Response=i},function(e,t,r){"use strict";function n(e,t,r){void 0===r&&(r=1);for(var n=t;n<e.length-r;n++)e[n]=e[n+r];e.length-=r}Object.defineProperty(t,"__esModule",{value:!0}),t.splice=n},function(e,t,r){(function(e,n,o){function i(e,r){var n={seen:[],stylize:u};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),v(r)?n.showHidden=r:r&&t._extend(n,r),O(n.showHidden)&&(n.showHidden=!1),O(n.depth)&&(n.depth=2),O(n.colors)&&(n.colors=!1),O(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,e,n.depth)}function s(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function u(e,t){return e}function a(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function c(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return w(o)||(o=c(e,o,n)),o}var i=f(e,r);if(i)return i;var s=Object.keys(r),u=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(E(r)){var v=r.name?": "+r.name:"";return e.stylize("[Function"+v+"]","special")}if(T(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(A(r))return l(r)}var g="",m=!1,b=["{","}"];if(y(r)&&(m=!0,b=["[","]"]),E(r)){g=" [Function"+(r.name?": "+r.name:"")+"]"}if(T(r)&&(g=" "+RegExp.prototype.toString.call(r)),_(r)&&(g=" "+Date.prototype.toUTCString.call(r)),A(r)&&(g=" "+l(r)),0===s.length&&(!m||0==r.length))return b[0]+g+b[1];if(n<0)return T(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var k;return k=m?h(e,r,n,u,s):s.map(function(t){return p(e,r,n,u,t,m)}),e.seen.pop(),d(k,g,b)}function f(e,t){if(O(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):v(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,o){for(var i=[],s=0,u=t.length;s<u;++s)q(t,String(s))?i.push(p(e,t,r,n,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))}),i}function p(e,t,r,n,o,i){var s,u,a;if(a=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},a.get?u=a.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):a.set&&(u=e.stylize("[Setter]","special")),q(n,o)||(s="["+o+"]"),u||(e.seen.indexOf(a.value)<0?(u=g(r)?c(e,a.value,null):c(e,a.value,r-1),u.indexOf("\n")>-1&&(u=i?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),O(s)){if(i&&o.match(/^\d+$/))return u;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function d(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function y(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return null==e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function k(e){return"symbol"==typeof e}function O(e){return void 0===e}function T(e){return j(e)&&"[object RegExp]"===P(e)}function j(e){return"object"==typeof e&&null!==e}function _(e){return j(e)&&"[object Date]"===P(e)}function A(e){return j(e)&&("[object Error]"===P(e)||e instanceof Error)}function E(e){return"function"==typeof e}function x(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function P(e){return Object.prototype.toString.call(e)}function U(e){return e<10?"0"+e.toString(10):e.toString(10)}function S(){var e=new Date,t=[U(e.getHours()),U(e.getMinutes()),U(e.getSeconds())].join(":");return[e.getDate(),D[e.getMonth()],t].join(" ")}function q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var C=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(i(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,o=n.length,s=String(e).replace(C,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r<o;u=n[++r])g(u)||!j(u)?s+=" "+u:s+=" "+i(u);return s},t.deprecate=function(r,i){function s(){if(!u){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?o.trace(i):o.error(i),u=!0}return r.apply(this,arguments)}if(O(e.process))return function(){return t.deprecate(r,i).apply(this,arguments)};if(!0===n.noDeprecation)return r;var u=!1;return s};var I,R={};t.debuglog=function(e){if(O(I)&&(I=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!R[e])if(new RegExp("\\b"+e+"\\b","i").test(I)){var r=n.pid;R[e]=function(){var n=t.format.apply(t,arguments);o.error("%s %d: %s",e,r,n)}}else R[e]=function(){};return R[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=y,t.isBoolean=v,t.isNull=g,t.isNullOrUndefined=m,t.isNumber=b,t.isString=w,t.isSymbol=k,t.isUndefined=O,t.isRegExp=T,t.isObject=j,t.isDate=_,t.isError=A,t.isFunction=E,t.isPrimitive=x,t.isBuffer=r(42);var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){o.log("%s - %s",S(),t.format.apply(t,arguments))},t.inherits=r(41),t._extend=function(e,t){if(!t||!j(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(t,r(0),r(35),r(1))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=r(21),s=n(i),u=r(14),a=n(u),c=r(18),f=n(c),l=r(19),h=n(l),p=r(15),d=n(p),y=r(17),v=n(y),g=function e(t){o(this,e);var r=t.prefix||t.appID;this.store=new s.default(r),this.store.appID=t.appID,this.store.server=t.server,this.store.websocketAddress=t.websocketAddress;var n=new v.default(this.store),i=new f.default(n,this.store),u=new h.default(n);this.UserManager=new a.default(i,this.store),this.Vatoms=new d.default(u)};t.default=g},function(e,t,r){"use strict";(function(t){/*!
* The buffer module from node.js, for the browser.

@@ -7,3 +7,3 @@ *

*/
function r(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}function i(e){return Object.prototype.toString.call(e)}function u(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function s(e){if(w.isFunction(e)){if(O)return e.name;var t=e.toString(),n=t.match(E);return n&&n[1]}}function a(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function c(e){if(O||!w.isFunction(e))return w.inspect(e);var t=s(e);return"[Function"+(t?": "+t:"")+"]"}function f(e){return a(c(e.actual),128)+" "+e.operator+" "+a(c(e.expected),128)}function l(e,t,n,r,o){throw new A.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:o})}function p(e,t){e||l(e,!0,t,"==",A.ok)}function h(e,t,n,s){if(e===t)return!0;if(o(e)&&o(t))return 0===r(e,t);if(w.isDate(e)&&w.isDate(t))return e.getTime()===t.getTime();if(w.isRegExp(e)&&w.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(u(e)&&u(t)&&i(e)===i(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===r(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;s=s||{actual:[],expected:[]};var a=s.actual.indexOf(e);return-1!==a&&a===s.expected.indexOf(t)||(s.actual.push(e),s.expected.push(t),v(e,t,n,s))}return n?e===t:e==t}function d(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function v(e,t,n,r){if(null===e||void 0===e||null===t||void 0===t)return!1;if(w.isPrimitive(e)||w.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=d(e),i=d(t);if(o&&!i||!o&&i)return!1;if(o)return e=T.call(e),t=T.call(t),h(e,t,n);var u,s,a=S(e),c=S(t);if(a.length!==c.length)return!1;for(a.sort(),c.sort(),s=a.length-1;s>=0;s--)if(a[s]!==c[s])return!1;for(s=a.length-1;s>=0;s--)if(u=a[s],!h(e[u],t[u],n,r))return!1;return!0}function y(e,t,n){h(e,t,!0)&&l(e,t,n,"notDeepStrictEqual",y)}function g(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function k(e){var t;try{e()}catch(e){t=e}return t}function m(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=k(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&l(o,n,"Missing expected exception"+r);var i="string"==typeof r,u=!e&&w.isError(o),s=!e&&o&&!n;if((u&&i&&g(o,n)||s)&&l(o,n,"Got unwanted exception"+r),e&&o&&n&&!g(o,n)||!e&&o)throw o}var w=n(2),b=Object.prototype.hasOwnProperty,T=Array.prototype.slice,O=function(){return"foo"===function(){}.name}(),A=e.exports=p,E=/\s*function\s+([^\(\s]*)\s*/;A.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=f(this),this.generatedMessage=!0);var t=e.stackStartFunction||l;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,o=s(t),i=r.indexOf("\n"+o);if(i>=0){var u=r.indexOf("\n",i+1);r=r.substring(u+1)}this.stack=r}}},w.inherits(A.AssertionError,Error),A.fail=l,A.ok=p,A.equal=function(e,t,n){e!=t&&l(e,t,n,"==",A.equal)},A.notEqual=function(e,t,n){e==t&&l(e,t,n,"!=",A.notEqual)},A.deepEqual=function(e,t,n){h(e,t,!1)||l(e,t,n,"deepEqual",A.deepEqual)},A.deepStrictEqual=function(e,t,n){h(e,t,!0)||l(e,t,n,"deepStrictEqual",A.deepStrictEqual)},A.notDeepEqual=function(e,t,n){h(e,t,!1)&&l(e,t,n,"notDeepEqual",A.notDeepEqual)},A.notDeepStrictEqual=y,A.strictEqual=function(e,t,n){e!==t&&l(e,t,n,"===",A.strictEqual)},A.notStrictEqual=function(e,t,n){e===t&&l(e,t,n,"!==",A.notStrictEqual)},A.throws=function(e,t,n){m(!0,e,t,n)},A.doesNotThrow=function(e,t,n){m(!1,e,t,n)},A.ifError=function(e){if(e)throw e};var S=Object.keys||function(e){var t=[];for(var n in e)b.call(e,n)&&t.push(n);return t}}).call(t,n(1))},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n){r(this,e),this.UserApi=t,this.store=n}return o(e,[{key:"register",value:function(e,t,n,r,o,i,u,s){return this.UserApi.register(new RegisterRequest(e,t,n,r,o,i,u,s))}},{key:"register",value:function(e){return this.UserApi.register(e)}},{key:"login",value:function(e,t,n){return this.UserApi.login(e,t,n)}},{key:"loginGuest",value:function(e){return this.UserApi.loginGuest(e)}},{key:"logout",value:function(){return this.UserApi.logout()}},{key:"getCurrentUser",value:function(){return this.UserApi.getCurrentUser()}},{key:"getCurrentUserTokens",value:function(){return this.UserApi.getUserTokens()}},{key:"uploadAvatar",value:function(e){this.UserApi.uploadAvatar(e)}},{key:"updateUser",value:function(e){return this.UserApi.updateUser(e)}},{key:"getAccessToken",value:function(){return this.UserApi.getAccessToken()}},{key:"encodeAssetProvider",value:function(e){return this.UserApi.encodeAssetProvider(e)}},{key:"sendTokenVerification",value:function(e,t){return this.UserApi.sendTokenVerification(e,t)}},{key:"getRefreshToken",value:function(){return this.UserApi.getRefreshToken()}},{key:"setRefreshToken",value:function(e){return this.UserApi.setRefreshToken(e)}},{key:"verifyUserToken",value:function(e){return this.UserApi.verifyUserToken(e)}},{key:"addUserToken",value:function(e){return this.UserApi.addUserToken(e)}},{key:"deleteUserToken",value:function(e){return this.UserApi.deleteUserToken(e)}},{key:"getGuestToken",value:function(){return this.UserApi.getGuestToken()}},{key:"resetPassword",value:function(e,t){return this.UserApi.resetPassword(e,t)}},{key:"addRedeemable",value:function(e){return this.UserApi.addRedeemable(e)}}]),e}();t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){r(this,e),this.vatomApi=t}return o(e,[{key:"performAction",value:function(e,t,n){return n=n||{},n["this.id"]=e,this.vatomApi.performAction(t,n)}},{key:"getUserInventory",value:function(){var e={parent_id:".",page:1,limit:1e3};return this.vatomApi.getUserInventory(e)}},{key:"getUserVatoms",value:function(e){var t={ids:[e]};return this.vatomApi.getUserVatoms(t)}}]),e}();t.default=i},function(e,t,n){"use strict";var r=n(3),o=function(e){return e&&e.__esModule?e:{default:e}}(r);e.exports=o.default},function(e,t,n){"use strict";(function(e){function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(17),a=r(s),c=n(11),f=r(c),l=function(){function t(e){o(this,t),this.store=e}return u(t,[{key:"request",value:function(e,t,n,r,o){var i=this;return!0===r?this.checkToken().then(function(r){return i._request(e,t,n,o)}):this._request(e,t,n,o)}},{key:"_request",value:function(t,n,r,o){var u=this;return o=Object.assign({"App-Id":this.store.appID,Authorization:"Bearer "+this.store.token,"Content-Type":"application/json"},o),r instanceof FormData||"object"!=(void 0===r?"undefined":i(r))||(r=JSON.stringify(r)),r instanceof FormData&&delete o["Content-Type"],new Promise(function(e,i){var s=new XMLHttpRequest;s.responseType="text",s.open(t,u.store.server+n);for(var a in o)s.setRequestHeader(a,o[a]);s.send(r),s.onerror=i,s.onload=function(t){return e(JSON.parse(s.response))}}).then(function(e){return Object.assign(new f.default,e)}).then(function(t){if(e.log(t),!t.payload){var n={11:"Problem with payload",401:"Token has Expired",516:"Invalid Payload",521:"Token Unavailable",527:"Invalid Date Format",2030:"No user found, Please register an account first.",2031:"Authentication Failed",2032:"Login Failed, Please try again",2034:"Invalid Token",2051:"Too many login attempts, Please try again later.",2552:"Unable To Retrieve Token",2563:"Token Already Confirmed",2564:"Invalid Verification Code",2569:"Invalid Phone Number"};if(2051===t.error){var r=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/g.exec(t.message);t.lockedUntil=new Date(r);var o=t.lockedUntil.getTime()-Date.now();o<2e3&&(o=2e3);var i=Math.floor(o/1e3),u=Math.floor(o/1e3/60);i<=90?t.error=t.message.replace("%DURATION%",1==i?"1 second":i+" seconds"):t.message=t.message.replace("%DURATION%",1==u?"1 minute":u+" minutes");var s=new Error("Too many login attempts, Try again at : "+t.lockedUntil);throw s.code=t.error||0,s}var s=new Error(n[t.error]||"An unknown server error occurred.");throw s.code=t.error||0,s}return t.payload})}},{key:"refreshToken",value:function(){var e=this,t={Authorization:"Bearer "+this.store.refreshToken};return this.request("POST","/v1/access_token","",!1,t).then(function(t){e.store.token=t.access_token.token})}},{key:"checkToken",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]&&arguments[0],void 0),t=void 0;if("undefined"==(t=this.store.token)||""==t)this.refreshToken();else try{return e=(0,a.default)(this.store.token),1e3*e.exp,Date.now(),this.refreshToken()}catch(e){return this.refreshToken()}}}]),t}();t.default=l}).call(t,n(0))},function(e,t,n){"use strict";(function(e){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(13),u=function(e){return e&&e.__esModule?e:{default:e}}(i),s=function(){function t(e,n){r(this,t),this.client=e,this.store=n}return o(t,[{key:"getAccessToken",value:function(){return this.store.token}},{key:"setAccessToken",value:function(e){this.store.token="",this.store.token=e}},{key:"getRefreshToken",value:function(){return this.store.refreshToken}},{key:"setRefreshToken",value:function(e){this.store.token="",this.store.refreshToken=e}},{key:"register",value:function(e){var t=this;return this.client.request("POST","/v1/users",e,!1).then(function(e){return t.store.token=e.access_token.token,t.store.refreshToken=e.refresh_token.token,e}).then(function(e){return new u.default(e)})}},{key:"login",value:function(e,t,n){var r=this,o={token:e,token_type:t,auth_data:{password:n}};return this.client.request("POST","/v1/user/login",o,!1).then(function(e){if(n)return r.store.token=e.access_token.token,r.store.refreshToken=e.refresh_token.token,r.store.assetProvider=e.asset_provider,r.store.userID=e.user.id,e;var t=new Error("Login Failed, Password Reset");throw t.code="PASSWORD_RESET",t}).then(function(e){return new u.default(e)})}},{key:"loginGuest",value:function(t){var n=this,r={token:t,token_type:"guest_id"};return this.client.request("POST","/v1/user/login",r,!1).then(function(t){return e.log(t),n.store.token=t.access_token.token,n.store.refreshToken=t.refresh_token.token,n.store.assetProvider=t.asset_provider,t}).then(function(e){return new u.default(e)})}},{key:"loginOAuth",value:function(e,t){}},{key:"uploadAvatar",value:function(e){var t={"Content-Type":"multipart/form-data"};this.client.request("POST","/v1/user/avatar",e,!0,t)}},{key:"getCurrentUser",value:function(t){return this.client.request("GET","/v1/user",t,!0).then(function(t){return e.log(t),t})}},{key:"updateUser",value:function(e){return this.client.request("PATCH","/v1/user",e,!0)}},{key:"getUserTokens",value:function(){return this.client.request("GET","/v1/user/tokens","",!0)}},{key:"verifyUserToken",value:function(e){return this.client.request("POST","/v1/user/verify_token",e,!0)}},{key:"resetPassword",value:function(e,t){var n={token:e,token_type:t};return this.client.request("POST","/v1/user/reset_token",n,!1)}},{key:"sendTokenVerification",value:function(e,t){var n={token:e,token_type:t};return this.client.request("POST","/v1/user/reset_token_verification",n,!1)}},{key:"getGuestToken",value:function(){return this.client.request("POST","/v1/user/guest","",!1).then(function(e){return e.properties.guest_id})}},{key:"logout",value:function(t){this.client.request("POST","/v1/user/logout",t,!0).then(function(){e.log("User has been logged out!"),this.store.token="",this.store.refreshToken=""})}},{key:"extractHostname",value:function(e){var t;return t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t=t.split("?")[0]}},{key:"encodeAssetProvider",value:function(e){for(var t=this.store.assetProvider,n=t.length,r=this.extractHostname(e),o=0;o<n;o++){if(r===this.extractHostname(t[o].uri)){var i=0;for(var u in t[o].descriptor)e+=0===i?"?"+u+"="+t[o].descriptor[u]:"&"+u+"="+t[o].descriptor[u],i++}}return e}},{key:"addUserToken",value:function(e){return this.client.request("POST","/v1/user/tokens",e,!0)}},{key:"deleteUserToken",value:function(e){return this.cliet.request("DELETE","/v1/user/tokens/"+e,null,!0)}},{key:"addRedeemable",value:function(e){var t=this.store.userID;return this.client.request("POST","/v1/users/"+t+"/redeemables",e,!0)}}]),t}();t.default=s}).call(t,n(0))},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){r(this,e),this.client=t}return o(e,[{key:"performAction",value:function(e,t){return this.client.request("POST","/v1/user/vatom/action/"+e,t,!0).then(function(e){e.main.output})}},{key:"getUserInventory",value:function(e){return this.client.request("POST","/v1/user/vatom/inventory",e,!0).then(function(e){return e.vatoms})}},{key:"getUserVatoms",value:function(e){return this.client.request("POST","/v1/user/vatom/get",e,!0).then(function(e){return e})}}]),e}();t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t,n,o,i){r(this,e),this.status=i,this.error=t,this.message=n,this.payload=o};t.default=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){r(this,e),this.prefix=t}return o(e,[{key:"server",get:function(){return this.serverAddress},set:function(e){this.serverAddress=e}},{key:"userID",set:function(e){this.USERID=e},get:function(){return this.USERID}},{key:"appID",get:function(){return this.APPID},set:function(e){this.APPID=e}},{key:"websocketAddress",get:function(){return this.wssocketAddress},set:function(e){this.wssocketAddress=e}},{key:"token",set:function(e){this.accessToken=e},get:function(){return this.accessToken}},{key:"refreshToken",set:function(e){window.localStorage.setItem(this.prefix+"_refresh",e)},get:function(){return window.localStorage.getItem(this.prefix+"_refresh")}},{key:"assetProvider",set:function(e){window.localStorage.setItem(this.prefix+"_asset_provider",JSON.stringify(e))},get:function(){return JSON.parse(window.localStorage.getItem(this.prefix+"_asset_provider")||"undefined")}}]),e}();t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t){r(this,e),this.id=t.user.id,this.firstName=t.user.properties.first_name,this.lastName=t.user.properties.last_name,this.avatarUri=t.user.properties.avatar_uri,this.birthday=t.user.properties.birthday,this.language=t.user.properties.language};t.default=o},function(e,t){function n(){return(new Date).getTime()}e.exports=n},function(e,t){function n(e){this.message=e}function r(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new n("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,i,u=0,s=0,a="";i=t.charAt(s++);~i&&(r=u%4?64*r+i:i,u++%4)?a+=String.fromCharCode(255&r>>(-2*u&6)):0)i=o.indexOf(i);return a}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.name="InvalidCharacterError",e.exports="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||r},function(e,t,n){function r(e){return decodeURIComponent(o(e).replace(/(.)/g,function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}var o=n(15);e.exports=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return r(t)}catch(e){return o(t)}}},function(e,t,n){"use strict";function r(e){this.message=e}var o=n(16);r.prototype=new Error,r.prototype.name="InvalidTokenError",e.exports=function(e,t){if("string"!=typeof e)throw new r("Invalid token specified");t=t||{};var n=!0===t.header?0:1;try{return JSON.parse(o(e.split(".")[n]))}catch(e){throw new r("Invalid token specified: "+e.message)}},e.exports.InvalidTokenError=r},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(l===clearTimeout)return clearTimeout(e);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function u(){v&&h&&(v=!1,h.length?d=h.concat(d):y=-1,d.length&&s())}function s(){if(!v){var e=o(u);v=!0;for(var t=d.length;t;){for(h=d,d=[];++y<t;)h&&h[y].run();y=-1,t=d.length}h=null,v=!1,i(e)}}function a(e,t){this.fun=e,this.array=t}function c(){}var f,l,p=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(e){l=r}}();var h,d=[],v=!1,y=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new a(e,t)),1!==d.length||v||o(s)},a.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=c,p.addListener=c,p.once=c,p.off=c,p.removeListener=c,p.removeAllListeners=c,p.emit=c,p.prependListener=c,p.prependOnceListener=c,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}}]);
function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}function i(e){return Object.prototype.toString.call(e)}function s(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function u(e){if(w.isFunction(e)){if(T)return e.name;var t=e.toString(),r=t.match(_);return r&&r[1]}}function a(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function c(e){if(T||!w.isFunction(e))return w.inspect(e);var t=u(e);return"[Function"+(t?": "+t:"")+"]"}function f(e){return a(c(e.actual),128)+" "+e.operator+" "+a(c(e.expected),128)}function l(e,t,r,n,o){throw new j.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:o})}function h(e,t){e||l(e,!0,t,"==",j.ok)}function p(e,t,r,u){if(e===t)return!0;if(o(e)&&o(t))return 0===n(e,t);if(w.isDate(e)&&w.isDate(t))return e.getTime()===t.getTime();if(w.isRegExp(e)&&w.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(s(e)&&s(t)&&i(e)===i(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;u=u||{actual:[],expected:[]};var a=u.actual.indexOf(e);return-1!==a&&a===u.expected.indexOf(t)||(u.actual.push(e),u.expected.push(t),y(e,t,r,u))}return r?e===t:e==t}function d(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function y(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(w.isPrimitive(e)||w.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=d(e),i=d(t);if(o&&!i||!o&&i)return!1;if(o)return e=O.call(e),t=O.call(t),p(e,t,r);var s,u,a=A(e),c=A(t);if(a.length!==c.length)return!1;for(a.sort(),c.sort(),u=a.length-1;u>=0;u--)if(a[u]!==c[u])return!1;for(u=a.length-1;u>=0;u--)if(s=a[u],!p(e[s],t[s],r,n))return!1;return!0}function v(e,t,r){p(e,t,!0)&&l(e,t,r,"notDeepStrictEqual",v)}function g(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function m(e){var t;try{e()}catch(e){t=e}return t}function b(e,t,r,n){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),o=m(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!o&&l(o,r,"Missing expected exception"+n);var i="string"==typeof n,s=!e&&w.isError(o),u=!e&&o&&!r;if((s&&i&&g(o,r)||u)&&l(o,r,"Got unwanted exception"+n),e&&o&&r&&!g(o,r)||!e&&o)throw o}var w=r(11),k=Object.prototype.hasOwnProperty,O=Array.prototype.slice,T=function(){return"foo"===function(){}.name}(),j=e.exports=h,_=/\s*function\s+([^\(\s]*)\s*/;j.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=f(this),this.generatedMessage=!0);var t=e.stackStartFunction||l;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,o=u(t),i=n.indexOf("\n"+o);if(i>=0){var s=n.indexOf("\n",i+1);n=n.substring(s+1)}this.stack=n}}},w.inherits(j.AssertionError,Error),j.fail=l,j.ok=h,j.equal=function(e,t,r){e!=t&&l(e,t,r,"==",j.equal)},j.notEqual=function(e,t,r){e==t&&l(e,t,r,"!=",j.notEqual)},j.deepEqual=function(e,t,r){p(e,t,!1)||l(e,t,r,"deepEqual",j.deepEqual)},j.deepStrictEqual=function(e,t,r){p(e,t,!0)||l(e,t,r,"deepStrictEqual",j.deepStrictEqual)},j.notDeepEqual=function(e,t,r){p(e,t,!1)&&l(e,t,r,"notDeepEqual",j.notDeepEqual)},j.notDeepStrictEqual=v,j.strictEqual=function(e,t,r){e!==t&&l(e,t,r,"===",j.strictEqual)},j.notStrictEqual=function(e,t,r){e===t&&l(e,t,r,"!==",j.notStrictEqual)},j.throws=function(e,t,r){b(!0,e,t,r)},j.doesNotThrow=function(e,t,r){b(!1,e,t,r)},j.ifError=function(e){if(e)throw e};var A=Object.keys||function(e){var t=[];for(var r in e)k.call(e,r)&&t.push(r);return t}}).call(t,r(0))},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t,r){n(this,e),this.UserApi=t,this.store=r}return o(e,[{key:"register",value:function(e,t,r,n,o,i,s,u){return this.UserApi.register(new RegisterRequest(e,t,r,n,o,i,s,u))}},{key:"register",value:function(e){return this.UserApi.register(e)}},{key:"login",value:function(e,t,r){return this.UserApi.login(e,t,r)}},{key:"loginGuest",value:function(e){return this.UserApi.loginGuest(e)}},{key:"logout",value:function(){return this.UserApi.logout()}},{key:"getCurrentUser",value:function(){return this.UserApi.getCurrentUser()}},{key:"getCurrentUserTokens",value:function(){return this.UserApi.getUserTokens()}},{key:"uploadAvatar",value:function(e){this.UserApi.uploadAvatar(e)}},{key:"updateUser",value:function(e){return this.UserApi.updateUser(e)}},{key:"getAccessToken",value:function(){return this.UserApi.getAccessToken()}},{key:"encodeAssetProvider",value:function(e){return this.UserApi.encodeAssetProvider(e)}},{key:"sendTokenVerification",value:function(e,t){return this.UserApi.sendTokenVerification(e,t)}},{key:"getRefreshToken",value:function(){return this.UserApi.getRefreshToken()}},{key:"setRefreshToken",value:function(e){return this.UserApi.setRefreshToken(e)}},{key:"verifyUserToken",value:function(e){return this.UserApi.verifyUserToken(e)}},{key:"addUserToken",value:function(e){return this.UserApi.addUserToken(e)}},{key:"deleteUserToken",value:function(e){return this.UserApi.deleteUserToken(e)}},{key:"getGuestToken",value:function(){return this.UserApi.getGuestToken()}},{key:"resetPassword",value:function(e,t){return this.UserApi.resetPassword(e,t)}},{key:"addRedeemable",value:function(e){return this.UserApi.addRedeemable(e)}}]),e}();t.default=i},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){n(this,e),this.vatomApi=t}return o(e,[{key:"performAction",value:function(e,t,r){return r=r||{},r["this.id"]=e,this.vatomApi.performAction(t,r)}},{key:"getUserInventory",value:function(){var e={parent_id:".",page:1,limit:1e3};return this.vatomApi.getUserInventory(e)}},{key:"getUserVatoms",value:function(e){var t={ids:[e]};return this.vatomApi.getUserVatoms(t)}}]),e}();t.default=i},function(e,t,r){"use strict";var n=r(12),o=function(e){return e&&e.__esModule?e:{default:e}}(n);e.exports=o.default},function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(31),u=r(26),a=n(u),c=r(20),f=n(c),l=function(){function t(e){o(this,t),this.store=e}return i(t,[{key:"request",value:function(e,t,r,n,o){var i=this;return!0===n?this.checkToken().then(function(n){return i._request(e,t,r,o)}):this._request(e,t,r,o)}},{key:"_request",value:function(t,r,n,o){return o=Object.assign({"App-Id":this.store.appID,Authorization:"Bearer "+this.store.token,"Content-Type":"application/json"},o),(0,s.request)({method:t,url:this.store.server+r,body:n,headers:o}).use(s.plugins.parse("json")).then(function(e){return Object.assign(new f.default,e.body)}).then(function(t){if(e.log(t),!t.payload){var r={11:"Problem with payload",401:"Token has Expired",516:"Invalid Payload",521:"Token Unavailable",527:"Invalid Date Format",2030:"No user found, Please register an account first.",2031:"Authentication Failed",2032:"Login Failed, Please try again",2034:"Invalid Token",2051:"Too many login attempts, Please try again later.",2552:"Unable To Retrieve Token",2563:"Token Already Confirmed",2564:"Invalid Verification Code",2569:"Invalid Phone Number"};if(2051===t.error){var n=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/g.exec(t.message);t.lockedUntil=new Date(n);var o=t.lockedUntil.getTime()-Date.now();o<2e3&&(o=2e3);var i=Math.floor(o/1e3),s=Math.floor(o/1e3/60);i<=90?t.error=t.message.replace("%DURATION%",1==i?"1 second":i+" seconds"):t.message=t.message.replace("%DURATION%",1==s?"1 minute":s+" minutes");var u=new Error("Too many login attempts, Try again at : "+t.lockedUntil);throw u.code=t.error||0,u}var u=new Error(r[t.error]||"An unknown server error occurred.");throw u.code=t.error||0,u}return t.payload})}},{key:"refreshToken",value:function(){var e=this,t={Authorization:"Bearer "+this.store.refreshToken};return this.request("POST","/v1/access_token","",!1,t).then(function(t){e.store.token=t.access_token.token})}},{key:"checkToken",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]&&arguments[0],void 0),t=void 0;if("undefined"==(t=this.store.token)||""==t)this.refreshToken();else try{return e=(0,a.default)(this.store.token),1e3*e.exp,Date.now(),this.refreshToken()}catch(e){return this.refreshToken()}}}]),t}();t.default=l}).call(t,r(1))},function(e,t,r){"use strict";(function(e){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(22),s=function(e){return e&&e.__esModule?e:{default:e}}(i),u=function(){function t(e,r){n(this,t),this.client=e,this.store=r}return o(t,[{key:"getAccessToken",value:function(){return this.store.token}},{key:"setAccessToken",value:function(e){this.store.token="",this.store.token=e}},{key:"getRefreshToken",value:function(){return this.store.refreshToken}},{key:"setRefreshToken",value:function(e){this.store.token="",this.store.refreshToken=e}},{key:"register",value:function(e){var t=this;return this.client.request("POST","/v1/users",e,!1).then(function(e){return t.store.token=e.access_token.token,t.store.refreshToken=e.refresh_token.token,e}).then(function(e){return new s.default(e)})}},{key:"login",value:function(e,t,r){var n=this,o={token:e,token_type:t,auth_data:{password:r}};return this.client.request("POST","/v1/user/login",o,!1).then(function(e){if(r)return n.store.token=e.access_token.token,n.store.refreshToken=e.refresh_token.token,n.store.assetProvider=e.asset_provider,n.store.userID=e.user.id,e;var t=new Error("Login Failed, Password Reset");throw t.code="PASSWORD_RESET",t}).then(function(e){return new s.default(e)})}},{key:"loginGuest",value:function(t){var r=this,n={token:t,token_type:"guest_id"};return this.client.request("POST","/v1/user/login",n,!1).then(function(t){return e.log(t),r.store.token=t.access_token.token,r.store.refreshToken=t.refresh_token.token,r.store.assetProvider=t.asset_provider,t}).then(function(e){return new s.default(e)})}},{key:"loginOAuth",value:function(e,t){}},{key:"uploadAvatar",value:function(e){var t={"Content-Type":"multipart/form-data"};this.client.request("POST","/v1/user/avatar",e,!0,t)}},{key:"getCurrentUser",value:function(t){return this.client.request("GET","/v1/user",t,!0).then(function(t){return e.log(t),t})}},{key:"updateUser",value:function(e){return this.client.request("PATCH","/v1/user",e,!0)}},{key:"getUserTokens",value:function(){return this.client.request("GET","/v1/user/tokens","",!0)}},{key:"verifyUserToken",value:function(e){return this.client.request("POST","/v1/user/verify_token",e,!0)}},{key:"resetPassword",value:function(e,t){var r={token:e,token_type:t};return this.client.request("POST","/v1/user/reset_token",r,!1)}},{key:"sendTokenVerification",value:function(e,t){var r={token:e,token_type:t};return this.client.request("POST","/v1/user/reset_token_verification",r,!1)}},{key:"getGuestToken",value:function(){return this.client.request("POST","/v1/user/guest","",!1).then(function(e){return e.properties.guest_id})}},{key:"logout",value:function(t){this.client.request("POST","/v1/user/logout",t,!0).then(function(){e.log("User has been logged out!"),this.store.token="",this.store.refreshToken=""})}},{key:"extractHostname",value:function(e){var t;return t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t=t.split("?")[0]}},{key:"encodeAssetProvider",value:function(e){for(var t=this.store.assetProvider,r=t.length,n=this.extractHostname(e),o=0;o<r;o++){if(n===this.extractHostname(t[o].uri)){var i=0;for(var s in t[o].descriptor)e+=0===i?"?"+s+"="+t[o].descriptor[s]:"&"+s+"="+t[o].descriptor[s],i++}}return e}},{key:"addUserToken",value:function(e){return this.client.request("POST","/v1/user/tokens",e,!0)}},{key:"deleteUserToken",value:function(e){return this.cliet.request("DELETE","/v1/user/tokens/"+e,null,!0)}},{key:"addRedeemable",value:function(e){var t=this.store.userID;return this.client.request("POST","/v1/users/"+t+"/redeemables",e,!0)}}]),t}();t.default=u}).call(t,r(1))},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){n(this,e),this.client=t}return o(e,[{key:"performAction",value:function(e,t){return this.client.request("POST","/v1/user/vatom/action/"+e,t,!0).then(function(e){e.main.output})}},{key:"getUserInventory",value:function(e){return this.client.request("POST","/v1/user/vatom/inventory",e,!0).then(function(e){return e.vatoms})}},{key:"getUserVatoms",value:function(e){return this.client.request("POST","/v1/user/vatom/get",e,!0).then(function(e){return e})}}]),e}();t.default=i},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t,r,o,i){n(this,e),this.status=i,this.error=t,this.message=r,this.payload=o};t.default=o},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){n(this,e),this.prefix=t}return o(e,[{key:"server",get:function(){return this.serverAddress},set:function(e){this.serverAddress=e}},{key:"userID",set:function(e){this.USERID=e},get:function(){return this.USERID}},{key:"appID",get:function(){return this.APPID},set:function(e){this.APPID=e}},{key:"websocketAddress",get:function(){return this.wssocketAddress},set:function(e){this.wssocketAddress=e}},{key:"token",set:function(e){this.accessToken=e},get:function(){return this.accessToken}},{key:"refreshToken",set:function(e){localStorage.setItem(this.prefix+"_refresh",e)},get:function(){return localStorage.getItem(this.prefix+"_refresh")}},{key:"assetProvider",set:function(e){localStorage.setItem(this.prefix+"_asset_provider",JSON.stringify(e))},get:function(){return JSON.parse(localStorage.getItem(this.prefix+"_asset_provider")||"undefined")}}]),e}();t.default=i},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t){n(this,e),this.id=t.user.id,this.firstName=t.user.properties.first_name,this.lastName=t.user.properties.last_name,this.avatarUri=t.user.properties.avatar_uri,this.birthday=t.user.properties.birthday,this.language=t.user.properties.language};t.default=o},function(e,t){function r(){return(new Date).getTime()}e.exports=r},function(e,t){function r(e){this.message=e}function n(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,u=0,a="";i=t.charAt(u++);~i&&(n=s%4?64*n+i:i,s++%4)?a+=String.fromCharCode(255&n>>(-2*s&6)):0)i=o.indexOf(i);return a}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error,r.prototype.name="InvalidCharacterError",e.exports="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||n},function(e,t,r){function n(e){return decodeURIComponent(o(e).replace(/(.)/g,function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}var o=r(24);e.exports=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return n(t)}catch(e){return o(t)}}},function(e,t,r){"use strict";function n(e){this.message=e}var o=r(25);n.prototype=new Error,n.prototype.name="InvalidTokenError",e.exports=function(e,t){if("string"!=typeof e)throw new n("Invalid token specified");t=t||{};var r=!0===t.header?0:1;try{return JSON.parse(o(e.split(".")[r]))}catch(e){throw new n("Invalid token specified: "+e.message)}},e.exports.InvalidTokenError=n},function(e,t,r){"use strict";function n(e,t){return void 0===t&&(t=n.BaseError),i(e,t)}var n,o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=r(28);!function(e){var t=function(e){function t(t,r){e.call(this,t),this.cause=r}return o(t,e),t.prototype.toString=function(){return e.prototype.toString.call(this)+(this.cause?"\nCaused by: "+this.cause.toString():"")},t}(i.BaseError);e.BaseError=t}(n||(n={})),e.exports=n},function(e,t,r){"use strict";function n(e){void 0!==e&&s(this,"message",{configurable:!0,value:e,writable:!0});var t=this.constructor.name;void 0!==t&&t!==this.name&&s(this,"name",{configurable:!0,value:t,writable:!0}),u(this,this.constructor)}function o(e,t){if(null==t||t===Error)t=n;else if("function"!=typeof t)throw new TypeError("super_ should be a function");var r;if("string"==typeof e)r=e,e=void 0!==i?function(){return i(t,arguments,this.constructor)}:function(){t.apply(this,arguments)},void 0!==a&&(a(e,r),r=void 0);else if("function"!=typeof e)throw new TypeError("constructor should be either a string or a function");e.super_=e.super=t;var o={constructor:{configurable:!0,value:e,writable:!0}};return void 0!==r&&(o.name={configurable:!0,value:r,writable:!0}),e.prototype=Object.create(t.prototype,o),e}var i="undefined"!=typeof Reflect?Reflect.construct:void 0,s=Object.defineProperty,u=Error.captureStackTrace;void 0===u&&(u=function(e){var t=new Error;s(e,"stack",{configurable:!0,get:function(){var e=t.stack;return s(this,"stack",{configurable:!0,value:e,writable:!0}),e},set:function(t){s(e,"stack",{configurable:!0,value:t,writable:!0})}})}),n.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:n,writable:!0}});var a=function(){function e(e,t){return s(e,"name",{configurable:!0,value:t})}try{var t=function(){};if(e(t,"foo"),"foo"===t.name)return e}catch(e){}}();t=e.exports=o,t.BaseError=n},function(e,t,r){"use strict";function n(e){return{use:c,abort:i,open:function(t){return o(t,e)}}}function o(e,t){return new Promise(function(r,n){function o(){return new Promise(function(e){return e(new u.Response({status:1223===f.status?204:f.status,statusText:f.statusText,rawHeaders:s(f.getAllResponseHeaders()),body:"text"===i?f.responseText:f.response,url:f.responseURL}))})}var i=t.type||"text",a=e.url,c=e.method;if("https:"===window.location.protocol&&/^http\:/.test(a))return n(e.error('The request to "'+a+'" was blocked',"EBLOCKED"));var f=e._raw=new XMLHttpRequest;f.onload=function(){return r(o())},f.onabort=function(){return r(o())},f.onerror=function(){return n(e.error('Unable to connect to "'+e.url+'"',"EUNAVAILABLE"))},f.onprogress=function(t){t.lengthComputable&&(e.downloadLength=t.total),e._setDownloadedBytes(t.loaded)},f.upload.onloadend=function(){return e.downloaded=1},"GET"!==c&&"HEAD"!==c&&f.upload?(f.upload.onprogress=function(t){t.lengthComputable&&(e.uploadLength=t.total),e._setUploadedBytes(t.loaded)},f.upload.onloadend=function(){return e.uploaded=1}):(e.uploadLength=0,e._setUploadedBytes(0,1));try{f.open(c,a)}catch(t){return n(e.error('Refused to connect to "'+a+'"',"ECSP",t))}if(t.withCredentials&&(f.withCredentials=!0),t.overrideMimeType&&f.overrideMimeType(t.overrideMimeType),"text"!==i)try{f.responseType=i}finally{if(f.responseType!==i)return n(e.error("Unsupported type: "+i,"ETYPE"))}for(var l=0;l<e.rawHeaders.length;l+=2)f.setRequestHeader(e.rawHeaders[l],e.rawHeaders[l+1]);f.send(e.body)})}function i(e){e._raw.abort()}function s(e){for(var t=[],r=e.split(/\r?\n/),n=0,o=r;n<o.length;n++){var i=o[n];if(i){var s=i.indexOf(":"),u=i.substr(0,s).trim(),a=i.substr(s+1).trim();t.push(u,a)}}return t}Object.defineProperty(t,"__esModule",{value:!0});var u=r(9),a=r(7);t.createTransport=n;var c=[a.stringify(),a.headers()]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){throw new TypeError("Cookie jars are not available in browsers")}return e}();t.CookieJar=n},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}function o(e){var t=l.createTransport({type:"text"}),r=Object.assign({},{transport:t},e);return function(e){var t=Object.assign({},r,"string"==typeof e?{url:e}:e);if("string"!=typeof t.url)throw new TypeError("The URL must be a string");return new s.Request(t)}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(3);t.FormData=i;var s=r(8),u=r(7);t.plugins=u;var a=r(6);t.form=a.default;var c=r(32);t.jar=c.default;var f=r(5);t.PopsicleError=f.default;var l=r(29);t.createTransport=l.createTransport,t.defaults=o,t.request=o({}),t.get=o({method:"get"}),t.post=o({method:"post"}),t.put=o({method:"put"}),t.patch=o({method:"patch"}),t.del=o({method:"delete"}),t.head=o({method:"head"}),n(r(2)),n(r(8)),n(r(9)),t.default=t.request},function(e,t,r){"use strict";function n(e){return new o.CookieJar(e)}Object.defineProperty(t,"__esModule",{value:!0});var o=r(30);t.default=n},function(e,t,r){"use strict";function n(e){return function(){return e}}function o(e,t){for(var r=Array.isArray(e)?e:[e],n=0,o=r;n<o.length;n++){var i=o[n];if("json"!==i&&"urlencoded"!==i)throw new TypeError("Unexpected parse type: "+i)}return function(e,n){return n().then(function(n){var o=n.body,i=n.type();if(null==o||""===o)return n.body=null,n;if(null==i)throw e.error("Unable to parse empty response content type","EPARSE");if("string"!=typeof o)throw e.error("Unable to parse non-string response body","EPARSE");for(var u=0,a=r;u<a.length;u++){var l=a[u];if("json"===l&&c.test(i)){try{n.body=JSON.parse(o.replace(h,""))}catch(t){throw e.error("Unable to parse response body: "+t.message,"EPARSE",t)}return n}if("urlencoded"===l&&f.test(i))return n.body=s.parse(o),n}if(!1!==t)throw e.error("Unhandled response type: "+i,"EPARSE");return n})}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),s=r(4),u=r(34),a=r(6),c=/^application\/(?:[\w!#\$%&\*`\-\.\^~]*\+)?json$/i,f=/^application\/x-www-form-urlencoded$/i,l=/^multipart\/form-data$/i,h=/^\)\]\}',?\n/;t.wrap=n,t.headers=n(function(e,t){return e.get("Accept")||e.set("Accept","*/*"),e.remove("Host"),t()}),t.stringify=n(function(e,t){var r=e.body;if(Object(r)!==r)return e.body=null==r?null:String(r),t();if(u.default(r))return t();var n=e.type();n||(n="application/json",e.type(n));try{c.test(n)?e.body=JSON.stringify(r):l.test(n)?e.body=a.default(r):f.test(n)&&(e.body=s.stringify(r))}catch(t){return Promise.reject(e.error("Unable to stringify request body: "+t.message,"ESTRINGIFY",t))}return e.body instanceof i&&e.remove("Content-Type"),t()}),t.parse=o},function(e,t,r){"use strict";function n(e){switch(Object.prototype.toString.call(e)){case"[object File]":case"[object Blob]":case"[object FormData]":case"[object ArrayBuffer]":return!0;default:return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(l===clearTimeout)return clearTimeout(e);if((l===n||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function s(){y&&p&&(y=!1,p.length?d=p.concat(d):v=-1,d.length&&u())}function u(){if(!y){var e=o(s);y=!0;for(var t=d.length;t;){for(p=d,d=[];++v<t;)p&&p[v].run();v=-1,t=d.length}p=null,y=!1,i(e)}}function a(e,t){this.fun=e,this.array=t}function c(){}var f,l,h=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(e){f=r}try{l="function"==typeof clearTimeout?clearTimeout:n}catch(e){l=n}}();var p,d=[],y=!1,v=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];d.push(new a(e,t)),1!==d.length||y||o(u)},a.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,r){(function(e,n){var o;!function(i){function s(e){throw new RangeError(q[e])}function u(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function a(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(S,"."),n+u(e.split("."),t).join(".")}function c(e){for(var t,r,n=[],o=0,i=e.length;o<i;)t=e.charCodeAt(o++),t>=55296&&t<=56319&&o<i?(r=e.charCodeAt(o++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--)):n.push(t);return n}function f(e){return u(e,function(e){var t="";return e>65535&&(e-=65536,t+=R(e>>>10&1023|55296),e=56320|1023&e),t+=R(e)}).join("")}function l(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:k}function h(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,r){var n=0;for(e=r?I(e/_):e>>1,e+=I(e/t);e>C*T>>1;n+=k)e=I(e/C);return I(n+(C+1)*e/(e+j))}function d(e){var t,r,n,o,i,u,a,c,h,d,y=[],v=e.length,g=0,m=E,b=A;for(r=e.lastIndexOf(x),r<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&s("not-basic"),y.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<v;){for(i=g,u=1,a=k;o>=v&&s("invalid-input"),c=l(e.charCodeAt(o++)),(c>=k||c>I((w-g)/u))&&s("overflow"),g+=c*u,h=a<=b?O:a>=b+T?T:a-b,!(c<h);a+=k)d=k-h,u>I(w/d)&&s("overflow"),u*=d;t=y.length+1,b=p(g-i,t,0==i),I(g/t)>w-m&&s("overflow"),m+=I(g/t),g%=t,y.splice(g++,0,m)}return f(y)}function y(e){var t,r,n,o,i,u,a,f,l,d,y,v,g,m,b,j=[];for(e=c(e),v=e.length,t=E,r=0,i=A,u=0;u<v;++u)(y=e[u])<128&&j.push(R(y));for(n=o=j.length,o&&j.push(x);n<v;){for(a=w,u=0;u<v;++u)(y=e[u])>=t&&y<a&&(a=y);for(g=n+1,a-t>I((w-r)/g)&&s("overflow"),r+=(a-t)*g,t=a,u=0;u<v;++u)if(y=e[u],y<t&&++r>w&&s("overflow"),y==t){for(f=r,l=k;d=l<=i?O:l>=i+T?T:l-i,!(f<d);l+=k)b=f-d,m=k-d,j.push(R(h(d+b%m,0))),f=I(b/m);j.push(R(h(f,0))),i=p(r,g,n==o),r=0,++n}++r,++t}return j.join("")}function v(e){return a(e,function(e){return P.test(e)?d(e.slice(4).toLowerCase()):e})}function g(e){return a(e,function(e){return U.test(e)?"xn--"+y(e):e})}var m=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof n&&n);var b,w=2147483647,k=36,O=1,T=26,j=38,_=700,A=72,E=128,x="-",P=/^xn--/,U=/[^\x20-\x7E]/,S=/[\x2E\u3002\uFF0E\uFF61]/g,q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=k-O,I=Math.floor,R=String.fromCharCode;b={version:"1.4.1",ucs2:{decode:c,encode:f},decode:d,encode:y,toASCII:g,toUnicode:v},void 0!==(o=function(){return b}.call(t,r,t,e))&&(e.exports=o)}()}).call(t,r(43)(e),r(0))},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,i){t=t||"&",r=r||"=";var s={};if("string"!=typeof e||0===e.length)return s;var u=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var f=0;f<c;++f){var l,h,p,d,y=e[f].replace(u,"%20"),v=y.indexOf(r);v>=0?(l=y.substr(0,v),h=y.substr(v+1)):(l=y,h=""),p=decodeURIComponent(l),d=decodeURIComponent(h),n(s,p)?o(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var o=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,u){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?n(s(e),function(s){var u=encodeURIComponent(o(s))+r;return i(e[s])?n(e[s],function(e){return u+encodeURIComponent(o(e))}).join(t):u+encodeURIComponent(o(e[s]))}).join(t):u?encodeURIComponent(o(u))+r+encodeURIComponent(o(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function o(e,t,r){if(e&&c.isObject(e)&&e instanceof n)return e;var o=new n;return o.parse(e,t,r),o}function i(e){return c.isString(e)&&(e=o(e)),e instanceof n?e.format():n.prototype.format.call(e)}function s(e,t){return o(e,!1,!0).resolve(t)}function u(e,t){return e?o(e,!1,!0).resolveObject(t):t}var a=r(36),c=r(40);t.parse=o,t.resolve=s,t.resolveObject=u,t.format=i,t.Url=n;var f=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["<",">",'"',"`"," ","\r","\n","\t"],d=["{","}","|","\\","^","`"].concat(p),y=["'"].concat(d),v=["%","/","?",";","#"].concat(y),g=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,w={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=r(4);n.prototype.parse=function(e,t,r){if(!c.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),o=-1!==n&&n<e.indexOf("#")?"?":"#",i=e.split(o),s=/\\/g;i[0]=i[0].replace(s,"/"),e=i.join(o);var u=e;if(u=u.trim(),!r&&1===e.split("#").length){var l=h.exec(u);if(l)return this.path=u,this.href=u,this.pathname=l[1],l[2]?(this.search=l[2],this.query=t?T.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var p=f.exec(u);if(p){p=p[0];var d=p.toLowerCase();this.protocol=d,u=u.substr(p.length)}if(r||p||u.match(/^\/\/[^@\/]+@[^@\/]+/)){var j="//"===u.substr(0,2);!j||p&&k[p]||(u=u.substr(2),this.slashes=!0)}if(!k[p]&&(j||p&&!O[p])){for(var _=-1,A=0;A<g.length;A++){var E=u.indexOf(g[A]);-1!==E&&(-1===_||E<_)&&(_=E)}var x,P;P=-1===_?u.lastIndexOf("@"):u.lastIndexOf("@",_),-1!==P&&(x=u.slice(0,P),u=u.slice(P+1),this.auth=decodeURIComponent(x)),_=-1;for(var A=0;A<v.length;A++){var E=u.indexOf(v[A]);-1!==E&&(-1===_||E<_)&&(_=E)}-1===_&&(_=u.length),this.host=u.slice(0,_),u=u.slice(_),this.parseHost(),this.hostname=this.hostname||"";var U="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!U)for(var S=this.hostname.split(/\./),A=0,q=S.length;A<q;A++){var C=S[A];if(C&&!C.match(m)){for(var I="",R=0,D=C.length;R<D;R++)C.charCodeAt(R)>127?I+="x":I+=C[R];if(!I.match(m)){var H=S.slice(0,A),M=S.slice(A+1),B=C.match(b);B&&(H.push(B[1]),M.unshift(B[2])),M.length&&(u="/"+M.join(".")+u),this.hostname=H.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=a.toASCII(this.hostname));var N=this.port?":"+this.port:"",L=this.hostname||"";this.host=L+N,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!w[d])for(var A=0,q=y.length;A<q;A++){var F=y[A];if(-1!==u.indexOf(F)){var z=encodeURIComponent(F);z===F&&(z=escape(F)),u=u.split(F).join(z)}}var G=u.indexOf("#");-1!==G&&(this.hash=u.substr(G),u=u.slice(0,G));var J=u.indexOf("?");if(-1!==J?(this.search=u.substr(J),this.query=u.substr(J+1),t&&(this.query=T.parse(this.query)),u=u.slice(0,J)):t&&(this.search="",this.query={}),u&&(this.pathname=u),O[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var N=this.pathname||"",$=this.search||"";this.path=N+$}return this.href=this.format(),this},n.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&c.isObject(this.query)&&Object.keys(this.query).length&&(i=T.stringify(this.query));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||O[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+o+r+s+n},n.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},n.prototype.resolveObject=function(e){if(c.isString(e)){var t=new n;t.parse(e,!1,!0),e=t}for(var r=new n,o=Object.keys(this),i=0;i<o.length;i++){var s=o[i];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),a=0;a<u.length;a++){var f=u[a];"protocol"!==f&&(r[f]=e[f])}return O[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!O[e.protocol]){for(var l=Object.keys(e),h=0;h<l.length;h++){var p=l[h];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||k[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var y=r.pathname||"",v=r.search||"";r.path=y+v}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),m=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=m||g||r.host&&e.pathname,w=b,T=r.pathname&&r.pathname.split("/")||[],d=e.pathname&&e.pathname.split("/")||[],j=r.protocol&&!O[r.protocol];if(j&&(r.hostname="",r.port=null,r.host&&(""===T[0]?T[0]=r.host:T.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),b=b&&(""===d[0]||""===T[0])),m)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,T=d;else if(d.length)T||(T=[]),T.pop(),T=T.concat(d),r.search=e.search,r.query=e.query;else if(!c.isNullOrUndefined(e.search)){if(j){r.hostname=r.host=T.shift();var _=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");_&&(r.auth=_.shift(),r.host=r.hostname=_.shift())}return r.search=e.search,r.query=e.query,c.isNull(r.pathname)&&c.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=T.slice(-1)[0],E=(r.host||e.host||T.length>1)&&("."===A||".."===A)||""===A,x=0,P=T.length;P>=0;P--)A=T[P],"."===A?T.splice(P,1):".."===A?(T.splice(P,1),x++):x&&(T.splice(P,1),x--);if(!b&&!w)for(;x--;x)T.unshift("..");!b||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),E&&"/"!==T.join("/").substr(-1)&&T.push("");var U=""===T[0]||T[0]&&"/"===T[0].charAt(0);if(j){r.hostname=r.host=U?"":T.length?T.shift():"";var _=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");_&&(r.auth=_.shift(),r.host=r.hostname=_.shift())}return b=b||r.host&&T.length,b&&!U&&T.unshift(""),T.length?r.pathname=T.join("/"):(r.pathname=null,r.path=null),c.isNull(r.pathname)&&c.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}]);
//# sourceMappingURL=blockv-sdk.min.js.map

@@ -7,4 +7,2 @@ 'use strict';

var _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; };
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; }; }(); //

@@ -22,2 +20,4 @@ // BlockV AG. Copyright (c) 2018, all rights reserved.

var _popsicle = require('popsicle');
var _jwtDecode = require('jwt-decode');

@@ -58,3 +58,2 @@

value: function _request(method, endpoint, payload, headers) {
var _this2 = this;

@@ -67,27 +66,10 @@ headers = Object.assign({

// Convert object payload to JSON
if (!(payload instanceof FormData) && (typeof payload === 'undefined' ? 'undefined' : _typeof(payload)) == "object") payload = JSON.stringify(payload);
return (0, _popsicle.request)({
method: method,
url: this.store.server + endpoint,
body: payload,
headers: headers
if (payload instanceof FormData) delete headers['Content-Type'];
// Create promise
return new Promise(function (onSuccess, onFail) {
// Create XHR
var xhr = new XMLHttpRequest();
xhr.responseType = 'text';
xhr.open(method, _this2.store.server + endpoint);
for (var name in headers) {
xhr.setRequestHeader(name, headers[name]);
}
xhr.send(payload);
// Add handlers
xhr.onerror = onFail;
xhr.onload = function (e) {
return onSuccess(JSON.parse(xhr.response));
};
}).then(function (parsedBody) {
return Object.assign(new _BaseResponse2.default(), parsedBody);
}).use(_popsicle.plugins.parse('json')).then(function (res) {
return Object.assign(new _BaseResponse2.default(), res.body);
}).then(function (response) {

@@ -159,3 +141,3 @@

value: function refreshToken() {
var _this3 = this;
var _this2 = this;

@@ -168,3 +150,3 @@ var options = {

_this3.store.token = data.access_token.token;
_this2.store.token = data.access_token.token;
});

@@ -171,0 +153,0 @@ }

@@ -71,6 +71,6 @@ 'use strict';

set: function set(refresh) {
window.localStorage.setItem(this.prefix + '_refresh', refresh);
localStorage.setItem(this.prefix + '_refresh', refresh);
},
get: function get() {
var rT = window.localStorage.getItem(this.prefix + '_refresh');
var rT = localStorage.getItem(this.prefix + '_refresh');
return rT;

@@ -81,6 +81,6 @@ }

set: function set(provider) {
window.localStorage.setItem(this.prefix + '_asset_provider', JSON.stringify(provider));
localStorage.setItem(this.prefix + '_asset_provider', JSON.stringify(provider));
},
get: function get() {
var aP = JSON.parse(window.localStorage.getItem(this.prefix + '_asset_provider') || 'undefined');
var aP = JSON.parse(localStorage.getItem(this.prefix + '_asset_provider') || 'undefined');
return aP;

@@ -87,0 +87,0 @@ }

{
"name": "@blockv/sdk",
"version": "1.0.3",
"version": "1.1.0",
"description": "Allows web apps to display and interact with vatoms.",

@@ -53,5 +53,6 @@ "main": "lib/index.js",

"lodash": "^4.17.4",
"mocha": "^5.0.4"
"mocha": "^5.0.4",
"popsicle": "^10.0.1"
},
"repository": "github:BLOCKvIO/web-sdk"
}

@@ -11,2 +11,3 @@ //

//
import {request, plugins as popsicle_plugins} from 'popsicle'
import jwt_decode from 'jwt-decode'

@@ -35,2 +36,3 @@ import BaseResponse from './rest/response/BaseResponse'

headers = Object.assign({

@@ -42,32 +44,15 @@ 'App-Id': this.store.appID,

// Convert object payload to JSON
if (!(payload instanceof FormData) && typeof payload == "object")
payload = JSON.stringify(payload)
if(payload instanceof FormData)
delete headers['Content-Type'];
// Create promise
return new Promise((onSuccess, onFail) => {
// Create XHR
var xhr = new XMLHttpRequest()
xhr.responseType = 'text'
xhr.open(method, this.store.server + endpoint)
for(let name in headers){
xhr.setRequestHeader(name, headers[name])
}
return request({
method: method,
url: this.store.server + endpoint,
body: payload,
headers: headers
}).use(popsicle_plugins.parse('json'))
.then(function (res) {
return Object.assign(new BaseResponse(), res.body);
}).then(response=>{
xhr.send(payload)
// Add handlers
xhr.onerror = onFail
xhr.onload = e => onSuccess(JSON.parse(xhr.response))
}).then(function (parsedBody) {
return Object.assign(new BaseResponse(), parsedBody);
}).then(response=>{
console.log(response);

@@ -74,0 +59,0 @@

@@ -54,7 +54,7 @@ //

set refreshToken(refresh){
window.localStorage.setItem(this.prefix+'_refresh', refresh);
localStorage.setItem(this.prefix+'_refresh', refresh);
}
get refreshToken(){
let rT = window.localStorage.getItem(this.prefix+'_refresh');
let rT = localStorage.getItem(this.prefix+'_refresh');
return rT;

@@ -64,7 +64,7 @@ }

set assetProvider(provider){
window.localStorage.setItem(this.prefix+'_asset_provider', JSON.stringify(provider));
localStorage.setItem(this.prefix+'_asset_provider', JSON.stringify(provider));
}
get assetProvider(){
let aP = JSON.parse(window.localStorage.getItem(this.prefix+'_asset_provider') || 'undefined');
let aP = JSON.parse(localStorage.getItem(this.prefix+'_asset_provider') || 'undefined');
return aP;

@@ -71,0 +71,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc