From 3b7132ee1b9dffa4927735e49598dcd92836fcb2 Mon Sep 17 00:00:00 2001 From: mzabriskie Date: Fri, 12 Sep 2014 14:05:14 -0600 Subject: [PATCH] Releasing 0.2.0 --- bower.json | 7 ++++--- dist/axios.amd.min.js | 2 +- dist/axios.min.js | 2 +- package.json | 7 ++++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bower.json b/bower.json index 3dfa439..ea10ed7 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,12 @@ { "name": "axios", "main": "./dist/axios.js", - "version": "0.1.0", + "version": "0.2.0", "homepage": "https://github.com/mzabriskie/axios", "authors": [ "Matt Zabriskie" ], - "description": "Promise based XHR library", + "description": "Promise based HTTP client for the browser and node.js", "moduleType": [ "amd", "globals" @@ -15,7 +15,8 @@ "xhr", "http", "ajax", - "promise" + "promise", + "node" ], "license": "MIT", "ignore": [ diff --git a/dist/axios.amd.min.js b/dist/axios.amd.min.js index ff46df7..aacdf5d 100644 --- a/dist/axios.amd.min.js +++ b/dist/axios.amd.min.js @@ -1,4 +1,4 @@ -/* axios v0.1.0 | (c) 2014 by Matt Zabriskie */ +/* axios v0.2.0 | (c) 2014 by Matt Zabriskie */ define("axios",[],function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){(function(t){function r(){a.forEach(arguments,function(e){c[e]=function(t,n){return c(a.merge(n||{},{method:e,url:t}))}})}function i(){a.forEach(arguments,function(e){c[e]=function(t,n,r){return c(a.merge(r||{},{method:e,url:t,data:n}))}})}var o=n(13).Promise,s=n(2),a=n(3),u=n(4),c=e.exports=function(e){e=a.merge({method:"get",transformRequest:s.transformRequest,transformResponse:s.transformResponse},e),e.withCredentials=e.withCredentials||s.withCredentials;var r=new o(function(r,i){try{"undefined"!=typeof window?n(5)(r,i,e):"undefined"!=typeof t&&n(6)(r,i,e)}catch(o){i(o)}});return r.success=function(e){return r.then(function(t){e(t)}),r},r.error=function(e){return r.then(null,function(t){e(t)}),r},r};c.defaults=s,c.all=o.all,c.spread=u,r("delete","get","head"),i("post","put","patch")}).call(t,n(7))},function(e,t,n){"use strict";var r=n(3),i=/^\s*(\[|\{[^\{])/,o=/[\}\]]\s*$/,s=/^\)\]\}',?\n/,a={"Content-Type":"application/json;charset=utf-8"};e.exports={transformRequest:[function(e){return!r.isObject(e)||r.isFile(e)||r.isBlob(e)?null:JSON.stringify(e)}],transformResponse:[function(e){return"string"==typeof e&&(e=e.replace(s,""),i.test(e)&&o.test(e)&&(e=JSON.parse(e))),e}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:r.merge(a),post:r.merge(a),put:r.merge(a)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(e){function t(e){return"[object Array]"===f.call(e)}function n(e){return"string"==typeof e}function r(e){return"number"==typeof e}function i(e){return null!==e&&"object"==typeof e}function o(e){return"[object Date]"===f.call(e)}function s(e){return"[object File]"===f.call(e)}function a(e){return"[object Blob]"===f.call(e)}function u(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function c(e,t){if(null!==e&&"undefined"!=typeof e){var n=e.constructor===Array||"function"==typeof e.callee;if("object"==typeof e||n||(e=[e]),n)for(var r=0,i=e.length;i>r;r++)t.call(null,e[r],r,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(null,e[o],o,e)}}function h(){var e={};return c(arguments,function(t){c(t,function(t,n){e[n]=t})}),e}var f=Object.prototype.toString;e.exports={isArray:t,isString:n,isNumber:r,isObject:i,isDate:o,isFile:s,isBlob:a,forEach:c,merge:h,trim:u}},function(e){e.exports=function(e){return function(t){e.apply(null,t)}}},function(e,t,n){var r=n(8),i=n(9),o=n(2),s=n(10),a=n(11),u=n(12),c=n(3);e.exports=function(e,t,n){var h=a(n.data,n.headers,n.transformRequest),f=c.merge(o.headers.common,o.headers[n.method]||{},n.headers||{}),l=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP");l.open(n.method,r(n.url,n.params),!0),l.onreadystatechange=function(){if(l&&4===l.readyState){var r=s(l.getAllResponseHeaders()),i={data:a(l.responseText,r,n.transformResponse),status:l.status,headers:r,config:n};(l.status>=200&&l.status<300?e:t)(i.data,i.status,i.headers,i.config),l=null}};var p=u(n.url)?i.read(n.xsrfCookieName||o.xsrfCookieName):void 0;if(p&&(f[n.xsrfHeaderName||o.xsrfHeaderName]=p),c.forEach(f,function(e,t){h||"content-type"!==t.toLowerCase()?l.setRequestHeader(t,e):delete f[t]}),n.withCredentials&&(l.withCredentials=!0),n.responseType)try{l.responseType=n.responseType}catch(d){if("json"!==l.responseType)throw d}l.send(h)}},function(e,t,n){var r=n(8),i=n(2),o=n(11),s=n(3),a=n(14),u=n(15);e.exports=function(e,t,n){var c=o(n.data,n.headers,n.transformRequest),h=s.merge(i.headers.common,i.headers[n.method]||{},n.headers||{}),f=u.parse(n.url),l={host:f.hostname,port:f.port,path:r(f.path,n.params).replace(/^\?/,""),method:n.method,headers:h},p=a.request(l,function(r){var i="";r.on("data",function(e){i+=e}),r.on("end",function(){var s={data:o(i,r.headers,n.transformResponse),status:r.statusCode,headers:r.headers,config:n};(r.statusCode>=200&&r.statusCode<300?e:t)(s.data,s.status,s.headers,s.config)})});p.end(c)}},function(e){function t(){}var n=e.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=t,n.addListener=t,n.once=t,n.off=t,n.removeListener=t,n.removeAllListeners=t,n.emit=t,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}var i=n(3);e.exports=function(e,t){if(!t)return e;var n=[];return i.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(i.isArray(e)||(e=[e]),i.forEach(e,function(e){i.isDate(e)?e=e.toISOString():i.isObject(e)&&(e=JSON.stringify(e)),n.push(r(t)+"="+r(e))}))}),n.length>0&&(e+=(-1===e.indexOf("?")?"?":"&")+n.join("&")),e}},function(e,t,n){"use strict";var r=n(3);e.exports={write:function(e,t,n,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e){var t,n,i,o={};return e?(r.forEach(e.split("\n"),function(e){i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t&&(o[t]=o[t]?o[t]+", "+n:n)}),o):o}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";function r(e){var t=e;return i&&(s.setAttribute("href",t),t=s.href),s.setAttribute("href",t),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:"/"===s.pathname.charAt(0)?s.pathname:"/"+s.pathname}}var i=/(msie|trident)/i.test(navigator.userAgent),o=n(3),s=document.createElement("a"),a=r(window.location.href);e.exports=function(e){var t=o.isString(e)?r(e):e;return t.protocol===a.protocol&&t.host===a.host}},function(e,t,n){"use strict";var r=n(16).Promise,i=n(17).polyfill;t.Promise=r,t.polyfill=i},function(e,t,n){var r=e.exports,i=(n(26).EventEmitter,n(18)),o=n(15);r.request=function(e,t){"string"==typeof e&&(e=o.parse(e)),e||(e={}),e.host||e.port||(e.port=parseInt(window.location.port,10)),!e.host&&e.hostname&&(e.host=e.hostname),e.scheme||(e.scheme=window.location.protocol.split(":")[0]),e.host||(e.host=window.location.hostname||window.location.host),/:/.test(e.host)&&(e.port||(e.port=e.host.split(":")[1]),e.host=e.host.split(":")[0]),e.port||(e.port="https"==e.scheme?443:80);var n=new i(new s,e);return t&&n.on("response",t),n},r.get=function(e,t){e.method="GET";var n=r.request(e,t);return n.end(),n},r.Agent=function(){},r.Agent.defaultMaxSockets=4;var s=function(){if("undefined"==typeof window)throw new Error("no window object present");if(window.XMLHttpRequest)return window.XMLHttpRequest;if(window.ActiveXObject){for(var e=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"],t=0;t",'"',"`"," ","\r","\n"," "],v=["{","}","|","\\","^","`"].concat(g),m=["'"].concat(v),y=["%","/","?",";","#"].concat(m),b=["/","?","#"],w=255,E=/^[a-z0-9A-Z_-]{0,63}$/,_=/^([a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},L={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=n(27);r.prototype.parse=function(e,t,n){if(!u(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e;r=r.trim();var i=p.exec(r);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,r=r.substr(i.length)}if(n||i||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===r.substr(0,2);!s||i&&S[i]||(r=r.substr(2),this.slashes=!0)}if(!S[i]&&(s||i&&!L[i])){for(var a=-1,c=0;ch)&&(a=h)}var f,d;d=-1===a?r.lastIndexOf("@"):r.lastIndexOf("@",a),-1!==d&&(f=r.slice(0,d),r=r.slice(d+1),this.auth=decodeURIComponent(f)),a=-1;for(var c=0;ch)&&(a=h)}-1===a&&(a=r.length),this.host=r.slice(0,a),r=r.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var v=this.hostname.split(/\./),c=0,j=v.length;j>c;c++){var C=v[c];if(C&&!C.match(E)){for(var I="",k=0,R=C.length;R>k;k++)I+=C.charCodeAt(k)>127?"x":C[k];if(!I.match(E)){var O=v.slice(0,c),B=v.slice(c+1),T=C.match(_);T&&(O.push(T[1]),B.unshift(T[2])),B.length&&(r="/"+B.join(".")+r),this.hostname=O.join(".");break}}}if(this.hostname=this.hostname.length>w?"":this.hostname.toLowerCase(),!g){for(var M=this.hostname.split("."),U=[],c=0;cc;c++){var P=m[c],F=encodeURIComponent(P);F===P&&(F=escape(P)),r=r.split(P).join(F)}var H=r.indexOf("#");-1!==H&&(this.hash=r.substr(H),r=r.slice(0,H));var z=r.indexOf("?");if(-1!==z?(this.search=r.substr(z),this.query=r.substr(z+1),t&&(this.query=A.parse(this.query)),r=r.slice(0,z)):t&&(this.search="",this.query={}),r&&(this.pathname=r),L[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var D=this.pathname||"",N=this.search||"";this.path=D+N}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&c(this.query)&&Object.keys(this.query).length&&(o=A.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||L[t])&&i!==!1?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+i+n+s+r},r.prototype.resolve=function(e){return this.resolveObject(i(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(u(e)){var t=new r;t.parse(e,!1,!0),e=t}var n=new r;if(Object.keys(this).forEach(function(e){n[e]=this[e]},this),n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(n[t]=e[t])}),L[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n;if(e.protocol&&e.protocol!==n.protocol){if(!L[e.protocol])return Object.keys(e).forEach(function(t){n[t]=e[t]}),n.href=n.format(),n;if(n.protocol=e.protocol,e.host||S[e.protocol])n.pathname=e.pathname;else{for(var i=(e.pathname||"").split("/");i.length&&!(e.host=i.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),n.pathname=i.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var o=n.pathname||"",s=n.search||"";n.path=o+s}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var a=n.pathname&&"/"===n.pathname.charAt(0),c=e.host||e.pathname&&"/"===e.pathname.charAt(0),l=c||a||n.host&&e.pathname,p=l,d=n.pathname&&n.pathname.split("/")||[],i=e.pathname&&e.pathname.split("/")||[],g=n.protocol&&!L[n.protocol];if(g&&(n.hostname="",n.port=null,n.host&&(""===d[0]?d[0]=n.host:d.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===i[0]?i[0]=e.host:i.unshift(e.host)),e.host=null),l=l&&(""===i[0]||""===d[0])),c)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,d=i;else if(i.length)d||(d=[]),d.pop(),d=d.concat(i),n.search=e.search,n.query=e.query;else if(!f(e.search)){if(g){n.hostname=n.host=d.shift();var v=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;v&&(n.auth=v.shift(),n.host=n.hostname=v.shift())}return n.search=e.search,n.query=e.query,h(n.pathname)&&h(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!d.length)return n.pathname=null,n.path=n.search?"/"+n.search:null,n.href=n.format(),n;for(var m=d.slice(-1)[0],y=(n.host||e.host)&&("."===m||".."===m)||""===m,b=0,w=d.length;w>=0;w--)m=d[w],"."==m?d.splice(w,1):".."===m?(d.splice(w,1),b++):b&&(d.splice(w,1),b--);if(!l&&!p)for(;b--;b)d.unshift("..");!l||""===d[0]||d[0]&&"/"===d[0].charAt(0)||d.unshift(""),y&&"/"!==d.join("/").substr(-1)&&d.push("");var E=""===d[0]||d[0]&&"/"===d[0].charAt(0);if(g){n.hostname=n.host=E?"":d.length?d.shift():"";var v=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;v&&(n.auth=v.shift(),n.host=n.hostname=v.shift())}return l=l||n.host&&d.length,l&&!E&&d.unshift(""),d.length?n.pathname=d.join("/"):(n.pathname=null,n.path=null),h(n.pathname)&&h(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=d.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,n){"use strict";function r(e){if(!v(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof r))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],i(e,this)}function i(e,t){function n(e){c(t,e)}function r(e){f(t,e)}try{e(n,r)}catch(i){r(i)}}function o(e,t,n,r){var i,o,s,a,h=v(n);if(h)try{i=n(r),s=!0}catch(l){a=!0,o=l}else i=r,s=!0;u(t,i)||(h&&s?c(t,i):a?f(t,o):e===S?c(t,i):e===L&&f(t,i))}function s(e,t,n,r){var i=e._subscribers,o=i.length;i[o]=t,i[o+S]=n,i[o+L]=r}function a(e,t){for(var n,r,i=e._subscribers,s=e._detail,a=0;ae||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,r,s,a,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(r=this._events[e],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(s=arguments.length,a=new Array(s-1),u=1;s>u;u++)a[u-1]=arguments[u];r.apply(this,a)}else if(i(r)){for(s=arguments.length,a=new Array(s-1),u=1;s>u;u++)a[u-1]=arguments[u];for(c=r.slice(),s=c.length,u=0;s>u;u++)c[u].apply(this,a)}return!0},t.prototype.addListener=function(e,r){var s;if(!n(r))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(r.listener)?r.listener:r),this._events[e]?i(this._events[e])?this._events[e].push(r):this._events[e]=[this._events[e],r]:this._events[e]=r,i(this._events[e])&&!this._events[e].warned){var s;s=o(this._maxListeners)?t.defaultMaxListeners:this._maxListeners,s&&s>0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},t.prototype.removeListener=function(e,t){var r,o,s,a;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],s=r.length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(a=s;a-->0;)if(r[a]===t||r[a].listener&&r[a].listener===t){o=a;break}if(0>o)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.listenerCount=function(e,t){var r;return r=e._events&&e._events[t]?n(e._events[t])?1:e._events[t].length:0}},function(e,t,n){"use strict";t.decode=t.parse=n(30),t.encode=t.stringify=n(31)},function(e,t,n){function r(e){for(var t=e.getAllResponseHeaders().split(/\r?\n/),n={},r=0;rthis.offset&&(this.emit("data",t.slice(this.offset)),this.offset=t.length))};var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){var r;(function(e,i){!function(o){function s(e){throw RangeError(B[e])}function a(e,t){for(var n=e.length;n--;)e[n]=t(e[n]);return e}function u(e,t){return a(e.split(O),t).join(".")}function c(e){for(var t,n,r=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function h(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=U(e>>>10&1023|55296),e=56320|1023&e),t+=U(e)}).join("")}function f(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:_}function l(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function p(e,t,n){var r=0;for(e=n?M(e/A):e>>1,e+=M(e/t);e>T*S>>1;r+=_)e=M(e/T);return M(r+(T+1)*e/(e+L))}function d(e){var t,n,r,i,o,a,u,c,l,d,g=[],v=e.length,m=0,y=C,b=j;for(n=e.lastIndexOf(I),0>n&&(n=0),r=0;n>r;++r)e.charCodeAt(r)>=128&&s("not-basic"),g.push(e.charCodeAt(r));for(i=n>0?n+1:0;v>i;){for(o=m,a=1,u=_;i>=v&&s("invalid-input"),c=f(e.charCodeAt(i++)),(c>=_||c>M((E-m)/a))&&s("overflow"),m+=c*a,l=b>=u?x:u>=b+S?S:u-b,!(l>c);u+=_)d=_-l,a>M(E/d)&&s("overflow"),a*=d;t=g.length+1,b=p(m-o,t,0==o),M(m/t)>E-y&&s("overflow"),y+=M(m/t),m%=t,g.splice(m++,0,y)}return h(g)}function g(e){var t,n,r,i,o,a,u,h,f,d,g,v,m,y,b,w=[];for(e=c(e),v=e.length,t=C,n=0,o=j,a=0;v>a;++a)g=e[a],128>g&&w.push(U(g));for(r=i=w.length,i&&w.push(I);v>r;){for(u=E,a=0;v>a;++a)g=e[a],g>=t&&u>g&&(u=g);for(m=r+1,u-t>M((E-n)/m)&&s("overflow"),n+=(u-t)*m,t=u,a=0;v>a;++a)if(g=e[a],t>g&&++n>E&&s("overflow"),g==t){for(h=n,f=_;d=o>=f?x:f>=o+S?S:f-o,!(d>h);f+=_)b=h-d,y=_-d,w.push(U(l(d+b%y,0))),h=M(b/y);w.push(U(l(h,0))),o=p(n,m,r==i),n=0,++r}++n,++t}return w.join("")}function v(e){return u(e,function(e){return k.test(e)?d(e.slice(4).toLowerCase()):e})}function m(e){return u(e,function(e){return R.test(e)?"xn--"+g(e):e})}var y="object"==typeof t&&t,b=("object"==typeof e&&e&&e.exports==y&&e,"object"==typeof i&&i);(b.global===b||b.window===b)&&(o=b);var w,E=2147483647,_=36,x=1,S=26,L=38,A=700,j=72,C=128,I="-",k=/^xn--/,R=/[^ -~]/,O=/\x2E|\u3002|\uFF0E|\uFF61/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=_-x,M=Math.floor,U=String.fromCharCode;w={version:"1.2.4",ucs2:{decode:c,encode:h},decode:d,encode:g,toASCII:m,toUnicode:v},r=function(){return w}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}(this)}).call(t,n(36)(e),function(){return this}())},function(e){"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,i,o){r=r||"&",i=i||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(r);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var h=0;c>h;++h){var f,l,p,d,g=e[h].replace(a,"%20"),v=g.indexOf(i);v>=0?(f=g.substr(0,v),l=g.substr(v+1)):(f=g,l=""),p=decodeURIComponent(f),d=decodeURIComponent(l),t(s,p)?n(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e){"use strict";function t(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r>8-o%1*8)){if(i=t.charCodeAt(o+=.75),i>255)throw new e("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|i}return a}),n.atob||(n.atob=function(t){if(t=t.replace(/=+$/,""),t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,o=0,s=0,a="";i=t.charAt(s++);~i&&(n=o%4?64*n+i:i,o++%4)?a+=String.fromCharCode(255&n>>(-2*o&6)):0)i=r.indexOf(i);return a})}()},function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){(function(e,r){function i(e,n){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(n)?r.showHidden=n:n&&t._extend(r,n),E(r.showHidden)&&(r.showHidden=!1),E(r.depth)&&(r.depth=2),E(r.colors)&&(r.colors=!1),E(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e){return e}function a(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function u(e,n,r){if(e.customInspect&&n&&A(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return b(i)||(i=u(e,i,r)),i}var o=c(e,n);if(o)return o;var s=Object.keys(n),g=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),L(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(n);if(0===s.length){if(A(n)){var v=n.name?": "+n.name:"";return e.stylize("[Function"+v+"]","special")}if(_(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(S(n))return e.stylize(Date.prototype.toString.call(n),"date");if(L(n))return h(n)}var m="",y=!1,w=["{","}"];if(d(n)&&(y=!0,w=["[","]"]),A(n)){var E=n.name?": "+n.name:"";m=" [Function"+E+"]"}if(_(n)&&(m=" "+RegExp.prototype.toString.call(n)),S(n)&&(m=" "+Date.prototype.toUTCString.call(n)),L(n)&&(m=" "+h(n)),0===s.length&&(!y||0==n.length))return w[0]+m+w[1];if(0>r)return _(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var x;return x=y?f(e,n,r,g,s):s.map(function(t){return l(e,n,r,g,t,y)}),e.seen.pop(),p(x,m,w)}function c(e,t){if(E(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return y(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,i){for(var o=[],s=0,a=t.length;a>s;++s)o.push(R(t,String(s))?l(e,t,n,r,String(s),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(l(e,t,n,r,i,!0))}),o}function l(e,t,n,r,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),R(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(c.value)<0?(a=v(n)?u(e,c.value,null):u(e,c.value,n-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),E(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),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+": "+a}function p(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function d(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function v(e){return null===e}function m(e){return null==e}function y(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function E(e){return void 0===e}function _(e){return x(e)&&"[object RegExp]"===C(e)}function x(e){return"object"==typeof e&&null!==e}function S(e){return x(e)&&"[object Date]"===C(e)}function L(e){return x(e)&&("[object Error]"===C(e)||e instanceof Error)}function A(e){return"function"==typeof e}function j(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function C(e){return Object.prototype.toString.call(e)}function I(e){return 10>e?"0"+e.toString(10):e.toString(10)}function k(){var e=new Date,t=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var O=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],n=0;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(t){return"[Circular]"}default:return e}}),a=r[n];o>n;a=r[++n])s+=v(a)||!x(a)?" "+a:" "+i(a);return s},t.deprecate=function(n,i){function o(){if(!s){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),s=!0}return n.apply(this,arguments)}if(E(e.process))return function(){return t.deprecate(n,i).apply(this,arguments)};if(r.noDeprecation===!0)return n;var s=!1;return o};var B,T={};t.debuglog=function(e){if(E(B)&&(B=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!T[e])if(new RegExp("\\b"+e+"\\b","i").test(B)){var n=r.pid;T[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else T[e]=function(){};return T[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=d,t.isBoolean=g,t.isNull=v,t.isNullOrUndefined=m,t.isNumber=y,t.isString=b,t.isSymbol=w,t.isUndefined=E,t.isRegExp=_,t.isObject=x,t.isDate=S,t.isError=L,t.isFunction=A,t.isPrimitive=j,t.isBuffer=n(43);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",k(),t.format.apply(t,arguments))},t.inherits=n(49),t._extend=function(e,t){if(!t||!x(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(t,function(){return this}(),n(7))},function(e){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,n){t=e.exports=n(44),t.Readable=t,t.Writable=n(45),t.Duplex=n(46),t.Transform=n(47),t.PassThrough=n(48)},function(e,t,n){e.exports=n(45)},function(e,t,n){e.exports=n(46)},function(e,t,n){e.exports=n(47)},function(e,t,n){e.exports=n(48)},function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,n){(function(t){function r(e){e=e||{};var t=e.highWaterMark;this.highWaterMark=t||0===t?t:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!e.objectMode,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(C||(C=n(51).StringDecoder),this.decoder=new C(e.encoding),this.encoding=e.encoding)}function i(e){return this instanceof i?(this._readableState=new r(e,this),this.readable=!0,void A.call(this)):new i(e)}function o(e,t,n,r,i){var o=c(t,n);if(o)e.emit("error",o);else if(null===n||void 0===n)t.reading=!1,t.ended||h(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||i||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&f(e),p(e,t);else i||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length=I)e=I;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function u(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function c(e,t){var n=null;return S.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?f(e):w(e)}function f(e){var n=e._readableState;n.needReadable=!1,n.emittedReadable||(n.emittedReadable=!0,n.sync?t.nextTick(function(){l(e)}):l(e))}function l(e){e.emit("readable")}function p(e,n){n.readingMore||(n.readingMore=!0,t.nextTick(function(){d(e,n)}))}function d(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length0)return;return 0===r.pipesCount?(r.flowing=!1,void(L.listenerCount(e,"data")>0&&y(e))):void(r.ranOut=!0)}function m(){this._readableState.ranOut&&(this._readableState.ranOut=!1,v(this))}function y(e,n){var r=e._readableState;if(r.flowing)throw new Error("Cannot switch to old mode now.");var i=n||!1,o=!1;e.readable=!0,e.pipe=A.prototype.pipe,e.on=e.addListener=A.prototype.on,e.on("readable",function(){o=!0;for(var t;!i&&null!==(t=e.read());)e.emit("data",t);null===t&&(o=!1,e._readableState.needReadable=!0)}),e.pause=function(){i=!0,this.emit("pause")},e.resume=function(){i=!1,o?t.nextTick(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function b(e,t){var n,r=t.buffer,i=t.length,o=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(s)n=r.shift();else if(!e||e>=i)n=o?r.join(""):S.concat(r,i),r.length=0;else if(ec&&e>u;c++){var a=r[0],f=Math.min(e-u,a.length);o?n+=a.slice(0,f):a.copy(n,u,0,f),f0)throw new Error("endReadable called on non-empty stream");!n.endEmitted&&n.calledRead&&(n.ended=!0,t.nextTick(function(){n.endEmitted||0!==n.length||(n.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function E(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function _(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}e.exports=i;var x=n(52),S=n(50).Buffer;i.ReadableState=r;var L=n(26).EventEmitter;L.listenerCount||(L.listenerCount=function(e,t){return e.listeners(t).length});var A=n(32),j=n(54);j.inherits=n(53);var C;j.inherits(i,A),i.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new S(e,t),t="")),o(this,n,e,t,!1)},i.prototype.unshift=function(e){var t=this._readableState;return o(this,t,e,"",!0)},i.prototype.setEncoding=function(e){C||(C=n(51).StringDecoder),this._readableState.decoder=new C(e),this._readableState.encoding=e};var I=8388608;i.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return f(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&w(this),null;var r=t.needReadable;t.length-e<=t.highWaterMark&&(r=!0),(t.ended||t.reading)&&(r=!1),r&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=u(n,t));var i;return i=e>0?b(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&w(this),i},i.prototype._read=function(){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(e,n){function r(e){e===h&&o()}function i(){e.end()}function o(){e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("drain",d),e.removeListener("error",s),e.removeListener("unpipe",r),h.removeListener("end",i),h.removeListener("end",o),(!e._writableState||e._writableState.needDrain)&&d()}function s(t){c(),e.removeListener("error",s),0===L.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",u),c()}function u(){e.removeListener("close",a),c()}function c(){h.unpipe(e)}var h=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1;var l=(!n||n.end!==!1)&&e!==t.stdout&&e!==t.stderr,p=l?i:o;f.endEmitted?t.nextTick(p):h.once("end",p),e.on("unpipe",r);var d=g(h);return e.on("drain",d),e._events&&e._events.error?x(e._events.error)?e._events.error.unshift(s):e._events.error=[s,e._events.error]:e.on("error",s),e.once("close",a),e.once("finish",u),e.emit("pipe",h),f.flowing||(this.on("readable",m),f.flowing=!0,t.nextTick(function(){v(h)})),e},i.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",m),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",m),t.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=_(t.pipes,e);return-1===i?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},i.prototype.on=function(e,t){var n=A.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||y(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&f(this,r):this.read(0))}return n},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){y(this),this.read(0),this.emit("resume")},i.prototype.pause=function(){y(this,!0),this.emit("pause")},i.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length)){var o=r.push(i);o||(n=!0,e.pause())}});for(var i in e)"function"==typeof e[i]&&"undefined"==typeof this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return E(o,function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(){n&&(n=!1,e.resume())},r},i._fromList=b}).call(t,n(7))},function(e,t,n){(function(t){function r(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function i(e,t){e=e||{};var n=e.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var r=e.decodeStrings===!1;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){p(t,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.errorEmitted=!1}function o(e){var t=n(46);return this instanceof o||this instanceof t?(this._writableState=new i(e,this),this.writable=!0,void _.call(this)):new o(e)}function s(e,n,r){var i=new Error("write after end");e.emit("error",i),t.nextTick(function(){r(i)})}function a(e,n,r,i){var o=!0;if(!w.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!n.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s),t.nextTick(function(){i(s)}),o=!1}return o}function u(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new w(t,n)),t}function c(e,t,n,i,o){n=u(t,n,i),w.isBuffer(n)&&(i="buffer");var s=t.objectMode?1:n.length;t.length+=s;var a=t.lengthn;n++)t(e[n],n)}e.exports=r;var s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},a=n(54);a.inherits=n(53);var u=n(44),c=n(45);a.inherits(r,u),o(s(c.prototype),function(e){r.prototype[e]||(r.prototype[e]=c.prototype[e])})}).call(t,n(7))},function(e,t,n){function r(e,t){this.afterTransform=function(e,n){return i(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),i&&i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length0?t>>>0:0;else if("string"===o)"base64"===n&&(t=j(t)),i=e.byteLength(t,n);else{if("object"!==o||null===t)throw new Error("First argument needs to be a number, array or string.");"Buffer"===t.type&&I(t.data)&&(t=t.data),i=+t.length>0?Math.floor(+t.length):0}var s;W?s=e._augment(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(W&&"number"==typeof t.byteLength)s._set(t);else if(k(t))if(e.isBuffer(t))for(a=0;i>a;a++)s[a]=t.readUInt8(a);else for(a=0;i>a;a++)s[a]=(t[a]%256+256)%256;else if("string"===o)s.write(t,0,n);else if("number"===o&&!W&&!r)for(a=0;i>a;a++)s[a]=0;return s}function r(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;F(o%2===0,"Invalid hex string"),r>o/2&&(r=o/2);for(var s=0;r>s;s++){var a=parseInt(t.substr(2*s,2),16);F(!isNaN(a),"Invalid hex string"),e[n+s]=a}return s}function i(e,t,n,r){var i=U(O(t),e,n,r);return i}function o(e,t,n,r){var i=U(B(t),e,n,r);return i}function s(e,t,n,r){return o(e,t,n,r)}function a(e,t,n,r){var i=U(M(t),e,n,r);return i}function u(e,t,n,r){var i=U(T(t),e,n,r);return i}function c(e,t,n){return H.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function h(e,t,n){var r="",i="";n=Math.min(e.length,n);for(var o=t;n>o;o++)e[o]<=127?(r+=N(i)+String.fromCharCode(e[o]),i=""):i+="%"+e[o].toString(16);return r+N(i)}function f(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(e[i]);return r}function l(e,t,n){return f(e,t,n)}function p(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=t;n>o;o++)i+=R(e[o]);return i}function d(e,t,n){for(var r=e.slice(t,n),i="",o=0;o=i)){var o;return n?(o=e[t],i>t+1&&(o|=e[t+1]<<8)):(o=e[t]<<8,i>t+1&&(o|=e[t+1])),o}}function v(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(t+3=i)){var o;return n?(i>t+2&&(o=e[t+2]<<16),i>t+1&&(o|=e[t+1]<<8),o|=e[t],i>t+3&&(o+=e[t+3]<<24>>>0)):(i>t+1&&(o=e[t+1]<<16),i>t+2&&(o|=e[t+2]<<8),i>t+3&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}}function m(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(t+1=i)){var o=g(e,t,n,!0),s=32768&o;return s?-1*(65535-o+1):o}}function y(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(t+3=i)){var o=v(e,t,n,!0),s=2147483648&o;return s?-1*(4294967295-o+1):o}}function b(e,t,n,r){return r||(F("boolean"==typeof n,"missing or invalid endian"),F(t+3=o)){for(var s=0,a=Math.min(o-n,2);a>s;s++)e[n+s]=(t&255<<8*(r?s:1-s))>>>8*(r?s:1-s);return n+2}}function _(e,t,n,r,i){i||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(n+3=o)){for(var s=0,a=Math.min(o-n,4);a>s;s++)e[n+s]=t>>>8*(r?s:3-s)&255;return n+4}}function x(e,t,n,r,i){i||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(n+1=o))return t>=0?E(e,t,n,r,i):E(e,65535+t+1,n,r,i),n+2}function S(e,t,n,r,i){i||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(n+3=o))return t>=0?_(e,t,n,r,i):_(e,4294967295+t+1,n,r,i),n+4}function L(e,t,n,r,i){i||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(n+3=o))return z.write(e,t,n,r,23,4),n+4}function A(e,t,n,r,i){i||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(n+7=o))return z.write(e,t,n,r,52,8),n+8}function j(e){for(e=C(e).replace(J,"");e.length%4!==0;)e+="=";return e}function C(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function I(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function k(t){return I(t)||e.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function R(e){return 16>e?"0"+e.toString(16):e.toString(16)}function O(e){for(var t=[],n=0;n=r)t.push(r);else{var i=n;r>=55296&&57343>=r&&n++;for(var o=encodeURIComponent(e.slice(i,n+1)).substr(1).split("%"),s=0;s>8,r=t%256,i.push(r),i.push(n);return i}function M(e){return H.toByteArray(e)}function U(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function N(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function D(e,t){F("number"==typeof e,"cannot write a non-number as a number"),F(e>=0,"specified a negative value for writing an unsigned value"),F(t>=e,"value is larger than maximum value for type"),F(Math.floor(e)===e,"value has a fractional component")}function q(e,t,n){F("number"==typeof e,"cannot write a non-number as a number"),F(t>=e,"value larger than maximum allowed value"),F(e>=n,"value smaller than minimum allowed value"),F(Math.floor(e)===e,"value has a fractional component")}function P(e,t,n){F("number"==typeof e,"cannot write a non-number as a number"),F(t>=e,"value larger than maximum allowed value"),F(e>=n,"value smaller than minimum allowed value")}function F(e,t){if(!e)throw new Error(t||"Failed assertion")}/*! * The buffer module from node.js, for the browser. diff --git a/dist/axios.min.js b/dist/axios.min.js index 7bf1dc1..cd19146 100644 --- a/dist/axios.min.js +++ b/dist/axios.min.js @@ -1,4 +1,4 @@ -/* axios v0.1.0 | (c) 2014 by Matt Zabriskie */ +/* axios v0.2.0 | (c) 2014 by Matt Zabriskie */ var axios=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){(function(t){function r(){a.forEach(arguments,function(e){c[e]=function(t,n){return c(a.merge(n||{},{method:e,url:t}))}})}function i(){a.forEach(arguments,function(e){c[e]=function(t,n,r){return c(a.merge(r||{},{method:e,url:t,data:n}))}})}var o=n(13).Promise,s=n(2),a=n(3),u=n(4),c=e.exports=function(e){e=a.merge({method:"get",transformRequest:s.transformRequest,transformResponse:s.transformResponse},e),e.withCredentials=e.withCredentials||s.withCredentials;var r=new o(function(r,i){try{"undefined"!=typeof window?n(5)(r,i,e):"undefined"!=typeof t&&n(6)(r,i,e)}catch(o){i(o)}});return r.success=function(e){return r.then(function(t){e(t)}),r},r.error=function(e){return r.then(null,function(t){e(t)}),r},r};c.defaults=s,c.all=o.all,c.spread=u,r("delete","get","head"),i("post","put","patch")}).call(t,n(7))},function(e,t,n){"use strict";var r=n(3),i=/^\s*(\[|\{[^\{])/,o=/[\}\]]\s*$/,s=/^\)\]\}',?\n/,a={"Content-Type":"application/json;charset=utf-8"};e.exports={transformRequest:[function(e){return!r.isObject(e)||r.isFile(e)||r.isBlob(e)?null:JSON.stringify(e)}],transformResponse:[function(e){return"string"==typeof e&&(e=e.replace(s,""),i.test(e)&&o.test(e)&&(e=JSON.parse(e))),e}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:r.merge(a),post:r.merge(a),put:r.merge(a)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(e){function t(e){return"[object Array]"===f.call(e)}function n(e){return"string"==typeof e}function r(e){return"number"==typeof e}function i(e){return null!==e&&"object"==typeof e}function o(e){return"[object Date]"===f.call(e)}function s(e){return"[object File]"===f.call(e)}function a(e){return"[object Blob]"===f.call(e)}function u(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function c(e,t){if(null!==e&&"undefined"!=typeof e){var n=e.constructor===Array||"function"==typeof e.callee;if("object"==typeof e||n||(e=[e]),n)for(var r=0,i=e.length;i>r;r++)t.call(null,e[r],r,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(null,e[o],o,e)}}function h(){var e={};return c(arguments,function(t){c(t,function(t,n){e[n]=t})}),e}var f=Object.prototype.toString;e.exports={isArray:t,isString:n,isNumber:r,isObject:i,isDate:o,isFile:s,isBlob:a,forEach:c,merge:h,trim:u}},function(e){e.exports=function(e){return function(t){e.apply(null,t)}}},function(e,t,n){var r=n(8),i=n(9),o=n(2),s=n(10),a=n(11),u=n(12),c=n(3);e.exports=function(e,t,n){var h=a(n.data,n.headers,n.transformRequest),f=c.merge(o.headers.common,o.headers[n.method]||{},n.headers||{}),l=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP");l.open(n.method,r(n.url,n.params),!0),l.onreadystatechange=function(){if(l&&4===l.readyState){var r=s(l.getAllResponseHeaders()),i={data:a(l.responseText,r,n.transformResponse),status:l.status,headers:r,config:n};(l.status>=200&&l.status<300?e:t)(i.data,i.status,i.headers,i.config),l=null}};var p=u(n.url)?i.read(n.xsrfCookieName||o.xsrfCookieName):void 0;if(p&&(f[n.xsrfHeaderName||o.xsrfHeaderName]=p),c.forEach(f,function(e,t){h||"content-type"!==t.toLowerCase()?l.setRequestHeader(t,e):delete f[t]}),n.withCredentials&&(l.withCredentials=!0),n.responseType)try{l.responseType=n.responseType}catch(d){if("json"!==l.responseType)throw d}l.send(h)}},function(e,t,n){var r=n(8),i=n(2),o=n(11),s=n(3),a=n(14),u=n(15);e.exports=function(e,t,n){var c=o(n.data,n.headers,n.transformRequest),h=s.merge(i.headers.common,i.headers[n.method]||{},n.headers||{}),f=u.parse(n.url),l={host:f.hostname,port:f.port,path:r(f.path,n.params).replace(/^\?/,""),method:n.method,headers:h},p=a.request(l,function(r){var i="";r.on("data",function(e){i+=e}),r.on("end",function(){var s={data:o(i,r.headers,n.transformResponse),status:r.statusCode,headers:r.headers,config:n};(r.statusCode>=200&&r.statusCode<300?e:t)(s.data,s.status,s.headers,s.config)})});p.end(c)}},function(e){function t(){}var n=e.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=t,n.addListener=t,n.once=t,n.off=t,n.removeListener=t,n.removeAllListeners=t,n.emit=t,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}var i=n(3);e.exports=function(e,t){if(!t)return e;var n=[];return i.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(i.isArray(e)||(e=[e]),i.forEach(e,function(e){i.isDate(e)?e=e.toISOString():i.isObject(e)&&(e=JSON.stringify(e)),n.push(r(t)+"="+r(e))}))}),n.length>0&&(e+=(-1===e.indexOf("?")?"?":"&")+n.join("&")),e}},function(e,t,n){"use strict";var r=n(3);e.exports={write:function(e,t,n,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e){var t,n,i,o={};return e?(r.forEach(e.split("\n"),function(e){i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t&&(o[t]=o[t]?o[t]+", "+n:n)}),o):o}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";function r(e){var t=e;return i&&(s.setAttribute("href",t),t=s.href),s.setAttribute("href",t),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:"/"===s.pathname.charAt(0)?s.pathname:"/"+s.pathname}}var i=/(msie|trident)/i.test(navigator.userAgent),o=n(3),s=document.createElement("a"),a=r(window.location.href);e.exports=function(e){var t=o.isString(e)?r(e):e;return t.protocol===a.protocol&&t.host===a.host}},function(e,t,n){"use strict";var r=n(16).Promise,i=n(17).polyfill;t.Promise=r,t.polyfill=i},function(e,t,n){var r=e.exports,i=(n(26).EventEmitter,n(18)),o=n(15);r.request=function(e,t){"string"==typeof e&&(e=o.parse(e)),e||(e={}),e.host||e.port||(e.port=parseInt(window.location.port,10)),!e.host&&e.hostname&&(e.host=e.hostname),e.scheme||(e.scheme=window.location.protocol.split(":")[0]),e.host||(e.host=window.location.hostname||window.location.host),/:/.test(e.host)&&(e.port||(e.port=e.host.split(":")[1]),e.host=e.host.split(":")[0]),e.port||(e.port="https"==e.scheme?443:80);var n=new i(new s,e);return t&&n.on("response",t),n},r.get=function(e,t){e.method="GET";var n=r.request(e,t);return n.end(),n},r.Agent=function(){},r.Agent.defaultMaxSockets=4;var s=function(){if("undefined"==typeof window)throw new Error("no window object present");if(window.XMLHttpRequest)return window.XMLHttpRequest;if(window.ActiveXObject){for(var e=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"],t=0;t",'"',"`"," ","\r","\n"," "],v=["{","}","|","\\","^","`"].concat(g),m=["'"].concat(v),y=["%","/","?",";","#"].concat(m),b=["/","?","#"],w=255,E=/^[a-z0-9A-Z_-]{0,63}$/,_=/^([a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},L={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=n(27);r.prototype.parse=function(e,t,n){if(!u(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e;r=r.trim();var i=p.exec(r);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,r=r.substr(i.length)}if(n||i||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===r.substr(0,2);!s||i&&S[i]||(r=r.substr(2),this.slashes=!0)}if(!S[i]&&(s||i&&!L[i])){for(var a=-1,c=0;ch)&&(a=h)}var f,d;d=-1===a?r.lastIndexOf("@"):r.lastIndexOf("@",a),-1!==d&&(f=r.slice(0,d),r=r.slice(d+1),this.auth=decodeURIComponent(f)),a=-1;for(var c=0;ch)&&(a=h)}-1===a&&(a=r.length),this.host=r.slice(0,a),r=r.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var v=this.hostname.split(/\./),c=0,j=v.length;j>c;c++){var C=v[c];if(C&&!C.match(E)){for(var I="",k=0,R=C.length;R>k;k++)I+=C.charCodeAt(k)>127?"x":C[k];if(!I.match(E)){var O=v.slice(0,c),B=v.slice(c+1),T=C.match(_);T&&(O.push(T[1]),B.unshift(T[2])),B.length&&(r="/"+B.join(".")+r),this.hostname=O.join(".");break}}}if(this.hostname=this.hostname.length>w?"":this.hostname.toLowerCase(),!g){for(var M=this.hostname.split("."),U=[],c=0;cc;c++){var P=m[c],F=encodeURIComponent(P);F===P&&(F=escape(P)),r=r.split(P).join(F)}var H=r.indexOf("#");-1!==H&&(this.hash=r.substr(H),r=r.slice(0,H));var z=r.indexOf("?");if(-1!==z?(this.search=r.substr(z),this.query=r.substr(z+1),t&&(this.query=A.parse(this.query)),r=r.slice(0,z)):t&&(this.search="",this.query={}),r&&(this.pathname=r),L[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var D=this.pathname||"",N=this.search||"";this.path=D+N}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&c(this.query)&&Object.keys(this.query).length&&(o=A.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||L[t])&&i!==!1?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+i+n+s+r},r.prototype.resolve=function(e){return this.resolveObject(i(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(u(e)){var t=new r;t.parse(e,!1,!0),e=t}var n=new r;if(Object.keys(this).forEach(function(e){n[e]=this[e]},this),n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(n[t]=e[t])}),L[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n;if(e.protocol&&e.protocol!==n.protocol){if(!L[e.protocol])return Object.keys(e).forEach(function(t){n[t]=e[t]}),n.href=n.format(),n;if(n.protocol=e.protocol,e.host||S[e.protocol])n.pathname=e.pathname;else{for(var i=(e.pathname||"").split("/");i.length&&!(e.host=i.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),n.pathname=i.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var o=n.pathname||"",s=n.search||"";n.path=o+s}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var a=n.pathname&&"/"===n.pathname.charAt(0),c=e.host||e.pathname&&"/"===e.pathname.charAt(0),l=c||a||n.host&&e.pathname,p=l,d=n.pathname&&n.pathname.split("/")||[],i=e.pathname&&e.pathname.split("/")||[],g=n.protocol&&!L[n.protocol];if(g&&(n.hostname="",n.port=null,n.host&&(""===d[0]?d[0]=n.host:d.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===i[0]?i[0]=e.host:i.unshift(e.host)),e.host=null),l=l&&(""===i[0]||""===d[0])),c)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,d=i;else if(i.length)d||(d=[]),d.pop(),d=d.concat(i),n.search=e.search,n.query=e.query;else if(!f(e.search)){if(g){n.hostname=n.host=d.shift();var v=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;v&&(n.auth=v.shift(),n.host=n.hostname=v.shift())}return n.search=e.search,n.query=e.query,h(n.pathname)&&h(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!d.length)return n.pathname=null,n.path=n.search?"/"+n.search:null,n.href=n.format(),n;for(var m=d.slice(-1)[0],y=(n.host||e.host)&&("."===m||".."===m)||""===m,b=0,w=d.length;w>=0;w--)m=d[w],"."==m?d.splice(w,1):".."===m?(d.splice(w,1),b++):b&&(d.splice(w,1),b--);if(!l&&!p)for(;b--;b)d.unshift("..");!l||""===d[0]||d[0]&&"/"===d[0].charAt(0)||d.unshift(""),y&&"/"!==d.join("/").substr(-1)&&d.push("");var E=""===d[0]||d[0]&&"/"===d[0].charAt(0);if(g){n.hostname=n.host=E?"":d.length?d.shift():"";var v=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;v&&(n.auth=v.shift(),n.host=n.hostname=v.shift())}return l=l||n.host&&d.length,l&&!E&&d.unshift(""),d.length?n.pathname=d.join("/"):(n.pathname=null,n.path=null),h(n.pathname)&&h(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=d.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,n){"use strict";function r(e){if(!v(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof r))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],i(e,this)}function i(e,t){function n(e){c(t,e)}function r(e){f(t,e)}try{e(n,r)}catch(i){r(i)}}function o(e,t,n,r){var i,o,s,a,h=v(n);if(h)try{i=n(r),s=!0}catch(l){a=!0,o=l}else i=r,s=!0;u(t,i)||(h&&s?c(t,i):a?f(t,o):e===S?c(t,i):e===L&&f(t,i))}function s(e,t,n,r){var i=e._subscribers,o=i.length;i[o]=t,i[o+S]=n,i[o+L]=r}function a(e,t){for(var n,r,i=e._subscribers,s=e._detail,a=0;ae||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,r,s,a,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(r=this._events[e],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(s=arguments.length,a=new Array(s-1),u=1;s>u;u++)a[u-1]=arguments[u];r.apply(this,a)}else if(i(r)){for(s=arguments.length,a=new Array(s-1),u=1;s>u;u++)a[u-1]=arguments[u];for(c=r.slice(),s=c.length,u=0;s>u;u++)c[u].apply(this,a)}return!0},t.prototype.addListener=function(e,r){var s;if(!n(r))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(r.listener)?r.listener:r),this._events[e]?i(this._events[e])?this._events[e].push(r):this._events[e]=[this._events[e],r]:this._events[e]=r,i(this._events[e])&&!this._events[e].warned){var s;s=o(this._maxListeners)?t.defaultMaxListeners:this._maxListeners,s&&s>0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},t.prototype.removeListener=function(e,t){var r,o,s,a;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],s=r.length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(a=s;a-->0;)if(r[a]===t||r[a].listener&&r[a].listener===t){o=a;break}if(0>o)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.listenerCount=function(e,t){var r;return r=e._events&&e._events[t]?n(e._events[t])?1:e._events[t].length:0}},function(e,t,n){"use strict";t.decode=t.parse=n(30),t.encode=t.stringify=n(31)},function(e,t,n){function r(e){for(var t=e.getAllResponseHeaders().split(/\r?\n/),n={},r=0;rthis.offset&&(this.emit("data",t.slice(this.offset)),this.offset=t.length))};var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){var r;(function(e,i){!function(o){function s(e){throw RangeError(B[e])}function a(e,t){for(var n=e.length;n--;)e[n]=t(e[n]);return e}function u(e,t){return a(e.split(O),t).join(".")}function c(e){for(var t,n,r=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function h(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=U(e>>>10&1023|55296),e=56320|1023&e),t+=U(e)}).join("")}function f(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:_}function l(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function p(e,t,n){var r=0;for(e=n?M(e/A):e>>1,e+=M(e/t);e>T*S>>1;r+=_)e=M(e/T);return M(r+(T+1)*e/(e+L))}function d(e){var t,n,r,i,o,a,u,c,l,d,g=[],v=e.length,m=0,y=C,b=j;for(n=e.lastIndexOf(I),0>n&&(n=0),r=0;n>r;++r)e.charCodeAt(r)>=128&&s("not-basic"),g.push(e.charCodeAt(r));for(i=n>0?n+1:0;v>i;){for(o=m,a=1,u=_;i>=v&&s("invalid-input"),c=f(e.charCodeAt(i++)),(c>=_||c>M((E-m)/a))&&s("overflow"),m+=c*a,l=b>=u?x:u>=b+S?S:u-b,!(l>c);u+=_)d=_-l,a>M(E/d)&&s("overflow"),a*=d;t=g.length+1,b=p(m-o,t,0==o),M(m/t)>E-y&&s("overflow"),y+=M(m/t),m%=t,g.splice(m++,0,y)}return h(g)}function g(e){var t,n,r,i,o,a,u,h,f,d,g,v,m,y,b,w=[];for(e=c(e),v=e.length,t=C,n=0,o=j,a=0;v>a;++a)g=e[a],128>g&&w.push(U(g));for(r=i=w.length,i&&w.push(I);v>r;){for(u=E,a=0;v>a;++a)g=e[a],g>=t&&u>g&&(u=g);for(m=r+1,u-t>M((E-n)/m)&&s("overflow"),n+=(u-t)*m,t=u,a=0;v>a;++a)if(g=e[a],t>g&&++n>E&&s("overflow"),g==t){for(h=n,f=_;d=o>=f?x:f>=o+S?S:f-o,!(d>h);f+=_)b=h-d,y=_-d,w.push(U(l(d+b%y,0))),h=M(b/y);w.push(U(l(h,0))),o=p(n,m,r==i),n=0,++r}++n,++t}return w.join("")}function v(e){return u(e,function(e){return k.test(e)?d(e.slice(4).toLowerCase()):e})}function m(e){return u(e,function(e){return R.test(e)?"xn--"+g(e):e})}var y="object"==typeof t&&t,b=("object"==typeof e&&e&&e.exports==y&&e,"object"==typeof i&&i);(b.global===b||b.window===b)&&(o=b);var w,E=2147483647,_=36,x=1,S=26,L=38,A=700,j=72,C=128,I="-",k=/^xn--/,R=/[^ -~]/,O=/\x2E|\u3002|\uFF0E|\uFF61/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=_-x,M=Math.floor,U=String.fromCharCode;w={version:"1.2.4",ucs2:{decode:c,encode:h},decode:d,encode:g,toASCII:m,toUnicode:v},r=function(){return w}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}(this)}).call(t,n(36)(e),function(){return this}())},function(e){"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,i,o){r=r||"&",i=i||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(r);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var h=0;c>h;++h){var f,l,p,d,g=e[h].replace(a,"%20"),v=g.indexOf(i);v>=0?(f=g.substr(0,v),l=g.substr(v+1)):(f=g,l=""),p=decodeURIComponent(f),d=decodeURIComponent(l),t(s,p)?n(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e){"use strict";function t(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r>8-o%1*8)){if(i=t.charCodeAt(o+=.75),i>255)throw new e("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|i}return a}),n.atob||(n.atob=function(t){if(t=t.replace(/=+$/,""),t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,o=0,s=0,a="";i=t.charAt(s++);~i&&(n=o%4?64*n+i:i,o++%4)?a+=String.fromCharCode(255&n>>(-2*o&6)):0)i=r.indexOf(i);return a})}()},function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){(function(e,r){function i(e,n){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(n)?r.showHidden=n:n&&t._extend(r,n),E(r.showHidden)&&(r.showHidden=!1),E(r.depth)&&(r.depth=2),E(r.colors)&&(r.colors=!1),E(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e){return e}function a(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function u(e,n,r){if(e.customInspect&&n&&A(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return b(i)||(i=u(e,i,r)),i}var o=c(e,n);if(o)return o;var s=Object.keys(n),g=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),L(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(n);if(0===s.length){if(A(n)){var v=n.name?": "+n.name:"";return e.stylize("[Function"+v+"]","special")}if(_(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(S(n))return e.stylize(Date.prototype.toString.call(n),"date");if(L(n))return h(n)}var m="",y=!1,w=["{","}"];if(d(n)&&(y=!0,w=["[","]"]),A(n)){var E=n.name?": "+n.name:"";m=" [Function"+E+"]"}if(_(n)&&(m=" "+RegExp.prototype.toString.call(n)),S(n)&&(m=" "+Date.prototype.toUTCString.call(n)),L(n)&&(m=" "+h(n)),0===s.length&&(!y||0==n.length))return w[0]+m+w[1];if(0>r)return _(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var x;return x=y?f(e,n,r,g,s):s.map(function(t){return l(e,n,r,g,t,y)}),e.seen.pop(),p(x,m,w)}function c(e,t){if(E(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return y(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,i){for(var o=[],s=0,a=t.length;a>s;++s)o.push(R(t,String(s))?l(e,t,n,r,String(s),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(l(e,t,n,r,i,!0))}),o}function l(e,t,n,r,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),R(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(c.value)<0?(a=v(n)?u(e,c.value,null):u(e,c.value,n-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),E(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),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+": "+a}function p(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function d(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function v(e){return null===e}function m(e){return null==e}function y(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function E(e){return void 0===e}function _(e){return x(e)&&"[object RegExp]"===C(e)}function x(e){return"object"==typeof e&&null!==e}function S(e){return x(e)&&"[object Date]"===C(e)}function L(e){return x(e)&&("[object Error]"===C(e)||e instanceof Error)}function A(e){return"function"==typeof e}function j(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function C(e){return Object.prototype.toString.call(e)}function I(e){return 10>e?"0"+e.toString(10):e.toString(10)}function k(){var e=new Date,t=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var O=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],n=0;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(t){return"[Circular]"}default:return e}}),a=r[n];o>n;a=r[++n])s+=v(a)||!x(a)?" "+a:" "+i(a);return s},t.deprecate=function(n,i){function o(){if(!s){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),s=!0}return n.apply(this,arguments)}if(E(e.process))return function(){return t.deprecate(n,i).apply(this,arguments)};if(r.noDeprecation===!0)return n;var s=!1;return o};var B,T={};t.debuglog=function(e){if(E(B)&&(B=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!T[e])if(new RegExp("\\b"+e+"\\b","i").test(B)){var n=r.pid;T[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else T[e]=function(){};return T[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=d,t.isBoolean=g,t.isNull=v,t.isNullOrUndefined=m,t.isNumber=y,t.isString=b,t.isSymbol=w,t.isUndefined=E,t.isRegExp=_,t.isObject=x,t.isDate=S,t.isError=L,t.isFunction=A,t.isPrimitive=j,t.isBuffer=n(43);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",k(),t.format.apply(t,arguments))},t.inherits=n(49),t._extend=function(e,t){if(!t||!x(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(t,function(){return this}(),n(7))},function(e){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,n){t=e.exports=n(44),t.Readable=t,t.Writable=n(45),t.Duplex=n(46),t.Transform=n(47),t.PassThrough=n(48)},function(e,t,n){e.exports=n(45)},function(e,t,n){e.exports=n(46)},function(e,t,n){e.exports=n(47)},function(e,t,n){e.exports=n(48)},function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,n){(function(t){function r(e){e=e||{};var t=e.highWaterMark;this.highWaterMark=t||0===t?t:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!e.objectMode,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(C||(C=n(51).StringDecoder),this.decoder=new C(e.encoding),this.encoding=e.encoding)}function i(e){return this instanceof i?(this._readableState=new r(e,this),this.readable=!0,void A.call(this)):new i(e)}function o(e,t,n,r,i){var o=c(t,n);if(o)e.emit("error",o);else if(null===n||void 0===n)t.reading=!1,t.ended||h(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||i||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&f(e),p(e,t);else i||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length=I)e=I;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function u(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function c(e,t){var n=null;return S.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?f(e):w(e)}function f(e){var n=e._readableState;n.needReadable=!1,n.emittedReadable||(n.emittedReadable=!0,n.sync?t.nextTick(function(){l(e)}):l(e))}function l(e){e.emit("readable")}function p(e,n){n.readingMore||(n.readingMore=!0,t.nextTick(function(){d(e,n)}))}function d(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length0)return;return 0===r.pipesCount?(r.flowing=!1,void(L.listenerCount(e,"data")>0&&y(e))):void(r.ranOut=!0)}function m(){this._readableState.ranOut&&(this._readableState.ranOut=!1,v(this))}function y(e,n){var r=e._readableState;if(r.flowing)throw new Error("Cannot switch to old mode now.");var i=n||!1,o=!1;e.readable=!0,e.pipe=A.prototype.pipe,e.on=e.addListener=A.prototype.on,e.on("readable",function(){o=!0;for(var t;!i&&null!==(t=e.read());)e.emit("data",t);null===t&&(o=!1,e._readableState.needReadable=!0)}),e.pause=function(){i=!0,this.emit("pause")},e.resume=function(){i=!1,o?t.nextTick(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function b(e,t){var n,r=t.buffer,i=t.length,o=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(s)n=r.shift();else if(!e||e>=i)n=o?r.join(""):S.concat(r,i),r.length=0;else if(ec&&e>u;c++){var a=r[0],f=Math.min(e-u,a.length);o?n+=a.slice(0,f):a.copy(n,u,0,f),f0)throw new Error("endReadable called on non-empty stream");!n.endEmitted&&n.calledRead&&(n.ended=!0,t.nextTick(function(){n.endEmitted||0!==n.length||(n.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function E(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function _(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}e.exports=i;var x=n(52),S=n(50).Buffer;i.ReadableState=r;var L=n(26).EventEmitter;L.listenerCount||(L.listenerCount=function(e,t){return e.listeners(t).length});var A=n(32),j=n(54);j.inherits=n(53);var C;j.inherits(i,A),i.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new S(e,t),t="")),o(this,n,e,t,!1)},i.prototype.unshift=function(e){var t=this._readableState;return o(this,t,e,"",!0)},i.prototype.setEncoding=function(e){C||(C=n(51).StringDecoder),this._readableState.decoder=new C(e),this._readableState.encoding=e};var I=8388608;i.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return f(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&w(this),null;var r=t.needReadable;t.length-e<=t.highWaterMark&&(r=!0),(t.ended||t.reading)&&(r=!1),r&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=u(n,t));var i;return i=e>0?b(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&w(this),i},i.prototype._read=function(){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(e,n){function r(e){e===h&&o()}function i(){e.end()}function o(){e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("drain",d),e.removeListener("error",s),e.removeListener("unpipe",r),h.removeListener("end",i),h.removeListener("end",o),(!e._writableState||e._writableState.needDrain)&&d()}function s(t){c(),e.removeListener("error",s),0===L.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",u),c()}function u(){e.removeListener("close",a),c()}function c(){h.unpipe(e)}var h=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1;var l=(!n||n.end!==!1)&&e!==t.stdout&&e!==t.stderr,p=l?i:o;f.endEmitted?t.nextTick(p):h.once("end",p),e.on("unpipe",r);var d=g(h);return e.on("drain",d),e._events&&e._events.error?x(e._events.error)?e._events.error.unshift(s):e._events.error=[s,e._events.error]:e.on("error",s),e.once("close",a),e.once("finish",u),e.emit("pipe",h),f.flowing||(this.on("readable",m),f.flowing=!0,t.nextTick(function(){v(h)})),e},i.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",m),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",m),t.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=_(t.pipes,e);return-1===i?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},i.prototype.on=function(e,t){var n=A.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||y(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&f(this,r):this.read(0))}return n},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){y(this),this.read(0),this.emit("resume")},i.prototype.pause=function(){y(this,!0),this.emit("pause")},i.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length)){var o=r.push(i);o||(n=!0,e.pause())}});for(var i in e)"function"==typeof e[i]&&"undefined"==typeof this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return E(o,function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(){n&&(n=!1,e.resume())},r},i._fromList=b}).call(t,n(7))},function(e,t,n){(function(t){function r(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function i(e,t){e=e||{};var n=e.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var r=e.decodeStrings===!1;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){p(t,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.errorEmitted=!1}function o(e){var t=n(46);return this instanceof o||this instanceof t?(this._writableState=new i(e,this),this.writable=!0,void _.call(this)):new o(e)}function s(e,n,r){var i=new Error("write after end");e.emit("error",i),t.nextTick(function(){r(i)})}function a(e,n,r,i){var o=!0;if(!w.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!n.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s),t.nextTick(function(){i(s)}),o=!1}return o}function u(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new w(t,n)),t}function c(e,t,n,i,o){n=u(t,n,i),w.isBuffer(n)&&(i="buffer");var s=t.objectMode?1:n.length;t.length+=s;var a=t.lengthn;n++)t(e[n],n)}e.exports=r;var s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},a=n(54);a.inherits=n(53);var u=n(44),c=n(45);a.inherits(r,u),o(s(c.prototype),function(e){r.prototype[e]||(r.prototype[e]=c.prototype[e])})}).call(t,n(7))},function(e,t,n){function r(e,t){this.afterTransform=function(e,n){return i(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),i&&i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length0?t>>>0:0;else if("string"===o)"base64"===n&&(t=j(t)),i=e.byteLength(t,n);else{if("object"!==o||null===t)throw new Error("First argument needs to be a number, array or string.");"Buffer"===t.type&&I(t.data)&&(t=t.data),i=+t.length>0?Math.floor(+t.length):0}var s;W?s=e._augment(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(W&&"number"==typeof t.byteLength)s._set(t);else if(k(t))if(e.isBuffer(t))for(a=0;i>a;a++)s[a]=t.readUInt8(a);else for(a=0;i>a;a++)s[a]=(t[a]%256+256)%256;else if("string"===o)s.write(t,0,n);else if("number"===o&&!W&&!r)for(a=0;i>a;a++)s[a]=0;return s}function r(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;F(o%2===0,"Invalid hex string"),r>o/2&&(r=o/2);for(var s=0;r>s;s++){var a=parseInt(t.substr(2*s,2),16);F(!isNaN(a),"Invalid hex string"),e[n+s]=a}return s}function i(e,t,n,r){var i=U(O(t),e,n,r);return i}function o(e,t,n,r){var i=U(B(t),e,n,r);return i}function s(e,t,n,r){return o(e,t,n,r)}function a(e,t,n,r){var i=U(M(t),e,n,r);return i}function u(e,t,n,r){var i=U(T(t),e,n,r);return i}function c(e,t,n){return H.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function h(e,t,n){var r="",i="";n=Math.min(e.length,n);for(var o=t;n>o;o++)e[o]<=127?(r+=N(i)+String.fromCharCode(e[o]),i=""):i+="%"+e[o].toString(16);return r+N(i)}function f(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(e[i]);return r}function l(e,t,n){return f(e,t,n)}function p(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=t;n>o;o++)i+=R(e[o]);return i}function d(e,t,n){for(var r=e.slice(t,n),i="",o=0;o=i)){var o;return n?(o=e[t],i>t+1&&(o|=e[t+1]<<8)):(o=e[t]<<8,i>t+1&&(o|=e[t+1])),o}}function v(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(t+3=i)){var o;return n?(i>t+2&&(o=e[t+2]<<16),i>t+1&&(o|=e[t+1]<<8),o|=e[t],i>t+3&&(o+=e[t+3]<<24>>>0)):(i>t+1&&(o=e[t+1]<<16),i>t+2&&(o|=e[t+2]<<8),i>t+3&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}}function m(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(t+1=i)){var o=g(e,t,n,!0),s=32768&o;return s?-1*(65535-o+1):o}}function y(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(t+3=i)){var o=v(e,t,n,!0),s=2147483648&o;return s?-1*(4294967295-o+1):o}}function b(e,t,n,r){return r||(F("boolean"==typeof n,"missing or invalid endian"),F(t+3=o)){for(var s=0,a=Math.min(o-n,2);a>s;s++)e[n+s]=(t&255<<8*(r?s:1-s))>>>8*(r?s:1-s);return n+2}}function _(e,t,n,r,i){i||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(n+3=o)){for(var s=0,a=Math.min(o-n,4);a>s;s++)e[n+s]=t>>>8*(r?s:3-s)&255;return n+4}}function x(e,t,n,r,i){i||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(n+1=o))return t>=0?E(e,t,n,r,i):E(e,65535+t+1,n,r,i),n+2}function S(e,t,n,r,i){i||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(n+3=o))return t>=0?_(e,t,n,r,i):_(e,4294967295+t+1,n,r,i),n+4}function L(e,t,n,r,i){i||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(n+3=o))return z.write(e,t,n,r,23,4),n+4}function A(e,t,n,r,i){i||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(n+7=o))return z.write(e,t,n,r,52,8),n+8}function j(e){for(e=C(e).replace(J,"");e.length%4!==0;)e+="=";return e}function C(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function I(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function k(t){return I(t)||e.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function R(e){return 16>e?"0"+e.toString(16):e.toString(16)}function O(e){for(var t=[],n=0;n=r)t.push(r);else{var i=n;r>=55296&&57343>=r&&n++;for(var o=encodeURIComponent(e.slice(i,n+1)).substr(1).split("%"),s=0;s>8,r=t%256,i.push(r),i.push(n);return i}function M(e){return H.toByteArray(e)}function U(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function N(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function D(e,t){F("number"==typeof e,"cannot write a non-number as a number"),F(e>=0,"specified a negative value for writing an unsigned value"),F(t>=e,"value is larger than maximum value for type"),F(Math.floor(e)===e,"value has a fractional component")}function q(e,t,n){F("number"==typeof e,"cannot write a non-number as a number"),F(t>=e,"value larger than maximum allowed value"),F(e>=n,"value smaller than minimum allowed value"),F(Math.floor(e)===e,"value has a fractional component")}function P(e,t,n){F("number"==typeof e,"cannot write a non-number as a number"),F(t>=e,"value larger than maximum allowed value"),F(e>=n,"value smaller than minimum allowed value")}function F(e,t){if(!e)throw new Error(t||"Failed assertion")}/*! * The buffer module from node.js, for the browser. diff --git a/package.json b/package.json index 85210d9..030378f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "axios", - "version": "0.1.0", - "description": "Promise based XHR library", + "version": "0.2.0", + "description": "Promise based HTTP client for the browser and node.js", "main": "index.js", "scripts": { "test": "grunt test", @@ -15,7 +15,8 @@ "xhr", "http", "ajax", - "promise" + "promise", + "node" ], "author": "Matt Zabriskie", "license": "MIT",