// Aliyun OSS SDK for JavaScript v4.4.4 // Copyright Aliyun.com, Inc. or its affiliates. All Rights Reserved. // License at https://github.com/ali-sdk/ali-oss/blob/master/LICENSE !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.OSS=e()}}(function(){var e;return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return i(r?r:t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a\n'+t+""),n.successStatuses=[200],o.next=5,this.request(n);case 5:return i=o.sent,o.abrupt("return",{bucket:i.headers.location&&i.headers.location.substring(1)||null,res:i.res});case 7:case"end":return o.stop()}},c,this)}),a.deleteBucket=o["default"].mark(function u(e,t,r){var n,i;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._bucketRequestParams("DELETE",e,"",r),t.delegateYield(this.request(n),"t0",2);case 2:if(i=t.t0,200!==i.status&&204!==i.status){t.next=5;break}return t.abrupt("return",{res:i.res});case 5:return t.delegateYield(this.requestError(i),"t1",6);case 6:throw t.t1;case 7:case"end":return t.stop()}},u,this)}),a.putBucketACL=o["default"].mark(function l(e,t,r,n){var i,a;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=this._bucketRequestParams("PUT",e,"acl",n),i.headers={"x-oss-acl":r},i.successStatuses=[200],t.next=5,this.request(i);case 5:return a=t.sent,t.abrupt("return",{bucket:a.headers.location&&a.headers.location.substring(1)||null,res:a.res});case 7:case"end":return t.stop()}},l,this)}),a.getBucketACL=o["default"].mark(function p(e,t,r){var n,i;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._bucketRequestParams("GET",e,"acl",r),n.successStatuses=[200],n.xmlResponse=!0,t.delegateYield(this.request(n),"t0",4);case 4:return i=t.t0,t.abrupt("return",{acl:i.data.AccessControlList.Grant,owner:{id:i.data.Owner.ID,displayName:i.data.Owner.DisplayName},res:i.res});case 6:case"end":return t.stop()}},p,this)}),a.putBucketLogging=o["default"].mark(function f(e,t,r,n){var i,a,s;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=this._bucketRequestParams("PUT",e,"logging",n),a='\n\n\n'+e+"\n",r&&(a+=""+r+"\n"),a+="\n",i.content=a,i.mime="xml",i.successStatuses=[200],t.next=9,this.request(i);case 9:return s=t.sent,t.abrupt("return",{res:s.res});case 11:case"end":return t.stop()}},f,this)}),a.getBucketLogging=o["default"].mark(function h(e,t,r){var n,i,a;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._bucketRequestParams("GET",e,"logging",r),n.successStatuses=[200],n.xmlResponse=!0,t.next=5,this.request(n);case 5:return i=t.sent,a=i.data.LoggingEnabled,t.abrupt("return",{enable:!!a,prefix:a&&a.TargetPrefix||null,res:i.res});case 8:case"end":return t.stop()}},h,this)}),a.deleteBucketLogging=o["default"].mark(function d(e,t,r){var n,i;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._bucketRequestParams("DELETE",e,"logging",r),n.successStatuses=[204,200],t.next=4,this.request(n);case 4:return i=t.sent,t.abrupt("return",{res:i.res});case 6:case"end":return t.stop()}},d,this)}),a.putBucketWebsite=o["default"].mark(function m(e,t,r,n){var i,a,s;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=this._bucketRequestParams("PUT",e,"website",n),r=r||{},r.index=r.index||"index.html",a='\n\n '+r.index+"\n",r.error&&(a+=""+r.error+"\n"),a+="",i.content=a,i.mime="xml",i.successStatuses=[200],t.delegateYield(this.request(i),"t0",10);case 10:return s=t.t0,t.abrupt("return",{res:s.res});case 12:case"end":return t.stop()}},m,this)}),a.getBucketWebsite=o["default"].mark(function v(e,t,r){var n,i;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._bucketRequestParams("GET",e,"website",r),n.successStatuses=[200],n.xmlResponse=!0,t.delegateYield(this.request(n),"t0",4);case 4:return i=t.t0,t.abrupt("return",{index:i.data.IndexDocument.Suffix,error:i.data.ErrorDocument&&i.data.ErrorDocument.Key||null,res:i.res});case 6:case"end":return t.stop()}},v,this)}),a.deleteBucketWebsite=o["default"].mark(function g(e,t,r){var n,i;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._bucketRequestParams("DELETE",e,"website",r),n.successStatuses=[204],t.delegateYield(this.request(n),"t0",3);case 3:return i=t.t0,t.abrupt("return",{res:i.res});case 5:case"end":return t.stop()}},g,this)}),a.putBucketLifecycle=o["default"].mark(function y(e,t,r,n){var i,a,s,c,u,l,p;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(i=this._bucketRequestParams("PUT",e,"lifecycle",n),a='\n\n',s=0;s"+c.days+"":""+c.date+"",l=c.id?""+c.id+"\n":"",a+=" \n"+l+" "+c.prefix+"\n "+c.status+"\n "+u+"\n \n";return a+="",i.content=a,i.mime="xml",i.successStatuses=[200],t.delegateYield(this.request(i),"t0",8);case 8:return p=t.t0,t.abrupt("return",{res:p.res});case 10:case"end":return t.stop()}},y,this)}),a.getBucketLifecycle=o["default"].mark(function b(e,t,r){var n,i,a;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._bucketRequestParams("GET",e,"lifecycle",r),n.successStatuses=[200],n.xmlResponse=!0,t.delegateYield(this.request(n),"t0",4);case 4:return i=t.t0,a=i.data.Rule||null,a&&(Array.isArray(a)||(a=[a]),a=a.map(function(e){var t={id:e.ID,prefix:e.Prefix,status:e.Status};return e.Expiration.Days?t.days=e.Expiration.Days:t.date=e.Expiration.Date,t})),t.abrupt("return",{rules:a,res:i.res});case 8:case"end":return t.stop()}},b,this)}),a.deleteBucketLifecycle=o["default"].mark(function _(e,t,r){var n,i;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._bucketRequestParams("DELETE",e,"lifecycle",r),n.successStatuses=[204],t.delegateYield(this.request(n),"t0",3);case 3:return i=t.t0,t.abrupt("return",{res:i.res});case 5:case"end":return t.stop()}},_,this)}),a.putBucketReferer=o["default"].mark(function x(e,t,r,n,i){var a,s,c,u;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=this._bucketRequestParams("PUT",e,"referer",i),s='\n\n',s+=" "+(r?"true":"false")+"\n",n&&n.length>0){for(s+=" \n",c=0;c"+n[c]+"\n";s+=" \n"}else s+=" \n";return s+="",a.content=s,a.mime="xml",a.successStatuses=[200],t.delegateYield(this.request(a),"t0",9);case 9:return u=t.t0,t.abrupt("return",{res:u.res});case 11:case"end":return t.stop()}},x,this)}),a.getBucketReferer=o["default"].mark(function w(e,t,r){var n,i,a;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._bucketRequestParams("GET",e,"referer",r),n.successStatuses=[200],n.xmlResponse=!0,t.delegateYield(this.request(n),"t0",4);case 4:return i=t.t0,a=i.data.RefererList.Referer||null,a&&(Array.isArray(a)||(a=[a])),t.abrupt("return",{allowEmpty:"true"===i.data.AllowEmptyReferer,referers:a,res:i.res});case 8:case"end":return t.stop()}},w,this)}),a.deleteBucketReferer=o["default"].mark(function E(e,t,r){return o["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.delegateYield(this.putBucketReferer(e,t,!0,null,r),"t0",1);case 1:return n.abrupt("return",n.t0);case 2:case"end":return n.stop()}},E,this)}),a._bucketRequestParams=function(e,t,r,n){return{method:e,bucket:t,subres:r,timeout:n&&n.timeout}}},{"babel-runtime/regenerator":112}],3:[function(e,t,r){(function(r,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(t){if(!(this instanceof o))return new o(t);if(!t||!t.accessKeyId||!t.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");var r={region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:"60s",bucket:null,endpoint:null,cname:!1};if(this.options={},d(t).and(r).to(this.options),this.options.accessKeyId=this.options.accessKeyId.trim(),this.options.accessKeySecret=this.options.accessKeySecret.trim(),this.options.timeout=g(this.options.timeout),this.options.endpoint)this.options.endpoint=this._setEndpoint(this.options.endpoint);else{if(!this.options.region)throw new Error("require options.endpoint or options.region");this.options.endpoint=this._setRegion(this.options.region,this.options.internal,this.options.secure)}this.options.urllib?this.urllib=this.options.urllib:(this.urllib=e("urllib"),this.agent=this.options.agent||new y)}function a(e,t){return e[t]||e[t.toLowerCase()]}var s=e("babel-runtime/regenerator"),c=i(s),u=e("babel-runtime/core-js/object/keys"),l=i(u),p=e("debug")("ali-oss"),f=e("./../shims/crypto.js"),h=e("path"),d=(e("querystring"),e("copy-to")),m=e("mime"),v=e("xml2js"),g=e("humanize-ms"),y=e("agentkeepalive"),b=e("merge-descriptors"),_=e("url"),x=e("is-type-of"),w=e("platform"),E=e("utility"),S=e("../package.json"),k=e("dateformat");t.exports=o;var T=o.prototype;b(T,e("./object")),b(T,e("./bucket")),b(T,e("./multipart")),o.ImageClient=e("./image")(o),o.ClusterClient=e("./cluster")(o),o.STS=e("./sts"),o.Wrapper=e("./wrapper"),T.signature=function(e){p("authorization stringToSign: %s",e);var t=f.createHmac("sha1",this.options.accessKeySecret);return t=t.update(new n(e,"utf8")).digest("base64")},T.authorization=function(e,t,r,n){var i=[e.toUpperCase(),n["Content-Md5"]||"",a(n,"Content-Type"),n["x-oss-date"]],o={};for(var s in n){var c=s.toLowerCase().trim();0===c.indexOf("x-oss-")&&(o[c]=o[c]||[],o[c].push(String(n[s]).trim()))}var u=[];(0,l["default"])(o).sort().forEach(function(e){u.push(e+":"+o[e].join(","))}),i=i.concat(u);var p="";p+=t;var f=[];if(r)if(x.string(r))f.push(r);else if(x.array(r))f=f.concat(r);else for(var h in r){var d=r[h]?h+"="+r[h]:h;f.push(d)}f.length>0&&(p+="?"+f.join("&")),i.push(p);var m=i.join("\n"),v="OSS "+this.options.accessKeyId+":";return v+this.signature(m)},T.createRequest=function(e){var t=this._userAgent(),r={"x-oss-date":k(new Date,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":t,"User-Agent":t};this.options.stsToken&&(r["x-oss-security-token"]=this.options.stsToken),d(e.headers).to(r),a(r,"Content-Type")||(e.mime===m.default_type&&(e.mime=""),e.mime&&e.mime.indexOf("/")>0?r["Content-Type"]=e.mime:r["Content-Type"]=m.lookup(e.mime||h.extname(e.object||""))),e.content&&(r["Content-Md5"]=f.createHash("md5").update(new n(e.content,"utf8")).digest("base64"),r["Content-Length"]||(r["Content-Length"]=e.content.length));var i=this._getResource(e);r.authorization=this.authorization(e.method,i,e.subres,r);var o=this._getReqUrl(e);p("request %s %s, with headers %j, !!stream: %s",e.method,o,r,!!e.stream);var s=e.timeout||this.options.timeout,c={agent:this.agent,method:e.method,content:e.content,stream:e.stream,headers:r,timeout:s,writeStream:e.writeStream,customResponse:e.customResponse};return{url:o,params:c}},T.request=c["default"].mark(function j(e){var t,r,n;return c["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return t=this.createRequest(e),i.next=3,this.urllib.requestThunk(t.url,t.params);case 3:if(r=i.sent,p("response %s %s, got %s, headers: %j",e.method,t.url,r.status,r.headers),!e.successStatuses||-1!==e.successStatuses.indexOf(r.status)){i.next=10;break}return i.delegateYield(this.requestError(r),"t0",7);case 7:throw n=i.t0,n.params=e,n;case 10:if(!e.xmlResponse){i.next=14;break}return i.next=13,this.parseXML(r.data);case 13:r.data=i.sent;case 14:return i.abrupt("return",r);case 15:case"end":return i.stop()}},j,this)}),T._getResource=function(e){var t="/";return e.bucket&&(t+=e.bucket+"/"),e.object&&(t+=e.object),t},T._isIP=function(e){var t=/^(\d{1,3}\.){3,3}\d{1,3}$/;return t.test(e)},T._setEndpoint=function(e){var t=_.parse(e);if(t.protocol||(t=_.parse("http://"+e)),"http:"!=t.protocol&&"https:"!=t.protocol)throw new Error("Endpoint protocol must be http or https.");return t},T._setRegion=function(e,t,r){var n=r?"https://":"http://",i=t?"-internal.aliyuncs.com":".aliyuncs.com";return _.parse(n+e+i)},T._escape=function(e){return E.encodeURIComponent(e).replace(/%2F/g,"/")},T._getReqUrl=function(e){var t={};d(this.options.endpoint).to(t);var r=this._isIP(t.hostname),n=this.options.cname;!e.bucket||n||r||(t.host=e.bucket+"."+t.host);var i="/";e.bucket&&r&&(i+=e.bucket+"/"),e.object&&(i+=this._escape(e.object)),t.pathname=i;var o={};if(e.query&&b(o,e.query),e.subres){var a={};x.string(e.subres)?a[e.subres]="":x.array(e.subres)?e.subres.forEach(function(e){a[e]=""}):a=e.subres,b(o,a)}return t.query=o,_.format(t).replace(/%20/g,"+")},T._userAgent=function(){var e=r&&r.browser?"js":"nodejs",t="aliyun-sdk-"+e+"/"+S.version,n=w.description;return t+" "+n},T.parseXML=function(e){return function(t){n.isBuffer(e)&&(e=e.toString()),v.parseString(e,{explicitRoot:!1,explicitArray:!1},t)}},T.requestError=c["default"].mark(function A(e){var t,r,n;return c["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(e.data&&e.data.length){i.next=6;break}404===e.status?(t=new Error("Object not exists"),t.name="NoSuchKeyError",t.status=404,t.code="NoSuchKey"):412===e.status?(t=new Error("Pre condition failed"),t.name="PreconditionFailedError",t.status=412,t.code="PreconditionFailed"):(t=new Error("Unknow error, status: "+e.status),t.name="UnknowError",t.status=e.status),t.requestId=e.headers["x-oss-request-id"],t.host="",i.next=29;break;case 6:return r=String(e.data),p("request response error data: %s",r),i.prev=8,i.next=11,this.parseXML(r)||{};case 11:n=i.sent,i.next=21;break;case 14:return i.prev=14,i.t0=i["catch"](8),p(r),i.t0.message+="\nraw xml: "+r,i.t0.status=e.status,i.t0.requestId=e.headers["x-oss-request-id"],i.abrupt("return",i.t0);case 21:r=n.Message||"unknow request error, status: "+e.status,n.Condition&&(r+=" (condition: "+n.Condition+")"),t=new Error(r),t.name=n.Code?n.Code+"Error":"UnknowError",t.status=e.status,t.code=n.Code,t.requestId=n.RequestId,t.hostId=n.HostId;case 29:return p("generate error %j",t),i.abrupt("return",t);case 31:case"end":return i.stop()}},A,this,[[8,14]])})}).call(this,e("_process"),e("buffer").Buffer)},{"../package.json":354,"./../shims/crypto.js":355,"./bucket":2,"./cluster":4,"./image":5,"./multipart":6,"./object":7,"./sts":8,"./wrapper":9,_process:127,agentkeepalive:11,"babel-runtime/core-js/object/keys":19,"babel-runtime/regenerator":112,buffer:116,"copy-to":163,dateformat:170,debug:171,"humanize-ms":177,"is-type-of":179,"merge-descriptors":183,mime:184,path:126,platform:186,querystring:131,url:156,urllib:188,utility:216,xml2js:221}],4:[function(e,t,r){(function(r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var i=e("babel-runtime/regenerator"),o=n(i),a=e("co"),s=e("co-defer"),c=e("sdk-base"),u=e("util"),l=e("utility"),p=e("get-ready"),f=e("copy-to"),h=e("address").ip(),d="roundRobin",m="masterSlave";t.exports=function(e){function t(r){if(!(this instanceof t))return new t(r);if(!r||!Array.isArray(r.cluster))throw new Error("require options.cluster to be an array");c.call(this),this.clients=[],this.availables={};for(var n=0;n=200&&t.t0.status<500)){t.next=12;break}throw t.t0;case 12:i=t.t0;case 13:a=0;case 14:if(!(a=200&&t.t1.status<500)){t.next=28;break}throw t.t1;case 28:i=t.t1;case 29:a++,t.next=14;break;case 32:throw i.message+=" (all clients are down)",i;case 34:case"end":return t.stop()}},t,this,[[2,8],[18,24]])})}),v.forEach(function(e){n[e]=o["default"].mark(function t(){var r,n,i=arguments;return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=l.argumentsToArray(i),t.next=3,this.clients.map(function(t){return t[e].apply(t,r)});case 3:return n=t.sent,t.abrupt("return",n[0]);case 5:case"end":return t.stop()}},t,this)})}),n.signatureUrl=function(){var e=l.argumentsToArray(arguments),t=this.chooseAvailable();return t.signatureUrl.apply(t,e)},n.getObjectUrl=function(){var e=l.argumentsToArray(arguments),t=this.chooseAvailable();return t.getObjectUrl.apply(t,e)},n._init=function(){var e=this;a(o["default"].mark(function t(){return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e._checkAvailable(e._ignoreStatusFile);case 2:e.ready(!0);case 3:case"end":return t.stop()}},t,this)}))["catch"](function(t){e.emit("error",t)})},n._checkAvailable=o["default"].mark(function g(e){var t,n,i,a,s,c;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(t="._ali-oss/check.status."+h+".txt",e){o.next=4;break}return o.next=4,this.put(t,new r("check available started at "+Date()));case 4:if(!this._checkAvailableLock){o.next=6;break}return o.abrupt("return");case 6:this._checkAvailableLock=!0,n=[],i=0;case 9:if(!(i0&&(c=new Error(n.length+" data node down, please check status file: "+n.join(", ")),c.name="CheckAvailableError",this.emit("error",c));case 29:case"end":return o.stop()}},g,this)}),n._checkStatus=o["default"].mark(function y(e,t){var r;return o["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=!0,n.prev=1,n.next=4,e.head(t);case 4:n.next=9;break;case 6:n.prev=6,n.t0=n["catch"](1),(!n.t0.status||n.t0.status>=500||n.t0.status<200)&&(r=!1);case 9:return n.abrupt("return",r);case 10:case"end":return n.stop()}},y,this,[[1,6]])}),n.chooseAvailable=function(){if(this.schedule===m){for(var e=0;e0;){var e=this._nextRRIndex();if(this.availables[e])return this.clients[e];t--}return this.clients[0]},n._nextRRIndex=function(){var e=this.index++;return this.index>=this.clients.length&&(this.index=0),e},n.close=function(){clearInterval(this._timerId),this._timerId=null},t}}).call(this,e("buffer").Buffer)},{address:10,"babel-runtime/regenerator":112,buffer:116,co:162,"co-defer":161,"copy-to":163,"get-ready":176,"sdk-base":187,util:159,utility:216}],5:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,r){r=r||{},t=this._objectName(t);var n="/"+this.options.bucket+"/"+t,i={name:t,method:e,host:this.options.imageHost,resource:"/"+t,timeout:r.timeout,authResource:n};return r.headers&&(i.headers=r.headers),i}var o=e("babel-runtime/regenerator"),a=n(o);t.exports=function(e){function t(r){if(!(this instanceof t))return new t(r);if(!r.bucket)throw new Error("require bucket for image service instance");if(!r.imageHost)throw new Error("require imageHost for image service instance");this.ossClient=new e(r),this.ossClient.options.imageHost=r.imageHost,this.ossClient._objectRequestParams=i}return t.prototype.get=a["default"].mark(function r(e,t,n){return a["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.ossClient.get(e,t,n);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}},r,this)}),t.prototype.getStream=a["default"].mark(function n(e,t){return a["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.ossClient.getStream(e,t);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}},n,this)}),t.prototype.getExif=a["default"].mark(function o(e,t){var r,n;return a["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=this.ossClient._objectRequestParams("GET",e+"@exif",t),r.successStatuses=[200],i.delegateYield(this.ossClient.request(r),"t0",3);case 3:return n=i.t0,i.next=6,this._parseResponse(n);case 6:return n=i.sent,i.abrupt("return",{res:n.res,data:n.data});case 8:case"end":return i.stop()}},o,this)}),t.prototype.getInfo=a["default"].mark(function s(e,t){var r,n;return a["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=this.ossClient._objectRequestParams("GET",e+"@infoexif",t),r.successStatuses=[200],i.delegateYield(this.ossClient.request(r),"t0",3);case 3:return n=i.t0,i.next=6,this._parseResponse(n);case 6:return n=i.sent,i.abrupt("return",{res:n.res,data:n.data});case 8:case"end":return i.stop()}},s,this)}),t.prototype.putStyle=a["default"].mark(function c(e,t,r){var n,i;return a["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return n=this.ossClient._objectRequestParams("PUT","/?style&styleName="+e,r),n.successStatuses=[200],n.content='\n",o.delegateYield(this.ossClient.request(n),"t0",4);case 4:return i=o.t0,o.next=7,this._parseResponse(i);case 7:return i=o.sent,o.abrupt("return",{res:i.res,data:i.data});case 9:case"end":return o.stop()}},c,this)}),t.prototype.getStyle=a["default"].mark(function u(e,t){var r,n;return a["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=this.ossClient._objectRequestParams("GET","/?style&styleName="+e,t),r.successStatuses=[200],i.delegateYield(this.ossClient.request(r),"t0",3);case 3:return n=i.t0,i.next=6,this._parseResponse(n);case 6:return n=i.sent,i.abrupt("return",{res:n.res,data:n.data});case 8:case"end":return i.stop()}},u,this)}),t.prototype.listStyle=a["default"].mark(function l(e){var t,r;return a["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return t=this.ossClient._objectRequestParams("GET","/?style",e),t.successStatuses=[200],n.delegateYield(this.ossClient.request(t),"t0",3);case 3:return r=n.t0,n.next=6,this._parseResponse(r);case 6:return r=n.sent,n.abrupt("return",{res:r.res,data:r.data.Style});case 8:case"end":return n.stop()}},l,this)}),t.prototype.deleteStyle=a["default"].mark(function p(e,t){var r,n;return a["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=this.ossClient._objectRequestParams("DELETE","/?style&styleName="+e,t),r.successStatuses=[204],i.delegateYield(this.ossClient.request(r),"t0",3);case 3:return n=i.t0,i.abrupt("return",{res:n.res});case 5:case"end":return i.stop()}},p,this)}),t.prototype.signatureUrl=function(e){return this.ossClient.signatureUrl(e,this.ossClient.options.imageHost)},t.prototype._parseResponse=a["default"].mark(function f(e){var t,r,n,i;return a["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(t=e.data.toString(),r=e.res.headers["content-type"],"application/json"!==r){o.next=8;break}n=JSON.parse(t),e.data={};for(i in n)e.data[i]=parseFloat(n[i].value,10)||n[i].value;o.next=12;break;case 8:if("application/xml"!==r){o.next=12;break}return o.next=11,this.ossClient.parseXML(t);case 11:e.data=o.sent;case 12:return o.abrupt("return",e);case 13:case"end":return o.stop()}},f,this)}),t}},{"babel-runtime/regenerator":112}],6:[function(e,t,r){(function(t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return this instanceof i?(h.call(this,t),this.file=e,void(this.reader=null)):new i(e,t)}var o=e("babel-runtime/regenerator"),a=n(o),s=(e("debug")("ali-oss:multipart"),e("fs")),c=e("is-type-of"),u=(e("destroy"),e("end-or-error"),e("util")),l=e("path"),p=e("mime"),f=r;f.multipartUpload=a["default"].mark(function d(e,t,r){var n,i,o,s,u,f,h,m,v;return a["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(r=r||{},!r.checkpoint||!r.checkpoint.uploadId){a.next=5;break}return a.next=4,this._resumeMultipart(r.checkpoint,r);case 4:return a.abrupt("return",a.sent);case 5:return n=102400,i=c.file(t)?t.name:t,r.mime=r.mime||p.lookup(l.extname(i)),r.headers=r.headers||{},this._convertMetaToHeaders(r.meta,r.headers),a.next=12,this._getFileSize(t);case 12:if(o=a.sent,!(n>o)){a.next=23;break}return s=this._createStream(t,0,o),r.contentLength=o,a.next=18,this.putStream(e,s,r);case 18:if(u=a.sent,!r||!r.progress){a.next=22;break}return a.next=22,r.progress(1);case 22:return a.abrupt("return",u);case 23:if(!(r.partSize&&r.partSizef)){a.next=25;break}return h=f+1,d=l[f],v={stream:this._createStream(r,d.start,d.end),size:d.end-d.start},a.next=16,this._uploadPart(u,o,h,v);case 16:if(g=a.sent,s.push({number:h,etag:g.res.headers.etag}),e.nextPart=f+1,!t||!t.progress){a.next=22;break}return a.next=22,t.progress(h/p,e);case 22:f++,a.next=10;break;case 25:return a.next=27,this._completeMultipartUpload(u,o,s,t);case 27:return a.abrupt("return",a.sent);case 28:case"end":return a.stop()}},m,this)}),f.listUploads=a["default"].mark(function v(e,t){var r,n,i;return a["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return t=t||{},t.subres="uploads",r=this._objectRequestParams("GET","",t),r.query=e,r.xmlResponse=!0,r.successStatuses=[200],o.next=8,this.request(r);case 8:return n=o.sent,i=n.data.Upload||[],Array.isArray(i)||(i=[i]),i=i.map(function(e){return{name:e.Key,uploadId:e.UploadId,initiated:e.Initiated}}),o.abrupt("return",{res:n.res,uploads:i,bucket:n.data.Bucket,nextKeyMarker:n.data.NextKeyMarker,nextUploadIdMarker:n.data.NextUploadIdMarker,isTruncated:"true"===n.data.IsTruncated});case 13:case"end":return o.stop()}},v,this)}),f.abortMultipartUpload=a["default"].mark(function g(e,t,r){var n,i;return a["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return r=r||{},r.subres={uploadId:t},n=this._objectRequestParams("DELETE",e,r),n.successStatuses=[204],o.next=6,this.request(n);case 6:return i=o.sent,o.abrupt("return",{res:i.res});case 8:case"end":return o.stop()}},g,this)}),f._initMultipartUpload=a["default"].mark(function y(e,t){var r,n;return a["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return t=t||{},t.headers=t.headers||{},this._convertMetaToHeaders(t.meta,t.headers),t.subres="uploads",r=this._objectRequestParams("POST",e,t),r.mime=t.mime,r.xmlResponse=!0,r.successStatuses=[200],i.next=10,this.request(r);case 10:return n=i.sent,i.abrupt("return",{res:n.res,bucket:n.data.Bucket,name:n.data.Key,uploadId:n.data.UploadId});case 12:case"end":return i.stop()}},y,this)}),f._uploadPart=a["default"].mark(function b(e,t,r,n){var i,o,s;return a["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return i={},i.headers={"Content-Length":n.size},i.subres={partNumber:r,uploadId:t},o=this._objectRequestParams("PUT",e,i),o.mime=i.mime,o.stream=n.stream,o.successStatuses=[200],a.next=9,this.request(o);case 9:return s=a.sent,a.abrupt("return",{name:e,etag:s.res.headers.etag,res:s.res});case 11:case"end":return a.stop()}},b,this)}),f._completeMultipartUpload=a["default"].mark(function _(e,t,r,n){var i,o,s,c,u,l;return a["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:for(i='\n\n',o=0;o\n",i+=""+s.number+"\n",i+=""+s.etag+"\n",i+="\n";return i+="",n=n||{},n.subres={uploadId:t},c=this._objectRequestParams("POST",e,n),c.mime="xml",c.content=i,n.headers&&n.headers["x-oss-callback"]||(c.xmlResponse=!0),c.successStatuses=[200],a.next=12,this.request(c);case 12:return u=a.sent,l={res:u.res,bucket:c.bucket,name:e,etag:u.res.headers.etag},n.headers&&n.headers["x-oss-callback"]&&(l.data=JSON.parse(u.data.toString())),a.abrupt("return",l);case 16:case"end":return a.stop()}},_,this)}),c.file=function(e){return"undefined"!=typeof File&&e instanceof File},f._getFileSize=a["default"].mark(function x(e){var t;return a["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!c.buffer(e)){r.next=4;break}return r.abrupt("return",e.length);case 4:if(!c.file(e)){r.next=6;break}return r.abrupt("return",e.size);case 6:if(!c.string(e)){r.next=11;break}return r.next=9,this._statFile(e);case 9:return t=r.sent,r.abrupt("return",t.size); case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return r.stop()}},x,this)});var h=e("stream").Readable;u.inherits(i,h),i.prototype._read=function(){if(!this.reader){var e=this;e.reader=new FileReader,e.reader.onload=function(r){e.push(new t(new Uint8Array(r.target.result))),e.push(null)},e.reader.readAsArrayBuffer(e.file)}},f._createStream=function(e,t,r){if(c.file(e))return new i(e.slice(t,r));if(c.string(e))return s.createReadStream(e,{start:t,end:r-1});throw new Error("_createStream requires File/String.")},f._getPartSize=function(e,t){var r=1e4,n=1048576;return t?Math.max(Math.ceil(e/r),t):n},f._divideParts=function(e,t){for(var r=Math.ceil(e/t),n=[],i=0;r>i;i++){var o=t*i,a=Math.min(o+t,e);n.push({start:o,end:a})}return n}}).call(this,e("buffer").Buffer)},{"babel-runtime/regenerator":112,buffer:116,debug:171,destroy:174,"end-or-error":175,fs:114,"is-type-of":179,mime:184,path:126,stream:147,util:159}],7:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var i=e("babel-runtime/regenerator"),o=n(i),a=e("debug")("ali-oss:object"),s=e("utility"),c=(e("./../shims/crypto.js"),e("fs")),u=e("is-type-of"),l=(e("destroy"),e("end-or-error"),e("url")),p=e("copy-to"),f=(e("querystring"),e("path")),h=e("mime"),d=r;d.put=o["default"].mark(function m(e,t,r){var n,i,a,s,l;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r=r||{},!u.buffer(t)){o.next=5;break}n=t,o.next=23;break;case 5:if(!u.string(t)){o.next=16;break}return r.mime=r.mime||h.lookup(f.extname(t)),i=c.createReadStream(t),o.next=10,this._getFileSize(t);case 10:return r.contentLength=o.sent,o.next=13,this.putStream(e,i,r);case 13:return o.abrupt("return",o.sent);case 16:if(!u.readableStream(t)){o.next=22;break}return o.next=19,this.putStream(e,t,r);case 19:return o.abrupt("return",o.sent);case 22:throw new TypeError("Must provide String/Buffer/ReadableStream for put.");case 23:return r.headers=r.headers||{},this._convertMetaToHeaders(r.meta,r.headers),a=this._objectRequestParams("PUT",e,r),a.mime=r.mime,a.content=n,a.successStatuses=[200],o.next=31,this.request(a);case 31:return s=o.sent,l={name:e,url:this._objectUrl(e),res:s.res},r.headers&&r.headers["x-oss-callback"]&&(l.data=JSON.parse(s.data.toString())),o.abrupt("return",l);case 35:case"end":return o.stop()}},m,this)}),d.putStream=o["default"].mark(function v(e,t,r){var n,i,a;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return r=r||{},r.headers=r.headers||{},r.contentLength?r.headers["Content-Length"]=r.contentLength:r.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(r.meta,r.headers),n=this._objectRequestParams("PUT",e,r),n.mime=r.mime,n.stream=t,n.successStatuses=[200],o.next=10,this.request(n);case 10:return i=o.sent,a={name:e,url:this._objectUrl(e),res:i.res},r.headers&&r.headers["x-oss-callback"]&&(a.data=JSON.parse(i.data.toString())),o.abrupt("return",a);case 14:case"end":return o.stop()}},v,this)}),d.head=o["default"].mark(function g(e,t){var r,n,i,a;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return r=this._objectRequestParams("HEAD",e,t),r.successStatuses=[200,304],o.next=4,this.request(r);case 4:if(n=o.sent,i={meta:null,res:n.res,status:n.status},200===n.status)for(a in n.headers)0===a.indexOf("x-oss-meta-")&&(i.meta||(i.meta={}),i.meta[a.substring(11)]=n.headers[a]);return o.abrupt("return",i);case 8:case"end":return o.stop()}},g,this)}),d.get=o["default"].mark(function y(e,t,r){var n,i,s,l;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return n=null,i=!1,u.writableStream(t)?n=t:u.string(t)?(n=c.createWriteStream(t),i=!0):r=t,r=r||{},o.prev=4,l=this._objectRequestParams("GET",e,r),l.writeStream=n,l.successStatuses=[200,206,304],o.next=10,this.request(l);case 10:s=o.sent,i&&n.destroy(),o.next=22;break;case 14:if(o.prev=14,o.t0=o["catch"](4),!i){o.next=21;break}return n.destroy(),a("get error: %s, delete the exists file %s",o.t0,t),o.next=21,this._deleteFileSafe(t);case 21:throw o.t0;case 22:return o.abrupt("return",{res:s.res,content:s.data});case 23:case"end":return o.stop()}},y,this,[[4,14]])}),d.getStream=o["default"].mark(function b(e,t){var r,n;return o["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return t=t||{},r=this._objectRequestParams("GET",e,t),r.customResponse=!0,r.successStatuses=[200,206,304],i.next=6,this.request(r);case 6:return n=i.sent,i.abrupt("return",{stream:n.res,res:{status:n.status,headers:n.headers}});case 8:case"end":return i.stop()}},b,this)}),d["delete"]=o["default"].mark(function _(e,t){var r,n;return o["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=this._objectRequestParams("DELETE",e,t),r.successStatuses=[204],i.next=4,this.request(r);case 4:return n=i.sent,i.abrupt("return",{res:n.res});case 6:case"end":return i.stop()}},_,this)}),d.deleteMulti=o["default"].mark(function x(e,t){var r,n,i,c,u,l;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:for(t=t||{},r='\n\n',r+=t.quiet?" true\n":" false\n",n=0;n"+s.escape(this._objectName(e[n]))+"\n";return r+="",a("delete multi objects: %s",r),t.subres="delete",i=this._objectRequestParams("POST","",t),i.mime="xml",i.content=r,i.xmlResponse=!0,i.successStatuses=[200],o.next=14,this.request(i);case 14:return c=o.sent,u=c.data,l=u&&u.Deleted||null,l&&(Array.isArray(l)||(l=[l]),l=l.map(function(e){return e.Key})),o.abrupt("return",{res:c.res,deleted:l});case 19:case"end":return o.stop()}},x,this)}),d.copy=o["default"].mark(function w(e,t,r){var n,i,a,s;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:r=r||{},r.headers=r.headers||{};for(n in r.headers)r.headers["x-oss-copy-source-"+n.toLowerCase()]=r.headers[n];return r.meta&&(r.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(r.meta,r.headers),"/"!==t[0]&&(t="/"+this.options.bucket+"/"+t),r.headers["x-oss-copy-source"]=t,i=this._objectRequestParams("PUT",e,r),i.xmlResponse=!0,i.successStatuses=[200,304],o.next=12,this.request(i);case 12:return a=o.sent,s=a.data,s&&(s={etag:s.ETag,lastModified:s.LastModified}),o.abrupt("return",{data:s,res:a.res});case 16:case"end":return o.stop()}},w,this)}),d.putMeta=o["default"].mark(function E(e,t,r){return o["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.copy(e,e,{meta:t||{},timeout:r&&r.timeout});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}},E,this)}),d.list=o["default"].mark(function S(e,t){var r,n,i,a,s;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return r=this._objectRequestParams("GET","",t),r.query=e,r.xmlResponse=!0,r.successStatuses=[200],o.next=6,this.request(r);case 6:return n=o.sent,i=n.data.Contents,a=this,i&&(Array.isArray(i)||(i=[i]),i=i.map(function(e){return{name:e.Key,url:a._objectUrl(e.Key),lastModified:e.LastModified,etag:e.ETag,type:e.Type,size:Number(e.Size),storageClass:e.StorageClass,owner:{id:e.Owner.ID,displayName:e.Owner.DisplayName}}})),s=n.data.CommonPrefixes||null,s&&(Array.isArray(s)||(s=[s]),s=s.map(function(e){return e.Prefix})),o.abrupt("return",{res:n.res,objects:i,prefixes:s,nextMarker:n.data.NextMarker||null,isTruncated:"true"===n.data.IsTruncated});case 13:case"end":return o.stop()}},S,this)}),d.putACL=o["default"].mark(function k(e,t,r){var n,i;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return r=r||{},r.subres="acl",r.headers=r.headers||{},r.headers["x-oss-object-acl"]=t,e=this._objectName(e),n=this._objectRequestParams("PUT",e,r),n.successStatuses=[200],o.next=9,this.request(n);case 9:return i=o.sent,o.abrupt("return",{res:i.res});case 11:case"end":return o.stop()}},k,this)}),d.getACL=o["default"].mark(function T(e,t){var r,n;return o["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return t=t||{},t.subres="acl",e=this._objectName(e),r=this._objectRequestParams("GET",e,t),r.successStatuses=[200],r.xmlResponse=!0,i.next=8,this.request(r);case 8:return n=i.sent,i.abrupt("return",{acl:n.data.AccessControlList.Grant,owner:{id:n.data.Owner.ID,displayName:n.data.Owner.DisplayName},res:n.res});case 10:case"end":return i.stop()}},T,this)}),d.signatureUrl=function(e,t){e=this._objectName(e);var r={bucket:this.options.bucket,object:e};t=t||{};var n=s.timestamp()+(t.expires||1800),i=this._getResource(r),o={},a=[];for(var c in t.response){var u="response-"+c.toLowerCase();o[u]=t.response[c],a.push(u+"="+t.response[c])}this.options.stsToken&&(o["security-token"]=this.options.stsToken,a.push("security-token="+this.options.stsToken)),a.length>0&&(a.sort(),i+="?"+a.join("&"));var f=[t.method||"GET",t["content-md5"]||"",t["content-type"]||"",n,i].join("\n"),h=this.signature(f),d=l.parse(this._getReqUrl(r));return d.query={OSSAccessKeyId:this.options.accessKeyId,Expires:n,Signature:h},p(o).to(d.query),d.format()},d.getObjectUrl=function(e,t){return t?"/"!==t[t.length-1]&&(t+="/"):t=this.options.endpoint.format(),t+this._escape(this._objectName(e))},d._objectUrl=function(e){return this._getReqUrl({bucket:this.options.bucket,object:e})},d._objectRequestParams=function(e,t,r){if(!this.options.bucket)throw new Error("Please create a bucket first");r=r||{},t=this._objectName(t);var n={object:t,bucket:this.options.bucket,method:e,subres:r&&r.subres,timeout:r&&r.timeout};return r.headers&&(n.headers=r.headers),n},d._objectName=function(e){return e.replace(/^\/+/,"")},d._statFile=function(e){return function(t){c.stat(e,t)}},d._convertMetaToHeaders=function(e,t){if(e)for(var r in e)t["x-oss-meta-"+r]=e[r]},d._deleteFileSafe=function(e){return function(t){c.exists(e,function(r){return r?void c.unlink(e,function(r){r&&a("unlink %j error: %s",e,r),t()}):t()})}}},{"./../shims/crypto.js":355,"babel-runtime/regenerator":112,"copy-to":163,debug:171,destroy:174,"end-or-error":175,fs:114,"is-type-of":179,mime:184,path:126,querystring:131,url:156,utility:216}],8:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(t){if(!(this instanceof i))return new i(t);if(!t||!t.accessKeyId||!t.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");this.options={endpoint:t.endpoint||"https://sts.aliyuncs.com",format:"JSON",apiVersion:"2015-04-01",sigMethod:"HMAC-SHA1",sigVersion:"1.0",timeout:"60s"},d(t).to(this.options),this.options.urllib?this.urllib=this.options.urllib:(this.urllib=e("urllib"),this.agent=this.options.agent||new m)}var o=e("babel-runtime/core-js/object/keys"),a=n(o),s=e("babel-runtime/regenerator"),c=n(s),u=e("babel-runtime/core-js/json/stringify"),l=n(u),p=e("debug")("ali-oss:sts"),f=e("./../shims/crypto.js"),h=e("querystring"),d=e("copy-to"),m=e("agentkeepalive"),v=e("is-type-of"),g=e("humanize-ms");t.exports=i;var y=i.prototype;y.assumeRole=c["default"].mark(function b(e,t,r,n,i){var o,a,s,u,f,d,m,y;return c["default"].wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(o=this.options,a={Action:"AssumeRole",RoleArn:e,RoleSessionName:n||"app",DurationSeconds:r||3600,Format:o.format,Version:o.apiVersion,AccessKeyId:o.accessKeyId,SignatureMethod:o.sigMethod,SignatureVersion:o.sigVersion,SignatureNonce:Math.random(),Timestamp:(new Date).toISOString()},!t){c.next=15;break}if(!v.string(t)){c.next=13;break}c.prev=4,s=(0,l["default"])(JSON.parse(t)),c.next=11;break;case 8:throw c.prev=8,c.t0=c["catch"](4),new Error("Policy string is not a valid JSON: "+c.t0.message);case 11:c.next=14;break;case 13:s=(0,l["default"])(t);case 14:a.Policy=s;case 15:return u=this._getSignature("POST",a,o.accessKeySecret),a.Signature=u,f=o.endpoint,d={agent:this.agent,timeout:g(i&&i.timeout||o.timeout),method:"POST",content:h.stringify(a),headers:{"Content-Type":"application/x-www-form-urlencoded"}},c.next=21,this.urllib.requestThunk(f,d);case 21:if(m=c.sent,p("response %s %s, got %s, headers: %j",d.method,f,m.status,m.headers),2===Math.floor(m.status/100)){c.next=29;break}return c.next=26,this._requestError(m);case 26:throw y=c.sent,y.params=d,y;case 29:return m.data=JSON.parse(m.data),c.abrupt("return",{res:m.res,credentials:m.data.Credentials});case 31:case"end":return c.stop()}},b,this,[[4,8]])}),y._requestError=c["default"].mark(function _(e){var t,r;return c["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return t=new Error,t.status=e.status,n.prev=2,n.next=5,JSON.parse(e.data)||{};case 5:r=n.sent,t.code=r.Code,t.message=r.Code+": "+r.Message,t.requestId=r.RequestId,n.next=14;break;case 11:n.prev=11,n.t0=n["catch"](2),t.message="UnknownError: "+String(e.data);case 14:return n.abrupt("return",t);case 15:case"end":return n.stop()}},_,this,[[2,11]])}),y._getSignature=function(e,t,r){var n=this,i=(0,a["default"])(t).sort().map(function(e){return n._escape(e)+"="+n._escape(t[e])}).join("&"),o=e.toUpperCase()+"&"+this._escape("/")+"&"+this._escape(i);p("string to sign: %s",o);var s=f.createHmac("sha1",r+"&");return s=s.update(o).digest("base64"),p("signature: %s",s),s},y._escape=function(e){return encodeURIComponent(e).replace(/\*/g,"%2A")}},{"./../shims/crypto.js":355,agentkeepalive:11,"babel-runtime/core-js/json/stringify":16,"babel-runtime/core-js/object/keys":19,"babel-runtime/regenerator":112,"copy-to":163,debug:171,"humanize-ms":177,"is-type-of":179,querystring:131,urllib:188}],9:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){return e&&"function"==typeof e.next&&"function"==typeof e["throw"]}function o(e){var t=e.constructor;return t?"GeneratorFunction"===t.name||"GeneratorFunction"===t.displayName?!0:i(t.prototype)||i(e.prototype):!1}function a(e,t){var r=new e(t),n=(0,p["default"])(r),i=(0,p["default"])((0,u["default"])(r));n.concat(i).forEach(function(e){o(r[e])?this[e]=f.wrap(r[e]).bind(r):this[e]=r[e]},this)}function s(e){return this instanceof s?void a.call(this,h,e):new s(e)}var c=e("babel-runtime/core-js/object/get-prototype-of"),u=n(c),l=e("babel-runtime/core-js/object/keys"),p=n(l),f=e("co"),h=e("..");t.exports=s,s.STS=function d(e){return this instanceof d?void a.call(this,h.STS,e):new d(e)}},{"..":3,"babel-runtime/core-js/object/get-prototype-of":18,"babel-runtime/core-js/object/keys":19,co:162}],10:[function(e,t,r){"use strict";function n(e,t){"function"==typeof e&&(t=e,e=null);var r={ip:n.ip(e),ipv6:n.ipv6(e),mac:null};n.mac(e,function(e,n){n&&(r.mac=n),t(e,r)})}function i(e,t,r){for(var n=e.split("\n"),i=0;ia;a++){var s=r[t+(a>=0?a:"")];if(s){i=s;break}}if(i&&i.length)for(var c=0;ct.maxSockets||s>=t.maxFreeSockets?(t.removeSocket(e,r),e.destroy()):(a=a||[],t.freeSockets[n]=a,e.setKeepAlive(!0,t.keepAliveMsecs),e.unref&&e.unref(),e._httpMessage=null,t.removeSocket(e,r),a.push(e),0===e.listeners("error").length&&e.once("error",i),e.setTimeout(t.keepAliveTimeout))}else t.removeSocket(e,r),e.destroy()}})}function i(e){var t=this;c("SOCKET ERROR on FREE socket:",e.message,e.stack),t.destroy(),t.emit("agentRemove")}var o=e("net"),a=e("util"),s=e("events").EventEmitter,c=e("./utils").debug;a.inherits(n,s),r.Agent=n,n.defaultMaxSockets=1/0,n.prototype.createConnection=o.createConnection,n.prototype.getName=function(e){var t="";return t+=e.host?e.host:"localhost",t+=":",e.port&&(t+=e.port),t+=":",e.localAddress&&(t+=e.localAddress),t+=":"},n.prototype.addRequest=function(e,t){"string"==typeof t&&(t={host:t,port:arguments[2],path:arguments[3]}),t=a._extend({},t),t=a._extend(t,this.options);var r=this.getName(t);this.sockets[r]||(this.sockets[r]=[]);var n=this.freeSockets[r]?this.freeSockets[r].length:0,o=n+this.sockets[r].length;if(n){var s=this.freeSockets[r].shift();c("have free socket"),s.removeListener("error",i),s.setTimeout(this.timeout),this.freeSockets[r].length||delete this.freeSockets[r],s.ref&&s.ref(),e.onSocket(s),this.sockets[r].push(s)}else ol;)if(s=c[l++],s!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===r)return e||l||0;return!e&&-1}}},{"./_to-index":93,"./_to-iobject":95,"./_to-length":96}],38:[function(e,t,r){var n=e("./_cof"),i=e("./_wks")("toStringTag"),o="Arguments"==n(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(r){}};t.exports=function(e){var t,r,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=a(t=Object(e),i))?r:o?n(t):"Object"==(s=n(t))&&"function"==typeof t.callee?"Arguments":s}},{"./_cof":39,"./_wks":100}],39:[function(e,t,r){var n={}.toString;t.exports=function(e){return n.call(e).slice(8,-1)}},{}],40:[function(e,t,r){var n=t.exports={version:"2.2.2"};"number"==typeof __e&&(__e=n)},{}],41:[function(e,t,r){var n=e("./_a-function");t.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":33}],42:[function(e,t,r){t.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},{}],43:[function(e,t,r){t.exports=!e("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":48}],44:[function(e,t,r){var n=e("./_is-object"),i=e("./_global").document,o=n(i)&&n(i.createElement);t.exports=function(e){return o?i.createElement(e):{}}},{"./_global":50,"./_is-object":59}],45:[function(e,t,r){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],46:[function(e,t,r){var n=e("./_object-keys"),i=e("./_object-gops"),o=e("./_object-pie");t.exports=function(e){var t=n(e),r=i.f;if(r)for(var a,s=r(e),c=o.f,u=0;s.length>u;)c.call(e,a=s[u++])&&t.push(a);return t}},{"./_object-gops":76,"./_object-keys":79,"./_object-pie":80}],47:[function(e,t,r){var n=e("./_global"),i=e("./_core"),o=e("./_ctx"),a=e("./_hide"),s="prototype",c=function(e,t,r){var u,l,p,f=e&c.F,h=e&c.G,d=e&c.S,m=e&c.P,v=e&c.B,g=e&c.W,y=h?i:i[t]||(i[t]={}),b=y[s],_=h?n:d?n[t]:(n[t]||{})[s];h&&(r=t);for(u in r)l=!f&&_&&void 0!==_[u],l&&u in y||(p=l?_[u]:r[u],y[u]=h&&"function"!=typeof _[u]?r[u]:v&&l?o(p,n):g&&_[u]==p?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t[s]=e[s],t}(p):m&&"function"==typeof p?o(Function.call,p):p,m&&((y.virtual||(y.virtual={}))[u]=p,e&c.R&&b&&!b[u]&&a(b,u,p)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},{"./_core":40,"./_ctx":41,"./_global":50,"./_hide":52}],48:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(t){return!0}}},{}],49:[function(e,t,r){var n=e("./_ctx"),i=e("./_iter-call"),o=e("./_is-array-iter"),a=e("./_an-object"),s=e("./_to-length"),c=e("./core.get-iterator-method");t.exports=function(e,t,r,u,l){var p,f,h,d=l?function(){return e}:c(e),m=n(r,u,t?2:1),v=0;if("function"!=typeof d)throw TypeError(e+" is not iterable!");if(o(d))for(p=s(e.length);p>v;v++)t?m(a(f=e[v])[0],f[1]):m(e[v]);else for(h=d.call(e);!(f=h.next()).done;)i(h,m,f.value,t)}},{"./_an-object":36,"./_ctx":41,"./_is-array-iter":57,"./_iter-call":60,"./_to-length":96,"./core.get-iterator-method":101}],50:[function(e,t,r){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},{}],51:[function(e,t,r){var n={}.hasOwnProperty;t.exports=function(e,t){return n.call(e,t)}},{}],52:[function(e,t,r){var n=e("./_object-dp"),i=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},{"./_descriptors":43,"./_object-dp":71,"./_property-desc":82}],53:[function(e,t,r){t.exports=e("./_global").document&&document.documentElement},{"./_global":50}],54:[function(e,t,r){t.exports=!e("./_descriptors")&&!e("./_fails")(function(){return 7!=Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":43,"./_dom-create":44,"./_fails":48}],55:[function(e,t,r){t.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},{}],56:[function(e,t,r){var n=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){ return"String"==n(e)?e.split(""):Object(e)}},{"./_cof":39}],57:[function(e,t,r){var n=e("./_iterators"),i=e("./_wks")("iterator"),o=Array.prototype;t.exports=function(e){return void 0!==e&&(n.Array===e||o[i]===e)}},{"./_iterators":65,"./_wks":100}],58:[function(e,t,r){var n=e("./_cof");t.exports=Array.isArray||function(e){return"Array"==n(e)}},{"./_cof":39}],59:[function(e,t,r){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],60:[function(e,t,r){var n=e("./_an-object");t.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(o){var a=e["return"];throw void 0!==a&&n(a.call(e)),o}}},{"./_an-object":36}],61:[function(e,t,r){"use strict";var n=e("./_object-create"),i=e("./_property-desc"),o=e("./_set-to-string-tag"),a={};e("./_hide")(a,e("./_wks")("iterator"),function(){return this}),t.exports=function(e,t,r){e.prototype=n(a,{next:i(1,r)}),o(e,t+" Iterator")}},{"./_hide":52,"./_object-create":70,"./_property-desc":82,"./_set-to-string-tag":87,"./_wks":100}],62:[function(e,t,r){"use strict";var n=e("./_library"),i=e("./_export"),o=e("./_redefine"),a=e("./_hide"),s=e("./_has"),c=e("./_iterators"),u=e("./_iter-create"),l=e("./_set-to-string-tag"),p=e("./_object-gpo"),f=e("./_wks")("iterator"),h=!([].keys&&"next"in[].keys()),d="@@iterator",m="keys",v="values",g=function(){return this};t.exports=function(e,t,r,y,b,_,x){u(r,t,y);var w,E,S,k=function(e){if(!h&&e in O)return O[e];switch(e){case m:return function(){return new r(this,e)};case v:return function(){return new r(this,e)}}return function(){return new r(this,e)}},T=t+" Iterator",j=b==v,A=!1,O=e.prototype,I=O[f]||O[d]||b&&O[b],R=I||k(b),C=b?j?k("entries"):R:void 0,N="Array"==t?O.entries||I:I;if(N&&(S=p(N.call(new e)),S!==Object.prototype&&(l(S,T,!0),n||s(S,f)||a(S,f,g))),j&&I&&I.name!==v&&(A=!0,R=function(){return I.call(this)}),n&&!x||!h&&!A&&O[f]||a(O,f,R),c[t]=R,c[T]=g,b)if(w={values:j?R:k(v),keys:_?R:k(m),entries:C},x)for(E in w)E in O||o(O,E,w[E]);else i(i.P+i.F*(h||A),t,w);return w}},{"./_export":47,"./_has":51,"./_hide":52,"./_iter-create":61,"./_iterators":65,"./_library":67,"./_object-gpo":77,"./_redefine":84,"./_set-to-string-tag":87,"./_wks":100}],63:[function(e,t,r){var n=e("./_wks")("iterator"),i=!1;try{var o=[7][n]();o["return"]=function(){i=!0},Array.from(o,function(){throw 2})}catch(a){}t.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o=[7],a=o[n]();a.next=function(){return{done:r=!0}},o[n]=function(){return a},e(o)}catch(s){}return r}},{"./_wks":100}],64:[function(e,t,r){t.exports=function(e,t){return{value:t,done:!!e}}},{}],65:[function(e,t,r){t.exports={}},{}],66:[function(e,t,r){var n=e("./_object-keys"),i=e("./_to-iobject");t.exports=function(e,t){for(var r,o=i(e),a=n(o),s=a.length,c=0;s>c;)if(o[r=a[c++]]===t)return r}},{"./_object-keys":79,"./_to-iobject":95}],67:[function(e,t,r){t.exports=!0},{}],68:[function(e,t,r){var n=e("./_uid")("meta"),i=e("./_is-object"),o=e("./_has"),a=e("./_object-dp").f,s=0,c=Object.isExtensible||function(){return!0},u=!e("./_fails")(function(){return c(Object.preventExtensions({}))}),l=function(e){a(e,n,{value:{i:"O"+ ++s,w:{}}})},p=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,n)){if(!c(e))return"F";if(!t)return"E";l(e)}return e[n].i},f=function(e,t){if(!o(e,n)){if(!c(e))return!0;if(!t)return!1;l(e)}return e[n].w},h=function(e){return u&&d.NEED&&c(e)&&!o(e,n)&&l(e),e},d=t.exports={KEY:n,NEED:!1,fastKey:p,getWeak:f,onFreeze:h}},{"./_fails":48,"./_has":51,"./_is-object":59,"./_object-dp":71,"./_uid":99}],69:[function(e,t,r){var n,i,o,a=e("./_global"),s=e("./_task").set,c=a.MutationObserver||a.WebKitMutationObserver,u=a.process,l=a.Promise,p="process"==e("./_cof")(u),f=function(){var e,t;for(p&&(e=u.domain)&&e.exit();n;)t=n.fn,t(),n=n.next;i=void 0,e&&e.enter()};if(p)o=function(){u.nextTick(f)};else if(c){var h=!0,d=document.createTextNode("");new c(f).observe(d,{characterData:!0}),o=function(){d.data=h=!h}}else o=l&&l.resolve?function(){l.resolve().then(f)}:function(){s.call(a,f)};t.exports=function(e){var t={fn:e,next:void 0};i&&(i.next=t),n||(n=t,o()),i=t}},{"./_cof":39,"./_global":50,"./_task":92}],70:[function(e,t,r){var n=e("./_an-object"),i=e("./_object-dps"),o=e("./_enum-bug-keys"),a=e("./_shared-key")("IE_PROTO"),s=function(){},c="prototype",u=function(){var t,r=e("./_dom-create")("iframe"),n=o.length,i=">";for(r.style.display="none",e("./_html").appendChild(r),r.src="javascript:",t=r.contentWindow.document,t.open(),t.write("