From 54e7c31f4e0a115fe268fbb911c5dea959ce2397 Mon Sep 17 00:00:00 2001 From: chrisftian Date: Wed, 1 Dec 2021 15:59:50 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9Arequest=20queryString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo-album/lib/cos-wx-sdk-v5.js | 2 +- demo-album/lib/cos-wx-sdk-v5.min.js | 2 +- demo/lib/cos-wx-sdk-v5.js | 2 +- demo/lib/cos-wx-sdk-v5.min.js | 2 +- lib/request.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/demo-album/lib/cos-wx-sdk-v5.js b/demo-album/lib/cos-wx-sdk-v5.js index 9cd3ef9..8deeac6 100644 --- a/demo-album/lib/cos-wx-sdk-v5.js +++ b/demo-album/lib/cos-wx-sdk-v5.js @@ -9032,7 +9032,7 @@ var request = function request(params, callback) { }); }); } else { - var qsStr = params.qs && obj2str(params.qs, true) || ''; + var qsStr = params.qs && obj2str(params.qs) || ''; if (qsStr) { url += (url.indexOf('?') > -1 ? '&' : '?') + qsStr; } diff --git a/demo-album/lib/cos-wx-sdk-v5.min.js b/demo-album/lib/cos-wx-sdk-v5.min.js index 7a6960d..21890f2 100644 --- a/demo-album/lib/cos-wx-sdk-v5.min.js +++ b/demo-album/lib/cos-wx-sdk-v5.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.COS=t():e.COS=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/Users/tianfeng/Documents/\u9879\u76ee/sdk/cos-wx-sdk-v5/demo/lib",t(t.s=6)}([function(e,t,n){"use strict";(function(t){function i(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function a(e,t){var n=[];for(var a in e)e.hasOwnProperty(a)&&n.push(t?i(a).toLowerCase():a);return n.sort(function(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),e===t?0:e>t?1:-1})}function o(e){return d(e,function(e){return"object"===(void 0===e?"undefined":f(e))&&null!==e?o(e):e})}function r(e,t,n){return e&&t in e?e[t]:n}function s(e,t){return u(t,function(n,i){e[i]=t[i]}),e}function c(e){return e instanceof Array}function l(e,t){for(var n=!1,i=0;i-1||S.indexOf(i)>-1)&&(t[n]=e[n])}return t},w=function(e){e=e||{};var t,n=e.SecretId,i=e.SecretKey,r=e.KeyTime,s=(e.method||e.Method||"get").toLowerCase(),c=o(e.Query||e.params||{}),l=R(o(e.Headers||e.headers||{})),p=e.Key||"";if(e.UseRawKey?t=e.Pathname||e.pathname||"/"+p:(t=e.Pathname||e.pathname||p,0!==t.indexOf("/")&&(t="/"+t)),!l.Host&&!l.host&&e.Bucket&&e.Region&&(l.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),!n)return console.error("missing param SecretId");if(!i)return console.error("missing param SecretKey");var u=Math.round(U(e.SystemClockOffset)/1e3)-1,d=u,m=e.Expires||e.expires;d+=void 0===m?900:1*m||0;var f=n,h=r||u+";"+d,v=r||u+";"+d,x=a(l,!0).join(";").toLowerCase(),y=a(c,!0).join(";").toLowerCase(),C=g.HmacSHA1(v,i).toString(),b=[s,t,z.obj2str(c,!0),z.obj2str(l,!0),""].join("\n"),k=["sha1",h,g.SHA1(b).toString(),""].join("\n");return["q-sign-algorithm=sha1","q-ak="+f,"q-sign-time="+h,"q-key-time="+v,"q-header-list="+x,"q-url-param-list="+y,"q-signature="+g.HmacSHA1(k,C).toString()].join("&")},_=function(){},A=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]);return t},T=function(e,t,n,i){e?b.readFile({filePath:e,position:t,length:n-t,success:function(e){i(e.data)},fail:function(){i(null)}}):i(null)},B=function(e,t,n){n=n||_,e&&t&&t instanceof ArrayBuffer?z.getFileMd5(t,function(e,t){n(t)}):n()},E=function(e,t){var n=h(e);return t&&t(n),n},O=function(e){var t,n,i,a="";for(t=0,n=e.length/2;t-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!i)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e){if(!n)return"Bucket";if(!i)return"Region";if(!a)return"Key"}return!1},N=function(e,t){if(t=s({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};if(t&&"object"===(void 0===t?"undefined":f(t))){!function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}();var i={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext"};z.each(i,function(e,i){void 0!==t[e]&&(n[i]=t[e])}),t.Headers=A(n)}}return t},P=function(e,n){return function(i,a){var o=this;"function"==typeof i&&(a=i,i={}),i=N(e,i);var r=function(e){return e&&e.headers&&(e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},s=function(e,t){a&&a(r(e),r(t))},c=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=I(e,i);if(t)return"missing param "+t;if(i.Region){if(i.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(i.Region))return"Region format error.";o.options.CompatibilityMode||-1!==i.Region.indexOf("-")||"yfb"===i.Region||"default"===i.Region||"accelerate"===i.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(i.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(i.Bucket))if(i.AppId)i.Bucket=i.Bucket+"-"+i.AppId;else{if(!o.options.AppId)return'Bucket should format as "test-1250000000".';i.Bucket=i.Bucket+"-"+o.options.AppId}i.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete i.AppId)}i.Key&&"/"===i.Key.substr(0,1)&&(i.Key=i.Key.substr(1))}}(),l="getAuth"===e||"getObjectUrl"===e,p=t.Promise;if(!l&&p&&!a)return new p(function(e,t){if(a=function(n,i){n?t(n):e(i)},c)return s({error:c});n.call(o,i,s)});if(c)return s({error:c});var u=n.call(o,i,s);return l?u:void 0}},j=function(e,t){function n(){if(a=0,t&&"function"==typeof t){i=Date.now();var n,o=Math.max(0,Math.round((s-r)/((i-c)/1e3)*100)/100)||0;n=0===s&&0===e?1:Math.floor(s/e*100)/100||0,c=i,r=s;try{t({loaded:s,total:e,speed:o,percent:n})}catch(e){}}}var i,a,o=this,r=0,s=0,c=Date.now();return function(t,i){if(t&&(s=t.loaded,e=t.total),i)clearTimeout(a),n();else{if(a)return;a=setTimeout(n,o.options.ProgressInterval)}}},M=function(e,t,n){"postObject"===e?n():"putObject"===e?void 0!==t.Body?(t.ContentLength=t.Body.byteLength,n(null,t.ContentLength)):n({error:"missing param Body"}):t.FilePath?b.stat({path:t.FilePath,success:function(e){var i=e.stats;t.FileStat=i,t.FileStat.FilePath=t.FilePath;var a=i.isDirectory()?0:i.size;t.ContentLength=a=a||0,n(null,a)},fail:function(e){n(e)}}):n({error:"missing param FilePath"})},U=function(e){return Date.now()+(e||0)},H=function(e,t){e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.lengtho)return 1;if(a=0,n=!t&&"devtools"===e.platform;return function(){return n&&console.warn("\u5f53\u524d\u5c0f\u7a0b\u5e8f\u7248\u672c\u5c0f\u4e8e 2.10.0\uff0c\u4e0d\u652f\u6301\u5206\u7247\u4e0a\u4f20\uff0c\u8bf7\u66f4\u65b0\u8f6f\u4ef6\u3002"),n=!1,t}}(),L=function(e){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e)},z={noop:_,formatParams:N,apiWrapper:P,xml2json:v,json2xml:x,md5:h,clearKey:A,fileSlice:T,getBodyMd5:B,getFileMd5:E,binaryBase64:O,extend:s,isArray:c,isInArray:l,makeArray:p,each:u,map:d,filter:m,clone:o,attr:r,uuid:D,camSafeUrlEncode:i,throttleOnProgress:j,getFileSize:M,getSkewTime:U,obj2str:k,getAuth:w,compareVersion:H,canFileSlice:F,isCIHost:L};e.exports=z}).call(t,n(1))},function(e,t,n){"use strict";var i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t){var n=e.prototype;if(Object.create){var a=Object.create(t.prototype);n.__proto__=a}if(!(n instanceof t)){var o=function(){};o.prototype=t.prototype,o=new o,i(n,o),e.prototype=n=o}n.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}function o(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,oe[e]),this.message=oe[e],Error.captureStackTrace&&Error.captureStackTrace(this,o);return n.code=e,t&&(this.message=this.message+": "+t),n}function r(){}function s(e,t){this._node=e,this._refresh=t,c(this)}function c(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);z(e,"length",n.length),i(n,e),e._inc=t}}function l(){}function p(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function u(e,t,n,i){if(i?t[p(t,i)]=n:t[t.length++]=n,e){n.ownerElement=e;var a=e.ownerDocument;a&&(i&&y(a,e,i),x(a,e,n))}}function d(e,t,n){var i=p(t,n);if(!(i>=0))throw o(se,new Error(e.tagName+"@"+n));for(var a=t.length-1;i"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function g(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(g(e,t))return!0}while(e=e.nextSibling)}function v(){}function x(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function y(e,t,n,i){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function C(e,t,n){if(e&&e._inc){e._inc++;var i=t.childNodes;if(n)i[i.length++]=n;else{for(var a=t.firstChild,o=0;a;)i[o++]=a,a=a.nextSibling;i.length=o}}}function b(e,t){var n=t.previousSibling,i=t.nextSibling;return n?n.nextSibling=i:e.firstChild=i,i?i.previousSibling=n:e.lastChild=n,C(e.ownerDocument,e),t}function k(e,t,n){var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===ne){var a=t.firstChild;if(null==a)return t;var o=t.lastChild}else a=o=t;var r=n?n.previousSibling:e.lastChild;a.previousSibling=r,o.nextSibling=n,r?r.nextSibling=a:e.firstChild=a,null==n?e.lastChild=o:n.previousSibling=o;do{a.parentNode=e}while(a!==o&&(a=a.nextSibling));return C(e.ownerDocument||e,e),t.nodeType==ne&&(t.firstChild=t.lastChild=null),t}function S(e,t){var n=t.parentNode;if(n){var i=e.lastChild;n.removeChild(t);var i=e.lastChild}var i=e.lastChild;return t.parentNode=e,t.previousSibling=i,t.nextSibling=null,i?i.nextSibling=t:e.firstChild=t,e.lastChild=t,C(e.ownerDocument,e,t),t}function R(){this._nsMap={}}function w(){}function _(){}function A(){}function T(){}function B(){}function E(){}function O(){}function D(){}function I(){}function N(){}function P(){}function j(){}function M(e,t){var n=[],i=9==this.nodeType?this.documentElement:this,a=i.prefix,o=i.namespaceURI;if(o&&null==a){var a=i.lookupPrefix(o);if(null==a)var r=[{namespace:o,prefix:null}]}return H(this,n,e,t,r),n.join("")}function U(e,t,n){var i=e.prefix||"",a=e.namespaceURI;if(!i&&!a)return!1;if("xml"===i&&"http://www.w3.org/XML/1998/namespace"===a||"http://www.w3.org/2000/xmlns/"==a)return!1;for(var o=n.length;o--;){var r=n[o];if(r.prefix==i)return r.namespace!=a}return!0}function H(e,t,n,i,a){if(i){if(!(e=i(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case V:a||(a=[]);var o=(a.length,e.attributes),r=o.length,s=e.firstChild,c=e.tagName;n=q===e.namespaceURI||n,t.push("<",c);for(var l=0;l"),n&&/^script$/i.test(c))for(;s;)s.data?t.push(s.data):H(s,t,n,i,a),s=s.nextSibling;else for(;s;)H(s,t,n,i,a),s=s.nextSibling;t.push("")}else t.push("/>");return;case ee:case ne:for(var s=e.firstChild;s;)H(s,t,n,i,a),s=s.nextSibling;return;case X:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,h),'"');case W:return t.push(e.data.replace(/[<&]/g,h));case $:return t.push("");case Z:return t.push("\x3c!--",e.data,"--\x3e");case te:var f=e.publicId,g=e.systemId;if(t.push("');else if(g&&"."!=g)t.push(' SYSTEM "',g,'">');else{var v=e.internalSubset;v&&t.push(" [",v,"]"),t.push(">")}return;case Y:return t.push("");case Q:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function F(e,t,n){var i;switch(t.nodeType){case V:i=t.cloneNode(!1),i.ownerDocument=e;case ne:break;case X:n=!0}if(i||(i=t.cloneNode(!1)),i.ownerDocument=e,i.parentNode=null,n)for(var a=t.firstChild;a;)i.appendChild(F(e,a,n)),a=a.nextSibling;return i}function L(e,t,n){var i=new t.constructor;for(var a in t){var o=t[a];"object"!=(void 0===o?"undefined":K(o))&&o!=i[a]&&(i[a]=o)}switch(t.childNodes&&(i.childNodes=new r),i.ownerDocument=e,i.nodeType){case V:var s=t.attributes,c=i.attributes=new l,p=s.length;c._ownerElement=i;for(var u=0;u0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var i in n)if(n[i]==e)return i;t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},i(G,f),i(G,f.prototype),v.prototype={nodeName:"#document",nodeType:ee,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==ne){for(var n=e.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,t),n=i}return e}return null==this.documentElement&&e.nodeType==V&&(this.documentElement=e),k(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),b(this,e)},importNode:function(e,t){return F(this,e,t)},getElementById:function(e){var t=null;return g(this.documentElement,function(n){if(n.nodeType==V&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new R;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new r,(t.attributes=new l)._ownerElement=t,t},createDocumentFragment:function(){var e=new N;return e.ownerDocument=this,e.childNodes=new r,e},createTextNode:function(e){var t=new A;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new T;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new B;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new P;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new w;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new I;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new R,i=t.split(":"),a=n.attributes=new l;return n.childNodes=new r,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,a._ownerElement=n,n},createAttributeNS:function(e,t){var n=new w,i=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,n}},a(v,f),R.prototype={nodeType:V,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===ne?this.insertBefore(e,null):S(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new s(this,function(t){var n=[];return g(t,function(i){i===t||i.nodeType!=V||"*"!==e&&i.tagName!=e||n.push(i)}),n})},getElementsByTagNameNS:function(e,t){return new s(this,function(n){var i=[];return g(n,function(a){a===n||a.nodeType!==V||"*"!==e&&a.namespaceURI!==e||"*"!==t&&a.localName!=t||i.push(a)}),i})}},v.prototype.getElementsByTagName=R.prototype.getElementsByTagName,v.prototype.getElementsByTagNameNS=R.prototype.getElementsByTagNameNS,a(R,f),w.prototype.nodeType=X,a(w,f),_.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(oe[re])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},a(_,f),A.prototype={nodeName:"#text",nodeType:W,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},a(A,_),T.prototype={nodeName:"#comment",nodeType:Z},a(T,_),B.prototype={nodeName:"#cdata-section",nodeType:$},a(B,_),E.prototype.nodeType=te,a(E,f),O.prototype.nodeType=ie,a(O,f),D.prototype.nodeType=J,a(D,f),I.prototype.nodeType=Q,a(I,f),N.prototype.nodeName="#document-fragment",N.prototype.nodeType=ne,a(N,f),P.prototype.nodeType=Y,a(P,f),j.prototype.serializeToString=function(e,t,n){return M.call(e,t,n)},f.prototype.toString=M;try{if(Object.defineProperty){var le=function e(t){switch(t.nodeType){case V:case ne:var n=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&n.push(e(t)),t=t.nextSibling;return n.join("");default:return t.nodeValue}};Object.defineProperty(s.prototype,"length",{get:function(){return c(this),this.$$length}}),Object.defineProperty(f.prototype,"textContent",{get:function(){return le(this)},set:function(e){switch(this.nodeType){case V:case ne:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),z=function(e,t,n){e["$$"+t]=n}}}catch(e){}t.DOMImplementation=m,t.XMLSerializer=j},function(e,t,n){"use strict";var i=function(e){e=e||{};var t,n=e.Base64,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=function(e){for(var t={},n=0,i=e.length;n>>6)+o(128|63&t):o(224|t>>>12&15)+o(128|t>>>6&63)+o(128|63&t)}var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|t>>>18&7)+o(128|t>>>12&63)+o(128|t>>>6&63)+o(128|63&t)},s=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,c=function(e){return e.replace(s,r)},l=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[i.charAt(n>>>18),i.charAt(n>>>12&63),t>=2?"=":i.charAt(n>>>6&63),t>=1?"=":i.charAt(63&n)].join("")},p=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,l)},u=t?function(e){return(e.constructor===t.constructor?e:new t(e)).toString("base64")}:function(e){return p(c(e))},d=function(e,t){return t?u(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):u(String(e))},m=function(e){return d(e,!0)},f=new RegExp(["[\xc0-\xdf][\x80-\xbf]","[\xe0-\xef][\x80-\xbf]{2}","[\xf0-\xf7][\x80-\xbf]{3}"].join("|"),"g"),h=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return o(55296+(n>>>10))+o(56320+(1023&n));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},g=function(e){return e.replace(f,h)},v=function(e){var t=e.length,n=t%4,i=(t>0?a[e.charAt(0)]<<18:0)|(t>1?a[e.charAt(1)]<<12:0)|(t>2?a[e.charAt(2)]<<6:0)|(t>3?a[e.charAt(3)]:0),r=[o(i>>>16),o(i>>>8&255),o(255&i)];return r.length-=[0,0,2,1][n],r.join("")},x=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,v)},y=t?function(e){return(e.constructor===t.constructor?e:new t(e,"base64")).toString()}:function(e){return g(x(e))},C=function(e){return y(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};return{VERSION:"2.1.9",atob:x,btoa:p,fromBase64:C,toBase64:d,utob:c,encode:d,encodeURI:m,btou:g,decode:C,noConflict:function(){var t=e.Base64;return e.Base64=n,t}}}();e.exports=i},function(e,t,n){"use strict";var i=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){n(e).push(t)},e.off=function(e,t){for(var i=n(e),a=i.length-1;a>=0;a--)t===i[a]&&i.splice(a,1)},e.emit=function(e,t){for(var i=n(e).map(function(e){return e}),a=0;a=0;n--){var a=i[n][2];(!a||a+2592e3=0;o--){var r=i[o];r[0]===e&&r[1]===t?i.splice(o,1):e!==r[0]&&0===r[0].indexOf(a)&&i.splice(o,1)}i.unshift([e,t,Math.round(Date.now()/1e3)]),i.length>n&&i.splice(n),l()}},removeUploadId:function(e){c(),delete p.using[e];for(var t=i.length-1;t>=0;t--)i[t][1]===e&&i.splice(t,1);l()}};e.exports=p},function(e,t,n){"use strict";var i=n(7);e.exports=i},function(e,t,n){"use strict";var i=n(0),a=n(4),o=n(17),r=n(18),s=n(24),c={SecretId:"",SecretKey:"",XCosSecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,UploadQueueSize:1e4,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1},l=function(e){this.options=i.extend(i.clone(c),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),this.options.SecretId&&this.options.SecretId.indexOf(" ")>-1&&(console.error("error: SecretId\u683c\u5f0f\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey\u683c\u5f0f\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5"),console.error("error: SecretKey format is incorrect. Please check")),a.init(this),o.init(this)};r.init(l,o),s.init(l,o),l.getAuthorization=i.getAuth,l.version="1.1.2",e.exports=l},function(module,exports,__webpack_require__){"use strict";(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var ERROR="input is invalid type",WINDOW="object"===("undefined"==typeof window?"undefined":_typeof(window)),root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===("undefined"==typeof self?"undefined":_typeof(self)),NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"===(void 0===process?"undefined":_typeof(process))&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"===_typeof(module)&&module.exports,AMD=__webpack_require__(11),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===(void 0===e?"undefined":_typeof(e))&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.getCtx=e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t>2]|=e[o]<>6,c[a++]=128|63&i):i<55296||i>=57344?(c[a++]=224|i>>12,c[a++]=128|i>>6&63,c[a++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),c[a++]=240|i>>18,c[a++]=128|i>>12&63,c[a++]=128|i>>6&63,c[a++]=128|63&i);else for(a=this.start;o>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[a>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=64?(this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,i,a,o,r=this.blocks;this.first?(e=r[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,i=(-1732584194^2004318071&e)+r[1]-117830708,i=(i<<12|i>>>20)+e<<0,n=(-271733879^i&(-271733879^e))+r[2]-1126478375,n=(n<<17|n>>>15)+i<<0,t=(e^n&(i^e))+r[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,i=this.h3,e+=(i^t&(n^i))+r[0]-680876936,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[1]-389564586,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[2]+606105819,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(i^t&(n^i))+r[4]-176418897,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[5]+1200080426,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[6]-1473231341,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(i^t&(n^i))+r[8]+1770035416,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[9]-1958414417,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[10]-42063,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(i^t&(n^i))+r[12]+1804603682,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[13]-40341101,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[14]-1502002290,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^i&(t^n))+r[1]-165796510,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[6]-1069501632,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[11]+643717713,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[5]-701558691,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[10]+38016083,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[15]-660478335,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[9]+568446438,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[14]-1019803690,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[3]-187363961,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[13]-1444681467,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[2]-51403784,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[7]+1735328473,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[12]-1926607734,t=(t<<20|t>>>12)+n<<0,a=t^n,e+=(a^i)+r[5]-378558,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[8]-2022574463,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[11]+1839030562,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[14]-35309556,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[1]-1530992060,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[4]+1272893353,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[7]-155497632,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[10]-1094730640,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[13]+681279174,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[0]-358537222,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[3]-722521979,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[6]+76029189,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[9]-640364487,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[12]-421815835,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[15]+530742520,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~i))+r[0]-198630844,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[7]+1126891415,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[14]-1416354905,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[12]+1700485571,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[3]-1894986606,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[10]-1051523,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[8]+1873313359,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[15]-30611744,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[6]-1560198380,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[4]-145523070,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[11]-1120210379,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[2]+718787259,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=i+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+i<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,i="",a=this.array(),o=0;o<15;)e=a[o++],t=a[o++],n=a[o++],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=a[o],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()}).call(exports,__webpack_require__(9),__webpack_require__(1),__webpack_require__(10)(module))},function(e,t,n){"use strict";function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(u===setTimeout)return setTimeout(e,0);if((u===i||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function r(e){if(d===clearTimeout)return clearTimeout(e);if((d===a||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function s(){g&&f&&(g=!1,f.length?h=f.concat(h):v=-1,h.length&&c())}function c(){if(!g){var e=o(s);g=!0;for(var t=h.length;t;){for(f=h,h=[];++v1)for(var n=1;n>>2]|=(n[a>>>2]>>>24-a%4*8&255)<<24-(i+a)%4*8;else if(65535>>2]=n[a>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new r.init(n,t/2)}},l=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],i=0;i>>2]>>>24-i%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new r.init(n,t)}},p=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},u=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,a=n.sigBytes,o=this.blockSize,s=a/(4*o),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*o,a=e.min(4*t,a),t){for(var c=0;cl;l++){if(16>l)o[l]=0|e[t+l];else{var p=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=p<<1|p>>>31}p=(i<<5|i>>>27)+c+o[l],p=20>l?p+(1518500249+(a&r|~a&s)):40>l?p+(1859775393+(a^r^s)):60>l?p+((a&r|a&s|r&s)-1894007588):p+((a^r^s)-899497514),c=s,s=r,r=a<<30|a>>>2,a=i,i=p}n[0]=n[0]+i|0,n[1]=n[1]+a|0,n[2]=n[2]+r|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(i+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=a._createHelper(t),e.HmacSHA1=a._createHmacHelper(t)}(),function(){var e=i,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var i=e.blockSize,a=4*i;n.sigBytes>a&&(n=e.finalize(n)),n.clamp();for(var o=this._oKey=n.clone(),r=this._iKey=n.clone(),s=o.words,c=r.words,l=0;l>>2]>>>24-o%4*8&255,s=t[o+1>>>2]>>>24-(o+1)%4*8&255,c=t[o+2>>>2]>>>24-(o+2)%4*8&255,l=r<<16|s<<8|c,p=0;p<4&&o+.75*p>>6*(3-p)&63));var u=i.charAt(64);if(u)for(;a.length%4;)a.push(u);return a.join("")},parse:function(e){var t=e.length,i=this._map,a=i.charAt(64);if(a){var o=e.indexOf(a);-1!=o&&(t=o)}for(var r=[],s=0,c=0;c>>6-c%4*2;r[s>>>2]|=(l|p)<<24-s%4*8,s++}return n.create(r,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.exports=i},function(e,t,n){"use strict";var i=n(14).DOMParser,a=function(e){function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function n(e){return e.prefix}function a(e){return"string"==typeof e?e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):e}function o(e,t,n,i){for(var a=0;a0&&o(e.arrayAccessFormPaths,t,n,i)&&(t[n]=[t[n]])}function s(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),i=t[5].split(".");if(n.setHours(t[3],t[4],i[0]),i.length>1&&n.setMilliseconds(i[1]),t[6]&&t[7]){var a=60*t[6]+Number(t[7]);a=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*a:a),n.setMinutes(n.getMinutes()-a-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function c(t,n,i){if(e.datetimeAccessFormPaths.length>0){var a=i.split(".#")[0];return o(e.datetimeAccessFormPaths,t,n,a)?s(t):t}return t}function l(t,n,i,a){return!(n==S.ELEMENT_NODE&&e.xmlElementsFilter.length>0)||o(e.xmlElementsFilter,t,i,a)}function p(i,a){if(i.nodeType==S.DOCUMENT_NODE){for(var o=new Object,s=i.childNodes,u=0;u1&&null!=o.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==o.__text||""==o.__text.trim())&&delete o.__text:o=o.__cdata,delete o.__cnt,!e.enableToStringFunc||null==o.__text&&null==o.__cdata||(o.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),o}if(i.nodeType==S.TEXT_NODE||i.nodeType==S.CDATA_SECTION_NODE)return i.nodeValue}function u(t,n,i,o){var r="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=i)for(var s=0;s":">"}function d(e,t){return""}function m(e,t){return-1!==e.indexOf(t,e.length-t.length)}function f(t,n){return!!("property"==e.arrayAccessForm&&m(n.toString(),"_asArray")||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function)}function h(e){var t=0;if(e instanceof Object)for(var n in e)f(e,n)||t++;return t}function g(t,n,i){return 0==e.jsonPropertiesFilter.length||""==i||o(e.jsonPropertiesFilter,t,n,i)}function v(t){var n=[];if(t instanceof Object)for(var i in t)-1==i.toString().indexOf("__")&&0==i.toString().indexOf(e.attributePrefix)&&n.push(i);return n}function x(t){var n="";return null!=t.__cdata&&(n+=""),null!=t.__text&&(e.escapeMode?n+=a(t.__text):n+=t.__text),n}function y(t){var n="";return t instanceof Object?n+=x(t):null!=t&&(e.escapeMode?n+=a(t):n+=t),n}function C(e,t){return""===e?t:e+"."+t}function b(e,t,n,i){var a="";if(0==e.length)a+=u(e,t,n,!0);else for(var o=0;o0)for(var i in e)if(!f(e,i)&&(""==t||g(e,i,C(t,i)))){var a=e[i],o=v(a);if(null==a||void 0==a)n+=u(a,i,o,!0);else if(a instanceof Object)if(a instanceof Array)n+=b(a,i,o,t);else if(a instanceof Date)n+=u(a,i,o,!1),n+=a.toISOString(),n+=d(a,i);else{var r=h(a);r>0||null!=a.__text||null!=a.__cdata?(n+=u(a,i,o,!1),n+=k(a,C(t,i)),n+=d(a,i)):n+=u(a,i,o,!0)}else n+=u(a,i,o,!1),n+=y(a),n+=d(a,i)}return n+=y(e)}e=e||{},function(){void 0===e.escapeMode&&(e.escapeMode=!0),e.attributePrefix=e.attributePrefix||"_",e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1)}();var S={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(e){if(void 0===e)return null;var t;if(i){var n=new i,a=null;try{a=n.parseFromString("INVALID","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(e){a=null}try{t=n.parseFromString(e,"text/xml"),null!=a&&t.getElementsByTagNameNS(a,"parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("")+2)),t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?s(e):e},this.xml2json=function(e){return p(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return k(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},o=function(e){if(!e)return null;var t=new i,n=t.parseFromString(e,"text/xml"),o=new a,r=o.xml2json(n);return r.html&&r.getElementsByTagName("parsererror").length?null:r};e.exports=o},function(e,t,n){"use strict";function i(e){this.options=e||{locator:{}}}function a(e,t,n){function i(t){var i=e[t];!i&&r&&(i=2==e.length?function(n){e(t,n)}:e),a[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+s(n))}||function(){}}if(!e){if(t instanceof o)return t;e=t}var a={},r=e instanceof Function;return n=n||{},i("warning"),i("error"),i("fatalError"),a}function o(){this.cdata=!1}function r(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function s(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function c(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function l(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}i.prototype.parseFromString=function(e,t){var n=this.options,i=new p,r=n.domBuilder||new o,s=n.errorHandler,c=n.locator,l=n.xmlns||{},u={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&r.setDocumentLocator(c),i.errorHandler=a(s,r,c),i.domBuilder=n.domBuilder||r,/\/x?html?$/.test(t)&&(u.nbsp="\xa0",u.copy="\xa9",l[""]="http://www.w3.org/1999/xhtml"),l.xml=l.xml||"http://www.w3.org/XML/1998/namespace",e?i.parse(e,l,u):i.errorHandler.error("invalid doc source"),r.doc},o.prototype={startDocument:function(){this.doc=(new u).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,i){var a=this.doc,o=a.createElementNS(e,n||t),s=i.length;l(this,o),this.currentElement=o,this.locator&&r(this.locator,o);for(var c=0;c65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function f(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?p(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function h(t){if(t>S){var n=e.substring(S,t).replace(/&#?\w+;/g,f);C&&g(S),i.characters(n,0,t-S),S=t}}function g(t,n){for(;t>=x&&(n=y.exec(e));)v=n.index,x=v+n[0].length,C.lineNumber++;C.columnNumber=t-v+1}for(var v=0,x=0,y=/.*(?:\r\n?|\n)|.*$/g,C=i.locator,b=[{currentNSMap:t}],k={},S=0;;){try{var R=e.indexOf("<",S);if(R<0){if(!e.substr(S).match(/^\s*$/)){var w=i.doc,_=w.createTextNode(e.substr(S));w.appendChild(_),i.currentElement=_}return}switch(R>S&&h(R),e.charAt(R+1)){case"/":var A=e.indexOf(">",R+3),T=e.substring(R+2,A),B=b.pop();A<0?(T=e.substring(R+2).replace(/[\s<].*/,""),a.error("end tag name: "+T+" is not complete:"+B.tagName),A=R+1+T.length):T.match(/\sS?S=A:h(Math.max(R,S)+1)}}function o(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function r(e,t,n,i,a,o){for(var r,s,c=++t,l=y;;){var p=e.charAt(c);switch(p){case"=":if(l===C)r=e.slice(t,c),l=k;else{if(l!==b)throw new Error("attribute equal must after attrName");l=k}break;case"'":case'"':if(l===k||l===C){if(l===C&&(o.warning('attribute value must after "="'),r=e.slice(t,c)),t=c+1,!((c=e.indexOf(p,t))>0))throw new Error("attribute value no end '"+p+"' match");s=e.slice(t,c).replace(/&#?\w+;/g,a),n.add(r,s,t-1),l=R}else{if(l!=S)throw new Error('attribute value must after "="');s=e.slice(t,c).replace(/&#?\w+;/g,a),n.add(r,s,t),o.warning('attribute "'+r+'" missed start quot('+p+")!!"),t=c+1,l=R}break;case"/":switch(l){case y:n.setTagName(e.slice(t,c));case R:case w:case _:l=_,n.closed=!0;case S:case C:case b:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),l==y&&n.setTagName(e.slice(t,c)),c;case">":switch(l){case y:n.setTagName(e.slice(t,c));case R:case w:case _:break;case S:case C:s=e.slice(t,c),"/"===s.slice(-1)&&(n.closed=!0,s=s.slice(0,-1));case b:l===b&&(s=r),l==S?(o.warning('attribute "'+s+'" missed quot(")!!'),n.add(r,s.replace(/&#?\w+;/g,a),t)):("http://www.w3.org/1999/xhtml"===i[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),n.add(s,s,t));break;case k:throw new Error("attribute value missed!!")}return c;case"\x80":p=" ";default:if(p<=" ")switch(l){case y:n.setTagName(e.slice(t,c)),l=w;break;case C:r=e.slice(t,c),l=b;break;case S:var s=e.slice(t,c).replace(/&#?\w+;/g,a);o.warning('attribute "'+s+'" missed quot(")!!'),n.add(r,s,t);case R:l=w}else switch(l){case b:n.tagName;"http://www.w3.org/1999/xhtml"===i[""]&&r.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+r+'" missed value!! "'+r+'" instead2!!'),n.add(r,r,t),t=c,l=C;break;case R:o.warning('attribute space is required"'+r+'"!!');case w:l=C,t=c;break;case k:l=S,t=c;break;case _:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function s(e,t,n){for(var i=e.tagName,a=null,o=e.length;o--;){var r=e[o],s=r.qName,c=r.value,l=s.indexOf(":");if(l>0)var u=r.prefix=s.slice(0,l),d=s.slice(l+1),m="xmlns"===u&&d;else d=s,u=null,m="xmlns"===s&&"";r.localName=d,!1!==m&&(null==a&&(a={},p(n,n={})),n[m]=a[m]=c,r.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(m,c))}for(var o=e.length;o--;){r=e[o];var u=r.prefix;u&&("xml"===u&&(r.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==u&&(r.uri=n[u||""]))}var l=i.indexOf(":");l>0?(u=e.prefix=i.slice(0,l),d=e.localName=i.slice(l+1)):(u=null,d=e.localName=i);var f=e.uri=n[u||""];if(t.startElement(f,d,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=a,!0;if(t.endElement(f,d,i),a)for(u in a)t.endPrefixMapping(u)}function c(e,t,n,i,a){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("",t),r=e.substring(t+1,o);if(/[&<]/.test(r))return/^script$/i.test(n)?(a.characters(r,0,r.length),o):(r=r.replace(/&#?\w+;/g,i),a.characters(r,0,r.length),o)}return t+1}function l(e,t,n,i){var a=i[n];return null==a&&(a=e.lastIndexOf(""),at?(n.comment(e,t+4,a-t-4),a+3):(i.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var a=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,a-t-9),n.endCDATA(),a+3}var o=h(e,t),r=o.length;if(r>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],c=r>3&&/^public$/i.test(o[2][0])&&o[3][0],l=r>4&&o[4][0],p=o[r-1];return n.startDTD(s,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),p.index+p[0].length}}return-1}function d(e,t,n){var i=e.indexOf("?>",t);if(i){var a=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(a){a[0].length;return n.processingInstruction(a[1],a[2]),i+2}return-1}return-1}function m(e){}function f(e,t){return e.__proto__=t,e}function h(e,t){var n,i=[],a=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(a.lastIndex=t,a.exec(e);n=a.exec(e);)if(i.push(n),n[1])return i}var g=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),x=new RegExp("^"+g.source+v.source+"*(?::"+g.source+v.source+"*)?$"),y=0,C=1,b=2,k=3,S=4,R=5,w=6,_=7;i.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),p(t,t={}),a(e,t,n,i,this.errorHandler),i.endDocument()}},m.prototype={setTagName:function(e){if(!x.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!x.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},f({},f.prototype)instanceof f||(f=function(e,t){function n(){}n.prototype=t,n=new n;for(t in e)n[t]=e[t];return n}),t.XMLReader=i},function(e,t,n){"use strict";function i(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(r,"")}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=new RegExp("^([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd])|^((x|X)(m|M)(l|L))|([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd-.0-9\xb7\u0300-\u036f\u203f\u2040])","g"),r=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,s=function(e){var t=[];if(e instanceof Object)for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},c=function(e,t){var n=function(e,n,i,a,r){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(a).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(o,"_"));var l=[c,"<",e,i||""];return n&&n.length>0?(l.push(">"),l.push(n),r&&l.push(c),l.push("")):l.push("/>"),l.join("")};return function e(o,r,c){var l=void 0===o?"undefined":a(o);switch((Array.isArray?Array.isArray(o):o instanceof Array)?l="array":o instanceof Date&&(l="date"),l){case"array":var p=[];return o.map(function(t){p.push(e(t,1,c+1))}),t.prettyPrint&&p.push("\n"),p.join("");case"date":return o.toJSON?o.toJSON():o+"";case"object":var u=[];for(var d in o)if(o.hasOwnProperty(d))if(o[d]instanceof Array)for(var m in o[d])o[d].hasOwnProperty(m)&&u.push(n(d,e(o[d][m],0,c+1),null,c+1,s(o[d][m]).length));else u.push(n(d,e(o[d],0,c+1),null,c+1));return t.prettyPrint&&u.length>0&&u.push("\n"),u.join("");case"function":return o();default:return t.escape?i(o):""+o}}(e,0,0)},l=function(e){var t=['"),t.join("")},p=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" "}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var n="",i="";return t&&("object"==(void 0===t?"undefined":a(t))?(t.xmlHeader&&(n=l(!!t.xmlHeader.standalone)),void 0!==t.docType&&(i="")):n=l()),t=t||{},[n,t.prettyPrint&&i?"\n":"",i,c(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")};e.exports=p},function(e,t,n){"use strict";var i=n(5),a=n(0),o={},r=function(e,t){o[t]=e[t],e[t]=function(e,n){e.SkipTask?o[t].call(this,e,n):this._addTask(t,e,n)}},s=function(e){var t=[],n={},r=0,s=0,c=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),t},l=function(){var n,i=function(){n=0,e.emit("task-list-update",{list:a.map(t,c)}),e.emit("list-update",{list:a.map(t,c)})};return function(){n||(n=setTimeout(i))}}(),p=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var i=0;ie.options.UploadQueueSize;){var a="waiting"===t[i].state||"checking"===t[i].state||"uploading"===t[i].state;t[i]&&a?i++:(n[t[i].id]&&delete n[t[i].id],t.splice(i,1),s--)}l()}},u=function n(){if(!(r>=e.options.FileParallelLimit)){for(;t[s]&&"waiting"!==t[s].state;)s++;if(!(s>=t.length)){var i=t[s];s++,r++,i.state="checking",i.params.onTaskStart&&i.params.onTaskStart(c(i)),!i.params.UploadData&&(i.params.UploadData={});var u=a.formatParams(i.api,i.params);o[i.api].call(e,u,function(t,a){e._isRunningTask(i.id)&&("checking"!==i.state&&"uploading"!==i.state||(i.state=t?"error":"success",t&&(i.error=t),r--,l(),n(),i.callback&&i.callback(t,a),"success"===i.state&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)),p())}),l(),setTimeout(n)}}},d=function(t,a){var o=n[t];if(o){var s=o&&"waiting"===o.state,c=o&&("checking"===o.state||"uploading"===o.state);if("canceled"===a&&"canceled"!==o.state||"paused"===a&&s||"paused"===a&&c){if("paused"===a&&o.params.Body&&"function"==typeof o.params.Body.pipe)return void console.error("stream not support pause");o.state=a,e.emit("inner-kill-task",{TaskId:t,toState:a});try{var d=o&&o.params&&o.params.UploadData.UploadId}catch(e){}"canceled"===a&&d&&i.removeUsing(d),l(),c&&(r--,u()),"canceled"===a&&(o.params&&(delete o.params.UploadData,delete o.params.Body,delete o.params),delete o.callback)}p()}};e._addTasks=function(t){a.each(t,function(t){e._addTask(t.api,t.params,t.callback,!0)}),l()},e._addTask=function(i,o,r,s){"sliceUploadFile"!==i||a.canFileSlice()||(i="postObject"),o=a.formatParams(i,o);var c=a.uuid();o.TaskId=c,o.onTaskReady&&o.onTaskReady(c);var d={params:o,callback:r,api:i,index:t.length,id:c,Bucket:o.Bucket,Region:o.Region,Key:o.Key,FilePath:o.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null},m=o.onHashProgress;o.onHashProgress=function(t){e._isRunningTask(d.id)&&(d.hashPercent=t.percent,m&&m(t),l())};var f=o.onProgress;return o.onProgress=function(t){e._isRunningTask(d.id)&&("checking"===d.state&&(d.state="uploading"),d.loaded=t.loaded,d.size=t.total,d.speed=t.speed,d.percent=t.percent,f&&f(t),l())},a.getFileSize(i,o,function(e,i){if(e)return void r(e);n[c]=d,t.push(d),d.size=i,!s&&l(),u(),p()}),c},e._isRunningTask=function(e){var t=n[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return a.map(t,c)},e.cancelTask=function(e){d(e,"canceled")},e.pauseTask=function(e){d(e,"paused")},e.restartTask=function(e){var t=n[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",l(),s=Math.min(s,t.index),u())},e.isUploadRunning=function(){return r||s/gi,"<$1Rule>"),i=i.replace(/<(\/?)Tags>/gi,"<$1Tag>");var a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Re.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"replication",headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function _(e,t){Re.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var i={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else e||!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=n.ReplicationConfiguration.Rule,delete n.ReplicationConfiguration.Rule),t(e,n)})}function A(e,t){Re.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function T(e,t){if(!e.WebsiteConfiguration)return void t({error:"missing param WebsiteConfiguration"});var n=Te.clone(e.WebsiteConfiguration||{}),i=n.RoutingRules||n.RoutingRule||[];i=Te.isArray(i)?i:[i],delete n.RoutingRule,delete n.RoutingRules,i.length&&(n.RoutingRules={RoutingRule:i});var a=Te.json2xml({WebsiteConfiguration:n}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"website",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function B(e,t){Re.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var a=n.WebsiteConfiguration||{};if(a.RoutingRules){var o=Te.clone(a.RoutingRules.RoutingRule||[]);o=Te.makeArray(o),a.RoutingRules=o}t(null,{WebsiteConfiguration:a,statusCode:n.statusCode,headers:n.headers})}})}function E(e,t){Re.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function O(e,t){if(!e.RefererConfiguration)return void t({error:"missing param RefererConfiguration"});var n=Te.clone(e.RefererConfiguration||{}),i=n.DomainList||{},a=i.Domains||i.Domain||[];a=Te.isArray(a)?a:[a],a.length&&(n.DomainList={Domain:a});var o=Te.json2xml({RefererConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Re.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"referer",headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function D(e,t){Re.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var a=n.RefererConfiguration||{};if(a.DomainList){var o=Te.makeArray(a.DomainList.Domain||[]);a.DomainList={Domains:o}}t(null,{RefererConfiguration:a,statusCode:n.statusCode,headers:n.headers})}})}function I(e,t){var n=e.DomainConfiguration||{},i=n.DomainRule||e.DomainRule||[];i=Te.clone(i);var a=Te.json2xml({DomainConfiguration:{DomainRule:i}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"domain",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function N(e,t){Re.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){if(e)return t(e);var i=[];try{i=n.DomainConfiguration.DomainRule||[]}catch(e){}i=Te.clone(Te.isArray(i)?i:[i]),t(null,{DomainRule:i,statusCode:n.statusCode,headers:n.headers})})}function P(e,t){Re.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function j(e,t){var n=e.OriginConfiguration||{},i=n.OriginRule||e.OriginRule||[];i=Te.clone(i);var a=Te.json2xml({OriginConfiguration:{OriginRule:i}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"origin",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function M(e,t){Re.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){if(e)return t(e);var i=[];try{i=n.OriginConfiguration.OriginRule||[]}catch(e){}i=Te.clone(Te.isArray(i)?i:[i]),t(null,{OriginRule:i,statusCode:n.statusCode,headers:n.headers})})}function U(e,t){Re.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function H(e,t){var n=Te.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(n)),Re.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function F(e,t){Re.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(e,n){if(e)return t(e);delete n.BucketLoggingStatus._xmlns,t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})})}function L(e,t){var n=Te.clone(e.InventoryConfiguration);if(n.OptionalFields){var i=n.OptionalFields||[];n.OptionalFields={Field:i}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var a=n.Destination.COSBucketDestination.Encryption;Object.keys(a).indexOf("SSECOS")>-1&&(a["SSE-COS"]=a.SSECOS,delete a.SSECOS)}var o=Te.json2xml({InventoryConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Re.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"inventory",qs:{id:e.Id},headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function z(e,t){Re.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){if(e)return t(e);var i=n.InventoryConfiguration;if(i&&i.OptionalFields&&i.OptionalFields.Field){var a=i.OptionalFields.Field;Te.isArray(a)||(a=[a]),i.OptionalFields=a}if(i.Destination&&i.Destination.COSBucketDestination&&i.Destination.COSBucketDestination.Encryption){var o=i.Destination.COSBucketDestination.Encryption;Object.keys(o).indexOf("SSE-COS")>-1&&(o.SSECOS=o["SSE-COS"],delete o["SSE-COS"])}t(null,{InventoryConfiguration:i,statusCode:n.statusCode,headers:n.headers})})}function K(e,t){Re.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken}},function(e,n){if(e)return t(e);var i=n.ListInventoryConfigurationResult,a=i.InventoryConfiguration||[];a=Te.isArray(a)?a:[a],delete i.InventoryConfiguration,Te.each(a,function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;Te.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}}),i.InventoryConfigurations=a,Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function q(e,t){Re.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function G(e,t){if(!e.AccelerateConfiguration)return void t({error:"missing param AccelerateConfiguration"});var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},i=Te.json2xml(n),a={};a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Re.call(this,{Interface:"putBucketAccelerate",Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"accelerate",headers:a},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function V(e,t){Re.call(this,{Interface:"getBucketAccelerate",Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)})}function X(e,t){Re.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(n,i){if(n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0,statusCode:a}):t(n)}i.ETag=Te.attr(i.headers,"etag",""),t(null,i)})}function W(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,Re.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions"},function(e,n){if(e)return t(e);var i=n.ListVersionsResult||{},a=i.DeleteMarker||[];a=Te.isArray(a)?a:[a];var o=i.Version||[];o=Te.isArray(o)?o:[o];var r=Te.clone(i);delete r.DeleteMarker,delete r.Version,Te.extend(r,{DeleteMarkers:a,Versions:o,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function $(e,t){var n=e.Query||{},i=e.QueryString||"";n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,Re.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,qs:n,qsStr:i,rawBody:!0},function(n,i){if(n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0}):t(n)}t(null,{Body:i.body,ETag:Te.attr(i.headers,"etag",""),statusCode:i.statusCode,headers:i.headers})})}function Q(e,t){var n=this,i=e.ContentLength,a=Te.throttleOnProgress.call(n,i,e.onProgress),o=e.Headers;o["Cache-Control"]||o["cache-control"]||(o["Cache-Control"]=""),o["Content-Type"]||o["content-type"]||(o["Content-Type"]=Be.getType(e.Key)||"application/octet-stream"),Te.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(r){r&&(o["Content-MD5"]=Te.binaryBase64(r)),void 0!==e.ContentLength&&(o["Content-Length"]=e.ContentLength),a(null,!0),Re.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:a},function(o,r){if(o)return a(null,!0),t(o);a({loaded:i,total:i},!0);var s=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});s=s.substr(s.indexOf("://")+3),r.Location=s,r.ETag=Te.attr(r.headers,"etag",""),t(null,r)})})}function J(e,t){var n=this,i={},a=e.FilePath;if(!a)return void t({error:"missing param FilePath"});i["Cache-Control"]=e.CacheControl,i["Content-Disposition"]=e.ContentDisposition,i["Content-Encoding"]=e.ContentEncoding,i["Content-MD5"]=e.ContentMD5,i["Content-Length"]=e.ContentLength,i["Content-Type"]=e.ContentType,i.Expect=e.Expect,i.Expires=e.Expires,i["x-cos-acl"]=e.ACL,i["x-cos-grant-read"]=e.GrantRead,i["x-cos-grant-write"]=e.GrantWrite,i["x-cos-grant-full-control"]=e.GrantFullControl,i["x-cos-storage-class"]=e.StorageClass,i["x-cos-mime-limit"]=e.MimeLimit,i["x-cos-traffic-limit"]=e.TrafficLimit,delete i["Content-Length"],delete i["content-length"];for(var o in e)o.indexOf("x-cos-meta-")>-1&&(i[o]=e[o]);var r=Te.throttleOnProgress.call(n,i["Content-Length"],e.onProgress);Re.call(this,{Action:"name/cos:PostObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:i,qs:e.Query,filePath:a,onProgress:r},function(i,o){if(r(null,!0),i)return t(i);if(o&&o.headers){var s=o.headers,c=s.etag||s.Etag||s.ETag||"",l=a.substr(a.lastIndexOf("/")+1),p=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key.replace(/\$\{filename\}/g,l),isLocation:!0});return t(null,{Location:p,statusCode:o.statusCode,headers:s,ETag:c})}t(null,o)})}function Y(e,t){Re.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId},function(e,n){if(e){var i=e.statusCode;return i&&204===i?t(null,{statusCode:i}):i&&404===i?t(null,{BucketNotFound:!0,statusCode:i}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})})}function Z(e,t){Re.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"acl"},function(e,n){if(e)return t(e);var i=n.AccessControlPolicy||{},a=i.Owner||{},o=i.AccessControlList&&i.AccessControlList.Grant||[];o=Te.isArray(o)?o:[o];var r=ye(i);n.headers&&n.headers["x-cos-acl"]&&(r.ACL=n.headers["x-cos-acl"]),r=Te.extend(r,{Owner:a,Grants:o,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function ee(e,t){var n=e.Headers,i="";if(e.AccessControlPolicy){var a=Te.clone(e.AccessControlPolicy||{}),o=a.Grants||a.Grant;o=Te.isArray(o)?o:[o],delete a.Grant,delete a.Grants,a.AccessControlList={Grant:o},i=Te.json2xml({AccessControlPolicy:a}),n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(i))}Te.each(n,function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=Ce(n[t]))}),Re.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:i},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function te(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,Re.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n},function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var i=n.headers||{};t(null,{AccessControlAllowOrigin:i["access-control-allow-origin"],AccessControlAllowMethods:i["access-control-allow-methods"],AccessControlAllowHeaders:i["access-control-allow-headers"],AccessControlExposeHeaders:i["access-control-expose-headers"],AccessControlMaxAge:i["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})})}function ne(e,t){var n=e.Headers;!n["Cache-Control"]&&n["cache-control"]&&(n["Cache-Control"]="");var i=e.CopySource||"",a=i.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!a)return void t({error:"CopySource format error"});var o=a[1],r=a[3],s=decodeURIComponent(a[4]);Re.call(this,{Scope:[{action:"name/cos:GetObject",bucket:o,region:r,prefix:s},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(e,n){if(e)return t(e);var i=Te.clone(n.CopyObjectResult||{});Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function ie(e,t){var n=e.CopySource||"",i=n.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!i)return void t({error:"CopySource format error"});var a=i[1],o=i[3],r=decodeURIComponent(i[4]);Re.call(this,{Scope:[{action:"name/cos:GetObject",bucket:a,region:o,prefix:r},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers},function(e,n){if(e)return t(e);var i=Te.clone(n.CopyPartResult||{});Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function ae(e,t){var n=e.Objects||[],i=e.Quiet;n=Te.isArray(n)?n:[n];var a=Te.json2xml({Delete:{Object:n,Quiet:i||!1}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a));var r=Te.map(n,function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}});Re.call(this,{Scope:r,method:"POST",Bucket:e.Bucket,Region:e.Region,body:a,action:"delete",headers:o},function(e,n){if(e)return t(e);var i=n.DeleteResult||{},a=i.Deleted||[],o=i.Error||[];a=Te.isArray(a)?a:[a],o=Te.isArray(o)?o:[o];var r=Te.clone(i);Te.extend(r,{Error:o,Deleted:a,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function oe(e,t){var n=e.Headers;if(!e.RestoreRequest)return void t({error:"missing param RestoreRequest"});var i=e.RestoreRequest||{},a=Te.json2xml({RestoreRequest:i});n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:a,action:"restore",headers:n},function(e,n){t(e,n)})}function re(e,t){var n=e.Tagging||{},i=n.TagSet||n.Tags||e.Tags||[];i=Te.clone(Te.isArray(i)?i:[i]);var a=Te.json2xml({Tagging:{TagSet:{Tag:i}}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Interface:"putObjectTagging",Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:a,action:"tagging",headers:o,VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function se(e,t){Re.call(this,{Interface:"getObjectTagging",Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var i={Tags:[],statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else{var a=[];try{a=n.Tagging.TagSet.Tag||[]}catch(e){}a=Te.clone(Te.isArray(a)?a:[a]),t(null,{Tags:a,statusCode:n.statusCode,headers:n.headers})}})}function ce(e,t){Re.call(this,{Interface:"deleteObjectTagging",Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function le(e,t){var n=this,i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=Be.getType(e.Key)||"application/octet-stream"),Re.call(n,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query},function(e,n){return e?t(e):(n=Te.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,Te.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)})}function pe(e,t){var n=this;Te.getFileSize("multipartUpload",e,function(){Te.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(i){i&&(e.Headers["Content-MD5"]=Te.binaryBase64(i)),Re.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null},function(e,n){if(e)return t(e);t(null,{ETag:Te.attr(n.headers,"etag",{}),statusCode:n.statusCode,headers:n.headers})})})})}function ue(e,t){for(var n=this,i=e.UploadId,a=e.Parts,o=0,r=a.length;o-1?function(e){var t=e.match(/q-url-param-list.*?(?=&)/g)[0],n="q-url-param-list="+encodeURIComponent(t.replace(/q-url-param-list=/,"")).toLowerCase(),i=new RegExp(t,"g");return e.replace(i,n)}(n.Authorization):"sign="+encodeURIComponent(n.Authorization)),n.XCosSecurityToken&&(o+="&x-cos-security-token="+n.XCosSecurityToken),n.ClientIP&&(o+="&clientIP="+n.ClientIP),n.ClientUA&&(o+="&clientUA="+n.ClientUA),n.Token&&(o+="&token="+n.Token),a&&(o+="&"+a),setTimeout(function(){t(null,{Url:o})})}});return s?(o+="?"+s.Authorization+(s.XCosSecurityToken?"&x-cos-security-token="+s.XCosSecurityToken:""),a&&(o+="&"+a)):a&&(o+="?"+a),o}function ye(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},i=e&&e.AccessControlList||{},a=i.Grant;a&&(a=Te.isArray(a)?a:[a]);var o={READ:0,WRITE:0,FULL_CONTROL:0};return a&&a.length&&Te.each(a,function(i){"qcs::cam::anyone:anyone"===i.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===i.Grantee.URI?o[i.Permission]=1:i.Grantee.ID!==e.Owner.ID&&t[n[i.Permission]].push('id="'+i.Grantee.ID+'"')}),o.FULL_CONTROL||o.WRITE&&o.READ?t.ACL="public-read-write":o.READ?t.ACL="public-read":t.ACL="private",Te.each(n,function(e){t[e]=Ce(t[e].join(","))}),t}function Ce(e){var t,n,i=e.split(","),a={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(a="{Bucket}."+a)),a=a.replace(/\{\{AppId\}\}/gi,i).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,o).replace(/\{\{.*?\}\}/gi,""),a=a.replace(/\{AppId\}/gi,i).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,o).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(a)||(a="https://"+a),"/"===a.slice(-1)&&(a=a.slice(0,-1));var s=a;return e.ForcePathStyle&&(s+="/"+t),s+="/",r&&(s+=Te.camSafeUrlEncode(r).replace(/%2F/g,"/")),e.isLocation&&(s=s.replace(/^https?:\/\//,"")),s}function ke(e,t){var n=Te.clone(e.Headers),i="";Te.each(n,function(e,t){(""===e||["content-type","cache-control"].indexOf(t.toLowerCase())>-1)&&delete n[t],"host"===t.toLowerCase()&&(i=e)}),!i&&e.SignHost&&(n.Host=e.SignHost);var a=function(e){var n=!1,i=e.Authorization;if(i)if(i.indexOf(" ")>-1)n=!1;else if(i.indexOf("q-sign-algorithm=")>-1&&i.indexOf("q-ak=")>-1&&i.indexOf("q-sign-time=")>-1&&i.indexOf("q-key-time=")>-1&&i.indexOf("q-url-param-list=")>-1)n=!0;else try{i=Ae.atob(i),i.indexOf("a=")>-1&&i.indexOf("k=")>-1&&i.indexOf("t=")>-1&&i.indexOf("r=")>-1&&i.indexOf("b=")>-1&&(n=!0)}catch(e){}n?t&&t(null,e):t&&t("authorization error")},o=this,r=e.Bucket||"",s=e.Region||"",c="name/cos:PostObject"!==e.Action&&e.Key?e.Key:"";o.options.ForcePathStyle&&r&&(c=r+"/"+c);var l="/"+c,p={},u=e.Scope;if(!u){var d=e.Action||"",m=e.ResourceKey||e.Key||"";u=e.Scope||[{action:d,bucket:r,region:s,prefix:m}]}var f=Te.md5(JSON.stringify(u));o._StsCache=o._StsCache||[],function(){var e,t;for(e=o._StsCache.length-1;e>=0;e--){t=o._StsCache[e];var n=Math.round(Te.getSkewTime(o.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)o._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===f){p=t;break}}}();var h=function(){var t=p.StartTime&&p.ExpiredTime?p.StartTime+";"+p.ExpiredTime:"",i=Te.getAuth({SecretId:p.TmpSecretId,SecretKey:p.TmpSecretKey,Method:e.Method,Pathname:l,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:o.options.SystemClockOffset,KeyTime:t}),r={Authorization:i,XCosSecurityToken:p.XCosSecurityToken||"",Token:p.Token||"",ClientIP:p.ClientIP||"",ClientUA:p.ClientUA||""};a(r)};if(p.ExpiredTime&&p.ExpiredTime-Te.getSkewTime(o.options.SystemClockOffset)/1e3>60)h();else if(o.options.getAuthorization)o.options.getAuthorization.call(o,{Bucket:r,Region:s,Method:e.Method,Key:c,Pathname:l,Query:e.Query,Headers:n,Scope:u,SystemClockOffset:o.options.SystemClockOffset},function(e){"string"==typeof e&&(e={Authorization:e}),e.TmpSecretId&&e.TmpSecretKey&&e.XCosSecurityToken&&e.ExpiredTime?(p=e||{},p.Scope=u,p.ScopeKey=f,o._StsCache.push(p),h()):a(e)});else{if(!o.options.getSTS)return function(){var t=Te.getAuth({SecretId:e.SecretId||o.options.SecretId,SecretKey:e.SecretKey||o.options.SecretKey,Method:e.Method,Pathname:l,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:o.options.SystemClockOffset}),i={Authorization:t,XCosSecurityToken:o.options.XCosSecurityToken};return a(i),i}();o.options.getSTS.call(o,{Bucket:r,Region:s},function(e){p=e||{},p.Scope=u,p.ScopeKey=f,p.TmpSecretId=p.SecretId,p.TmpSecretKey=p.SecretKey,o._StsCache.push(p),h()})}return""}function Se(e){var t=!1,n=!1,i=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var a=e.error.Code,o=e.error.Message;("RequestTimeTooSkewed"===a||"AccessDenied"===a&&"Request has expired"===o)&&(n=!0)}catch(e){}if(e)if(n&&i){var r=Date.parse(i);this.options.CorrectClockSkew&&Math.abs(Te.getSkewTime(this.options.SystemClockOffset)-r)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=r-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0);return t}function Re(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=Te.clearKey(e.qs),e.headers&&(e.headers=Te.clearKey(e.headers)),e.qs&&(e.qs=Te.clearKey(e.qs));var i=Te.clone(e.qs);e.action&&(i[e.action]="");var a=e.url||e.Url,o=e.SignHost||Ee.call(this,{Bucket:e.Bucket,Region:e.Region,Url:a});!function a(r){var s=n.options.SystemClockOffset;ke.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:i,Headers:e.headers,SignHost:o,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope},function(i,o){if(i)return void t(i);e.AuthData=o,we.call(n,e,function(i,o){i&&r<2&&(s!==n.options.SystemClockOffset||Se.call(n,i))?(e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,delete e.headers["x-cos-security-token"]),a(r+1)):t(i,o)})})}(1)}function we(e,t){var n=this,i=e.TaskId;if(!i||n._isRunningTask(i)){var a=e.Bucket,o=e.Region,r=e.Key,s=e.method||"GET",c=e.url||e.Url,l=e.body,p=e.json,u=e.rawBody;n.options.UseAccelerate&&(o="accelerate"),c=c||be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:a,region:o,object:r}),e.action&&(c=c+"?"+e.action),e.qsStr&&(c=c.indexOf("?")>-1?c+"&"+e.qsStr:c+"?"+e.qsStr);var d={method:s,url:c,headers:e.headers,qs:e.qs,filePath:e.filePath,body:l,json:p},m="x-cos-security-token";Te.isCIHost(c)&&(m="x-ci-security-token"),d.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(d.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(d.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(d.headers.clientUA=e.AuthData.ClientUA),e.AuthData.XCosSecurityToken&&(d.headers[m]=e.AuthData.XCosSecurityToken),d.headers&&(d.headers=Te.clearKey(d.headers)),d=Te.clearKey(d),e.onProgress&&"function"==typeof e.onProgress&&(d.onProgress=function(t){if(!i||n._isRunningTask(i)){var a=t?t.loaded:0;e.onProgress({loaded:a,total:t.total})}}),this.options.Timeout&&(d.timeout=this.options.Timeout),n.options.ForcePathStyle&&(d.pathStyle=n.options.ForcePathStyle),n.emit("before-send",d);var f=_e(d,function(e,a,o){if("abort"!==e){var r,s=function(e,o){if(i&&n.off("inner-kill-task",h),!r){r=!0;var s={};a&&a.statusCode&&(s.statusCode=a.statusCode),a&&a.headers&&(s.headers=a.headers),e?(e=Te.extend(e||{},s),t(e,null)):(o=Te.extend(o||{},s),t(null,o)),f=null}};if(e)return void s({error:e});var c;if(u)c={},c.body=o;else try{c=o&&o.indexOf("<")>-1&&o.indexOf(">")>-1&&Te.xml2json(o)||{}}catch(e){c=o||{}}var l=a.statusCode;return 2===Math.floor(l/100)?c.Error?void s({error:c.Error}):void s(null,c):void s({error:c.Error||c})}}),h=function e(t){t.TaskId===i&&(f&&f.abort&&f.abort(),n.off("inner-kill-task",e))};i&&n.on("inner-kill-task",h)}}var _e=n(19),Ae=n(3),Te=n(0),Be=n(20),Ee=function(e){if(!e.Bucket||!e.Bucket)return"";var t=e.Url||be({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:e.Region}),n=t.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");return new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$").test(n)?n:""},Oe={getService:i,putBucket:a,headBucket:o,getBucket:r,deleteBucket:s,putBucketAcl:c,getBucketAcl:l,putBucketCors:p,getBucketCors:u,deleteBucketCors:d,getBucketLocation:m,getBucketPolicy:h,putBucketPolicy:f,deleteBucketPolicy:g,putBucketTagging:v,getBucketTagging:x,deleteBucketTagging:y,putBucketLifecycle:C,getBucketLifecycle:b,deleteBucketLifecycle:k,putBucketVersioning:S,getBucketVersioning:R,putBucketReplication:w,getBucketReplication:_,deleteBucketReplication:A,putBucketWebsite:T,getBucketWebsite:B,deleteBucketWebsite:E,putBucketReferer:O,getBucketReferer:D,putBucketDomain:I,getBucketDomain:N,deleteBucketDomain:P,putBucketOrigin:j,getBucketOrigin:M,deleteBucketOrigin:U,putBucketLogging:H,getBucketLogging:F,putBucketInventory:L,getBucketInventory:z,listBucketInventory:K,deleteBucketInventory:q,putBucketAccelerate:G,getBucketAccelerate:V,getObject:$,headObject:X,listObjectVersions:W,putObject:Q,postObject:J,deleteObject:Y,getObjectAcl:Z,putObjectAcl:ee,optionsObject:te,putObjectCopy:ne,deleteMultipleObject:ae,restoreObject:oe,putObjectTagging:re,getObjectTagging:se,deleteObjectTagging:ce,appendObject:he,uploadPartCopy:ie,multipartInit:le,multipartUpload:pe,multipartComplete:ue,multipartList:de,multipartListPart:me,multipartAbort:fe,request:ge,getObjectUrl:xe,getAuth:ve};e.exports.init=function(e,t){t.transferToTaskMethod(Oe,"postObject"),t.transferToTaskMethod(Oe,"putObject"),Te.each(Oe,function(t,n){e.prototype[n]=Te.apiWrapper(n,t)})}},function(e,t,n){"use strict";function i(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function a(e,t){var n=[];for(var a in e)e.hasOwnProperty(a)&&n.push(t?i(a).toLowerCase():a);return n.sort(function(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),e===t?0:e>t?1:-1})}var o=function(e,t){var n,o,r,s=[],c=a(e);for(n=0;n-1||m.indexOf(f)>-1)&&(d[f]=e.headers[f]);a["x-cos-acl"]&&(d.acl=a["x-cos-acl"]),!d["Content-Type"]&&(d["Content-Type"]=""),n=wx.uploadFile({url:r,method:s,name:"file",header:a,filePath:i,formData:d,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}}),n.onProgressUpdate(function(e){c&&c({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend,progress:e.progress/100})})}else{var h=e.qs&&o(e.qs,!0)||"";h&&(r+=(r.indexOf("?")>-1?"&":"?")+h),a["Content-Length"]&&delete a["Content-Length"],n=wx.request({url:r,method:s,header:a,dataType:"text",data:e.body,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}})}return n};e.exports=r},function(e,t,n){"use strict";var i=n(21);e.exports=new i(n(22),n(23))},function(e,t,n){"use strict";function i(){this._types=Object.create(null),this._extensions=Object.create(null);for(var e=0;em)return t(null,!1);if(n>1){if(Math.max(e[0].Size,e[1].Size)!==d)return t(null,!1)}!function i(a){if(a=c.length)return void S.emit("has_and_check_upload_id",t);var p=c[o];return C.isInArray(t,p)?v.using[p]?void e(o+1):void r.call(l,{Bucket:i,Region:a,Key:s,UploadId:p},function(t,i){l._isRunningTask(n)&&(t?(v.removeUploadId(p),e(o+1)):S.emit("upload_id_available",{UploadId:p,PartList:i.PartList}))}):(v.removeUploadId(p),void e(o+1))}(0)}),S.on("get_remote_upload_id_list",function(){o.call(l,{Bucket:i,Region:a,Key:s},function(t,a){if(l._isRunningTask(n)){if(t)return S.emit("error",t);var o=C.filter(a.UploadList,function(e){return e.Key===s&&(!c||e.StorageClass.toUpperCase()===c.toUpperCase())}).reverse().map(function(e){return e.UploadId||e.UploadID});if(o.length)S.emit("seek_local_avail_upload_id",o);else{var r,p=v.getFileId(e.FileStat,e.ChunkSize,i,s);p&&(r=v.getUploadIdList(p))&&C.each(r,function(e){v.removeUploadId(e)}),S.emit("no_available_upload_id")}}})}),S.emit("get_remote_upload_id_list")}function o(e,t){var n=this,i=[],a={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key};!function e(){n.multipartList(a,function(n,o){if(n)return t(n);i.push.apply(i,o.Upload||[]),"true"===o.IsTruncated?(a.KeyMarker=o.NextKeyMarker,a.UploadIdMarker=o.NextUploadIdMarker,e()):t(null,{UploadList:i})})}()}function r(e,t){var n=this,i=[],a={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId};!function e(){n.multipartListPart(a,function(n,o){if(n)return t(n);i.push.apply(i,o.Part||[]),"true"===o.IsTruncated?(a.PartNumberMarker=o.NextPartNumberMarker,e()):t(null,{PartList:i})})}()}function s(e,t){var n=this,i=e.TaskId,a=e.Bucket,o=e.Region,r=e.Key,s=e.UploadData,l=e.FileSize,p=e.SliceSize,u=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),d=e.FilePath,m=Math.ceil(l/p),f=0,h=e.ServerSideEncryption,g=C.filter(s.PartList,function(e){return e.Uploaded&&(f+=e.PartNumber>=m?l%p||p:p),!e.Uploaded}),v=e.onProgress;x.eachLimit(g,u,function(e,t){if(n._isRunningTask(i)){var u=e.PartNumber,m=Math.min(l,e.PartNumber*p)-(e.PartNumber-1)*p,g=0;c.call(n,{TaskId:i,Bucket:a,Region:o,Key:r,SliceSize:p,FileSize:l,PartNumber:u,ServerSideEncryption:h,FilePath:d,UploadData:s,onProgress:function(e){f+=e.loaded-g,g=e.loaded,v({loaded:f,total:l})}},function(a,o){n._isRunningTask(i)&&(a?f-=g:(f+=m-g,e.ETag=o.ETag),v({loaded:f,total:l}),t(a||null,o))})}},function(e){if(n._isRunningTask(i))return e?t(e):void t(null,{UploadId:s.UploadId,SliceList:s.PartList})})}function c(e,t){var n=this,i=e.TaskId,a=e.Bucket,o=e.Region,r=e.Key,s=e.FileSize,c=e.FilePath,l=1*e.PartNumber,p=e.SliceSize,u=e.ServerSideEncryption,d=e.UploadData,m=n.options.ChunkRetryTimes+1,f=e.Headers||{},h=p*(l-1),g=p,v=h+p;v>s&&(v=s,g=v-h);var y=["x-cos-traffic-limit","x-cos-mime-limit"],b={};C.each(f,function(e,t){y.indexOf(t)>-1&&(b[t]=e)}),C.fileSlice(c,h,v,function(s){var c=C.getFileMd5(s),p=c?C.binaryBase64(c):null,f=d.PartList[l-1];x.retry(m,function(t){n._isRunningTask(i)&&n.multipartUpload({TaskId:i,Bucket:a,Region:o,Key:r,ContentLength:g,PartNumber:l,UploadId:d.UploadId,ServerSideEncryption:u,Body:s,Headers:b,onProgress:e.onProgress,ContentMD5:p},function(e,a){if(n._isRunningTask(i))return e?t(e):(f.Uploaded=!0,t(null,a))})},function(e,a){if(n._isRunningTask(i))return t(e,a)})})}function l(e,t){var n=e.Bucket,i=e.Region,a=e.Key,o=e.UploadId,r=e.SliceList,s=this,c=this.options.ChunkRetryTimes+1,l=r.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});x.retry(c,function(e){s.multipartComplete({Bucket:n,Region:i,Key:a,UploadId:o,Parts:l},e)},function(e,n){t(e,n)})}function p(e,t){var n=e.Bucket,i=e.Region,a=e.Key,r=e.UploadId,s=e.Level||"task",c=e.AsyncLimit,l=this,p=new y;if(p.on("error",function(e){return t(e)}),p.on("get_abort_array",function(o){u.call(l,{Bucket:n,Region:i,Key:a,Headers:e.Headers,AsyncLimit:c,AbortArray:o},function(e,n){if(e)return t(e);t(null,n)})}),"bucket"===s)o.call(l,{Bucket:n,Region:i},function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])});else if("file"===s){if(!a)return t({error:"abort_upload_task_no_key"});o.call(l,{Bucket:n,Region:i,Key:a},function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])})}else{if("task"!==s)return t({error:"abort_unknown_level"});if(!r)return t({error:"abort_upload_task_no_id"});if(!a)return t({error:"abort_upload_task_no_key"});p.emit("get_abort_array",[{Key:a,UploadId:r}])}}function u(e,t){var n=e.Bucket,i=e.Region,a=e.Key,o=e.AbortArray,r=e.AsyncLimit||1,s=this,c=0,l=new Array(o.length);x.eachLimit(o,r,function(t,o){var r=c;if(a&&a!==t.Key)return l[r]={error:{KeyNotMatch:!0}},void o(null);var p=t.UploadId||t.UploadID;s.multipartAbort({Bucket:n,Region:i,Key:t.Key,Headers:e.Headers,UploadId:p},function(e){var a={Bucket:n,Region:i,Key:t.Key,UploadId:p};l[r]={error:e,task:a},o(null)}),c++},function(e){if(e)return t(e);for(var n=[],i=[],a=0,o=l.length;ai?"sliceUploadFile":"postObject";a.push({api:p,params:e,callback:l}),n._addTasks(a)}function m(e,t){var n=this,i=void 0===e.SliceSize?n.options.SliceSize:e.SliceSize,a=0,o=0,r=C.throttleOnProgress.call(n,o,e.onProgress),s=e.files.length,c=e.onFileFinish,l=Array(s),p=function(e,n,i){r(null,!0),c&&c(e,n,i),l[i.Index]={options:i,error:e,data:n},--s<=0&&t&&t(null,{files:l})},u=[];C.each(e.files,function(e,t){var n=e.FileSize,s={Index:t,TaskId:""};a+=n,C.each(e,function(e,t){"object"!==(void 0===e?"undefined":g(e))&&"function"!=typeof e&&(s[t]=e)});var c=e.onTaskReady;e.onTaskReady=function(e){s.TaskId=e,c&&c(e)};var l=0,d=e.onProgress;e.onProgress=function(e){o=o-l+e.loaded,l=e.loaded,d&&d(e),r({loaded:o,total:a})};var m=e.onFileFinish,f=function(e,t){m&&m(e,t),p&&p(e,t,s)},h=n>i?"sliceUploadFile":"postObject";u.push({api:h,params:e,callback:f})}),n._addTasks(u)}function f(e,t){var n=new y,i=this,a=e.Bucket,o=e.Region,r=e.Key,s=e.CopySource,c=s.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!c)return void t({error:"CopySource format error"});var l=c[1],p=c[3],u=decodeURIComponent(c[4]),d=void 0===e.CopySliceSize?i.options.CopySliceSize:e.CopySliceSize;d=Math.max(0,d);var m,f,g=e.CopyChunkSize||this.options.CopyChunkSize,v=this.options.CopyChunkParallelLimit,b=0;n.on("copy_slice_complete",function(e){i.multipartComplete({Bucket:a,Region:o,Key:r,UploadId:e.UploadId,Parts:e.PartList},function(e,n){if(e)return f(null,!0),t(e);f({loaded:m,total:m},!0),t(null,n)})}),n.on("get_copy_data_finish",function(e){x.eachLimit(e.PartList,v,function(t,n){var c=t.PartNumber,l=t.CopySourceRange,p=t.end-t.start,u=0;h.call(i,{Bucket:a,Region:o,Key:r,CopySource:s,UploadId:e.UploadId,PartNumber:c,CopySourceRange:l,onProgress:function(e){b+=e.loaded-u,u=e.loaded,f({loaded:b,total:m})}},function(e,i){if(e)return n(e);f({loaded:b,total:m}),b+=p-u,t.ETag=i.ETag,n(e||null,i)})},function(i){if(i)return f(null,!0),t(i);n.emit("copy_slice_complete",e)})}),n.on("get_file_size_finish",function(s){!function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,a=0;a"x-cos-meta-".length&&(s[t]=e)}),n.emit("get_file_size_finish",s)}})}function h(e,t){var n=e.TaskId,i=e.Bucket,a=e.Region,o=e.Key,r=e.CopySource,s=e.UploadId,c=1*e.PartNumber,l=e.CopySourceRange,p=this.options.ChunkRetryTimes+1,u=this;x.retry(p,function(t){u.uploadPartCopy({TaskId:n,Bucket:i,Region:a,Key:o,CopySource:r,UploadId:s,PartNumber:c,CopySourceRange:l,onProgress:e.onProgress},function(e,n){t(e||null,n)})},function(e,n){return t(e,n)})}var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v=n(5),x=n(25),y=n(4).EventProxy,C=n(0),b={sliceUploadFile:i,abortUploadTask:p,uploadFile:d,uploadFiles:m,sliceCopyFile:f};e.exports.init=function(e,t){t.transferToTaskMethod(b,"sliceUploadFile"),C.each(b,function(t,n){e.prototype[n]=C.apiWrapper(n,t)})}},function(e,t,n){"use strict";var i=function(e,t,n,i){if(i=i||function(){},!e.length||t<=0)return i();var a=0,o=0,r=0;!function s(){if(a>=e.length)return i();for(;r=e.length?i():s())})}()},a=function(e,t,n){e<1?n():function i(a){t(function(t,o){t&&at?1:-1})}function o(e){return d(e,function(e){return"object"===(void 0===e?"undefined":f(e))&&null!==e?o(e):e})}function r(e,t,n){return e&&t in e?e[t]:n}function s(e,t){return u(t,function(n,i){e[i]=t[i]}),e}function c(e){return e instanceof Array}function l(e,t){for(var n=!1,i=0;i-1||S.indexOf(i)>-1)&&(t[n]=e[n])}return t},w=function(e){e=e||{};var t,n=e.SecretId,i=e.SecretKey,r=e.KeyTime,s=(e.method||e.Method||"get").toLowerCase(),c=o(e.Query||e.params||{}),l=R(o(e.Headers||e.headers||{})),p=e.Key||"";if(e.UseRawKey?t=e.Pathname||e.pathname||"/"+p:(t=e.Pathname||e.pathname||p,0!==t.indexOf("/")&&(t="/"+t)),!l.Host&&!l.host&&e.Bucket&&e.Region&&(l.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),!n)return console.error("missing param SecretId");if(!i)return console.error("missing param SecretKey");var u=Math.round(U(e.SystemClockOffset)/1e3)-1,d=u,m=e.Expires||e.expires;d+=void 0===m?900:1*m||0;var f=n,h=r||u+";"+d,v=r||u+";"+d,x=a(l,!0).join(";").toLowerCase(),y=a(c,!0).join(";").toLowerCase(),C=g.HmacSHA1(v,i).toString(),b=[s,t,z.obj2str(c,!0),z.obj2str(l,!0),""].join("\n"),k=["sha1",h,g.SHA1(b).toString(),""].join("\n");return["q-sign-algorithm=sha1","q-ak="+f,"q-sign-time="+h,"q-key-time="+v,"q-header-list="+x,"q-url-param-list="+y,"q-signature="+g.HmacSHA1(k,C).toString()].join("&")},_=function(){},A=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]);return t},T=function(e,t,n,i){e?b.readFile({filePath:e,position:t,length:n-t,success:function(e){i(e.data)},fail:function(){i(null)}}):i(null)},B=function(e,t,n){n=n||_,e&&t&&t instanceof ArrayBuffer?z.getFileMd5(t,function(e,t){n(t)}):n()},E=function(e,t){var n=h(e);return t&&t(n),n},O=function(e){var t,n,i,a="";for(t=0,n=e.length/2;t-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!i)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e){if(!n)return"Bucket";if(!i)return"Region";if(!a)return"Key"}return!1},N=function(e,t){if(t=s({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};if(t&&"object"===(void 0===t?"undefined":f(t))){!function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}();var i={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext"};z.each(i,function(e,i){void 0!==t[e]&&(n[i]=t[e])}),t.Headers=A(n)}}return t},P=function(e,n){return function(i,a){var o=this;"function"==typeof i&&(a=i,i={}),i=N(e,i);var r=function(e){return e&&e.headers&&(e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},s=function(e,t){a&&a(r(e),r(t))},c=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=I(e,i);if(t)return"missing param "+t;if(i.Region){if(i.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(i.Region))return"Region format error.";o.options.CompatibilityMode||-1!==i.Region.indexOf("-")||"yfb"===i.Region||"default"===i.Region||"accelerate"===i.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(i.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(i.Bucket))if(i.AppId)i.Bucket=i.Bucket+"-"+i.AppId;else{if(!o.options.AppId)return'Bucket should format as "test-1250000000".';i.Bucket=i.Bucket+"-"+o.options.AppId}i.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete i.AppId)}i.Key&&"/"===i.Key.substr(0,1)&&(i.Key=i.Key.substr(1))}}(),l="getAuth"===e||"getObjectUrl"===e,p=t.Promise;if(!l&&p&&!a)return new p(function(e,t){if(a=function(n,i){n?t(n):e(i)},c)return s({error:c});n.call(o,i,s)});if(c)return s({error:c});var u=n.call(o,i,s);return l?u:void 0}},j=function(e,t){function n(){if(a=0,t&&"function"==typeof t){i=Date.now();var n,o=Math.max(0,Math.round((s-r)/((i-c)/1e3)*100)/100)||0;n=0===s&&0===e?1:Math.floor(s/e*100)/100||0,c=i,r=s;try{t({loaded:s,total:e,speed:o,percent:n})}catch(e){}}}var i,a,o=this,r=0,s=0,c=Date.now();return function(t,i){if(t&&(s=t.loaded,e=t.total),i)clearTimeout(a),n();else{if(a)return;a=setTimeout(n,o.options.ProgressInterval)}}},M=function(e,t,n){"postObject"===e?n():"putObject"===e?void 0!==t.Body?(t.ContentLength=t.Body.byteLength,n(null,t.ContentLength)):n({error:"missing param Body"}):t.FilePath?b.stat({path:t.FilePath,success:function(e){var i=e.stats;t.FileStat=i,t.FileStat.FilePath=t.FilePath;var a=i.isDirectory()?0:i.size;t.ContentLength=a=a||0,n(null,a)},fail:function(e){n(e)}}):n({error:"missing param FilePath"})},U=function(e){return Date.now()+(e||0)},H=function(e,t){e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.lengtho)return 1;if(a=0,n=!t&&"devtools"===e.platform;return function(){return n&&console.warn("\u5f53\u524d\u5c0f\u7a0b\u5e8f\u7248\u672c\u5c0f\u4e8e 2.10.0\uff0c\u4e0d\u652f\u6301\u5206\u7247\u4e0a\u4f20\uff0c\u8bf7\u66f4\u65b0\u8f6f\u4ef6\u3002"),n=!1,t}}(),L=function(e){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e)},z={noop:_,formatParams:N,apiWrapper:P,xml2json:v,json2xml:x,md5:h,clearKey:A,fileSlice:T,getBodyMd5:B,getFileMd5:E,binaryBase64:O,extend:s,isArray:c,isInArray:l,makeArray:p,each:u,map:d,filter:m,clone:o,attr:r,uuid:D,camSafeUrlEncode:i,throttleOnProgress:j,getFileSize:M,getSkewTime:U,obj2str:k,getAuth:w,compareVersion:H,canFileSlice:F,isCIHost:L};e.exports=z}).call(t,n(1))},function(e,t,n){"use strict";var i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t){var n=e.prototype;if(Object.create){var a=Object.create(t.prototype);n.__proto__=a}if(!(n instanceof t)){var o=function(){};o.prototype=t.prototype,o=new o,i(n,o),e.prototype=n=o}n.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}function o(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,oe[e]),this.message=oe[e],Error.captureStackTrace&&Error.captureStackTrace(this,o);return n.code=e,t&&(this.message=this.message+": "+t),n}function r(){}function s(e,t){this._node=e,this._refresh=t,c(this)}function c(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);z(e,"length",n.length),i(n,e),e._inc=t}}function l(){}function p(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function u(e,t,n,i){if(i?t[p(t,i)]=n:t[t.length++]=n,e){n.ownerElement=e;var a=e.ownerDocument;a&&(i&&y(a,e,i),x(a,e,n))}}function d(e,t,n){var i=p(t,n);if(!(i>=0))throw o(se,new Error(e.tagName+"@"+n));for(var a=t.length-1;i"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function g(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(g(e,t))return!0}while(e=e.nextSibling)}function v(){}function x(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function y(e,t,n,i){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function C(e,t,n){if(e&&e._inc){e._inc++;var i=t.childNodes;if(n)i[i.length++]=n;else{for(var a=t.firstChild,o=0;a;)i[o++]=a,a=a.nextSibling;i.length=o}}}function b(e,t){var n=t.previousSibling,i=t.nextSibling;return n?n.nextSibling=i:e.firstChild=i,i?i.previousSibling=n:e.lastChild=n,C(e.ownerDocument,e),t}function k(e,t,n){var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===ne){var a=t.firstChild;if(null==a)return t;var o=t.lastChild}else a=o=t;var r=n?n.previousSibling:e.lastChild;a.previousSibling=r,o.nextSibling=n,r?r.nextSibling=a:e.firstChild=a,null==n?e.lastChild=o:n.previousSibling=o;do{a.parentNode=e}while(a!==o&&(a=a.nextSibling));return C(e.ownerDocument||e,e),t.nodeType==ne&&(t.firstChild=t.lastChild=null),t}function S(e,t){var n=t.parentNode;if(n){var i=e.lastChild;n.removeChild(t);var i=e.lastChild}var i=e.lastChild;return t.parentNode=e,t.previousSibling=i,t.nextSibling=null,i?i.nextSibling=t:e.firstChild=t,e.lastChild=t,C(e.ownerDocument,e,t),t}function R(){this._nsMap={}}function w(){}function _(){}function A(){}function T(){}function B(){}function E(){}function O(){}function D(){}function I(){}function N(){}function P(){}function j(){}function M(e,t){var n=[],i=9==this.nodeType?this.documentElement:this,a=i.prefix,o=i.namespaceURI;if(o&&null==a){var a=i.lookupPrefix(o);if(null==a)var r=[{namespace:o,prefix:null}]}return H(this,n,e,t,r),n.join("")}function U(e,t,n){var i=e.prefix||"",a=e.namespaceURI;if(!i&&!a)return!1;if("xml"===i&&"http://www.w3.org/XML/1998/namespace"===a||"http://www.w3.org/2000/xmlns/"==a)return!1;for(var o=n.length;o--;){var r=n[o];if(r.prefix==i)return r.namespace!=a}return!0}function H(e,t,n,i,a){if(i){if(!(e=i(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case V:a||(a=[]);var o=(a.length,e.attributes),r=o.length,s=e.firstChild,c=e.tagName;n=q===e.namespaceURI||n,t.push("<",c);for(var l=0;l"),n&&/^script$/i.test(c))for(;s;)s.data?t.push(s.data):H(s,t,n,i,a),s=s.nextSibling;else for(;s;)H(s,t,n,i,a),s=s.nextSibling;t.push("")}else t.push("/>");return;case ee:case ne:for(var s=e.firstChild;s;)H(s,t,n,i,a),s=s.nextSibling;return;case X:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,h),'"');case W:return t.push(e.data.replace(/[<&]/g,h));case $:return t.push("");case Z:return t.push("\x3c!--",e.data,"--\x3e");case te:var f=e.publicId,g=e.systemId;if(t.push("');else if(g&&"."!=g)t.push(' SYSTEM "',g,'">');else{var v=e.internalSubset;v&&t.push(" [",v,"]"),t.push(">")}return;case Y:return t.push("");case Q:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function F(e,t,n){var i;switch(t.nodeType){case V:i=t.cloneNode(!1),i.ownerDocument=e;case ne:break;case X:n=!0}if(i||(i=t.cloneNode(!1)),i.ownerDocument=e,i.parentNode=null,n)for(var a=t.firstChild;a;)i.appendChild(F(e,a,n)),a=a.nextSibling;return i}function L(e,t,n){var i=new t.constructor;for(var a in t){var o=t[a];"object"!=(void 0===o?"undefined":K(o))&&o!=i[a]&&(i[a]=o)}switch(t.childNodes&&(i.childNodes=new r),i.ownerDocument=e,i.nodeType){case V:var s=t.attributes,c=i.attributes=new l,p=s.length;c._ownerElement=i;for(var u=0;u0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var i in n)if(n[i]==e)return i;t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},i(G,f),i(G,f.prototype),v.prototype={nodeName:"#document",nodeType:ee,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==ne){for(var n=e.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,t),n=i}return e}return null==this.documentElement&&e.nodeType==V&&(this.documentElement=e),k(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),b(this,e)},importNode:function(e,t){return F(this,e,t)},getElementById:function(e){var t=null;return g(this.documentElement,function(n){if(n.nodeType==V&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new R;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new r,(t.attributes=new l)._ownerElement=t,t},createDocumentFragment:function(){var e=new N;return e.ownerDocument=this,e.childNodes=new r,e},createTextNode:function(e){var t=new A;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new T;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new B;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new P;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new w;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new I;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new R,i=t.split(":"),a=n.attributes=new l;return n.childNodes=new r,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,a._ownerElement=n,n},createAttributeNS:function(e,t){var n=new w,i=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,n}},a(v,f),R.prototype={nodeType:V,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===ne?this.insertBefore(e,null):S(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new s(this,function(t){var n=[];return g(t,function(i){i===t||i.nodeType!=V||"*"!==e&&i.tagName!=e||n.push(i)}),n})},getElementsByTagNameNS:function(e,t){return new s(this,function(n){var i=[];return g(n,function(a){a===n||a.nodeType!==V||"*"!==e&&a.namespaceURI!==e||"*"!==t&&a.localName!=t||i.push(a)}),i})}},v.prototype.getElementsByTagName=R.prototype.getElementsByTagName,v.prototype.getElementsByTagNameNS=R.prototype.getElementsByTagNameNS,a(R,f),w.prototype.nodeType=X,a(w,f),_.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(oe[re])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},a(_,f),A.prototype={nodeName:"#text",nodeType:W,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},a(A,_),T.prototype={nodeName:"#comment",nodeType:Z},a(T,_),B.prototype={nodeName:"#cdata-section",nodeType:$},a(B,_),E.prototype.nodeType=te,a(E,f),O.prototype.nodeType=ie,a(O,f),D.prototype.nodeType=J,a(D,f),I.prototype.nodeType=Q,a(I,f),N.prototype.nodeName="#document-fragment",N.prototype.nodeType=ne,a(N,f),P.prototype.nodeType=Y,a(P,f),j.prototype.serializeToString=function(e,t,n){return M.call(e,t,n)},f.prototype.toString=M;try{if(Object.defineProperty){var le=function e(t){switch(t.nodeType){case V:case ne:var n=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&n.push(e(t)),t=t.nextSibling;return n.join("");default:return t.nodeValue}};Object.defineProperty(s.prototype,"length",{get:function(){return c(this),this.$$length}}),Object.defineProperty(f.prototype,"textContent",{get:function(){return le(this)},set:function(e){switch(this.nodeType){case V:case ne:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),z=function(e,t,n){e["$$"+t]=n}}}catch(e){}t.DOMImplementation=m,t.XMLSerializer=j},function(e,t,n){"use strict";var i=function(e){e=e||{};var t,n=e.Base64,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=function(e){for(var t={},n=0,i=e.length;n>>6)+o(128|63&t):o(224|t>>>12&15)+o(128|t>>>6&63)+o(128|63&t)}var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|t>>>18&7)+o(128|t>>>12&63)+o(128|t>>>6&63)+o(128|63&t)},s=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,c=function(e){return e.replace(s,r)},l=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[i.charAt(n>>>18),i.charAt(n>>>12&63),t>=2?"=":i.charAt(n>>>6&63),t>=1?"=":i.charAt(63&n)].join("")},p=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,l)},u=t?function(e){return(e.constructor===t.constructor?e:new t(e)).toString("base64")}:function(e){return p(c(e))},d=function(e,t){return t?u(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):u(String(e))},m=function(e){return d(e,!0)},f=new RegExp(["[\xc0-\xdf][\x80-\xbf]","[\xe0-\xef][\x80-\xbf]{2}","[\xf0-\xf7][\x80-\xbf]{3}"].join("|"),"g"),h=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return o(55296+(n>>>10))+o(56320+(1023&n));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},g=function(e){return e.replace(f,h)},v=function(e){var t=e.length,n=t%4,i=(t>0?a[e.charAt(0)]<<18:0)|(t>1?a[e.charAt(1)]<<12:0)|(t>2?a[e.charAt(2)]<<6:0)|(t>3?a[e.charAt(3)]:0),r=[o(i>>>16),o(i>>>8&255),o(255&i)];return r.length-=[0,0,2,1][n],r.join("")},x=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,v)},y=t?function(e){return(e.constructor===t.constructor?e:new t(e,"base64")).toString()}:function(e){return g(x(e))},C=function(e){return y(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};return{VERSION:"2.1.9",atob:x,btoa:p,fromBase64:C,toBase64:d,utob:c,encode:d,encodeURI:m,btou:g,decode:C,noConflict:function(){var t=e.Base64;return e.Base64=n,t}}}();e.exports=i},function(e,t,n){"use strict";var i=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){n(e).push(t)},e.off=function(e,t){for(var i=n(e),a=i.length-1;a>=0;a--)t===i[a]&&i.splice(a,1)},e.emit=function(e,t){for(var i=n(e).map(function(e){return e}),a=0;a=0;n--){var a=i[n][2];(!a||a+2592e3=0;o--){var r=i[o];r[0]===e&&r[1]===t?i.splice(o,1):e!==r[0]&&0===r[0].indexOf(a)&&i.splice(o,1)}i.unshift([e,t,Math.round(Date.now()/1e3)]),i.length>n&&i.splice(n),l()}},removeUploadId:function(e){c(),delete p.using[e];for(var t=i.length-1;t>=0;t--)i[t][1]===e&&i.splice(t,1);l()}};e.exports=p},function(e,t,n){"use strict";var i=n(7);e.exports=i},function(e,t,n){"use strict";var i=n(0),a=n(4),o=n(17),r=n(18),s=n(24),c={SecretId:"",SecretKey:"",XCosSecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,UploadQueueSize:1e4,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1},l=function(e){this.options=i.extend(i.clone(c),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),this.options.SecretId&&this.options.SecretId.indexOf(" ")>-1&&(console.error("error: SecretId\u683c\u5f0f\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey\u683c\u5f0f\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5"),console.error("error: SecretKey format is incorrect. Please check")),a.init(this),o.init(this)};r.init(l,o),s.init(l,o),l.getAuthorization=i.getAuth,l.version="1.1.2",e.exports=l},function(module,exports,__webpack_require__){"use strict";(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var ERROR="input is invalid type",WINDOW="object"===("undefined"==typeof window?"undefined":_typeof(window)),root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===("undefined"==typeof self?"undefined":_typeof(self)),NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"===(void 0===process?"undefined":_typeof(process))&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"===_typeof(module)&&module.exports,AMD=__webpack_require__(11),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===(void 0===e?"undefined":_typeof(e))&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.getCtx=e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t>2]|=e[o]<>6,c[a++]=128|63&i):i<55296||i>=57344?(c[a++]=224|i>>12,c[a++]=128|i>>6&63,c[a++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),c[a++]=240|i>>18,c[a++]=128|i>>12&63,c[a++]=128|i>>6&63,c[a++]=128|63&i);else for(a=this.start;o>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[a>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=64?(this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,i,a,o,r=this.blocks;this.first?(e=r[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,i=(-1732584194^2004318071&e)+r[1]-117830708,i=(i<<12|i>>>20)+e<<0,n=(-271733879^i&(-271733879^e))+r[2]-1126478375,n=(n<<17|n>>>15)+i<<0,t=(e^n&(i^e))+r[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,i=this.h3,e+=(i^t&(n^i))+r[0]-680876936,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[1]-389564586,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[2]+606105819,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(i^t&(n^i))+r[4]-176418897,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[5]+1200080426,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[6]-1473231341,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(i^t&(n^i))+r[8]+1770035416,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[9]-1958414417,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[10]-42063,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(i^t&(n^i))+r[12]+1804603682,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[13]-40341101,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[14]-1502002290,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^i&(t^n))+r[1]-165796510,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[6]-1069501632,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[11]+643717713,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[5]-701558691,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[10]+38016083,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[15]-660478335,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[9]+568446438,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[14]-1019803690,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[3]-187363961,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[13]-1444681467,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[2]-51403784,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[7]+1735328473,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[12]-1926607734,t=(t<<20|t>>>12)+n<<0,a=t^n,e+=(a^i)+r[5]-378558,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[8]-2022574463,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[11]+1839030562,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[14]-35309556,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[1]-1530992060,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[4]+1272893353,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[7]-155497632,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[10]-1094730640,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[13]+681279174,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[0]-358537222,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[3]-722521979,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[6]+76029189,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[9]-640364487,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[12]-421815835,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[15]+530742520,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~i))+r[0]-198630844,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[7]+1126891415,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[14]-1416354905,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[12]+1700485571,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[3]-1894986606,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[10]-1051523,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[8]+1873313359,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[15]-30611744,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[6]-1560198380,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[4]-145523070,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[11]-1120210379,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[2]+718787259,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=i+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+i<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,i="",a=this.array(),o=0;o<15;)e=a[o++],t=a[o++],n=a[o++],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=a[o],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()}).call(exports,__webpack_require__(9),__webpack_require__(1),__webpack_require__(10)(module))},function(e,t,n){"use strict";function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(u===setTimeout)return setTimeout(e,0);if((u===i||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function r(e){if(d===clearTimeout)return clearTimeout(e);if((d===a||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function s(){g&&f&&(g=!1,f.length?h=f.concat(h):v=-1,h.length&&c())}function c(){if(!g){var e=o(s);g=!0;for(var t=h.length;t;){for(f=h,h=[];++v1)for(var n=1;n>>2]|=(n[a>>>2]>>>24-a%4*8&255)<<24-(i+a)%4*8;else if(65535>>2]=n[a>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new r.init(n,t/2)}},l=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],i=0;i>>2]>>>24-i%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new r.init(n,t)}},p=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},u=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,a=n.sigBytes,o=this.blockSize,s=a/(4*o),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*o,a=e.min(4*t,a),t){for(var c=0;cl;l++){if(16>l)o[l]=0|e[t+l];else{var p=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=p<<1|p>>>31}p=(i<<5|i>>>27)+c+o[l],p=20>l?p+(1518500249+(a&r|~a&s)):40>l?p+(1859775393+(a^r^s)):60>l?p+((a&r|a&s|r&s)-1894007588):p+((a^r^s)-899497514),c=s,s=r,r=a<<30|a>>>2,a=i,i=p}n[0]=n[0]+i|0,n[1]=n[1]+a|0,n[2]=n[2]+r|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(i+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=a._createHelper(t),e.HmacSHA1=a._createHmacHelper(t)}(),function(){var e=i,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var i=e.blockSize,a=4*i;n.sigBytes>a&&(n=e.finalize(n)),n.clamp();for(var o=this._oKey=n.clone(),r=this._iKey=n.clone(),s=o.words,c=r.words,l=0;l>>2]>>>24-o%4*8&255,s=t[o+1>>>2]>>>24-(o+1)%4*8&255,c=t[o+2>>>2]>>>24-(o+2)%4*8&255,l=r<<16|s<<8|c,p=0;p<4&&o+.75*p>>6*(3-p)&63));var u=i.charAt(64);if(u)for(;a.length%4;)a.push(u);return a.join("")},parse:function(e){var t=e.length,i=this._map,a=i.charAt(64);if(a){var o=e.indexOf(a);-1!=o&&(t=o)}for(var r=[],s=0,c=0;c>>6-c%4*2;r[s>>>2]|=(l|p)<<24-s%4*8,s++}return n.create(r,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.exports=i},function(e,t,n){"use strict";var i=n(14).DOMParser,a=function(e){function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function n(e){return e.prefix}function a(e){return"string"==typeof e?e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):e}function o(e,t,n,i){for(var a=0;a0&&o(e.arrayAccessFormPaths,t,n,i)&&(t[n]=[t[n]])}function s(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),i=t[5].split(".");if(n.setHours(t[3],t[4],i[0]),i.length>1&&n.setMilliseconds(i[1]),t[6]&&t[7]){var a=60*t[6]+Number(t[7]);a=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*a:a),n.setMinutes(n.getMinutes()-a-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function c(t,n,i){if(e.datetimeAccessFormPaths.length>0){var a=i.split(".#")[0];return o(e.datetimeAccessFormPaths,t,n,a)?s(t):t}return t}function l(t,n,i,a){return!(n==S.ELEMENT_NODE&&e.xmlElementsFilter.length>0)||o(e.xmlElementsFilter,t,i,a)}function p(i,a){if(i.nodeType==S.DOCUMENT_NODE){for(var o=new Object,s=i.childNodes,u=0;u1&&null!=o.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==o.__text||""==o.__text.trim())&&delete o.__text:o=o.__cdata,delete o.__cnt,!e.enableToStringFunc||null==o.__text&&null==o.__cdata||(o.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),o}if(i.nodeType==S.TEXT_NODE||i.nodeType==S.CDATA_SECTION_NODE)return i.nodeValue}function u(t,n,i,o){var r="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=i)for(var s=0;s":">"}function d(e,t){return""}function m(e,t){return-1!==e.indexOf(t,e.length-t.length)}function f(t,n){return!!("property"==e.arrayAccessForm&&m(n.toString(),"_asArray")||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function)}function h(e){var t=0;if(e instanceof Object)for(var n in e)f(e,n)||t++;return t}function g(t,n,i){return 0==e.jsonPropertiesFilter.length||""==i||o(e.jsonPropertiesFilter,t,n,i)}function v(t){var n=[];if(t instanceof Object)for(var i in t)-1==i.toString().indexOf("__")&&0==i.toString().indexOf(e.attributePrefix)&&n.push(i);return n}function x(t){var n="";return null!=t.__cdata&&(n+=""),null!=t.__text&&(e.escapeMode?n+=a(t.__text):n+=t.__text),n}function y(t){var n="";return t instanceof Object?n+=x(t):null!=t&&(e.escapeMode?n+=a(t):n+=t),n}function C(e,t){return""===e?t:e+"."+t}function b(e,t,n,i){var a="";if(0==e.length)a+=u(e,t,n,!0);else for(var o=0;o0)for(var i in e)if(!f(e,i)&&(""==t||g(e,i,C(t,i)))){var a=e[i],o=v(a);if(null==a||void 0==a)n+=u(a,i,o,!0);else if(a instanceof Object)if(a instanceof Array)n+=b(a,i,o,t);else if(a instanceof Date)n+=u(a,i,o,!1),n+=a.toISOString(),n+=d(a,i);else{var r=h(a);r>0||null!=a.__text||null!=a.__cdata?(n+=u(a,i,o,!1),n+=k(a,C(t,i)),n+=d(a,i)):n+=u(a,i,o,!0)}else n+=u(a,i,o,!1),n+=y(a),n+=d(a,i)}return n+=y(e)}e=e||{},function(){void 0===e.escapeMode&&(e.escapeMode=!0),e.attributePrefix=e.attributePrefix||"_",e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1)}();var S={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(e){if(void 0===e)return null;var t;if(i){var n=new i,a=null;try{a=n.parseFromString("INVALID","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(e){a=null}try{t=n.parseFromString(e,"text/xml"),null!=a&&t.getElementsByTagNameNS(a,"parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("")+2)),t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?s(e):e},this.xml2json=function(e){return p(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return k(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},o=function(e){if(!e)return null;var t=new i,n=t.parseFromString(e,"text/xml"),o=new a,r=o.xml2json(n);return r.html&&r.getElementsByTagName("parsererror").length?null:r};e.exports=o},function(e,t,n){"use strict";function i(e){this.options=e||{locator:{}}}function a(e,t,n){function i(t){var i=e[t];!i&&r&&(i=2==e.length?function(n){e(t,n)}:e),a[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+s(n))}||function(){}}if(!e){if(t instanceof o)return t;e=t}var a={},r=e instanceof Function;return n=n||{},i("warning"),i("error"),i("fatalError"),a}function o(){this.cdata=!1}function r(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function s(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function c(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function l(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}i.prototype.parseFromString=function(e,t){var n=this.options,i=new p,r=n.domBuilder||new o,s=n.errorHandler,c=n.locator,l=n.xmlns||{},u={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&r.setDocumentLocator(c),i.errorHandler=a(s,r,c),i.domBuilder=n.domBuilder||r,/\/x?html?$/.test(t)&&(u.nbsp="\xa0",u.copy="\xa9",l[""]="http://www.w3.org/1999/xhtml"),l.xml=l.xml||"http://www.w3.org/XML/1998/namespace",e?i.parse(e,l,u):i.errorHandler.error("invalid doc source"),r.doc},o.prototype={startDocument:function(){this.doc=(new u).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,i){var a=this.doc,o=a.createElementNS(e,n||t),s=i.length;l(this,o),this.currentElement=o,this.locator&&r(this.locator,o);for(var c=0;c65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function f(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?p(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function h(t){if(t>S){var n=e.substring(S,t).replace(/&#?\w+;/g,f);C&&g(S),i.characters(n,0,t-S),S=t}}function g(t,n){for(;t>=x&&(n=y.exec(e));)v=n.index,x=v+n[0].length,C.lineNumber++;C.columnNumber=t-v+1}for(var v=0,x=0,y=/.*(?:\r\n?|\n)|.*$/g,C=i.locator,b=[{currentNSMap:t}],k={},S=0;;){try{var R=e.indexOf("<",S);if(R<0){if(!e.substr(S).match(/^\s*$/)){var w=i.doc,_=w.createTextNode(e.substr(S));w.appendChild(_),i.currentElement=_}return}switch(R>S&&h(R),e.charAt(R+1)){case"/":var A=e.indexOf(">",R+3),T=e.substring(R+2,A),B=b.pop();A<0?(T=e.substring(R+2).replace(/[\s<].*/,""),a.error("end tag name: "+T+" is not complete:"+B.tagName),A=R+1+T.length):T.match(/\sS?S=A:h(Math.max(R,S)+1)}}function o(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function r(e,t,n,i,a,o){for(var r,s,c=++t,l=y;;){var p=e.charAt(c);switch(p){case"=":if(l===C)r=e.slice(t,c),l=k;else{if(l!==b)throw new Error("attribute equal must after attrName");l=k}break;case"'":case'"':if(l===k||l===C){if(l===C&&(o.warning('attribute value must after "="'),r=e.slice(t,c)),t=c+1,!((c=e.indexOf(p,t))>0))throw new Error("attribute value no end '"+p+"' match");s=e.slice(t,c).replace(/&#?\w+;/g,a),n.add(r,s,t-1),l=R}else{if(l!=S)throw new Error('attribute value must after "="');s=e.slice(t,c).replace(/&#?\w+;/g,a),n.add(r,s,t),o.warning('attribute "'+r+'" missed start quot('+p+")!!"),t=c+1,l=R}break;case"/":switch(l){case y:n.setTagName(e.slice(t,c));case R:case w:case _:l=_,n.closed=!0;case S:case C:case b:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),l==y&&n.setTagName(e.slice(t,c)),c;case">":switch(l){case y:n.setTagName(e.slice(t,c));case R:case w:case _:break;case S:case C:s=e.slice(t,c),"/"===s.slice(-1)&&(n.closed=!0,s=s.slice(0,-1));case b:l===b&&(s=r),l==S?(o.warning('attribute "'+s+'" missed quot(")!!'),n.add(r,s.replace(/&#?\w+;/g,a),t)):("http://www.w3.org/1999/xhtml"===i[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),n.add(s,s,t));break;case k:throw new Error("attribute value missed!!")}return c;case"\x80":p=" ";default:if(p<=" ")switch(l){case y:n.setTagName(e.slice(t,c)),l=w;break;case C:r=e.slice(t,c),l=b;break;case S:var s=e.slice(t,c).replace(/&#?\w+;/g,a);o.warning('attribute "'+s+'" missed quot(")!!'),n.add(r,s,t);case R:l=w}else switch(l){case b:n.tagName;"http://www.w3.org/1999/xhtml"===i[""]&&r.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+r+'" missed value!! "'+r+'" instead2!!'),n.add(r,r,t),t=c,l=C;break;case R:o.warning('attribute space is required"'+r+'"!!');case w:l=C,t=c;break;case k:l=S,t=c;break;case _:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function s(e,t,n){for(var i=e.tagName,a=null,o=e.length;o--;){var r=e[o],s=r.qName,c=r.value,l=s.indexOf(":");if(l>0)var u=r.prefix=s.slice(0,l),d=s.slice(l+1),m="xmlns"===u&&d;else d=s,u=null,m="xmlns"===s&&"";r.localName=d,!1!==m&&(null==a&&(a={},p(n,n={})),n[m]=a[m]=c,r.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(m,c))}for(var o=e.length;o--;){r=e[o];var u=r.prefix;u&&("xml"===u&&(r.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==u&&(r.uri=n[u||""]))}var l=i.indexOf(":");l>0?(u=e.prefix=i.slice(0,l),d=e.localName=i.slice(l+1)):(u=null,d=e.localName=i);var f=e.uri=n[u||""];if(t.startElement(f,d,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=a,!0;if(t.endElement(f,d,i),a)for(u in a)t.endPrefixMapping(u)}function c(e,t,n,i,a){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("",t),r=e.substring(t+1,o);if(/[&<]/.test(r))return/^script$/i.test(n)?(a.characters(r,0,r.length),o):(r=r.replace(/&#?\w+;/g,i),a.characters(r,0,r.length),o)}return t+1}function l(e,t,n,i){var a=i[n];return null==a&&(a=e.lastIndexOf(""),at?(n.comment(e,t+4,a-t-4),a+3):(i.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var a=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,a-t-9),n.endCDATA(),a+3}var o=h(e,t),r=o.length;if(r>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],c=r>3&&/^public$/i.test(o[2][0])&&o[3][0],l=r>4&&o[4][0],p=o[r-1];return n.startDTD(s,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),p.index+p[0].length}}return-1}function d(e,t,n){var i=e.indexOf("?>",t);if(i){var a=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(a){a[0].length;return n.processingInstruction(a[1],a[2]),i+2}return-1}return-1}function m(e){}function f(e,t){return e.__proto__=t,e}function h(e,t){var n,i=[],a=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(a.lastIndex=t,a.exec(e);n=a.exec(e);)if(i.push(n),n[1])return i}var g=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),x=new RegExp("^"+g.source+v.source+"*(?::"+g.source+v.source+"*)?$"),y=0,C=1,b=2,k=3,S=4,R=5,w=6,_=7;i.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),p(t,t={}),a(e,t,n,i,this.errorHandler),i.endDocument()}},m.prototype={setTagName:function(e){if(!x.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!x.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},f({},f.prototype)instanceof f||(f=function(e,t){function n(){}n.prototype=t,n=new n;for(t in e)n[t]=e[t];return n}),t.XMLReader=i},function(e,t,n){"use strict";function i(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(r,"")}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=new RegExp("^([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd])|^((x|X)(m|M)(l|L))|([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd-.0-9\xb7\u0300-\u036f\u203f\u2040])","g"),r=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,s=function(e){var t=[];if(e instanceof Object)for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},c=function(e,t){var n=function(e,n,i,a,r){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(a).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(o,"_"));var l=[c,"<",e,i||""];return n&&n.length>0?(l.push(">"),l.push(n),r&&l.push(c),l.push("")):l.push("/>"),l.join("")};return function e(o,r,c){var l=void 0===o?"undefined":a(o);switch((Array.isArray?Array.isArray(o):o instanceof Array)?l="array":o instanceof Date&&(l="date"),l){case"array":var p=[];return o.map(function(t){p.push(e(t,1,c+1))}),t.prettyPrint&&p.push("\n"),p.join("");case"date":return o.toJSON?o.toJSON():o+"";case"object":var u=[];for(var d in o)if(o.hasOwnProperty(d))if(o[d]instanceof Array)for(var m in o[d])o[d].hasOwnProperty(m)&&u.push(n(d,e(o[d][m],0,c+1),null,c+1,s(o[d][m]).length));else u.push(n(d,e(o[d],0,c+1),null,c+1));return t.prettyPrint&&u.length>0&&u.push("\n"),u.join("");case"function":return o();default:return t.escape?i(o):""+o}}(e,0,0)},l=function(e){var t=['"),t.join("")},p=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" "}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var n="",i="";return t&&("object"==(void 0===t?"undefined":a(t))?(t.xmlHeader&&(n=l(!!t.xmlHeader.standalone)),void 0!==t.docType&&(i="")):n=l()),t=t||{},[n,t.prettyPrint&&i?"\n":"",i,c(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")};e.exports=p},function(e,t,n){"use strict";var i=n(5),a=n(0),o={},r=function(e,t){o[t]=e[t],e[t]=function(e,n){e.SkipTask?o[t].call(this,e,n):this._addTask(t,e,n)}},s=function(e){var t=[],n={},r=0,s=0,c=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),t},l=function(){var n,i=function(){n=0,e.emit("task-list-update",{list:a.map(t,c)}),e.emit("list-update",{list:a.map(t,c)})};return function(){n||(n=setTimeout(i))}}(),p=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var i=0;ie.options.UploadQueueSize;){var a="waiting"===t[i].state||"checking"===t[i].state||"uploading"===t[i].state;t[i]&&a?i++:(n[t[i].id]&&delete n[t[i].id],t.splice(i,1),s--)}l()}},u=function n(){if(!(r>=e.options.FileParallelLimit)){for(;t[s]&&"waiting"!==t[s].state;)s++;if(!(s>=t.length)){var i=t[s];s++,r++,i.state="checking",i.params.onTaskStart&&i.params.onTaskStart(c(i)),!i.params.UploadData&&(i.params.UploadData={});var u=a.formatParams(i.api,i.params);o[i.api].call(e,u,function(t,a){e._isRunningTask(i.id)&&("checking"!==i.state&&"uploading"!==i.state||(i.state=t?"error":"success",t&&(i.error=t),r--,l(),n(),i.callback&&i.callback(t,a),"success"===i.state&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)),p())}),l(),setTimeout(n)}}},d=function(t,a){var o=n[t];if(o){var s=o&&"waiting"===o.state,c=o&&("checking"===o.state||"uploading"===o.state);if("canceled"===a&&"canceled"!==o.state||"paused"===a&&s||"paused"===a&&c){if("paused"===a&&o.params.Body&&"function"==typeof o.params.Body.pipe)return void console.error("stream not support pause");o.state=a,e.emit("inner-kill-task",{TaskId:t,toState:a});try{var d=o&&o.params&&o.params.UploadData.UploadId}catch(e){}"canceled"===a&&d&&i.removeUsing(d),l(),c&&(r--,u()),"canceled"===a&&(o.params&&(delete o.params.UploadData,delete o.params.Body,delete o.params),delete o.callback)}p()}};e._addTasks=function(t){a.each(t,function(t){e._addTask(t.api,t.params,t.callback,!0)}),l()},e._addTask=function(i,o,r,s){"sliceUploadFile"!==i||a.canFileSlice()||(i="postObject"),o=a.formatParams(i,o);var c=a.uuid();o.TaskId=c,o.onTaskReady&&o.onTaskReady(c);var d={params:o,callback:r,api:i,index:t.length,id:c,Bucket:o.Bucket,Region:o.Region,Key:o.Key,FilePath:o.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null},m=o.onHashProgress;o.onHashProgress=function(t){e._isRunningTask(d.id)&&(d.hashPercent=t.percent,m&&m(t),l())};var f=o.onProgress;return o.onProgress=function(t){e._isRunningTask(d.id)&&("checking"===d.state&&(d.state="uploading"),d.loaded=t.loaded,d.size=t.total,d.speed=t.speed,d.percent=t.percent,f&&f(t),l())},a.getFileSize(i,o,function(e,i){if(e)return void r(e);n[c]=d,t.push(d),d.size=i,!s&&l(),u(),p()}),c},e._isRunningTask=function(e){var t=n[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return a.map(t,c)},e.cancelTask=function(e){d(e,"canceled")},e.pauseTask=function(e){d(e,"paused")},e.restartTask=function(e){var t=n[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",l(),s=Math.min(s,t.index),u())},e.isUploadRunning=function(){return r||s/gi,"<$1Rule>"),i=i.replace(/<(\/?)Tags>/gi,"<$1Tag>");var a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Re.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"replication",headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function _(e,t){Re.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var i={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else e||!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=n.ReplicationConfiguration.Rule,delete n.ReplicationConfiguration.Rule),t(e,n)})}function A(e,t){Re.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function T(e,t){if(!e.WebsiteConfiguration)return void t({error:"missing param WebsiteConfiguration"});var n=Te.clone(e.WebsiteConfiguration||{}),i=n.RoutingRules||n.RoutingRule||[];i=Te.isArray(i)?i:[i],delete n.RoutingRule,delete n.RoutingRules,i.length&&(n.RoutingRules={RoutingRule:i});var a=Te.json2xml({WebsiteConfiguration:n}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"website",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function B(e,t){Re.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var a=n.WebsiteConfiguration||{};if(a.RoutingRules){var o=Te.clone(a.RoutingRules.RoutingRule||[]);o=Te.makeArray(o),a.RoutingRules=o}t(null,{WebsiteConfiguration:a,statusCode:n.statusCode,headers:n.headers})}})}function E(e,t){Re.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function O(e,t){if(!e.RefererConfiguration)return void t({error:"missing param RefererConfiguration"});var n=Te.clone(e.RefererConfiguration||{}),i=n.DomainList||{},a=i.Domains||i.Domain||[];a=Te.isArray(a)?a:[a],a.length&&(n.DomainList={Domain:a});var o=Te.json2xml({RefererConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Re.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"referer",headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function D(e,t){Re.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var a=n.RefererConfiguration||{};if(a.DomainList){var o=Te.makeArray(a.DomainList.Domain||[]);a.DomainList={Domains:o}}t(null,{RefererConfiguration:a,statusCode:n.statusCode,headers:n.headers})}})}function I(e,t){var n=e.DomainConfiguration||{},i=n.DomainRule||e.DomainRule||[];i=Te.clone(i);var a=Te.json2xml({DomainConfiguration:{DomainRule:i}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"domain",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function N(e,t){Re.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){if(e)return t(e);var i=[];try{i=n.DomainConfiguration.DomainRule||[]}catch(e){}i=Te.clone(Te.isArray(i)?i:[i]),t(null,{DomainRule:i,statusCode:n.statusCode,headers:n.headers})})}function P(e,t){Re.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function j(e,t){var n=e.OriginConfiguration||{},i=n.OriginRule||e.OriginRule||[];i=Te.clone(i);var a=Te.json2xml({OriginConfiguration:{OriginRule:i}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"origin",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function M(e,t){Re.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){if(e)return t(e);var i=[];try{i=n.OriginConfiguration.OriginRule||[]}catch(e){}i=Te.clone(Te.isArray(i)?i:[i]),t(null,{OriginRule:i,statusCode:n.statusCode,headers:n.headers})})}function U(e,t){Re.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function H(e,t){var n=Te.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(n)),Re.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function F(e,t){Re.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(e,n){if(e)return t(e);delete n.BucketLoggingStatus._xmlns,t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})})}function L(e,t){var n=Te.clone(e.InventoryConfiguration);if(n.OptionalFields){var i=n.OptionalFields||[];n.OptionalFields={Field:i}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var a=n.Destination.COSBucketDestination.Encryption;Object.keys(a).indexOf("SSECOS")>-1&&(a["SSE-COS"]=a.SSECOS,delete a.SSECOS)}var o=Te.json2xml({InventoryConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Re.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"inventory",qs:{id:e.Id},headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function z(e,t){Re.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){if(e)return t(e);var i=n.InventoryConfiguration;if(i&&i.OptionalFields&&i.OptionalFields.Field){var a=i.OptionalFields.Field;Te.isArray(a)||(a=[a]),i.OptionalFields=a}if(i.Destination&&i.Destination.COSBucketDestination&&i.Destination.COSBucketDestination.Encryption){var o=i.Destination.COSBucketDestination.Encryption;Object.keys(o).indexOf("SSE-COS")>-1&&(o.SSECOS=o["SSE-COS"],delete o["SSE-COS"])}t(null,{InventoryConfiguration:i,statusCode:n.statusCode,headers:n.headers})})}function K(e,t){Re.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken}},function(e,n){if(e)return t(e);var i=n.ListInventoryConfigurationResult,a=i.InventoryConfiguration||[];a=Te.isArray(a)?a:[a],delete i.InventoryConfiguration,Te.each(a,function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;Te.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}}),i.InventoryConfigurations=a,Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function q(e,t){Re.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function G(e,t){if(!e.AccelerateConfiguration)return void t({error:"missing param AccelerateConfiguration"});var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},i=Te.json2xml(n),a={};a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Re.call(this,{Interface:"putBucketAccelerate",Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"accelerate",headers:a},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function V(e,t){Re.call(this,{Interface:"getBucketAccelerate",Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)})}function X(e,t){Re.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(n,i){if(n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0,statusCode:a}):t(n)}i.ETag=Te.attr(i.headers,"etag",""),t(null,i)})}function W(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,Re.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions"},function(e,n){if(e)return t(e);var i=n.ListVersionsResult||{},a=i.DeleteMarker||[];a=Te.isArray(a)?a:[a];var o=i.Version||[];o=Te.isArray(o)?o:[o];var r=Te.clone(i);delete r.DeleteMarker,delete r.Version,Te.extend(r,{DeleteMarkers:a,Versions:o,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function $(e,t){var n=e.Query||{},i=e.QueryString||"";n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,Re.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,qs:n,qsStr:i,rawBody:!0},function(n,i){if(n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0}):t(n)}t(null,{Body:i.body,ETag:Te.attr(i.headers,"etag",""),statusCode:i.statusCode,headers:i.headers})})}function Q(e,t){var n=this,i=e.ContentLength,a=Te.throttleOnProgress.call(n,i,e.onProgress),o=e.Headers;o["Cache-Control"]||o["cache-control"]||(o["Cache-Control"]=""),o["Content-Type"]||o["content-type"]||(o["Content-Type"]=Be.getType(e.Key)||"application/octet-stream"),Te.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(r){r&&(o["Content-MD5"]=Te.binaryBase64(r)),void 0!==e.ContentLength&&(o["Content-Length"]=e.ContentLength),a(null,!0),Re.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:a},function(o,r){if(o)return a(null,!0),t(o);a({loaded:i,total:i},!0);var s=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});s=s.substr(s.indexOf("://")+3),r.Location=s,r.ETag=Te.attr(r.headers,"etag",""),t(null,r)})})}function J(e,t){var n=this,i={},a=e.FilePath;if(!a)return void t({error:"missing param FilePath"});i["Cache-Control"]=e.CacheControl,i["Content-Disposition"]=e.ContentDisposition,i["Content-Encoding"]=e.ContentEncoding,i["Content-MD5"]=e.ContentMD5,i["Content-Length"]=e.ContentLength,i["Content-Type"]=e.ContentType,i.Expect=e.Expect,i.Expires=e.Expires,i["x-cos-acl"]=e.ACL,i["x-cos-grant-read"]=e.GrantRead,i["x-cos-grant-write"]=e.GrantWrite,i["x-cos-grant-full-control"]=e.GrantFullControl,i["x-cos-storage-class"]=e.StorageClass,i["x-cos-mime-limit"]=e.MimeLimit,i["x-cos-traffic-limit"]=e.TrafficLimit,delete i["Content-Length"],delete i["content-length"];for(var o in e)o.indexOf("x-cos-meta-")>-1&&(i[o]=e[o]);var r=Te.throttleOnProgress.call(n,i["Content-Length"],e.onProgress);Re.call(this,{Action:"name/cos:PostObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:i,qs:e.Query,filePath:a,onProgress:r},function(i,o){if(r(null,!0),i)return t(i);if(o&&o.headers){var s=o.headers,c=s.etag||s.Etag||s.ETag||"",l=a.substr(a.lastIndexOf("/")+1),p=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key.replace(/\$\{filename\}/g,l),isLocation:!0});return t(null,{Location:p,statusCode:o.statusCode,headers:s,ETag:c})}t(null,o)})}function Y(e,t){Re.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId},function(e,n){if(e){var i=e.statusCode;return i&&204===i?t(null,{statusCode:i}):i&&404===i?t(null,{BucketNotFound:!0,statusCode:i}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})})}function Z(e,t){Re.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"acl"},function(e,n){if(e)return t(e);var i=n.AccessControlPolicy||{},a=i.Owner||{},o=i.AccessControlList&&i.AccessControlList.Grant||[];o=Te.isArray(o)?o:[o];var r=ye(i);n.headers&&n.headers["x-cos-acl"]&&(r.ACL=n.headers["x-cos-acl"]),r=Te.extend(r,{Owner:a,Grants:o,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function ee(e,t){var n=e.Headers,i="";if(e.AccessControlPolicy){var a=Te.clone(e.AccessControlPolicy||{}),o=a.Grants||a.Grant;o=Te.isArray(o)?o:[o],delete a.Grant,delete a.Grants,a.AccessControlList={Grant:o},i=Te.json2xml({AccessControlPolicy:a}),n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(i))}Te.each(n,function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=Ce(n[t]))}),Re.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:i},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function te(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,Re.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n},function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var i=n.headers||{};t(null,{AccessControlAllowOrigin:i["access-control-allow-origin"],AccessControlAllowMethods:i["access-control-allow-methods"],AccessControlAllowHeaders:i["access-control-allow-headers"],AccessControlExposeHeaders:i["access-control-expose-headers"],AccessControlMaxAge:i["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})})}function ne(e,t){var n=e.Headers;!n["Cache-Control"]&&n["cache-control"]&&(n["Cache-Control"]="");var i=e.CopySource||"",a=i.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!a)return void t({error:"CopySource format error"});var o=a[1],r=a[3],s=decodeURIComponent(a[4]);Re.call(this,{Scope:[{action:"name/cos:GetObject",bucket:o,region:r,prefix:s},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(e,n){if(e)return t(e);var i=Te.clone(n.CopyObjectResult||{});Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function ie(e,t){var n=e.CopySource||"",i=n.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!i)return void t({error:"CopySource format error"});var a=i[1],o=i[3],r=decodeURIComponent(i[4]);Re.call(this,{Scope:[{action:"name/cos:GetObject",bucket:a,region:o,prefix:r},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers},function(e,n){if(e)return t(e);var i=Te.clone(n.CopyPartResult||{});Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function ae(e,t){var n=e.Objects||[],i=e.Quiet;n=Te.isArray(n)?n:[n];var a=Te.json2xml({Delete:{Object:n,Quiet:i||!1}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a));var r=Te.map(n,function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}});Re.call(this,{Scope:r,method:"POST",Bucket:e.Bucket,Region:e.Region,body:a,action:"delete",headers:o},function(e,n){if(e)return t(e);var i=n.DeleteResult||{},a=i.Deleted||[],o=i.Error||[];a=Te.isArray(a)?a:[a],o=Te.isArray(o)?o:[o];var r=Te.clone(i);Te.extend(r,{Error:o,Deleted:a,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function oe(e,t){var n=e.Headers;if(!e.RestoreRequest)return void t({error:"missing param RestoreRequest"});var i=e.RestoreRequest||{},a=Te.json2xml({RestoreRequest:i});n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:a,action:"restore",headers:n},function(e,n){t(e,n)})}function re(e,t){var n=e.Tagging||{},i=n.TagSet||n.Tags||e.Tags||[];i=Te.clone(Te.isArray(i)?i:[i]);var a=Te.json2xml({Tagging:{TagSet:{Tag:i}}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Interface:"putObjectTagging",Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:a,action:"tagging",headers:o,VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function se(e,t){Re.call(this,{Interface:"getObjectTagging",Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var i={Tags:[],statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else{var a=[];try{a=n.Tagging.TagSet.Tag||[]}catch(e){}a=Te.clone(Te.isArray(a)?a:[a]),t(null,{Tags:a,statusCode:n.statusCode,headers:n.headers})}})}function ce(e,t){Re.call(this,{Interface:"deleteObjectTagging",Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function le(e,t){var n=this,i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=Be.getType(e.Key)||"application/octet-stream"),Re.call(n,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query},function(e,n){return e?t(e):(n=Te.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,Te.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)})}function pe(e,t){var n=this;Te.getFileSize("multipartUpload",e,function(){Te.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(i){i&&(e.Headers["Content-MD5"]=Te.binaryBase64(i)),Re.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null},function(e,n){if(e)return t(e);t(null,{ETag:Te.attr(n.headers,"etag",{}),statusCode:n.statusCode,headers:n.headers})})})})}function ue(e,t){for(var n=this,i=e.UploadId,a=e.Parts,o=0,r=a.length;o-1?function(e){var t=e.match(/q-url-param-list.*?(?=&)/g)[0],n="q-url-param-list="+encodeURIComponent(t.replace(/q-url-param-list=/,"")).toLowerCase(),i=new RegExp(t,"g");return e.replace(i,n)}(n.Authorization):"sign="+encodeURIComponent(n.Authorization)),n.XCosSecurityToken&&(o+="&x-cos-security-token="+n.XCosSecurityToken),n.ClientIP&&(o+="&clientIP="+n.ClientIP),n.ClientUA&&(o+="&clientUA="+n.ClientUA),n.Token&&(o+="&token="+n.Token),a&&(o+="&"+a),setTimeout(function(){t(null,{Url:o})})}});return s?(o+="?"+s.Authorization+(s.XCosSecurityToken?"&x-cos-security-token="+s.XCosSecurityToken:""),a&&(o+="&"+a)):a&&(o+="?"+a),o}function ye(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},i=e&&e.AccessControlList||{},a=i.Grant;a&&(a=Te.isArray(a)?a:[a]);var o={READ:0,WRITE:0,FULL_CONTROL:0};return a&&a.length&&Te.each(a,function(i){"qcs::cam::anyone:anyone"===i.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===i.Grantee.URI?o[i.Permission]=1:i.Grantee.ID!==e.Owner.ID&&t[n[i.Permission]].push('id="'+i.Grantee.ID+'"')}),o.FULL_CONTROL||o.WRITE&&o.READ?t.ACL="public-read-write":o.READ?t.ACL="public-read":t.ACL="private",Te.each(n,function(e){t[e]=Ce(t[e].join(","))}),t}function Ce(e){var t,n,i=e.split(","),a={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(a="{Bucket}."+a)),a=a.replace(/\{\{AppId\}\}/gi,i).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,o).replace(/\{\{.*?\}\}/gi,""),a=a.replace(/\{AppId\}/gi,i).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,o).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(a)||(a="https://"+a),"/"===a.slice(-1)&&(a=a.slice(0,-1));var s=a;return e.ForcePathStyle&&(s+="/"+t),s+="/",r&&(s+=Te.camSafeUrlEncode(r).replace(/%2F/g,"/")),e.isLocation&&(s=s.replace(/^https?:\/\//,"")),s}function ke(e,t){var n=Te.clone(e.Headers),i="";Te.each(n,function(e,t){(""===e||["content-type","cache-control"].indexOf(t.toLowerCase())>-1)&&delete n[t],"host"===t.toLowerCase()&&(i=e)}),!i&&e.SignHost&&(n.Host=e.SignHost);var a=function(e){var n=!1,i=e.Authorization;if(i)if(i.indexOf(" ")>-1)n=!1;else if(i.indexOf("q-sign-algorithm=")>-1&&i.indexOf("q-ak=")>-1&&i.indexOf("q-sign-time=")>-1&&i.indexOf("q-key-time=")>-1&&i.indexOf("q-url-param-list=")>-1)n=!0;else try{i=Ae.atob(i),i.indexOf("a=")>-1&&i.indexOf("k=")>-1&&i.indexOf("t=")>-1&&i.indexOf("r=")>-1&&i.indexOf("b=")>-1&&(n=!0)}catch(e){}n?t&&t(null,e):t&&t("authorization error")},o=this,r=e.Bucket||"",s=e.Region||"",c="name/cos:PostObject"!==e.Action&&e.Key?e.Key:"";o.options.ForcePathStyle&&r&&(c=r+"/"+c);var l="/"+c,p={},u=e.Scope;if(!u){var d=e.Action||"",m=e.ResourceKey||e.Key||"";u=e.Scope||[{action:d,bucket:r,region:s,prefix:m}]}var f=Te.md5(JSON.stringify(u));o._StsCache=o._StsCache||[],function(){var e,t;for(e=o._StsCache.length-1;e>=0;e--){t=o._StsCache[e];var n=Math.round(Te.getSkewTime(o.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)o._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===f){p=t;break}}}();var h=function(){var t=p.StartTime&&p.ExpiredTime?p.StartTime+";"+p.ExpiredTime:"",i=Te.getAuth({SecretId:p.TmpSecretId,SecretKey:p.TmpSecretKey,Method:e.Method,Pathname:l,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:o.options.SystemClockOffset,KeyTime:t}),r={Authorization:i,XCosSecurityToken:p.XCosSecurityToken||"",Token:p.Token||"",ClientIP:p.ClientIP||"",ClientUA:p.ClientUA||""};a(r)};if(p.ExpiredTime&&p.ExpiredTime-Te.getSkewTime(o.options.SystemClockOffset)/1e3>60)h();else if(o.options.getAuthorization)o.options.getAuthorization.call(o,{Bucket:r,Region:s,Method:e.Method,Key:c,Pathname:l,Query:e.Query,Headers:n,Scope:u,SystemClockOffset:o.options.SystemClockOffset},function(e){"string"==typeof e&&(e={Authorization:e}),e.TmpSecretId&&e.TmpSecretKey&&e.XCosSecurityToken&&e.ExpiredTime?(p=e||{},p.Scope=u,p.ScopeKey=f,o._StsCache.push(p),h()):a(e)});else{if(!o.options.getSTS)return function(){var t=Te.getAuth({SecretId:e.SecretId||o.options.SecretId,SecretKey:e.SecretKey||o.options.SecretKey,Method:e.Method,Pathname:l,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:o.options.SystemClockOffset}),i={Authorization:t,XCosSecurityToken:o.options.XCosSecurityToken};return a(i),i}();o.options.getSTS.call(o,{Bucket:r,Region:s},function(e){p=e||{},p.Scope=u,p.ScopeKey=f,p.TmpSecretId=p.SecretId,p.TmpSecretKey=p.SecretKey,o._StsCache.push(p),h()})}return""}function Se(e){var t=!1,n=!1,i=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var a=e.error.Code,o=e.error.Message;("RequestTimeTooSkewed"===a||"AccessDenied"===a&&"Request has expired"===o)&&(n=!0)}catch(e){}if(e)if(n&&i){var r=Date.parse(i);this.options.CorrectClockSkew&&Math.abs(Te.getSkewTime(this.options.SystemClockOffset)-r)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=r-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0);return t}function Re(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=Te.clearKey(e.qs),e.headers&&(e.headers=Te.clearKey(e.headers)),e.qs&&(e.qs=Te.clearKey(e.qs));var i=Te.clone(e.qs);e.action&&(i[e.action]="");var a=e.url||e.Url,o=e.SignHost||Ee.call(this,{Bucket:e.Bucket,Region:e.Region,Url:a});!function a(r){var s=n.options.SystemClockOffset;ke.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:i,Headers:e.headers,SignHost:o,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope},function(i,o){if(i)return void t(i);e.AuthData=o,we.call(n,e,function(i,o){i&&r<2&&(s!==n.options.SystemClockOffset||Se.call(n,i))?(e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,delete e.headers["x-cos-security-token"]),a(r+1)):t(i,o)})})}(1)}function we(e,t){var n=this,i=e.TaskId;if(!i||n._isRunningTask(i)){var a=e.Bucket,o=e.Region,r=e.Key,s=e.method||"GET",c=e.url||e.Url,l=e.body,p=e.json,u=e.rawBody;n.options.UseAccelerate&&(o="accelerate"),c=c||be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:a,region:o,object:r}),e.action&&(c=c+"?"+e.action),e.qsStr&&(c=c.indexOf("?")>-1?c+"&"+e.qsStr:c+"?"+e.qsStr);var d={method:s,url:c,headers:e.headers,qs:e.qs,filePath:e.filePath,body:l,json:p},m="x-cos-security-token";Te.isCIHost(c)&&(m="x-ci-security-token"),d.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(d.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(d.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(d.headers.clientUA=e.AuthData.ClientUA),e.AuthData.XCosSecurityToken&&(d.headers[m]=e.AuthData.XCosSecurityToken),d.headers&&(d.headers=Te.clearKey(d.headers)),d=Te.clearKey(d),e.onProgress&&"function"==typeof e.onProgress&&(d.onProgress=function(t){if(!i||n._isRunningTask(i)){var a=t?t.loaded:0;e.onProgress({loaded:a,total:t.total})}}),this.options.Timeout&&(d.timeout=this.options.Timeout),n.options.ForcePathStyle&&(d.pathStyle=n.options.ForcePathStyle),n.emit("before-send",d);var f=_e(d,function(e,a,o){if("abort"!==e){var r,s=function(e,o){if(i&&n.off("inner-kill-task",h),!r){r=!0;var s={};a&&a.statusCode&&(s.statusCode=a.statusCode),a&&a.headers&&(s.headers=a.headers),e?(e=Te.extend(e||{},s),t(e,null)):(o=Te.extend(o||{},s),t(null,o)),f=null}};if(e)return void s({error:e});var c;if(u)c={},c.body=o;else try{c=o&&o.indexOf("<")>-1&&o.indexOf(">")>-1&&Te.xml2json(o)||{}}catch(e){c=o||{}}var l=a.statusCode;return 2===Math.floor(l/100)?c.Error?void s({error:c.Error}):void s(null,c):void s({error:c.Error||c})}}),h=function e(t){t.TaskId===i&&(f&&f.abort&&f.abort(),n.off("inner-kill-task",e))};i&&n.on("inner-kill-task",h)}}var _e=n(19),Ae=n(3),Te=n(0),Be=n(20),Ee=function(e){if(!e.Bucket||!e.Bucket)return"";var t=e.Url||be({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:e.Region}),n=t.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");return new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$").test(n)?n:""},Oe={getService:i,putBucket:a,headBucket:o,getBucket:r,deleteBucket:s,putBucketAcl:c,getBucketAcl:l,putBucketCors:p,getBucketCors:u,deleteBucketCors:d,getBucketLocation:m,getBucketPolicy:h,putBucketPolicy:f,deleteBucketPolicy:g,putBucketTagging:v,getBucketTagging:x,deleteBucketTagging:y,putBucketLifecycle:C,getBucketLifecycle:b,deleteBucketLifecycle:k,putBucketVersioning:S,getBucketVersioning:R,putBucketReplication:w,getBucketReplication:_,deleteBucketReplication:A,putBucketWebsite:T,getBucketWebsite:B,deleteBucketWebsite:E,putBucketReferer:O,getBucketReferer:D,putBucketDomain:I,getBucketDomain:N,deleteBucketDomain:P,putBucketOrigin:j,getBucketOrigin:M,deleteBucketOrigin:U,putBucketLogging:H,getBucketLogging:F,putBucketInventory:L,getBucketInventory:z,listBucketInventory:K,deleteBucketInventory:q,putBucketAccelerate:G,getBucketAccelerate:V,getObject:$,headObject:X,listObjectVersions:W,putObject:Q,postObject:J,deleteObject:Y,getObjectAcl:Z,putObjectAcl:ee,optionsObject:te,putObjectCopy:ne,deleteMultipleObject:ae,restoreObject:oe,putObjectTagging:re,getObjectTagging:se,deleteObjectTagging:ce,appendObject:he,uploadPartCopy:ie,multipartInit:le,multipartUpload:pe,multipartComplete:ue,multipartList:de,multipartListPart:me,multipartAbort:fe,request:ge,getObjectUrl:xe,getAuth:ve};e.exports.init=function(e,t){t.transferToTaskMethod(Oe,"postObject"),t.transferToTaskMethod(Oe,"putObject"),Te.each(Oe,function(t,n){e.prototype[n]=Te.apiWrapper(n,t)})}},function(e,t,n){"use strict";function i(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function a(e,t){var n=[];for(var a in e)e.hasOwnProperty(a)&&n.push(t?i(a).toLowerCase():a);return n.sort(function(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),e===t?0:e>t?1:-1})}var o=function(e,t){var n,o,r,s=[],c=a(e);for(n=0;n-1||m.indexOf(f)>-1)&&(d[f]=e.headers[f]);a["x-cos-acl"]&&(d.acl=a["x-cos-acl"]),!d["Content-Type"]&&(d["Content-Type"]=""),n=wx.uploadFile({url:r,method:s,name:"file",header:a,filePath:i,formData:d,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}}),n.onProgressUpdate(function(e){c&&c({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend,progress:e.progress/100})})}else{var h=e.qs&&o(e.qs)||"";h&&(r+=(r.indexOf("?")>-1?"&":"?")+h),a["Content-Length"]&&delete a["Content-Length"],n=wx.request({url:r,method:s,header:a,dataType:"text",data:e.body,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}})}return n};e.exports=r},function(e,t,n){"use strict";var i=n(21);e.exports=new i(n(22),n(23))},function(e,t,n){"use strict";function i(){this._types=Object.create(null),this._extensions=Object.create(null);for(var e=0;em)return t(null,!1);if(n>1){if(Math.max(e[0].Size,e[1].Size)!==d)return t(null,!1)}!function i(a){if(a=c.length)return void S.emit("has_and_check_upload_id",t);var p=c[o];return C.isInArray(t,p)?v.using[p]?void e(o+1):void r.call(l,{Bucket:i,Region:a,Key:s,UploadId:p},function(t,i){l._isRunningTask(n)&&(t?(v.removeUploadId(p),e(o+1)):S.emit("upload_id_available",{UploadId:p,PartList:i.PartList}))}):(v.removeUploadId(p),void e(o+1))}(0)}),S.on("get_remote_upload_id_list",function(){o.call(l,{Bucket:i,Region:a,Key:s},function(t,a){if(l._isRunningTask(n)){if(t)return S.emit("error",t);var o=C.filter(a.UploadList,function(e){return e.Key===s&&(!c||e.StorageClass.toUpperCase()===c.toUpperCase())}).reverse().map(function(e){return e.UploadId||e.UploadID});if(o.length)S.emit("seek_local_avail_upload_id",o);else{var r,p=v.getFileId(e.FileStat,e.ChunkSize,i,s);p&&(r=v.getUploadIdList(p))&&C.each(r,function(e){v.removeUploadId(e)}),S.emit("no_available_upload_id")}}})}),S.emit("get_remote_upload_id_list")}function o(e,t){var n=this,i=[],a={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key};!function e(){n.multipartList(a,function(n,o){if(n)return t(n);i.push.apply(i,o.Upload||[]),"true"===o.IsTruncated?(a.KeyMarker=o.NextKeyMarker,a.UploadIdMarker=o.NextUploadIdMarker,e()):t(null,{UploadList:i})})}()}function r(e,t){var n=this,i=[],a={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId};!function e(){n.multipartListPart(a,function(n,o){if(n)return t(n);i.push.apply(i,o.Part||[]),"true"===o.IsTruncated?(a.PartNumberMarker=o.NextPartNumberMarker,e()):t(null,{PartList:i})})}()}function s(e,t){var n=this,i=e.TaskId,a=e.Bucket,o=e.Region,r=e.Key,s=e.UploadData,l=e.FileSize,p=e.SliceSize,u=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),d=e.FilePath,m=Math.ceil(l/p),f=0,h=e.ServerSideEncryption,g=C.filter(s.PartList,function(e){return e.Uploaded&&(f+=e.PartNumber>=m?l%p||p:p),!e.Uploaded}),v=e.onProgress;x.eachLimit(g,u,function(e,t){if(n._isRunningTask(i)){var u=e.PartNumber,m=Math.min(l,e.PartNumber*p)-(e.PartNumber-1)*p,g=0;c.call(n,{TaskId:i,Bucket:a,Region:o,Key:r,SliceSize:p,FileSize:l,PartNumber:u,ServerSideEncryption:h,FilePath:d,UploadData:s,onProgress:function(e){f+=e.loaded-g,g=e.loaded,v({loaded:f,total:l})}},function(a,o){n._isRunningTask(i)&&(a?f-=g:(f+=m-g,e.ETag=o.ETag),v({loaded:f,total:l}),t(a||null,o))})}},function(e){if(n._isRunningTask(i))return e?t(e):void t(null,{UploadId:s.UploadId,SliceList:s.PartList})})}function c(e,t){var n=this,i=e.TaskId,a=e.Bucket,o=e.Region,r=e.Key,s=e.FileSize,c=e.FilePath,l=1*e.PartNumber,p=e.SliceSize,u=e.ServerSideEncryption,d=e.UploadData,m=n.options.ChunkRetryTimes+1,f=e.Headers||{},h=p*(l-1),g=p,v=h+p;v>s&&(v=s,g=v-h);var y=["x-cos-traffic-limit","x-cos-mime-limit"],b={};C.each(f,function(e,t){y.indexOf(t)>-1&&(b[t]=e)}),C.fileSlice(c,h,v,function(s){var c=C.getFileMd5(s),p=c?C.binaryBase64(c):null,f=d.PartList[l-1];x.retry(m,function(t){n._isRunningTask(i)&&n.multipartUpload({TaskId:i,Bucket:a,Region:o,Key:r,ContentLength:g,PartNumber:l,UploadId:d.UploadId,ServerSideEncryption:u,Body:s,Headers:b,onProgress:e.onProgress,ContentMD5:p},function(e,a){if(n._isRunningTask(i))return e?t(e):(f.Uploaded=!0,t(null,a))})},function(e,a){if(n._isRunningTask(i))return t(e,a)})})}function l(e,t){var n=e.Bucket,i=e.Region,a=e.Key,o=e.UploadId,r=e.SliceList,s=this,c=this.options.ChunkRetryTimes+1,l=r.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});x.retry(c,function(e){s.multipartComplete({Bucket:n,Region:i,Key:a,UploadId:o,Parts:l},e)},function(e,n){t(e,n)})}function p(e,t){var n=e.Bucket,i=e.Region,a=e.Key,r=e.UploadId,s=e.Level||"task",c=e.AsyncLimit,l=this,p=new y;if(p.on("error",function(e){return t(e)}),p.on("get_abort_array",function(o){u.call(l,{Bucket:n,Region:i,Key:a,Headers:e.Headers,AsyncLimit:c,AbortArray:o},function(e,n){if(e)return t(e);t(null,n)})}),"bucket"===s)o.call(l,{Bucket:n,Region:i},function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])});else if("file"===s){if(!a)return t({error:"abort_upload_task_no_key"});o.call(l,{Bucket:n,Region:i,Key:a},function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])})}else{if("task"!==s)return t({error:"abort_unknown_level"});if(!r)return t({error:"abort_upload_task_no_id"});if(!a)return t({error:"abort_upload_task_no_key"});p.emit("get_abort_array",[{Key:a,UploadId:r}])}}function u(e,t){var n=e.Bucket,i=e.Region,a=e.Key,o=e.AbortArray,r=e.AsyncLimit||1,s=this,c=0,l=new Array(o.length);x.eachLimit(o,r,function(t,o){var r=c;if(a&&a!==t.Key)return l[r]={error:{KeyNotMatch:!0}},void o(null);var p=t.UploadId||t.UploadID;s.multipartAbort({Bucket:n,Region:i,Key:t.Key,Headers:e.Headers,UploadId:p},function(e){var a={Bucket:n,Region:i,Key:t.Key,UploadId:p};l[r]={error:e,task:a},o(null)}),c++},function(e){if(e)return t(e);for(var n=[],i=[],a=0,o=l.length;ai?"sliceUploadFile":"postObject";a.push({api:p,params:e,callback:l}),n._addTasks(a)}function m(e,t){var n=this,i=void 0===e.SliceSize?n.options.SliceSize:e.SliceSize,a=0,o=0,r=C.throttleOnProgress.call(n,o,e.onProgress),s=e.files.length,c=e.onFileFinish,l=Array(s),p=function(e,n,i){r(null,!0),c&&c(e,n,i),l[i.Index]={options:i,error:e,data:n},--s<=0&&t&&t(null,{files:l})},u=[];C.each(e.files,function(e,t){var n=e.FileSize,s={Index:t,TaskId:""};a+=n,C.each(e,function(e,t){"object"!==(void 0===e?"undefined":g(e))&&"function"!=typeof e&&(s[t]=e)});var c=e.onTaskReady;e.onTaskReady=function(e){s.TaskId=e,c&&c(e)};var l=0,d=e.onProgress;e.onProgress=function(e){o=o-l+e.loaded,l=e.loaded,d&&d(e),r({loaded:o,total:a})};var m=e.onFileFinish,f=function(e,t){m&&m(e,t),p&&p(e,t,s)},h=n>i?"sliceUploadFile":"postObject";u.push({api:h,params:e,callback:f})}),n._addTasks(u)}function f(e,t){var n=new y,i=this,a=e.Bucket,o=e.Region,r=e.Key,s=e.CopySource,c=s.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!c)return void t({error:"CopySource format error"});var l=c[1],p=c[3],u=decodeURIComponent(c[4]),d=void 0===e.CopySliceSize?i.options.CopySliceSize:e.CopySliceSize;d=Math.max(0,d);var m,f,g=e.CopyChunkSize||this.options.CopyChunkSize,v=this.options.CopyChunkParallelLimit,b=0;n.on("copy_slice_complete",function(e){i.multipartComplete({Bucket:a,Region:o,Key:r,UploadId:e.UploadId,Parts:e.PartList},function(e,n){if(e)return f(null,!0),t(e);f({loaded:m,total:m},!0),t(null,n)})}),n.on("get_copy_data_finish",function(e){x.eachLimit(e.PartList,v,function(t,n){var c=t.PartNumber,l=t.CopySourceRange,p=t.end-t.start,u=0;h.call(i,{Bucket:a,Region:o,Key:r,CopySource:s,UploadId:e.UploadId,PartNumber:c,CopySourceRange:l,onProgress:function(e){b+=e.loaded-u,u=e.loaded,f({loaded:b,total:m})}},function(e,i){if(e)return n(e);f({loaded:b,total:m}),b+=p-u,t.ETag=i.ETag,n(e||null,i)})},function(i){if(i)return f(null,!0),t(i);n.emit("copy_slice_complete",e)})}),n.on("get_file_size_finish",function(s){!function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,a=0;a"x-cos-meta-".length&&(s[t]=e)}),n.emit("get_file_size_finish",s)}})}function h(e,t){var n=e.TaskId,i=e.Bucket,a=e.Region,o=e.Key,r=e.CopySource,s=e.UploadId,c=1*e.PartNumber,l=e.CopySourceRange,p=this.options.ChunkRetryTimes+1,u=this;x.retry(p,function(t){u.uploadPartCopy({TaskId:n,Bucket:i,Region:a,Key:o,CopySource:r,UploadId:s,PartNumber:c,CopySourceRange:l,onProgress:e.onProgress},function(e,n){t(e||null,n)})},function(e,n){return t(e,n)})}var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v=n(5),x=n(25),y=n(4).EventProxy,C=n(0),b={sliceUploadFile:i,abortUploadTask:p,uploadFile:d,uploadFiles:m,sliceCopyFile:f};e.exports.init=function(e,t){t.transferToTaskMethod(b,"sliceUploadFile"),C.each(b,function(t,n){e.prototype[n]=C.apiWrapper(n,t)})}},function(e,t,n){"use strict";var i=function(e,t,n,i){if(i=i||function(){},!e.length||t<=0)return i();var a=0,o=0,r=0;!function s(){if(a>=e.length)return i();for(;r=e.length?i():s())})}()},a=function(e,t,n){e<1?n():function i(a){t(function(t,o){t&&a -1 ? '&' : '?') + qsStr; } diff --git a/demo/lib/cos-wx-sdk-v5.min.js b/demo/lib/cos-wx-sdk-v5.min.js index 7a6960d..21890f2 100644 --- a/demo/lib/cos-wx-sdk-v5.min.js +++ b/demo/lib/cos-wx-sdk-v5.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.COS=t():e.COS=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/Users/tianfeng/Documents/\u9879\u76ee/sdk/cos-wx-sdk-v5/demo/lib",t(t.s=6)}([function(e,t,n){"use strict";(function(t){function i(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function a(e,t){var n=[];for(var a in e)e.hasOwnProperty(a)&&n.push(t?i(a).toLowerCase():a);return n.sort(function(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),e===t?0:e>t?1:-1})}function o(e){return d(e,function(e){return"object"===(void 0===e?"undefined":f(e))&&null!==e?o(e):e})}function r(e,t,n){return e&&t in e?e[t]:n}function s(e,t){return u(t,function(n,i){e[i]=t[i]}),e}function c(e){return e instanceof Array}function l(e,t){for(var n=!1,i=0;i-1||S.indexOf(i)>-1)&&(t[n]=e[n])}return t},w=function(e){e=e||{};var t,n=e.SecretId,i=e.SecretKey,r=e.KeyTime,s=(e.method||e.Method||"get").toLowerCase(),c=o(e.Query||e.params||{}),l=R(o(e.Headers||e.headers||{})),p=e.Key||"";if(e.UseRawKey?t=e.Pathname||e.pathname||"/"+p:(t=e.Pathname||e.pathname||p,0!==t.indexOf("/")&&(t="/"+t)),!l.Host&&!l.host&&e.Bucket&&e.Region&&(l.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),!n)return console.error("missing param SecretId");if(!i)return console.error("missing param SecretKey");var u=Math.round(U(e.SystemClockOffset)/1e3)-1,d=u,m=e.Expires||e.expires;d+=void 0===m?900:1*m||0;var f=n,h=r||u+";"+d,v=r||u+";"+d,x=a(l,!0).join(";").toLowerCase(),y=a(c,!0).join(";").toLowerCase(),C=g.HmacSHA1(v,i).toString(),b=[s,t,z.obj2str(c,!0),z.obj2str(l,!0),""].join("\n"),k=["sha1",h,g.SHA1(b).toString(),""].join("\n");return["q-sign-algorithm=sha1","q-ak="+f,"q-sign-time="+h,"q-key-time="+v,"q-header-list="+x,"q-url-param-list="+y,"q-signature="+g.HmacSHA1(k,C).toString()].join("&")},_=function(){},A=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]);return t},T=function(e,t,n,i){e?b.readFile({filePath:e,position:t,length:n-t,success:function(e){i(e.data)},fail:function(){i(null)}}):i(null)},B=function(e,t,n){n=n||_,e&&t&&t instanceof ArrayBuffer?z.getFileMd5(t,function(e,t){n(t)}):n()},E=function(e,t){var n=h(e);return t&&t(n),n},O=function(e){var t,n,i,a="";for(t=0,n=e.length/2;t-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!i)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e){if(!n)return"Bucket";if(!i)return"Region";if(!a)return"Key"}return!1},N=function(e,t){if(t=s({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};if(t&&"object"===(void 0===t?"undefined":f(t))){!function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}();var i={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext"};z.each(i,function(e,i){void 0!==t[e]&&(n[i]=t[e])}),t.Headers=A(n)}}return t},P=function(e,n){return function(i,a){var o=this;"function"==typeof i&&(a=i,i={}),i=N(e,i);var r=function(e){return e&&e.headers&&(e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},s=function(e,t){a&&a(r(e),r(t))},c=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=I(e,i);if(t)return"missing param "+t;if(i.Region){if(i.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(i.Region))return"Region format error.";o.options.CompatibilityMode||-1!==i.Region.indexOf("-")||"yfb"===i.Region||"default"===i.Region||"accelerate"===i.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(i.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(i.Bucket))if(i.AppId)i.Bucket=i.Bucket+"-"+i.AppId;else{if(!o.options.AppId)return'Bucket should format as "test-1250000000".';i.Bucket=i.Bucket+"-"+o.options.AppId}i.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete i.AppId)}i.Key&&"/"===i.Key.substr(0,1)&&(i.Key=i.Key.substr(1))}}(),l="getAuth"===e||"getObjectUrl"===e,p=t.Promise;if(!l&&p&&!a)return new p(function(e,t){if(a=function(n,i){n?t(n):e(i)},c)return s({error:c});n.call(o,i,s)});if(c)return s({error:c});var u=n.call(o,i,s);return l?u:void 0}},j=function(e,t){function n(){if(a=0,t&&"function"==typeof t){i=Date.now();var n,o=Math.max(0,Math.round((s-r)/((i-c)/1e3)*100)/100)||0;n=0===s&&0===e?1:Math.floor(s/e*100)/100||0,c=i,r=s;try{t({loaded:s,total:e,speed:o,percent:n})}catch(e){}}}var i,a,o=this,r=0,s=0,c=Date.now();return function(t,i){if(t&&(s=t.loaded,e=t.total),i)clearTimeout(a),n();else{if(a)return;a=setTimeout(n,o.options.ProgressInterval)}}},M=function(e,t,n){"postObject"===e?n():"putObject"===e?void 0!==t.Body?(t.ContentLength=t.Body.byteLength,n(null,t.ContentLength)):n({error:"missing param Body"}):t.FilePath?b.stat({path:t.FilePath,success:function(e){var i=e.stats;t.FileStat=i,t.FileStat.FilePath=t.FilePath;var a=i.isDirectory()?0:i.size;t.ContentLength=a=a||0,n(null,a)},fail:function(e){n(e)}}):n({error:"missing param FilePath"})},U=function(e){return Date.now()+(e||0)},H=function(e,t){e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.lengtho)return 1;if(a=0,n=!t&&"devtools"===e.platform;return function(){return n&&console.warn("\u5f53\u524d\u5c0f\u7a0b\u5e8f\u7248\u672c\u5c0f\u4e8e 2.10.0\uff0c\u4e0d\u652f\u6301\u5206\u7247\u4e0a\u4f20\uff0c\u8bf7\u66f4\u65b0\u8f6f\u4ef6\u3002"),n=!1,t}}(),L=function(e){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e)},z={noop:_,formatParams:N,apiWrapper:P,xml2json:v,json2xml:x,md5:h,clearKey:A,fileSlice:T,getBodyMd5:B,getFileMd5:E,binaryBase64:O,extend:s,isArray:c,isInArray:l,makeArray:p,each:u,map:d,filter:m,clone:o,attr:r,uuid:D,camSafeUrlEncode:i,throttleOnProgress:j,getFileSize:M,getSkewTime:U,obj2str:k,getAuth:w,compareVersion:H,canFileSlice:F,isCIHost:L};e.exports=z}).call(t,n(1))},function(e,t,n){"use strict";var i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t){var n=e.prototype;if(Object.create){var a=Object.create(t.prototype);n.__proto__=a}if(!(n instanceof t)){var o=function(){};o.prototype=t.prototype,o=new o,i(n,o),e.prototype=n=o}n.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}function o(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,oe[e]),this.message=oe[e],Error.captureStackTrace&&Error.captureStackTrace(this,o);return n.code=e,t&&(this.message=this.message+": "+t),n}function r(){}function s(e,t){this._node=e,this._refresh=t,c(this)}function c(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);z(e,"length",n.length),i(n,e),e._inc=t}}function l(){}function p(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function u(e,t,n,i){if(i?t[p(t,i)]=n:t[t.length++]=n,e){n.ownerElement=e;var a=e.ownerDocument;a&&(i&&y(a,e,i),x(a,e,n))}}function d(e,t,n){var i=p(t,n);if(!(i>=0))throw o(se,new Error(e.tagName+"@"+n));for(var a=t.length-1;i"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function g(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(g(e,t))return!0}while(e=e.nextSibling)}function v(){}function x(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function y(e,t,n,i){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function C(e,t,n){if(e&&e._inc){e._inc++;var i=t.childNodes;if(n)i[i.length++]=n;else{for(var a=t.firstChild,o=0;a;)i[o++]=a,a=a.nextSibling;i.length=o}}}function b(e,t){var n=t.previousSibling,i=t.nextSibling;return n?n.nextSibling=i:e.firstChild=i,i?i.previousSibling=n:e.lastChild=n,C(e.ownerDocument,e),t}function k(e,t,n){var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===ne){var a=t.firstChild;if(null==a)return t;var o=t.lastChild}else a=o=t;var r=n?n.previousSibling:e.lastChild;a.previousSibling=r,o.nextSibling=n,r?r.nextSibling=a:e.firstChild=a,null==n?e.lastChild=o:n.previousSibling=o;do{a.parentNode=e}while(a!==o&&(a=a.nextSibling));return C(e.ownerDocument||e,e),t.nodeType==ne&&(t.firstChild=t.lastChild=null),t}function S(e,t){var n=t.parentNode;if(n){var i=e.lastChild;n.removeChild(t);var i=e.lastChild}var i=e.lastChild;return t.parentNode=e,t.previousSibling=i,t.nextSibling=null,i?i.nextSibling=t:e.firstChild=t,e.lastChild=t,C(e.ownerDocument,e,t),t}function R(){this._nsMap={}}function w(){}function _(){}function A(){}function T(){}function B(){}function E(){}function O(){}function D(){}function I(){}function N(){}function P(){}function j(){}function M(e,t){var n=[],i=9==this.nodeType?this.documentElement:this,a=i.prefix,o=i.namespaceURI;if(o&&null==a){var a=i.lookupPrefix(o);if(null==a)var r=[{namespace:o,prefix:null}]}return H(this,n,e,t,r),n.join("")}function U(e,t,n){var i=e.prefix||"",a=e.namespaceURI;if(!i&&!a)return!1;if("xml"===i&&"http://www.w3.org/XML/1998/namespace"===a||"http://www.w3.org/2000/xmlns/"==a)return!1;for(var o=n.length;o--;){var r=n[o];if(r.prefix==i)return r.namespace!=a}return!0}function H(e,t,n,i,a){if(i){if(!(e=i(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case V:a||(a=[]);var o=(a.length,e.attributes),r=o.length,s=e.firstChild,c=e.tagName;n=q===e.namespaceURI||n,t.push("<",c);for(var l=0;l"),n&&/^script$/i.test(c))for(;s;)s.data?t.push(s.data):H(s,t,n,i,a),s=s.nextSibling;else for(;s;)H(s,t,n,i,a),s=s.nextSibling;t.push("")}else t.push("/>");return;case ee:case ne:for(var s=e.firstChild;s;)H(s,t,n,i,a),s=s.nextSibling;return;case X:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,h),'"');case W:return t.push(e.data.replace(/[<&]/g,h));case $:return t.push("");case Z:return t.push("\x3c!--",e.data,"--\x3e");case te:var f=e.publicId,g=e.systemId;if(t.push("');else if(g&&"."!=g)t.push(' SYSTEM "',g,'">');else{var v=e.internalSubset;v&&t.push(" [",v,"]"),t.push(">")}return;case Y:return t.push("");case Q:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function F(e,t,n){var i;switch(t.nodeType){case V:i=t.cloneNode(!1),i.ownerDocument=e;case ne:break;case X:n=!0}if(i||(i=t.cloneNode(!1)),i.ownerDocument=e,i.parentNode=null,n)for(var a=t.firstChild;a;)i.appendChild(F(e,a,n)),a=a.nextSibling;return i}function L(e,t,n){var i=new t.constructor;for(var a in t){var o=t[a];"object"!=(void 0===o?"undefined":K(o))&&o!=i[a]&&(i[a]=o)}switch(t.childNodes&&(i.childNodes=new r),i.ownerDocument=e,i.nodeType){case V:var s=t.attributes,c=i.attributes=new l,p=s.length;c._ownerElement=i;for(var u=0;u0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var i in n)if(n[i]==e)return i;t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},i(G,f),i(G,f.prototype),v.prototype={nodeName:"#document",nodeType:ee,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==ne){for(var n=e.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,t),n=i}return e}return null==this.documentElement&&e.nodeType==V&&(this.documentElement=e),k(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),b(this,e)},importNode:function(e,t){return F(this,e,t)},getElementById:function(e){var t=null;return g(this.documentElement,function(n){if(n.nodeType==V&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new R;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new r,(t.attributes=new l)._ownerElement=t,t},createDocumentFragment:function(){var e=new N;return e.ownerDocument=this,e.childNodes=new r,e},createTextNode:function(e){var t=new A;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new T;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new B;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new P;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new w;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new I;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new R,i=t.split(":"),a=n.attributes=new l;return n.childNodes=new r,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,a._ownerElement=n,n},createAttributeNS:function(e,t){var n=new w,i=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,n}},a(v,f),R.prototype={nodeType:V,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===ne?this.insertBefore(e,null):S(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new s(this,function(t){var n=[];return g(t,function(i){i===t||i.nodeType!=V||"*"!==e&&i.tagName!=e||n.push(i)}),n})},getElementsByTagNameNS:function(e,t){return new s(this,function(n){var i=[];return g(n,function(a){a===n||a.nodeType!==V||"*"!==e&&a.namespaceURI!==e||"*"!==t&&a.localName!=t||i.push(a)}),i})}},v.prototype.getElementsByTagName=R.prototype.getElementsByTagName,v.prototype.getElementsByTagNameNS=R.prototype.getElementsByTagNameNS,a(R,f),w.prototype.nodeType=X,a(w,f),_.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(oe[re])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},a(_,f),A.prototype={nodeName:"#text",nodeType:W,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},a(A,_),T.prototype={nodeName:"#comment",nodeType:Z},a(T,_),B.prototype={nodeName:"#cdata-section",nodeType:$},a(B,_),E.prototype.nodeType=te,a(E,f),O.prototype.nodeType=ie,a(O,f),D.prototype.nodeType=J,a(D,f),I.prototype.nodeType=Q,a(I,f),N.prototype.nodeName="#document-fragment",N.prototype.nodeType=ne,a(N,f),P.prototype.nodeType=Y,a(P,f),j.prototype.serializeToString=function(e,t,n){return M.call(e,t,n)},f.prototype.toString=M;try{if(Object.defineProperty){var le=function e(t){switch(t.nodeType){case V:case ne:var n=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&n.push(e(t)),t=t.nextSibling;return n.join("");default:return t.nodeValue}};Object.defineProperty(s.prototype,"length",{get:function(){return c(this),this.$$length}}),Object.defineProperty(f.prototype,"textContent",{get:function(){return le(this)},set:function(e){switch(this.nodeType){case V:case ne:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),z=function(e,t,n){e["$$"+t]=n}}}catch(e){}t.DOMImplementation=m,t.XMLSerializer=j},function(e,t,n){"use strict";var i=function(e){e=e||{};var t,n=e.Base64,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=function(e){for(var t={},n=0,i=e.length;n>>6)+o(128|63&t):o(224|t>>>12&15)+o(128|t>>>6&63)+o(128|63&t)}var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|t>>>18&7)+o(128|t>>>12&63)+o(128|t>>>6&63)+o(128|63&t)},s=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,c=function(e){return e.replace(s,r)},l=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[i.charAt(n>>>18),i.charAt(n>>>12&63),t>=2?"=":i.charAt(n>>>6&63),t>=1?"=":i.charAt(63&n)].join("")},p=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,l)},u=t?function(e){return(e.constructor===t.constructor?e:new t(e)).toString("base64")}:function(e){return p(c(e))},d=function(e,t){return t?u(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):u(String(e))},m=function(e){return d(e,!0)},f=new RegExp(["[\xc0-\xdf][\x80-\xbf]","[\xe0-\xef][\x80-\xbf]{2}","[\xf0-\xf7][\x80-\xbf]{3}"].join("|"),"g"),h=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return o(55296+(n>>>10))+o(56320+(1023&n));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},g=function(e){return e.replace(f,h)},v=function(e){var t=e.length,n=t%4,i=(t>0?a[e.charAt(0)]<<18:0)|(t>1?a[e.charAt(1)]<<12:0)|(t>2?a[e.charAt(2)]<<6:0)|(t>3?a[e.charAt(3)]:0),r=[o(i>>>16),o(i>>>8&255),o(255&i)];return r.length-=[0,0,2,1][n],r.join("")},x=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,v)},y=t?function(e){return(e.constructor===t.constructor?e:new t(e,"base64")).toString()}:function(e){return g(x(e))},C=function(e){return y(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};return{VERSION:"2.1.9",atob:x,btoa:p,fromBase64:C,toBase64:d,utob:c,encode:d,encodeURI:m,btou:g,decode:C,noConflict:function(){var t=e.Base64;return e.Base64=n,t}}}();e.exports=i},function(e,t,n){"use strict";var i=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){n(e).push(t)},e.off=function(e,t){for(var i=n(e),a=i.length-1;a>=0;a--)t===i[a]&&i.splice(a,1)},e.emit=function(e,t){for(var i=n(e).map(function(e){return e}),a=0;a=0;n--){var a=i[n][2];(!a||a+2592e3=0;o--){var r=i[o];r[0]===e&&r[1]===t?i.splice(o,1):e!==r[0]&&0===r[0].indexOf(a)&&i.splice(o,1)}i.unshift([e,t,Math.round(Date.now()/1e3)]),i.length>n&&i.splice(n),l()}},removeUploadId:function(e){c(),delete p.using[e];for(var t=i.length-1;t>=0;t--)i[t][1]===e&&i.splice(t,1);l()}};e.exports=p},function(e,t,n){"use strict";var i=n(7);e.exports=i},function(e,t,n){"use strict";var i=n(0),a=n(4),o=n(17),r=n(18),s=n(24),c={SecretId:"",SecretKey:"",XCosSecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,UploadQueueSize:1e4,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1},l=function(e){this.options=i.extend(i.clone(c),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),this.options.SecretId&&this.options.SecretId.indexOf(" ")>-1&&(console.error("error: SecretId\u683c\u5f0f\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey\u683c\u5f0f\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5"),console.error("error: SecretKey format is incorrect. Please check")),a.init(this),o.init(this)};r.init(l,o),s.init(l,o),l.getAuthorization=i.getAuth,l.version="1.1.2",e.exports=l},function(module,exports,__webpack_require__){"use strict";(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var ERROR="input is invalid type",WINDOW="object"===("undefined"==typeof window?"undefined":_typeof(window)),root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===("undefined"==typeof self?"undefined":_typeof(self)),NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"===(void 0===process?"undefined":_typeof(process))&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"===_typeof(module)&&module.exports,AMD=__webpack_require__(11),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===(void 0===e?"undefined":_typeof(e))&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.getCtx=e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t>2]|=e[o]<>6,c[a++]=128|63&i):i<55296||i>=57344?(c[a++]=224|i>>12,c[a++]=128|i>>6&63,c[a++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),c[a++]=240|i>>18,c[a++]=128|i>>12&63,c[a++]=128|i>>6&63,c[a++]=128|63&i);else for(a=this.start;o>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[a>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=64?(this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,i,a,o,r=this.blocks;this.first?(e=r[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,i=(-1732584194^2004318071&e)+r[1]-117830708,i=(i<<12|i>>>20)+e<<0,n=(-271733879^i&(-271733879^e))+r[2]-1126478375,n=(n<<17|n>>>15)+i<<0,t=(e^n&(i^e))+r[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,i=this.h3,e+=(i^t&(n^i))+r[0]-680876936,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[1]-389564586,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[2]+606105819,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(i^t&(n^i))+r[4]-176418897,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[5]+1200080426,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[6]-1473231341,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(i^t&(n^i))+r[8]+1770035416,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[9]-1958414417,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[10]-42063,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(i^t&(n^i))+r[12]+1804603682,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[13]-40341101,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[14]-1502002290,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^i&(t^n))+r[1]-165796510,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[6]-1069501632,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[11]+643717713,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[5]-701558691,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[10]+38016083,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[15]-660478335,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[9]+568446438,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[14]-1019803690,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[3]-187363961,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[13]-1444681467,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[2]-51403784,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[7]+1735328473,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[12]-1926607734,t=(t<<20|t>>>12)+n<<0,a=t^n,e+=(a^i)+r[5]-378558,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[8]-2022574463,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[11]+1839030562,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[14]-35309556,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[1]-1530992060,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[4]+1272893353,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[7]-155497632,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[10]-1094730640,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[13]+681279174,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[0]-358537222,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[3]-722521979,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[6]+76029189,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[9]-640364487,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[12]-421815835,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[15]+530742520,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~i))+r[0]-198630844,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[7]+1126891415,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[14]-1416354905,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[12]+1700485571,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[3]-1894986606,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[10]-1051523,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[8]+1873313359,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[15]-30611744,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[6]-1560198380,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[4]-145523070,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[11]-1120210379,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[2]+718787259,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=i+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+i<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,i="",a=this.array(),o=0;o<15;)e=a[o++],t=a[o++],n=a[o++],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=a[o],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()}).call(exports,__webpack_require__(9),__webpack_require__(1),__webpack_require__(10)(module))},function(e,t,n){"use strict";function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(u===setTimeout)return setTimeout(e,0);if((u===i||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function r(e){if(d===clearTimeout)return clearTimeout(e);if((d===a||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function s(){g&&f&&(g=!1,f.length?h=f.concat(h):v=-1,h.length&&c())}function c(){if(!g){var e=o(s);g=!0;for(var t=h.length;t;){for(f=h,h=[];++v1)for(var n=1;n>>2]|=(n[a>>>2]>>>24-a%4*8&255)<<24-(i+a)%4*8;else if(65535>>2]=n[a>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new r.init(n,t/2)}},l=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],i=0;i>>2]>>>24-i%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new r.init(n,t)}},p=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},u=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,a=n.sigBytes,o=this.blockSize,s=a/(4*o),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*o,a=e.min(4*t,a),t){for(var c=0;cl;l++){if(16>l)o[l]=0|e[t+l];else{var p=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=p<<1|p>>>31}p=(i<<5|i>>>27)+c+o[l],p=20>l?p+(1518500249+(a&r|~a&s)):40>l?p+(1859775393+(a^r^s)):60>l?p+((a&r|a&s|r&s)-1894007588):p+((a^r^s)-899497514),c=s,s=r,r=a<<30|a>>>2,a=i,i=p}n[0]=n[0]+i|0,n[1]=n[1]+a|0,n[2]=n[2]+r|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(i+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=a._createHelper(t),e.HmacSHA1=a._createHmacHelper(t)}(),function(){var e=i,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var i=e.blockSize,a=4*i;n.sigBytes>a&&(n=e.finalize(n)),n.clamp();for(var o=this._oKey=n.clone(),r=this._iKey=n.clone(),s=o.words,c=r.words,l=0;l>>2]>>>24-o%4*8&255,s=t[o+1>>>2]>>>24-(o+1)%4*8&255,c=t[o+2>>>2]>>>24-(o+2)%4*8&255,l=r<<16|s<<8|c,p=0;p<4&&o+.75*p>>6*(3-p)&63));var u=i.charAt(64);if(u)for(;a.length%4;)a.push(u);return a.join("")},parse:function(e){var t=e.length,i=this._map,a=i.charAt(64);if(a){var o=e.indexOf(a);-1!=o&&(t=o)}for(var r=[],s=0,c=0;c>>6-c%4*2;r[s>>>2]|=(l|p)<<24-s%4*8,s++}return n.create(r,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.exports=i},function(e,t,n){"use strict";var i=n(14).DOMParser,a=function(e){function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function n(e){return e.prefix}function a(e){return"string"==typeof e?e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):e}function o(e,t,n,i){for(var a=0;a0&&o(e.arrayAccessFormPaths,t,n,i)&&(t[n]=[t[n]])}function s(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),i=t[5].split(".");if(n.setHours(t[3],t[4],i[0]),i.length>1&&n.setMilliseconds(i[1]),t[6]&&t[7]){var a=60*t[6]+Number(t[7]);a=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*a:a),n.setMinutes(n.getMinutes()-a-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function c(t,n,i){if(e.datetimeAccessFormPaths.length>0){var a=i.split(".#")[0];return o(e.datetimeAccessFormPaths,t,n,a)?s(t):t}return t}function l(t,n,i,a){return!(n==S.ELEMENT_NODE&&e.xmlElementsFilter.length>0)||o(e.xmlElementsFilter,t,i,a)}function p(i,a){if(i.nodeType==S.DOCUMENT_NODE){for(var o=new Object,s=i.childNodes,u=0;u1&&null!=o.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==o.__text||""==o.__text.trim())&&delete o.__text:o=o.__cdata,delete o.__cnt,!e.enableToStringFunc||null==o.__text&&null==o.__cdata||(o.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),o}if(i.nodeType==S.TEXT_NODE||i.nodeType==S.CDATA_SECTION_NODE)return i.nodeValue}function u(t,n,i,o){var r="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=i)for(var s=0;s":">"}function d(e,t){return""}function m(e,t){return-1!==e.indexOf(t,e.length-t.length)}function f(t,n){return!!("property"==e.arrayAccessForm&&m(n.toString(),"_asArray")||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function)}function h(e){var t=0;if(e instanceof Object)for(var n in e)f(e,n)||t++;return t}function g(t,n,i){return 0==e.jsonPropertiesFilter.length||""==i||o(e.jsonPropertiesFilter,t,n,i)}function v(t){var n=[];if(t instanceof Object)for(var i in t)-1==i.toString().indexOf("__")&&0==i.toString().indexOf(e.attributePrefix)&&n.push(i);return n}function x(t){var n="";return null!=t.__cdata&&(n+=""),null!=t.__text&&(e.escapeMode?n+=a(t.__text):n+=t.__text),n}function y(t){var n="";return t instanceof Object?n+=x(t):null!=t&&(e.escapeMode?n+=a(t):n+=t),n}function C(e,t){return""===e?t:e+"."+t}function b(e,t,n,i){var a="";if(0==e.length)a+=u(e,t,n,!0);else for(var o=0;o0)for(var i in e)if(!f(e,i)&&(""==t||g(e,i,C(t,i)))){var a=e[i],o=v(a);if(null==a||void 0==a)n+=u(a,i,o,!0);else if(a instanceof Object)if(a instanceof Array)n+=b(a,i,o,t);else if(a instanceof Date)n+=u(a,i,o,!1),n+=a.toISOString(),n+=d(a,i);else{var r=h(a);r>0||null!=a.__text||null!=a.__cdata?(n+=u(a,i,o,!1),n+=k(a,C(t,i)),n+=d(a,i)):n+=u(a,i,o,!0)}else n+=u(a,i,o,!1),n+=y(a),n+=d(a,i)}return n+=y(e)}e=e||{},function(){void 0===e.escapeMode&&(e.escapeMode=!0),e.attributePrefix=e.attributePrefix||"_",e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1)}();var S={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(e){if(void 0===e)return null;var t;if(i){var n=new i,a=null;try{a=n.parseFromString("INVALID","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(e){a=null}try{t=n.parseFromString(e,"text/xml"),null!=a&&t.getElementsByTagNameNS(a,"parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("")+2)),t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?s(e):e},this.xml2json=function(e){return p(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return k(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},o=function(e){if(!e)return null;var t=new i,n=t.parseFromString(e,"text/xml"),o=new a,r=o.xml2json(n);return r.html&&r.getElementsByTagName("parsererror").length?null:r};e.exports=o},function(e,t,n){"use strict";function i(e){this.options=e||{locator:{}}}function a(e,t,n){function i(t){var i=e[t];!i&&r&&(i=2==e.length?function(n){e(t,n)}:e),a[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+s(n))}||function(){}}if(!e){if(t instanceof o)return t;e=t}var a={},r=e instanceof Function;return n=n||{},i("warning"),i("error"),i("fatalError"),a}function o(){this.cdata=!1}function r(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function s(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function c(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function l(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}i.prototype.parseFromString=function(e,t){var n=this.options,i=new p,r=n.domBuilder||new o,s=n.errorHandler,c=n.locator,l=n.xmlns||{},u={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&r.setDocumentLocator(c),i.errorHandler=a(s,r,c),i.domBuilder=n.domBuilder||r,/\/x?html?$/.test(t)&&(u.nbsp="\xa0",u.copy="\xa9",l[""]="http://www.w3.org/1999/xhtml"),l.xml=l.xml||"http://www.w3.org/XML/1998/namespace",e?i.parse(e,l,u):i.errorHandler.error("invalid doc source"),r.doc},o.prototype={startDocument:function(){this.doc=(new u).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,i){var a=this.doc,o=a.createElementNS(e,n||t),s=i.length;l(this,o),this.currentElement=o,this.locator&&r(this.locator,o);for(var c=0;c65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function f(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?p(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function h(t){if(t>S){var n=e.substring(S,t).replace(/&#?\w+;/g,f);C&&g(S),i.characters(n,0,t-S),S=t}}function g(t,n){for(;t>=x&&(n=y.exec(e));)v=n.index,x=v+n[0].length,C.lineNumber++;C.columnNumber=t-v+1}for(var v=0,x=0,y=/.*(?:\r\n?|\n)|.*$/g,C=i.locator,b=[{currentNSMap:t}],k={},S=0;;){try{var R=e.indexOf("<",S);if(R<0){if(!e.substr(S).match(/^\s*$/)){var w=i.doc,_=w.createTextNode(e.substr(S));w.appendChild(_),i.currentElement=_}return}switch(R>S&&h(R),e.charAt(R+1)){case"/":var A=e.indexOf(">",R+3),T=e.substring(R+2,A),B=b.pop();A<0?(T=e.substring(R+2).replace(/[\s<].*/,""),a.error("end tag name: "+T+" is not complete:"+B.tagName),A=R+1+T.length):T.match(/\sS?S=A:h(Math.max(R,S)+1)}}function o(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function r(e,t,n,i,a,o){for(var r,s,c=++t,l=y;;){var p=e.charAt(c);switch(p){case"=":if(l===C)r=e.slice(t,c),l=k;else{if(l!==b)throw new Error("attribute equal must after attrName");l=k}break;case"'":case'"':if(l===k||l===C){if(l===C&&(o.warning('attribute value must after "="'),r=e.slice(t,c)),t=c+1,!((c=e.indexOf(p,t))>0))throw new Error("attribute value no end '"+p+"' match");s=e.slice(t,c).replace(/&#?\w+;/g,a),n.add(r,s,t-1),l=R}else{if(l!=S)throw new Error('attribute value must after "="');s=e.slice(t,c).replace(/&#?\w+;/g,a),n.add(r,s,t),o.warning('attribute "'+r+'" missed start quot('+p+")!!"),t=c+1,l=R}break;case"/":switch(l){case y:n.setTagName(e.slice(t,c));case R:case w:case _:l=_,n.closed=!0;case S:case C:case b:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),l==y&&n.setTagName(e.slice(t,c)),c;case">":switch(l){case y:n.setTagName(e.slice(t,c));case R:case w:case _:break;case S:case C:s=e.slice(t,c),"/"===s.slice(-1)&&(n.closed=!0,s=s.slice(0,-1));case b:l===b&&(s=r),l==S?(o.warning('attribute "'+s+'" missed quot(")!!'),n.add(r,s.replace(/&#?\w+;/g,a),t)):("http://www.w3.org/1999/xhtml"===i[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),n.add(s,s,t));break;case k:throw new Error("attribute value missed!!")}return c;case"\x80":p=" ";default:if(p<=" ")switch(l){case y:n.setTagName(e.slice(t,c)),l=w;break;case C:r=e.slice(t,c),l=b;break;case S:var s=e.slice(t,c).replace(/&#?\w+;/g,a);o.warning('attribute "'+s+'" missed quot(")!!'),n.add(r,s,t);case R:l=w}else switch(l){case b:n.tagName;"http://www.w3.org/1999/xhtml"===i[""]&&r.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+r+'" missed value!! "'+r+'" instead2!!'),n.add(r,r,t),t=c,l=C;break;case R:o.warning('attribute space is required"'+r+'"!!');case w:l=C,t=c;break;case k:l=S,t=c;break;case _:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function s(e,t,n){for(var i=e.tagName,a=null,o=e.length;o--;){var r=e[o],s=r.qName,c=r.value,l=s.indexOf(":");if(l>0)var u=r.prefix=s.slice(0,l),d=s.slice(l+1),m="xmlns"===u&&d;else d=s,u=null,m="xmlns"===s&&"";r.localName=d,!1!==m&&(null==a&&(a={},p(n,n={})),n[m]=a[m]=c,r.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(m,c))}for(var o=e.length;o--;){r=e[o];var u=r.prefix;u&&("xml"===u&&(r.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==u&&(r.uri=n[u||""]))}var l=i.indexOf(":");l>0?(u=e.prefix=i.slice(0,l),d=e.localName=i.slice(l+1)):(u=null,d=e.localName=i);var f=e.uri=n[u||""];if(t.startElement(f,d,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=a,!0;if(t.endElement(f,d,i),a)for(u in a)t.endPrefixMapping(u)}function c(e,t,n,i,a){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("",t),r=e.substring(t+1,o);if(/[&<]/.test(r))return/^script$/i.test(n)?(a.characters(r,0,r.length),o):(r=r.replace(/&#?\w+;/g,i),a.characters(r,0,r.length),o)}return t+1}function l(e,t,n,i){var a=i[n];return null==a&&(a=e.lastIndexOf(""),at?(n.comment(e,t+4,a-t-4),a+3):(i.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var a=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,a-t-9),n.endCDATA(),a+3}var o=h(e,t),r=o.length;if(r>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],c=r>3&&/^public$/i.test(o[2][0])&&o[3][0],l=r>4&&o[4][0],p=o[r-1];return n.startDTD(s,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),p.index+p[0].length}}return-1}function d(e,t,n){var i=e.indexOf("?>",t);if(i){var a=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(a){a[0].length;return n.processingInstruction(a[1],a[2]),i+2}return-1}return-1}function m(e){}function f(e,t){return e.__proto__=t,e}function h(e,t){var n,i=[],a=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(a.lastIndex=t,a.exec(e);n=a.exec(e);)if(i.push(n),n[1])return i}var g=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),x=new RegExp("^"+g.source+v.source+"*(?::"+g.source+v.source+"*)?$"),y=0,C=1,b=2,k=3,S=4,R=5,w=6,_=7;i.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),p(t,t={}),a(e,t,n,i,this.errorHandler),i.endDocument()}},m.prototype={setTagName:function(e){if(!x.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!x.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},f({},f.prototype)instanceof f||(f=function(e,t){function n(){}n.prototype=t,n=new n;for(t in e)n[t]=e[t];return n}),t.XMLReader=i},function(e,t,n){"use strict";function i(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(r,"")}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=new RegExp("^([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd])|^((x|X)(m|M)(l|L))|([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd-.0-9\xb7\u0300-\u036f\u203f\u2040])","g"),r=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,s=function(e){var t=[];if(e instanceof Object)for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},c=function(e,t){var n=function(e,n,i,a,r){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(a).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(o,"_"));var l=[c,"<",e,i||""];return n&&n.length>0?(l.push(">"),l.push(n),r&&l.push(c),l.push("")):l.push("/>"),l.join("")};return function e(o,r,c){var l=void 0===o?"undefined":a(o);switch((Array.isArray?Array.isArray(o):o instanceof Array)?l="array":o instanceof Date&&(l="date"),l){case"array":var p=[];return o.map(function(t){p.push(e(t,1,c+1))}),t.prettyPrint&&p.push("\n"),p.join("");case"date":return o.toJSON?o.toJSON():o+"";case"object":var u=[];for(var d in o)if(o.hasOwnProperty(d))if(o[d]instanceof Array)for(var m in o[d])o[d].hasOwnProperty(m)&&u.push(n(d,e(o[d][m],0,c+1),null,c+1,s(o[d][m]).length));else u.push(n(d,e(o[d],0,c+1),null,c+1));return t.prettyPrint&&u.length>0&&u.push("\n"),u.join("");case"function":return o();default:return t.escape?i(o):""+o}}(e,0,0)},l=function(e){var t=['"),t.join("")},p=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" "}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var n="",i="";return t&&("object"==(void 0===t?"undefined":a(t))?(t.xmlHeader&&(n=l(!!t.xmlHeader.standalone)),void 0!==t.docType&&(i="")):n=l()),t=t||{},[n,t.prettyPrint&&i?"\n":"",i,c(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")};e.exports=p},function(e,t,n){"use strict";var i=n(5),a=n(0),o={},r=function(e,t){o[t]=e[t],e[t]=function(e,n){e.SkipTask?o[t].call(this,e,n):this._addTask(t,e,n)}},s=function(e){var t=[],n={},r=0,s=0,c=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),t},l=function(){var n,i=function(){n=0,e.emit("task-list-update",{list:a.map(t,c)}),e.emit("list-update",{list:a.map(t,c)})};return function(){n||(n=setTimeout(i))}}(),p=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var i=0;ie.options.UploadQueueSize;){var a="waiting"===t[i].state||"checking"===t[i].state||"uploading"===t[i].state;t[i]&&a?i++:(n[t[i].id]&&delete n[t[i].id],t.splice(i,1),s--)}l()}},u=function n(){if(!(r>=e.options.FileParallelLimit)){for(;t[s]&&"waiting"!==t[s].state;)s++;if(!(s>=t.length)){var i=t[s];s++,r++,i.state="checking",i.params.onTaskStart&&i.params.onTaskStart(c(i)),!i.params.UploadData&&(i.params.UploadData={});var u=a.formatParams(i.api,i.params);o[i.api].call(e,u,function(t,a){e._isRunningTask(i.id)&&("checking"!==i.state&&"uploading"!==i.state||(i.state=t?"error":"success",t&&(i.error=t),r--,l(),n(),i.callback&&i.callback(t,a),"success"===i.state&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)),p())}),l(),setTimeout(n)}}},d=function(t,a){var o=n[t];if(o){var s=o&&"waiting"===o.state,c=o&&("checking"===o.state||"uploading"===o.state);if("canceled"===a&&"canceled"!==o.state||"paused"===a&&s||"paused"===a&&c){if("paused"===a&&o.params.Body&&"function"==typeof o.params.Body.pipe)return void console.error("stream not support pause");o.state=a,e.emit("inner-kill-task",{TaskId:t,toState:a});try{var d=o&&o.params&&o.params.UploadData.UploadId}catch(e){}"canceled"===a&&d&&i.removeUsing(d),l(),c&&(r--,u()),"canceled"===a&&(o.params&&(delete o.params.UploadData,delete o.params.Body,delete o.params),delete o.callback)}p()}};e._addTasks=function(t){a.each(t,function(t){e._addTask(t.api,t.params,t.callback,!0)}),l()},e._addTask=function(i,o,r,s){"sliceUploadFile"!==i||a.canFileSlice()||(i="postObject"),o=a.formatParams(i,o);var c=a.uuid();o.TaskId=c,o.onTaskReady&&o.onTaskReady(c);var d={params:o,callback:r,api:i,index:t.length,id:c,Bucket:o.Bucket,Region:o.Region,Key:o.Key,FilePath:o.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null},m=o.onHashProgress;o.onHashProgress=function(t){e._isRunningTask(d.id)&&(d.hashPercent=t.percent,m&&m(t),l())};var f=o.onProgress;return o.onProgress=function(t){e._isRunningTask(d.id)&&("checking"===d.state&&(d.state="uploading"),d.loaded=t.loaded,d.size=t.total,d.speed=t.speed,d.percent=t.percent,f&&f(t),l())},a.getFileSize(i,o,function(e,i){if(e)return void r(e);n[c]=d,t.push(d),d.size=i,!s&&l(),u(),p()}),c},e._isRunningTask=function(e){var t=n[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return a.map(t,c)},e.cancelTask=function(e){d(e,"canceled")},e.pauseTask=function(e){d(e,"paused")},e.restartTask=function(e){var t=n[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",l(),s=Math.min(s,t.index),u())},e.isUploadRunning=function(){return r||s/gi,"<$1Rule>"),i=i.replace(/<(\/?)Tags>/gi,"<$1Tag>");var a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Re.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"replication",headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function _(e,t){Re.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var i={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else e||!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=n.ReplicationConfiguration.Rule,delete n.ReplicationConfiguration.Rule),t(e,n)})}function A(e,t){Re.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function T(e,t){if(!e.WebsiteConfiguration)return void t({error:"missing param WebsiteConfiguration"});var n=Te.clone(e.WebsiteConfiguration||{}),i=n.RoutingRules||n.RoutingRule||[];i=Te.isArray(i)?i:[i],delete n.RoutingRule,delete n.RoutingRules,i.length&&(n.RoutingRules={RoutingRule:i});var a=Te.json2xml({WebsiteConfiguration:n}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"website",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function B(e,t){Re.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var a=n.WebsiteConfiguration||{};if(a.RoutingRules){var o=Te.clone(a.RoutingRules.RoutingRule||[]);o=Te.makeArray(o),a.RoutingRules=o}t(null,{WebsiteConfiguration:a,statusCode:n.statusCode,headers:n.headers})}})}function E(e,t){Re.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function O(e,t){if(!e.RefererConfiguration)return void t({error:"missing param RefererConfiguration"});var n=Te.clone(e.RefererConfiguration||{}),i=n.DomainList||{},a=i.Domains||i.Domain||[];a=Te.isArray(a)?a:[a],a.length&&(n.DomainList={Domain:a});var o=Te.json2xml({RefererConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Re.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"referer",headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function D(e,t){Re.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var a=n.RefererConfiguration||{};if(a.DomainList){var o=Te.makeArray(a.DomainList.Domain||[]);a.DomainList={Domains:o}}t(null,{RefererConfiguration:a,statusCode:n.statusCode,headers:n.headers})}})}function I(e,t){var n=e.DomainConfiguration||{},i=n.DomainRule||e.DomainRule||[];i=Te.clone(i);var a=Te.json2xml({DomainConfiguration:{DomainRule:i}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"domain",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function N(e,t){Re.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){if(e)return t(e);var i=[];try{i=n.DomainConfiguration.DomainRule||[]}catch(e){}i=Te.clone(Te.isArray(i)?i:[i]),t(null,{DomainRule:i,statusCode:n.statusCode,headers:n.headers})})}function P(e,t){Re.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function j(e,t){var n=e.OriginConfiguration||{},i=n.OriginRule||e.OriginRule||[];i=Te.clone(i);var a=Te.json2xml({OriginConfiguration:{OriginRule:i}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"origin",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function M(e,t){Re.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){if(e)return t(e);var i=[];try{i=n.OriginConfiguration.OriginRule||[]}catch(e){}i=Te.clone(Te.isArray(i)?i:[i]),t(null,{OriginRule:i,statusCode:n.statusCode,headers:n.headers})})}function U(e,t){Re.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function H(e,t){var n=Te.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(n)),Re.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function F(e,t){Re.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(e,n){if(e)return t(e);delete n.BucketLoggingStatus._xmlns,t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})})}function L(e,t){var n=Te.clone(e.InventoryConfiguration);if(n.OptionalFields){var i=n.OptionalFields||[];n.OptionalFields={Field:i}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var a=n.Destination.COSBucketDestination.Encryption;Object.keys(a).indexOf("SSECOS")>-1&&(a["SSE-COS"]=a.SSECOS,delete a.SSECOS)}var o=Te.json2xml({InventoryConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Re.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"inventory",qs:{id:e.Id},headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function z(e,t){Re.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){if(e)return t(e);var i=n.InventoryConfiguration;if(i&&i.OptionalFields&&i.OptionalFields.Field){var a=i.OptionalFields.Field;Te.isArray(a)||(a=[a]),i.OptionalFields=a}if(i.Destination&&i.Destination.COSBucketDestination&&i.Destination.COSBucketDestination.Encryption){var o=i.Destination.COSBucketDestination.Encryption;Object.keys(o).indexOf("SSE-COS")>-1&&(o.SSECOS=o["SSE-COS"],delete o["SSE-COS"])}t(null,{InventoryConfiguration:i,statusCode:n.statusCode,headers:n.headers})})}function K(e,t){Re.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken}},function(e,n){if(e)return t(e);var i=n.ListInventoryConfigurationResult,a=i.InventoryConfiguration||[];a=Te.isArray(a)?a:[a],delete i.InventoryConfiguration,Te.each(a,function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;Te.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}}),i.InventoryConfigurations=a,Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function q(e,t){Re.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function G(e,t){if(!e.AccelerateConfiguration)return void t({error:"missing param AccelerateConfiguration"});var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},i=Te.json2xml(n),a={};a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Re.call(this,{Interface:"putBucketAccelerate",Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"accelerate",headers:a},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function V(e,t){Re.call(this,{Interface:"getBucketAccelerate",Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)})}function X(e,t){Re.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(n,i){if(n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0,statusCode:a}):t(n)}i.ETag=Te.attr(i.headers,"etag",""),t(null,i)})}function W(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,Re.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions"},function(e,n){if(e)return t(e);var i=n.ListVersionsResult||{},a=i.DeleteMarker||[];a=Te.isArray(a)?a:[a];var o=i.Version||[];o=Te.isArray(o)?o:[o];var r=Te.clone(i);delete r.DeleteMarker,delete r.Version,Te.extend(r,{DeleteMarkers:a,Versions:o,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function $(e,t){var n=e.Query||{},i=e.QueryString||"";n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,Re.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,qs:n,qsStr:i,rawBody:!0},function(n,i){if(n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0}):t(n)}t(null,{Body:i.body,ETag:Te.attr(i.headers,"etag",""),statusCode:i.statusCode,headers:i.headers})})}function Q(e,t){var n=this,i=e.ContentLength,a=Te.throttleOnProgress.call(n,i,e.onProgress),o=e.Headers;o["Cache-Control"]||o["cache-control"]||(o["Cache-Control"]=""),o["Content-Type"]||o["content-type"]||(o["Content-Type"]=Be.getType(e.Key)||"application/octet-stream"),Te.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(r){r&&(o["Content-MD5"]=Te.binaryBase64(r)),void 0!==e.ContentLength&&(o["Content-Length"]=e.ContentLength),a(null,!0),Re.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:a},function(o,r){if(o)return a(null,!0),t(o);a({loaded:i,total:i},!0);var s=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});s=s.substr(s.indexOf("://")+3),r.Location=s,r.ETag=Te.attr(r.headers,"etag",""),t(null,r)})})}function J(e,t){var n=this,i={},a=e.FilePath;if(!a)return void t({error:"missing param FilePath"});i["Cache-Control"]=e.CacheControl,i["Content-Disposition"]=e.ContentDisposition,i["Content-Encoding"]=e.ContentEncoding,i["Content-MD5"]=e.ContentMD5,i["Content-Length"]=e.ContentLength,i["Content-Type"]=e.ContentType,i.Expect=e.Expect,i.Expires=e.Expires,i["x-cos-acl"]=e.ACL,i["x-cos-grant-read"]=e.GrantRead,i["x-cos-grant-write"]=e.GrantWrite,i["x-cos-grant-full-control"]=e.GrantFullControl,i["x-cos-storage-class"]=e.StorageClass,i["x-cos-mime-limit"]=e.MimeLimit,i["x-cos-traffic-limit"]=e.TrafficLimit,delete i["Content-Length"],delete i["content-length"];for(var o in e)o.indexOf("x-cos-meta-")>-1&&(i[o]=e[o]);var r=Te.throttleOnProgress.call(n,i["Content-Length"],e.onProgress);Re.call(this,{Action:"name/cos:PostObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:i,qs:e.Query,filePath:a,onProgress:r},function(i,o){if(r(null,!0),i)return t(i);if(o&&o.headers){var s=o.headers,c=s.etag||s.Etag||s.ETag||"",l=a.substr(a.lastIndexOf("/")+1),p=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key.replace(/\$\{filename\}/g,l),isLocation:!0});return t(null,{Location:p,statusCode:o.statusCode,headers:s,ETag:c})}t(null,o)})}function Y(e,t){Re.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId},function(e,n){if(e){var i=e.statusCode;return i&&204===i?t(null,{statusCode:i}):i&&404===i?t(null,{BucketNotFound:!0,statusCode:i}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})})}function Z(e,t){Re.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"acl"},function(e,n){if(e)return t(e);var i=n.AccessControlPolicy||{},a=i.Owner||{},o=i.AccessControlList&&i.AccessControlList.Grant||[];o=Te.isArray(o)?o:[o];var r=ye(i);n.headers&&n.headers["x-cos-acl"]&&(r.ACL=n.headers["x-cos-acl"]),r=Te.extend(r,{Owner:a,Grants:o,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function ee(e,t){var n=e.Headers,i="";if(e.AccessControlPolicy){var a=Te.clone(e.AccessControlPolicy||{}),o=a.Grants||a.Grant;o=Te.isArray(o)?o:[o],delete a.Grant,delete a.Grants,a.AccessControlList={Grant:o},i=Te.json2xml({AccessControlPolicy:a}),n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(i))}Te.each(n,function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=Ce(n[t]))}),Re.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:i},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function te(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,Re.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n},function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var i=n.headers||{};t(null,{AccessControlAllowOrigin:i["access-control-allow-origin"],AccessControlAllowMethods:i["access-control-allow-methods"],AccessControlAllowHeaders:i["access-control-allow-headers"],AccessControlExposeHeaders:i["access-control-expose-headers"],AccessControlMaxAge:i["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})})}function ne(e,t){var n=e.Headers;!n["Cache-Control"]&&n["cache-control"]&&(n["Cache-Control"]="");var i=e.CopySource||"",a=i.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!a)return void t({error:"CopySource format error"});var o=a[1],r=a[3],s=decodeURIComponent(a[4]);Re.call(this,{Scope:[{action:"name/cos:GetObject",bucket:o,region:r,prefix:s},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(e,n){if(e)return t(e);var i=Te.clone(n.CopyObjectResult||{});Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function ie(e,t){var n=e.CopySource||"",i=n.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!i)return void t({error:"CopySource format error"});var a=i[1],o=i[3],r=decodeURIComponent(i[4]);Re.call(this,{Scope:[{action:"name/cos:GetObject",bucket:a,region:o,prefix:r},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers},function(e,n){if(e)return t(e);var i=Te.clone(n.CopyPartResult||{});Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function ae(e,t){var n=e.Objects||[],i=e.Quiet;n=Te.isArray(n)?n:[n];var a=Te.json2xml({Delete:{Object:n,Quiet:i||!1}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a));var r=Te.map(n,function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}});Re.call(this,{Scope:r,method:"POST",Bucket:e.Bucket,Region:e.Region,body:a,action:"delete",headers:o},function(e,n){if(e)return t(e);var i=n.DeleteResult||{},a=i.Deleted||[],o=i.Error||[];a=Te.isArray(a)?a:[a],o=Te.isArray(o)?o:[o];var r=Te.clone(i);Te.extend(r,{Error:o,Deleted:a,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function oe(e,t){var n=e.Headers;if(!e.RestoreRequest)return void t({error:"missing param RestoreRequest"});var i=e.RestoreRequest||{},a=Te.json2xml({RestoreRequest:i});n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:a,action:"restore",headers:n},function(e,n){t(e,n)})}function re(e,t){var n=e.Tagging||{},i=n.TagSet||n.Tags||e.Tags||[];i=Te.clone(Te.isArray(i)?i:[i]);var a=Te.json2xml({Tagging:{TagSet:{Tag:i}}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Interface:"putObjectTagging",Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:a,action:"tagging",headers:o,VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function se(e,t){Re.call(this,{Interface:"getObjectTagging",Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var i={Tags:[],statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else{var a=[];try{a=n.Tagging.TagSet.Tag||[]}catch(e){}a=Te.clone(Te.isArray(a)?a:[a]),t(null,{Tags:a,statusCode:n.statusCode,headers:n.headers})}})}function ce(e,t){Re.call(this,{Interface:"deleteObjectTagging",Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function le(e,t){var n=this,i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=Be.getType(e.Key)||"application/octet-stream"),Re.call(n,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query},function(e,n){return e?t(e):(n=Te.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,Te.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)})}function pe(e,t){var n=this;Te.getFileSize("multipartUpload",e,function(){Te.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(i){i&&(e.Headers["Content-MD5"]=Te.binaryBase64(i)),Re.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null},function(e,n){if(e)return t(e);t(null,{ETag:Te.attr(n.headers,"etag",{}),statusCode:n.statusCode,headers:n.headers})})})})}function ue(e,t){for(var n=this,i=e.UploadId,a=e.Parts,o=0,r=a.length;o-1?function(e){var t=e.match(/q-url-param-list.*?(?=&)/g)[0],n="q-url-param-list="+encodeURIComponent(t.replace(/q-url-param-list=/,"")).toLowerCase(),i=new RegExp(t,"g");return e.replace(i,n)}(n.Authorization):"sign="+encodeURIComponent(n.Authorization)),n.XCosSecurityToken&&(o+="&x-cos-security-token="+n.XCosSecurityToken),n.ClientIP&&(o+="&clientIP="+n.ClientIP),n.ClientUA&&(o+="&clientUA="+n.ClientUA),n.Token&&(o+="&token="+n.Token),a&&(o+="&"+a),setTimeout(function(){t(null,{Url:o})})}});return s?(o+="?"+s.Authorization+(s.XCosSecurityToken?"&x-cos-security-token="+s.XCosSecurityToken:""),a&&(o+="&"+a)):a&&(o+="?"+a),o}function ye(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},i=e&&e.AccessControlList||{},a=i.Grant;a&&(a=Te.isArray(a)?a:[a]);var o={READ:0,WRITE:0,FULL_CONTROL:0};return a&&a.length&&Te.each(a,function(i){"qcs::cam::anyone:anyone"===i.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===i.Grantee.URI?o[i.Permission]=1:i.Grantee.ID!==e.Owner.ID&&t[n[i.Permission]].push('id="'+i.Grantee.ID+'"')}),o.FULL_CONTROL||o.WRITE&&o.READ?t.ACL="public-read-write":o.READ?t.ACL="public-read":t.ACL="private",Te.each(n,function(e){t[e]=Ce(t[e].join(","))}),t}function Ce(e){var t,n,i=e.split(","),a={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(a="{Bucket}."+a)),a=a.replace(/\{\{AppId\}\}/gi,i).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,o).replace(/\{\{.*?\}\}/gi,""),a=a.replace(/\{AppId\}/gi,i).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,o).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(a)||(a="https://"+a),"/"===a.slice(-1)&&(a=a.slice(0,-1));var s=a;return e.ForcePathStyle&&(s+="/"+t),s+="/",r&&(s+=Te.camSafeUrlEncode(r).replace(/%2F/g,"/")),e.isLocation&&(s=s.replace(/^https?:\/\//,"")),s}function ke(e,t){var n=Te.clone(e.Headers),i="";Te.each(n,function(e,t){(""===e||["content-type","cache-control"].indexOf(t.toLowerCase())>-1)&&delete n[t],"host"===t.toLowerCase()&&(i=e)}),!i&&e.SignHost&&(n.Host=e.SignHost);var a=function(e){var n=!1,i=e.Authorization;if(i)if(i.indexOf(" ")>-1)n=!1;else if(i.indexOf("q-sign-algorithm=")>-1&&i.indexOf("q-ak=")>-1&&i.indexOf("q-sign-time=")>-1&&i.indexOf("q-key-time=")>-1&&i.indexOf("q-url-param-list=")>-1)n=!0;else try{i=Ae.atob(i),i.indexOf("a=")>-1&&i.indexOf("k=")>-1&&i.indexOf("t=")>-1&&i.indexOf("r=")>-1&&i.indexOf("b=")>-1&&(n=!0)}catch(e){}n?t&&t(null,e):t&&t("authorization error")},o=this,r=e.Bucket||"",s=e.Region||"",c="name/cos:PostObject"!==e.Action&&e.Key?e.Key:"";o.options.ForcePathStyle&&r&&(c=r+"/"+c);var l="/"+c,p={},u=e.Scope;if(!u){var d=e.Action||"",m=e.ResourceKey||e.Key||"";u=e.Scope||[{action:d,bucket:r,region:s,prefix:m}]}var f=Te.md5(JSON.stringify(u));o._StsCache=o._StsCache||[],function(){var e,t;for(e=o._StsCache.length-1;e>=0;e--){t=o._StsCache[e];var n=Math.round(Te.getSkewTime(o.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)o._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===f){p=t;break}}}();var h=function(){var t=p.StartTime&&p.ExpiredTime?p.StartTime+";"+p.ExpiredTime:"",i=Te.getAuth({SecretId:p.TmpSecretId,SecretKey:p.TmpSecretKey,Method:e.Method,Pathname:l,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:o.options.SystemClockOffset,KeyTime:t}),r={Authorization:i,XCosSecurityToken:p.XCosSecurityToken||"",Token:p.Token||"",ClientIP:p.ClientIP||"",ClientUA:p.ClientUA||""};a(r)};if(p.ExpiredTime&&p.ExpiredTime-Te.getSkewTime(o.options.SystemClockOffset)/1e3>60)h();else if(o.options.getAuthorization)o.options.getAuthorization.call(o,{Bucket:r,Region:s,Method:e.Method,Key:c,Pathname:l,Query:e.Query,Headers:n,Scope:u,SystemClockOffset:o.options.SystemClockOffset},function(e){"string"==typeof e&&(e={Authorization:e}),e.TmpSecretId&&e.TmpSecretKey&&e.XCosSecurityToken&&e.ExpiredTime?(p=e||{},p.Scope=u,p.ScopeKey=f,o._StsCache.push(p),h()):a(e)});else{if(!o.options.getSTS)return function(){var t=Te.getAuth({SecretId:e.SecretId||o.options.SecretId,SecretKey:e.SecretKey||o.options.SecretKey,Method:e.Method,Pathname:l,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:o.options.SystemClockOffset}),i={Authorization:t,XCosSecurityToken:o.options.XCosSecurityToken};return a(i),i}();o.options.getSTS.call(o,{Bucket:r,Region:s},function(e){p=e||{},p.Scope=u,p.ScopeKey=f,p.TmpSecretId=p.SecretId,p.TmpSecretKey=p.SecretKey,o._StsCache.push(p),h()})}return""}function Se(e){var t=!1,n=!1,i=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var a=e.error.Code,o=e.error.Message;("RequestTimeTooSkewed"===a||"AccessDenied"===a&&"Request has expired"===o)&&(n=!0)}catch(e){}if(e)if(n&&i){var r=Date.parse(i);this.options.CorrectClockSkew&&Math.abs(Te.getSkewTime(this.options.SystemClockOffset)-r)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=r-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0);return t}function Re(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=Te.clearKey(e.qs),e.headers&&(e.headers=Te.clearKey(e.headers)),e.qs&&(e.qs=Te.clearKey(e.qs));var i=Te.clone(e.qs);e.action&&(i[e.action]="");var a=e.url||e.Url,o=e.SignHost||Ee.call(this,{Bucket:e.Bucket,Region:e.Region,Url:a});!function a(r){var s=n.options.SystemClockOffset;ke.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:i,Headers:e.headers,SignHost:o,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope},function(i,o){if(i)return void t(i);e.AuthData=o,we.call(n,e,function(i,o){i&&r<2&&(s!==n.options.SystemClockOffset||Se.call(n,i))?(e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,delete e.headers["x-cos-security-token"]),a(r+1)):t(i,o)})})}(1)}function we(e,t){var n=this,i=e.TaskId;if(!i||n._isRunningTask(i)){var a=e.Bucket,o=e.Region,r=e.Key,s=e.method||"GET",c=e.url||e.Url,l=e.body,p=e.json,u=e.rawBody;n.options.UseAccelerate&&(o="accelerate"),c=c||be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:a,region:o,object:r}),e.action&&(c=c+"?"+e.action),e.qsStr&&(c=c.indexOf("?")>-1?c+"&"+e.qsStr:c+"?"+e.qsStr);var d={method:s,url:c,headers:e.headers,qs:e.qs,filePath:e.filePath,body:l,json:p},m="x-cos-security-token";Te.isCIHost(c)&&(m="x-ci-security-token"),d.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(d.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(d.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(d.headers.clientUA=e.AuthData.ClientUA),e.AuthData.XCosSecurityToken&&(d.headers[m]=e.AuthData.XCosSecurityToken),d.headers&&(d.headers=Te.clearKey(d.headers)),d=Te.clearKey(d),e.onProgress&&"function"==typeof e.onProgress&&(d.onProgress=function(t){if(!i||n._isRunningTask(i)){var a=t?t.loaded:0;e.onProgress({loaded:a,total:t.total})}}),this.options.Timeout&&(d.timeout=this.options.Timeout),n.options.ForcePathStyle&&(d.pathStyle=n.options.ForcePathStyle),n.emit("before-send",d);var f=_e(d,function(e,a,o){if("abort"!==e){var r,s=function(e,o){if(i&&n.off("inner-kill-task",h),!r){r=!0;var s={};a&&a.statusCode&&(s.statusCode=a.statusCode),a&&a.headers&&(s.headers=a.headers),e?(e=Te.extend(e||{},s),t(e,null)):(o=Te.extend(o||{},s),t(null,o)),f=null}};if(e)return void s({error:e});var c;if(u)c={},c.body=o;else try{c=o&&o.indexOf("<")>-1&&o.indexOf(">")>-1&&Te.xml2json(o)||{}}catch(e){c=o||{}}var l=a.statusCode;return 2===Math.floor(l/100)?c.Error?void s({error:c.Error}):void s(null,c):void s({error:c.Error||c})}}),h=function e(t){t.TaskId===i&&(f&&f.abort&&f.abort(),n.off("inner-kill-task",e))};i&&n.on("inner-kill-task",h)}}var _e=n(19),Ae=n(3),Te=n(0),Be=n(20),Ee=function(e){if(!e.Bucket||!e.Bucket)return"";var t=e.Url||be({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:e.Region}),n=t.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");return new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$").test(n)?n:""},Oe={getService:i,putBucket:a,headBucket:o,getBucket:r,deleteBucket:s,putBucketAcl:c,getBucketAcl:l,putBucketCors:p,getBucketCors:u,deleteBucketCors:d,getBucketLocation:m,getBucketPolicy:h,putBucketPolicy:f,deleteBucketPolicy:g,putBucketTagging:v,getBucketTagging:x,deleteBucketTagging:y,putBucketLifecycle:C,getBucketLifecycle:b,deleteBucketLifecycle:k,putBucketVersioning:S,getBucketVersioning:R,putBucketReplication:w,getBucketReplication:_,deleteBucketReplication:A,putBucketWebsite:T,getBucketWebsite:B,deleteBucketWebsite:E,putBucketReferer:O,getBucketReferer:D,putBucketDomain:I,getBucketDomain:N,deleteBucketDomain:P,putBucketOrigin:j,getBucketOrigin:M,deleteBucketOrigin:U,putBucketLogging:H,getBucketLogging:F,putBucketInventory:L,getBucketInventory:z,listBucketInventory:K,deleteBucketInventory:q,putBucketAccelerate:G,getBucketAccelerate:V,getObject:$,headObject:X,listObjectVersions:W,putObject:Q,postObject:J,deleteObject:Y,getObjectAcl:Z,putObjectAcl:ee,optionsObject:te,putObjectCopy:ne,deleteMultipleObject:ae,restoreObject:oe,putObjectTagging:re,getObjectTagging:se,deleteObjectTagging:ce,appendObject:he,uploadPartCopy:ie,multipartInit:le,multipartUpload:pe,multipartComplete:ue,multipartList:de,multipartListPart:me,multipartAbort:fe,request:ge,getObjectUrl:xe,getAuth:ve};e.exports.init=function(e,t){t.transferToTaskMethod(Oe,"postObject"),t.transferToTaskMethod(Oe,"putObject"),Te.each(Oe,function(t,n){e.prototype[n]=Te.apiWrapper(n,t)})}},function(e,t,n){"use strict";function i(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function a(e,t){var n=[];for(var a in e)e.hasOwnProperty(a)&&n.push(t?i(a).toLowerCase():a);return n.sort(function(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),e===t?0:e>t?1:-1})}var o=function(e,t){var n,o,r,s=[],c=a(e);for(n=0;n-1||m.indexOf(f)>-1)&&(d[f]=e.headers[f]);a["x-cos-acl"]&&(d.acl=a["x-cos-acl"]),!d["Content-Type"]&&(d["Content-Type"]=""),n=wx.uploadFile({url:r,method:s,name:"file",header:a,filePath:i,formData:d,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}}),n.onProgressUpdate(function(e){c&&c({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend,progress:e.progress/100})})}else{var h=e.qs&&o(e.qs,!0)||"";h&&(r+=(r.indexOf("?")>-1?"&":"?")+h),a["Content-Length"]&&delete a["Content-Length"],n=wx.request({url:r,method:s,header:a,dataType:"text",data:e.body,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}})}return n};e.exports=r},function(e,t,n){"use strict";var i=n(21);e.exports=new i(n(22),n(23))},function(e,t,n){"use strict";function i(){this._types=Object.create(null),this._extensions=Object.create(null);for(var e=0;em)return t(null,!1);if(n>1){if(Math.max(e[0].Size,e[1].Size)!==d)return t(null,!1)}!function i(a){if(a=c.length)return void S.emit("has_and_check_upload_id",t);var p=c[o];return C.isInArray(t,p)?v.using[p]?void e(o+1):void r.call(l,{Bucket:i,Region:a,Key:s,UploadId:p},function(t,i){l._isRunningTask(n)&&(t?(v.removeUploadId(p),e(o+1)):S.emit("upload_id_available",{UploadId:p,PartList:i.PartList}))}):(v.removeUploadId(p),void e(o+1))}(0)}),S.on("get_remote_upload_id_list",function(){o.call(l,{Bucket:i,Region:a,Key:s},function(t,a){if(l._isRunningTask(n)){if(t)return S.emit("error",t);var o=C.filter(a.UploadList,function(e){return e.Key===s&&(!c||e.StorageClass.toUpperCase()===c.toUpperCase())}).reverse().map(function(e){return e.UploadId||e.UploadID});if(o.length)S.emit("seek_local_avail_upload_id",o);else{var r,p=v.getFileId(e.FileStat,e.ChunkSize,i,s);p&&(r=v.getUploadIdList(p))&&C.each(r,function(e){v.removeUploadId(e)}),S.emit("no_available_upload_id")}}})}),S.emit("get_remote_upload_id_list")}function o(e,t){var n=this,i=[],a={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key};!function e(){n.multipartList(a,function(n,o){if(n)return t(n);i.push.apply(i,o.Upload||[]),"true"===o.IsTruncated?(a.KeyMarker=o.NextKeyMarker,a.UploadIdMarker=o.NextUploadIdMarker,e()):t(null,{UploadList:i})})}()}function r(e,t){var n=this,i=[],a={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId};!function e(){n.multipartListPart(a,function(n,o){if(n)return t(n);i.push.apply(i,o.Part||[]),"true"===o.IsTruncated?(a.PartNumberMarker=o.NextPartNumberMarker,e()):t(null,{PartList:i})})}()}function s(e,t){var n=this,i=e.TaskId,a=e.Bucket,o=e.Region,r=e.Key,s=e.UploadData,l=e.FileSize,p=e.SliceSize,u=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),d=e.FilePath,m=Math.ceil(l/p),f=0,h=e.ServerSideEncryption,g=C.filter(s.PartList,function(e){return e.Uploaded&&(f+=e.PartNumber>=m?l%p||p:p),!e.Uploaded}),v=e.onProgress;x.eachLimit(g,u,function(e,t){if(n._isRunningTask(i)){var u=e.PartNumber,m=Math.min(l,e.PartNumber*p)-(e.PartNumber-1)*p,g=0;c.call(n,{TaskId:i,Bucket:a,Region:o,Key:r,SliceSize:p,FileSize:l,PartNumber:u,ServerSideEncryption:h,FilePath:d,UploadData:s,onProgress:function(e){f+=e.loaded-g,g=e.loaded,v({loaded:f,total:l})}},function(a,o){n._isRunningTask(i)&&(a?f-=g:(f+=m-g,e.ETag=o.ETag),v({loaded:f,total:l}),t(a||null,o))})}},function(e){if(n._isRunningTask(i))return e?t(e):void t(null,{UploadId:s.UploadId,SliceList:s.PartList})})}function c(e,t){var n=this,i=e.TaskId,a=e.Bucket,o=e.Region,r=e.Key,s=e.FileSize,c=e.FilePath,l=1*e.PartNumber,p=e.SliceSize,u=e.ServerSideEncryption,d=e.UploadData,m=n.options.ChunkRetryTimes+1,f=e.Headers||{},h=p*(l-1),g=p,v=h+p;v>s&&(v=s,g=v-h);var y=["x-cos-traffic-limit","x-cos-mime-limit"],b={};C.each(f,function(e,t){y.indexOf(t)>-1&&(b[t]=e)}),C.fileSlice(c,h,v,function(s){var c=C.getFileMd5(s),p=c?C.binaryBase64(c):null,f=d.PartList[l-1];x.retry(m,function(t){n._isRunningTask(i)&&n.multipartUpload({TaskId:i,Bucket:a,Region:o,Key:r,ContentLength:g,PartNumber:l,UploadId:d.UploadId,ServerSideEncryption:u,Body:s,Headers:b,onProgress:e.onProgress,ContentMD5:p},function(e,a){if(n._isRunningTask(i))return e?t(e):(f.Uploaded=!0,t(null,a))})},function(e,a){if(n._isRunningTask(i))return t(e,a)})})}function l(e,t){var n=e.Bucket,i=e.Region,a=e.Key,o=e.UploadId,r=e.SliceList,s=this,c=this.options.ChunkRetryTimes+1,l=r.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});x.retry(c,function(e){s.multipartComplete({Bucket:n,Region:i,Key:a,UploadId:o,Parts:l},e)},function(e,n){t(e,n)})}function p(e,t){var n=e.Bucket,i=e.Region,a=e.Key,r=e.UploadId,s=e.Level||"task",c=e.AsyncLimit,l=this,p=new y;if(p.on("error",function(e){return t(e)}),p.on("get_abort_array",function(o){u.call(l,{Bucket:n,Region:i,Key:a,Headers:e.Headers,AsyncLimit:c,AbortArray:o},function(e,n){if(e)return t(e);t(null,n)})}),"bucket"===s)o.call(l,{Bucket:n,Region:i},function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])});else if("file"===s){if(!a)return t({error:"abort_upload_task_no_key"});o.call(l,{Bucket:n,Region:i,Key:a},function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])})}else{if("task"!==s)return t({error:"abort_unknown_level"});if(!r)return t({error:"abort_upload_task_no_id"});if(!a)return t({error:"abort_upload_task_no_key"});p.emit("get_abort_array",[{Key:a,UploadId:r}])}}function u(e,t){var n=e.Bucket,i=e.Region,a=e.Key,o=e.AbortArray,r=e.AsyncLimit||1,s=this,c=0,l=new Array(o.length);x.eachLimit(o,r,function(t,o){var r=c;if(a&&a!==t.Key)return l[r]={error:{KeyNotMatch:!0}},void o(null);var p=t.UploadId||t.UploadID;s.multipartAbort({Bucket:n,Region:i,Key:t.Key,Headers:e.Headers,UploadId:p},function(e){var a={Bucket:n,Region:i,Key:t.Key,UploadId:p};l[r]={error:e,task:a},o(null)}),c++},function(e){if(e)return t(e);for(var n=[],i=[],a=0,o=l.length;ai?"sliceUploadFile":"postObject";a.push({api:p,params:e,callback:l}),n._addTasks(a)}function m(e,t){var n=this,i=void 0===e.SliceSize?n.options.SliceSize:e.SliceSize,a=0,o=0,r=C.throttleOnProgress.call(n,o,e.onProgress),s=e.files.length,c=e.onFileFinish,l=Array(s),p=function(e,n,i){r(null,!0),c&&c(e,n,i),l[i.Index]={options:i,error:e,data:n},--s<=0&&t&&t(null,{files:l})},u=[];C.each(e.files,function(e,t){var n=e.FileSize,s={Index:t,TaskId:""};a+=n,C.each(e,function(e,t){"object"!==(void 0===e?"undefined":g(e))&&"function"!=typeof e&&(s[t]=e)});var c=e.onTaskReady;e.onTaskReady=function(e){s.TaskId=e,c&&c(e)};var l=0,d=e.onProgress;e.onProgress=function(e){o=o-l+e.loaded,l=e.loaded,d&&d(e),r({loaded:o,total:a})};var m=e.onFileFinish,f=function(e,t){m&&m(e,t),p&&p(e,t,s)},h=n>i?"sliceUploadFile":"postObject";u.push({api:h,params:e,callback:f})}),n._addTasks(u)}function f(e,t){var n=new y,i=this,a=e.Bucket,o=e.Region,r=e.Key,s=e.CopySource,c=s.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!c)return void t({error:"CopySource format error"});var l=c[1],p=c[3],u=decodeURIComponent(c[4]),d=void 0===e.CopySliceSize?i.options.CopySliceSize:e.CopySliceSize;d=Math.max(0,d);var m,f,g=e.CopyChunkSize||this.options.CopyChunkSize,v=this.options.CopyChunkParallelLimit,b=0;n.on("copy_slice_complete",function(e){i.multipartComplete({Bucket:a,Region:o,Key:r,UploadId:e.UploadId,Parts:e.PartList},function(e,n){if(e)return f(null,!0),t(e);f({loaded:m,total:m},!0),t(null,n)})}),n.on("get_copy_data_finish",function(e){x.eachLimit(e.PartList,v,function(t,n){var c=t.PartNumber,l=t.CopySourceRange,p=t.end-t.start,u=0;h.call(i,{Bucket:a,Region:o,Key:r,CopySource:s,UploadId:e.UploadId,PartNumber:c,CopySourceRange:l,onProgress:function(e){b+=e.loaded-u,u=e.loaded,f({loaded:b,total:m})}},function(e,i){if(e)return n(e);f({loaded:b,total:m}),b+=p-u,t.ETag=i.ETag,n(e||null,i)})},function(i){if(i)return f(null,!0),t(i);n.emit("copy_slice_complete",e)})}),n.on("get_file_size_finish",function(s){!function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,a=0;a"x-cos-meta-".length&&(s[t]=e)}),n.emit("get_file_size_finish",s)}})}function h(e,t){var n=e.TaskId,i=e.Bucket,a=e.Region,o=e.Key,r=e.CopySource,s=e.UploadId,c=1*e.PartNumber,l=e.CopySourceRange,p=this.options.ChunkRetryTimes+1,u=this;x.retry(p,function(t){u.uploadPartCopy({TaskId:n,Bucket:i,Region:a,Key:o,CopySource:r,UploadId:s,PartNumber:c,CopySourceRange:l,onProgress:e.onProgress},function(e,n){t(e||null,n)})},function(e,n){return t(e,n)})}var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v=n(5),x=n(25),y=n(4).EventProxy,C=n(0),b={sliceUploadFile:i,abortUploadTask:p,uploadFile:d,uploadFiles:m,sliceCopyFile:f};e.exports.init=function(e,t){t.transferToTaskMethod(b,"sliceUploadFile"),C.each(b,function(t,n){e.prototype[n]=C.apiWrapper(n,t)})}},function(e,t,n){"use strict";var i=function(e,t,n,i){if(i=i||function(){},!e.length||t<=0)return i();var a=0,o=0,r=0;!function s(){if(a>=e.length)return i();for(;r=e.length?i():s())})}()},a=function(e,t,n){e<1?n():function i(a){t(function(t,o){t&&at?1:-1})}function o(e){return d(e,function(e){return"object"===(void 0===e?"undefined":f(e))&&null!==e?o(e):e})}function r(e,t,n){return e&&t in e?e[t]:n}function s(e,t){return u(t,function(n,i){e[i]=t[i]}),e}function c(e){return e instanceof Array}function l(e,t){for(var n=!1,i=0;i-1||S.indexOf(i)>-1)&&(t[n]=e[n])}return t},w=function(e){e=e||{};var t,n=e.SecretId,i=e.SecretKey,r=e.KeyTime,s=(e.method||e.Method||"get").toLowerCase(),c=o(e.Query||e.params||{}),l=R(o(e.Headers||e.headers||{})),p=e.Key||"";if(e.UseRawKey?t=e.Pathname||e.pathname||"/"+p:(t=e.Pathname||e.pathname||p,0!==t.indexOf("/")&&(t="/"+t)),!l.Host&&!l.host&&e.Bucket&&e.Region&&(l.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),!n)return console.error("missing param SecretId");if(!i)return console.error("missing param SecretKey");var u=Math.round(U(e.SystemClockOffset)/1e3)-1,d=u,m=e.Expires||e.expires;d+=void 0===m?900:1*m||0;var f=n,h=r||u+";"+d,v=r||u+";"+d,x=a(l,!0).join(";").toLowerCase(),y=a(c,!0).join(";").toLowerCase(),C=g.HmacSHA1(v,i).toString(),b=[s,t,z.obj2str(c,!0),z.obj2str(l,!0),""].join("\n"),k=["sha1",h,g.SHA1(b).toString(),""].join("\n");return["q-sign-algorithm=sha1","q-ak="+f,"q-sign-time="+h,"q-key-time="+v,"q-header-list="+x,"q-url-param-list="+y,"q-signature="+g.HmacSHA1(k,C).toString()].join("&")},_=function(){},A=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]);return t},T=function(e,t,n,i){e?b.readFile({filePath:e,position:t,length:n-t,success:function(e){i(e.data)},fail:function(){i(null)}}):i(null)},B=function(e,t,n){n=n||_,e&&t&&t instanceof ArrayBuffer?z.getFileMd5(t,function(e,t){n(t)}):n()},E=function(e,t){var n=h(e);return t&&t(n),n},O=function(e){var t,n,i,a="";for(t=0,n=e.length/2;t-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!i)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e){if(!n)return"Bucket";if(!i)return"Region";if(!a)return"Key"}return!1},N=function(e,t){if(t=s({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};if(t&&"object"===(void 0===t?"undefined":f(t))){!function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}();var i={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext"};z.each(i,function(e,i){void 0!==t[e]&&(n[i]=t[e])}),t.Headers=A(n)}}return t},P=function(e,n){return function(i,a){var o=this;"function"==typeof i&&(a=i,i={}),i=N(e,i);var r=function(e){return e&&e.headers&&(e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},s=function(e,t){a&&a(r(e),r(t))},c=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=I(e,i);if(t)return"missing param "+t;if(i.Region){if(i.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(i.Region))return"Region format error.";o.options.CompatibilityMode||-1!==i.Region.indexOf("-")||"yfb"===i.Region||"default"===i.Region||"accelerate"===i.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(i.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(i.Bucket))if(i.AppId)i.Bucket=i.Bucket+"-"+i.AppId;else{if(!o.options.AppId)return'Bucket should format as "test-1250000000".';i.Bucket=i.Bucket+"-"+o.options.AppId}i.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete i.AppId)}i.Key&&"/"===i.Key.substr(0,1)&&(i.Key=i.Key.substr(1))}}(),l="getAuth"===e||"getObjectUrl"===e,p=t.Promise;if(!l&&p&&!a)return new p(function(e,t){if(a=function(n,i){n?t(n):e(i)},c)return s({error:c});n.call(o,i,s)});if(c)return s({error:c});var u=n.call(o,i,s);return l?u:void 0}},j=function(e,t){function n(){if(a=0,t&&"function"==typeof t){i=Date.now();var n,o=Math.max(0,Math.round((s-r)/((i-c)/1e3)*100)/100)||0;n=0===s&&0===e?1:Math.floor(s/e*100)/100||0,c=i,r=s;try{t({loaded:s,total:e,speed:o,percent:n})}catch(e){}}}var i,a,o=this,r=0,s=0,c=Date.now();return function(t,i){if(t&&(s=t.loaded,e=t.total),i)clearTimeout(a),n();else{if(a)return;a=setTimeout(n,o.options.ProgressInterval)}}},M=function(e,t,n){"postObject"===e?n():"putObject"===e?void 0!==t.Body?(t.ContentLength=t.Body.byteLength,n(null,t.ContentLength)):n({error:"missing param Body"}):t.FilePath?b.stat({path:t.FilePath,success:function(e){var i=e.stats;t.FileStat=i,t.FileStat.FilePath=t.FilePath;var a=i.isDirectory()?0:i.size;t.ContentLength=a=a||0,n(null,a)},fail:function(e){n(e)}}):n({error:"missing param FilePath"})},U=function(e){return Date.now()+(e||0)},H=function(e,t){e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.lengtho)return 1;if(a=0,n=!t&&"devtools"===e.platform;return function(){return n&&console.warn("\u5f53\u524d\u5c0f\u7a0b\u5e8f\u7248\u672c\u5c0f\u4e8e 2.10.0\uff0c\u4e0d\u652f\u6301\u5206\u7247\u4e0a\u4f20\uff0c\u8bf7\u66f4\u65b0\u8f6f\u4ef6\u3002"),n=!1,t}}(),L=function(e){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e)},z={noop:_,formatParams:N,apiWrapper:P,xml2json:v,json2xml:x,md5:h,clearKey:A,fileSlice:T,getBodyMd5:B,getFileMd5:E,binaryBase64:O,extend:s,isArray:c,isInArray:l,makeArray:p,each:u,map:d,filter:m,clone:o,attr:r,uuid:D,camSafeUrlEncode:i,throttleOnProgress:j,getFileSize:M,getSkewTime:U,obj2str:k,getAuth:w,compareVersion:H,canFileSlice:F,isCIHost:L};e.exports=z}).call(t,n(1))},function(e,t,n){"use strict";var i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t){var n=e.prototype;if(Object.create){var a=Object.create(t.prototype);n.__proto__=a}if(!(n instanceof t)){var o=function(){};o.prototype=t.prototype,o=new o,i(n,o),e.prototype=n=o}n.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}function o(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,oe[e]),this.message=oe[e],Error.captureStackTrace&&Error.captureStackTrace(this,o);return n.code=e,t&&(this.message=this.message+": "+t),n}function r(){}function s(e,t){this._node=e,this._refresh=t,c(this)}function c(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);z(e,"length",n.length),i(n,e),e._inc=t}}function l(){}function p(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function u(e,t,n,i){if(i?t[p(t,i)]=n:t[t.length++]=n,e){n.ownerElement=e;var a=e.ownerDocument;a&&(i&&y(a,e,i),x(a,e,n))}}function d(e,t,n){var i=p(t,n);if(!(i>=0))throw o(se,new Error(e.tagName+"@"+n));for(var a=t.length-1;i"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function g(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(g(e,t))return!0}while(e=e.nextSibling)}function v(){}function x(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function y(e,t,n,i){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function C(e,t,n){if(e&&e._inc){e._inc++;var i=t.childNodes;if(n)i[i.length++]=n;else{for(var a=t.firstChild,o=0;a;)i[o++]=a,a=a.nextSibling;i.length=o}}}function b(e,t){var n=t.previousSibling,i=t.nextSibling;return n?n.nextSibling=i:e.firstChild=i,i?i.previousSibling=n:e.lastChild=n,C(e.ownerDocument,e),t}function k(e,t,n){var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===ne){var a=t.firstChild;if(null==a)return t;var o=t.lastChild}else a=o=t;var r=n?n.previousSibling:e.lastChild;a.previousSibling=r,o.nextSibling=n,r?r.nextSibling=a:e.firstChild=a,null==n?e.lastChild=o:n.previousSibling=o;do{a.parentNode=e}while(a!==o&&(a=a.nextSibling));return C(e.ownerDocument||e,e),t.nodeType==ne&&(t.firstChild=t.lastChild=null),t}function S(e,t){var n=t.parentNode;if(n){var i=e.lastChild;n.removeChild(t);var i=e.lastChild}var i=e.lastChild;return t.parentNode=e,t.previousSibling=i,t.nextSibling=null,i?i.nextSibling=t:e.firstChild=t,e.lastChild=t,C(e.ownerDocument,e,t),t}function R(){this._nsMap={}}function w(){}function _(){}function A(){}function T(){}function B(){}function E(){}function O(){}function D(){}function I(){}function N(){}function P(){}function j(){}function M(e,t){var n=[],i=9==this.nodeType?this.documentElement:this,a=i.prefix,o=i.namespaceURI;if(o&&null==a){var a=i.lookupPrefix(o);if(null==a)var r=[{namespace:o,prefix:null}]}return H(this,n,e,t,r),n.join("")}function U(e,t,n){var i=e.prefix||"",a=e.namespaceURI;if(!i&&!a)return!1;if("xml"===i&&"http://www.w3.org/XML/1998/namespace"===a||"http://www.w3.org/2000/xmlns/"==a)return!1;for(var o=n.length;o--;){var r=n[o];if(r.prefix==i)return r.namespace!=a}return!0}function H(e,t,n,i,a){if(i){if(!(e=i(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case V:a||(a=[]);var o=(a.length,e.attributes),r=o.length,s=e.firstChild,c=e.tagName;n=q===e.namespaceURI||n,t.push("<",c);for(var l=0;l"),n&&/^script$/i.test(c))for(;s;)s.data?t.push(s.data):H(s,t,n,i,a),s=s.nextSibling;else for(;s;)H(s,t,n,i,a),s=s.nextSibling;t.push("")}else t.push("/>");return;case ee:case ne:for(var s=e.firstChild;s;)H(s,t,n,i,a),s=s.nextSibling;return;case X:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,h),'"');case W:return t.push(e.data.replace(/[<&]/g,h));case $:return t.push("");case Z:return t.push("\x3c!--",e.data,"--\x3e");case te:var f=e.publicId,g=e.systemId;if(t.push("');else if(g&&"."!=g)t.push(' SYSTEM "',g,'">');else{var v=e.internalSubset;v&&t.push(" [",v,"]"),t.push(">")}return;case Y:return t.push("");case Q:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function F(e,t,n){var i;switch(t.nodeType){case V:i=t.cloneNode(!1),i.ownerDocument=e;case ne:break;case X:n=!0}if(i||(i=t.cloneNode(!1)),i.ownerDocument=e,i.parentNode=null,n)for(var a=t.firstChild;a;)i.appendChild(F(e,a,n)),a=a.nextSibling;return i}function L(e,t,n){var i=new t.constructor;for(var a in t){var o=t[a];"object"!=(void 0===o?"undefined":K(o))&&o!=i[a]&&(i[a]=o)}switch(t.childNodes&&(i.childNodes=new r),i.ownerDocument=e,i.nodeType){case V:var s=t.attributes,c=i.attributes=new l,p=s.length;c._ownerElement=i;for(var u=0;u0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var i in n)if(n[i]==e)return i;t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},i(G,f),i(G,f.prototype),v.prototype={nodeName:"#document",nodeType:ee,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==ne){for(var n=e.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,t),n=i}return e}return null==this.documentElement&&e.nodeType==V&&(this.documentElement=e),k(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),b(this,e)},importNode:function(e,t){return F(this,e,t)},getElementById:function(e){var t=null;return g(this.documentElement,function(n){if(n.nodeType==V&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new R;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new r,(t.attributes=new l)._ownerElement=t,t},createDocumentFragment:function(){var e=new N;return e.ownerDocument=this,e.childNodes=new r,e},createTextNode:function(e){var t=new A;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new T;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new B;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new P;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new w;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new I;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new R,i=t.split(":"),a=n.attributes=new l;return n.childNodes=new r,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,a._ownerElement=n,n},createAttributeNS:function(e,t){var n=new w,i=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,n}},a(v,f),R.prototype={nodeType:V,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===ne?this.insertBefore(e,null):S(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new s(this,function(t){var n=[];return g(t,function(i){i===t||i.nodeType!=V||"*"!==e&&i.tagName!=e||n.push(i)}),n})},getElementsByTagNameNS:function(e,t){return new s(this,function(n){var i=[];return g(n,function(a){a===n||a.nodeType!==V||"*"!==e&&a.namespaceURI!==e||"*"!==t&&a.localName!=t||i.push(a)}),i})}},v.prototype.getElementsByTagName=R.prototype.getElementsByTagName,v.prototype.getElementsByTagNameNS=R.prototype.getElementsByTagNameNS,a(R,f),w.prototype.nodeType=X,a(w,f),_.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(oe[re])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},a(_,f),A.prototype={nodeName:"#text",nodeType:W,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},a(A,_),T.prototype={nodeName:"#comment",nodeType:Z},a(T,_),B.prototype={nodeName:"#cdata-section",nodeType:$},a(B,_),E.prototype.nodeType=te,a(E,f),O.prototype.nodeType=ie,a(O,f),D.prototype.nodeType=J,a(D,f),I.prototype.nodeType=Q,a(I,f),N.prototype.nodeName="#document-fragment",N.prototype.nodeType=ne,a(N,f),P.prototype.nodeType=Y,a(P,f),j.prototype.serializeToString=function(e,t,n){return M.call(e,t,n)},f.prototype.toString=M;try{if(Object.defineProperty){var le=function e(t){switch(t.nodeType){case V:case ne:var n=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&n.push(e(t)),t=t.nextSibling;return n.join("");default:return t.nodeValue}};Object.defineProperty(s.prototype,"length",{get:function(){return c(this),this.$$length}}),Object.defineProperty(f.prototype,"textContent",{get:function(){return le(this)},set:function(e){switch(this.nodeType){case V:case ne:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),z=function(e,t,n){e["$$"+t]=n}}}catch(e){}t.DOMImplementation=m,t.XMLSerializer=j},function(e,t,n){"use strict";var i=function(e){e=e||{};var t,n=e.Base64,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=function(e){for(var t={},n=0,i=e.length;n>>6)+o(128|63&t):o(224|t>>>12&15)+o(128|t>>>6&63)+o(128|63&t)}var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|t>>>18&7)+o(128|t>>>12&63)+o(128|t>>>6&63)+o(128|63&t)},s=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,c=function(e){return e.replace(s,r)},l=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[i.charAt(n>>>18),i.charAt(n>>>12&63),t>=2?"=":i.charAt(n>>>6&63),t>=1?"=":i.charAt(63&n)].join("")},p=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,l)},u=t?function(e){return(e.constructor===t.constructor?e:new t(e)).toString("base64")}:function(e){return p(c(e))},d=function(e,t){return t?u(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):u(String(e))},m=function(e){return d(e,!0)},f=new RegExp(["[\xc0-\xdf][\x80-\xbf]","[\xe0-\xef][\x80-\xbf]{2}","[\xf0-\xf7][\x80-\xbf]{3}"].join("|"),"g"),h=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return o(55296+(n>>>10))+o(56320+(1023&n));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},g=function(e){return e.replace(f,h)},v=function(e){var t=e.length,n=t%4,i=(t>0?a[e.charAt(0)]<<18:0)|(t>1?a[e.charAt(1)]<<12:0)|(t>2?a[e.charAt(2)]<<6:0)|(t>3?a[e.charAt(3)]:0),r=[o(i>>>16),o(i>>>8&255),o(255&i)];return r.length-=[0,0,2,1][n],r.join("")},x=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,v)},y=t?function(e){return(e.constructor===t.constructor?e:new t(e,"base64")).toString()}:function(e){return g(x(e))},C=function(e){return y(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};return{VERSION:"2.1.9",atob:x,btoa:p,fromBase64:C,toBase64:d,utob:c,encode:d,encodeURI:m,btou:g,decode:C,noConflict:function(){var t=e.Base64;return e.Base64=n,t}}}();e.exports=i},function(e,t,n){"use strict";var i=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){n(e).push(t)},e.off=function(e,t){for(var i=n(e),a=i.length-1;a>=0;a--)t===i[a]&&i.splice(a,1)},e.emit=function(e,t){for(var i=n(e).map(function(e){return e}),a=0;a=0;n--){var a=i[n][2];(!a||a+2592e3=0;o--){var r=i[o];r[0]===e&&r[1]===t?i.splice(o,1):e!==r[0]&&0===r[0].indexOf(a)&&i.splice(o,1)}i.unshift([e,t,Math.round(Date.now()/1e3)]),i.length>n&&i.splice(n),l()}},removeUploadId:function(e){c(),delete p.using[e];for(var t=i.length-1;t>=0;t--)i[t][1]===e&&i.splice(t,1);l()}};e.exports=p},function(e,t,n){"use strict";var i=n(7);e.exports=i},function(e,t,n){"use strict";var i=n(0),a=n(4),o=n(17),r=n(18),s=n(24),c={SecretId:"",SecretKey:"",XCosSecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,UploadQueueSize:1e4,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1},l=function(e){this.options=i.extend(i.clone(c),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),this.options.SecretId&&this.options.SecretId.indexOf(" ")>-1&&(console.error("error: SecretId\u683c\u5f0f\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey\u683c\u5f0f\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5"),console.error("error: SecretKey format is incorrect. Please check")),a.init(this),o.init(this)};r.init(l,o),s.init(l,o),l.getAuthorization=i.getAuth,l.version="1.1.2",e.exports=l},function(module,exports,__webpack_require__){"use strict";(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var ERROR="input is invalid type",WINDOW="object"===("undefined"==typeof window?"undefined":_typeof(window)),root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===("undefined"==typeof self?"undefined":_typeof(self)),NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"===(void 0===process?"undefined":_typeof(process))&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"===_typeof(module)&&module.exports,AMD=__webpack_require__(11),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===(void 0===e?"undefined":_typeof(e))&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.getCtx=e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t>2]|=e[o]<>6,c[a++]=128|63&i):i<55296||i>=57344?(c[a++]=224|i>>12,c[a++]=128|i>>6&63,c[a++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),c[a++]=240|i>>18,c[a++]=128|i>>12&63,c[a++]=128|i>>6&63,c[a++]=128|63&i);else for(a=this.start;o>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[a>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=64?(this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,i,a,o,r=this.blocks;this.first?(e=r[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,i=(-1732584194^2004318071&e)+r[1]-117830708,i=(i<<12|i>>>20)+e<<0,n=(-271733879^i&(-271733879^e))+r[2]-1126478375,n=(n<<17|n>>>15)+i<<0,t=(e^n&(i^e))+r[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,i=this.h3,e+=(i^t&(n^i))+r[0]-680876936,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[1]-389564586,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[2]+606105819,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(i^t&(n^i))+r[4]-176418897,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[5]+1200080426,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[6]-1473231341,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(i^t&(n^i))+r[8]+1770035416,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[9]-1958414417,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[10]-42063,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(i^t&(n^i))+r[12]+1804603682,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[13]-40341101,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[14]-1502002290,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^i&(t^n))+r[1]-165796510,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[6]-1069501632,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[11]+643717713,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[5]-701558691,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[10]+38016083,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[15]-660478335,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[9]+568446438,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[14]-1019803690,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[3]-187363961,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[13]-1444681467,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[2]-51403784,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[7]+1735328473,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[12]-1926607734,t=(t<<20|t>>>12)+n<<0,a=t^n,e+=(a^i)+r[5]-378558,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[8]-2022574463,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[11]+1839030562,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[14]-35309556,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[1]-1530992060,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[4]+1272893353,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[7]-155497632,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[10]-1094730640,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[13]+681279174,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[0]-358537222,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[3]-722521979,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[6]+76029189,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[9]-640364487,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[12]-421815835,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[15]+530742520,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~i))+r[0]-198630844,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[7]+1126891415,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[14]-1416354905,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[12]+1700485571,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[3]-1894986606,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[10]-1051523,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[8]+1873313359,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[15]-30611744,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[6]-1560198380,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[4]-145523070,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[11]-1120210379,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[2]+718787259,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=i+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+i<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,i="",a=this.array(),o=0;o<15;)e=a[o++],t=a[o++],n=a[o++],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=a[o],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()}).call(exports,__webpack_require__(9),__webpack_require__(1),__webpack_require__(10)(module))},function(e,t,n){"use strict";function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(u===setTimeout)return setTimeout(e,0);if((u===i||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function r(e){if(d===clearTimeout)return clearTimeout(e);if((d===a||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function s(){g&&f&&(g=!1,f.length?h=f.concat(h):v=-1,h.length&&c())}function c(){if(!g){var e=o(s);g=!0;for(var t=h.length;t;){for(f=h,h=[];++v1)for(var n=1;n>>2]|=(n[a>>>2]>>>24-a%4*8&255)<<24-(i+a)%4*8;else if(65535>>2]=n[a>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new r.init(n,t/2)}},l=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],i=0;i>>2]>>>24-i%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new r.init(n,t)}},p=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},u=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,a=n.sigBytes,o=this.blockSize,s=a/(4*o),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*o,a=e.min(4*t,a),t){for(var c=0;cl;l++){if(16>l)o[l]=0|e[t+l];else{var p=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=p<<1|p>>>31}p=(i<<5|i>>>27)+c+o[l],p=20>l?p+(1518500249+(a&r|~a&s)):40>l?p+(1859775393+(a^r^s)):60>l?p+((a&r|a&s|r&s)-1894007588):p+((a^r^s)-899497514),c=s,s=r,r=a<<30|a>>>2,a=i,i=p}n[0]=n[0]+i|0,n[1]=n[1]+a|0,n[2]=n[2]+r|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(i+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=a._createHelper(t),e.HmacSHA1=a._createHmacHelper(t)}(),function(){var e=i,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var i=e.blockSize,a=4*i;n.sigBytes>a&&(n=e.finalize(n)),n.clamp();for(var o=this._oKey=n.clone(),r=this._iKey=n.clone(),s=o.words,c=r.words,l=0;l>>2]>>>24-o%4*8&255,s=t[o+1>>>2]>>>24-(o+1)%4*8&255,c=t[o+2>>>2]>>>24-(o+2)%4*8&255,l=r<<16|s<<8|c,p=0;p<4&&o+.75*p>>6*(3-p)&63));var u=i.charAt(64);if(u)for(;a.length%4;)a.push(u);return a.join("")},parse:function(e){var t=e.length,i=this._map,a=i.charAt(64);if(a){var o=e.indexOf(a);-1!=o&&(t=o)}for(var r=[],s=0,c=0;c>>6-c%4*2;r[s>>>2]|=(l|p)<<24-s%4*8,s++}return n.create(r,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.exports=i},function(e,t,n){"use strict";var i=n(14).DOMParser,a=function(e){function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function n(e){return e.prefix}function a(e){return"string"==typeof e?e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):e}function o(e,t,n,i){for(var a=0;a0&&o(e.arrayAccessFormPaths,t,n,i)&&(t[n]=[t[n]])}function s(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),i=t[5].split(".");if(n.setHours(t[3],t[4],i[0]),i.length>1&&n.setMilliseconds(i[1]),t[6]&&t[7]){var a=60*t[6]+Number(t[7]);a=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*a:a),n.setMinutes(n.getMinutes()-a-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function c(t,n,i){if(e.datetimeAccessFormPaths.length>0){var a=i.split(".#")[0];return o(e.datetimeAccessFormPaths,t,n,a)?s(t):t}return t}function l(t,n,i,a){return!(n==S.ELEMENT_NODE&&e.xmlElementsFilter.length>0)||o(e.xmlElementsFilter,t,i,a)}function p(i,a){if(i.nodeType==S.DOCUMENT_NODE){for(var o=new Object,s=i.childNodes,u=0;u1&&null!=o.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==o.__text||""==o.__text.trim())&&delete o.__text:o=o.__cdata,delete o.__cnt,!e.enableToStringFunc||null==o.__text&&null==o.__cdata||(o.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),o}if(i.nodeType==S.TEXT_NODE||i.nodeType==S.CDATA_SECTION_NODE)return i.nodeValue}function u(t,n,i,o){var r="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=i)for(var s=0;s":">"}function d(e,t){return""}function m(e,t){return-1!==e.indexOf(t,e.length-t.length)}function f(t,n){return!!("property"==e.arrayAccessForm&&m(n.toString(),"_asArray")||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function)}function h(e){var t=0;if(e instanceof Object)for(var n in e)f(e,n)||t++;return t}function g(t,n,i){return 0==e.jsonPropertiesFilter.length||""==i||o(e.jsonPropertiesFilter,t,n,i)}function v(t){var n=[];if(t instanceof Object)for(var i in t)-1==i.toString().indexOf("__")&&0==i.toString().indexOf(e.attributePrefix)&&n.push(i);return n}function x(t){var n="";return null!=t.__cdata&&(n+=""),null!=t.__text&&(e.escapeMode?n+=a(t.__text):n+=t.__text),n}function y(t){var n="";return t instanceof Object?n+=x(t):null!=t&&(e.escapeMode?n+=a(t):n+=t),n}function C(e,t){return""===e?t:e+"."+t}function b(e,t,n,i){var a="";if(0==e.length)a+=u(e,t,n,!0);else for(var o=0;o0)for(var i in e)if(!f(e,i)&&(""==t||g(e,i,C(t,i)))){var a=e[i],o=v(a);if(null==a||void 0==a)n+=u(a,i,o,!0);else if(a instanceof Object)if(a instanceof Array)n+=b(a,i,o,t);else if(a instanceof Date)n+=u(a,i,o,!1),n+=a.toISOString(),n+=d(a,i);else{var r=h(a);r>0||null!=a.__text||null!=a.__cdata?(n+=u(a,i,o,!1),n+=k(a,C(t,i)),n+=d(a,i)):n+=u(a,i,o,!0)}else n+=u(a,i,o,!1),n+=y(a),n+=d(a,i)}return n+=y(e)}e=e||{},function(){void 0===e.escapeMode&&(e.escapeMode=!0),e.attributePrefix=e.attributePrefix||"_",e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1)}();var S={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(e){if(void 0===e)return null;var t;if(i){var n=new i,a=null;try{a=n.parseFromString("INVALID","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(e){a=null}try{t=n.parseFromString(e,"text/xml"),null!=a&&t.getElementsByTagNameNS(a,"parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("")+2)),t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?s(e):e},this.xml2json=function(e){return p(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return k(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},o=function(e){if(!e)return null;var t=new i,n=t.parseFromString(e,"text/xml"),o=new a,r=o.xml2json(n);return r.html&&r.getElementsByTagName("parsererror").length?null:r};e.exports=o},function(e,t,n){"use strict";function i(e){this.options=e||{locator:{}}}function a(e,t,n){function i(t){var i=e[t];!i&&r&&(i=2==e.length?function(n){e(t,n)}:e),a[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+s(n))}||function(){}}if(!e){if(t instanceof o)return t;e=t}var a={},r=e instanceof Function;return n=n||{},i("warning"),i("error"),i("fatalError"),a}function o(){this.cdata=!1}function r(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function s(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function c(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function l(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}i.prototype.parseFromString=function(e,t){var n=this.options,i=new p,r=n.domBuilder||new o,s=n.errorHandler,c=n.locator,l=n.xmlns||{},u={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&r.setDocumentLocator(c),i.errorHandler=a(s,r,c),i.domBuilder=n.domBuilder||r,/\/x?html?$/.test(t)&&(u.nbsp="\xa0",u.copy="\xa9",l[""]="http://www.w3.org/1999/xhtml"),l.xml=l.xml||"http://www.w3.org/XML/1998/namespace",e?i.parse(e,l,u):i.errorHandler.error("invalid doc source"),r.doc},o.prototype={startDocument:function(){this.doc=(new u).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,i){var a=this.doc,o=a.createElementNS(e,n||t),s=i.length;l(this,o),this.currentElement=o,this.locator&&r(this.locator,o);for(var c=0;c65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function f(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?p(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function h(t){if(t>S){var n=e.substring(S,t).replace(/&#?\w+;/g,f);C&&g(S),i.characters(n,0,t-S),S=t}}function g(t,n){for(;t>=x&&(n=y.exec(e));)v=n.index,x=v+n[0].length,C.lineNumber++;C.columnNumber=t-v+1}for(var v=0,x=0,y=/.*(?:\r\n?|\n)|.*$/g,C=i.locator,b=[{currentNSMap:t}],k={},S=0;;){try{var R=e.indexOf("<",S);if(R<0){if(!e.substr(S).match(/^\s*$/)){var w=i.doc,_=w.createTextNode(e.substr(S));w.appendChild(_),i.currentElement=_}return}switch(R>S&&h(R),e.charAt(R+1)){case"/":var A=e.indexOf(">",R+3),T=e.substring(R+2,A),B=b.pop();A<0?(T=e.substring(R+2).replace(/[\s<].*/,""),a.error("end tag name: "+T+" is not complete:"+B.tagName),A=R+1+T.length):T.match(/\sS?S=A:h(Math.max(R,S)+1)}}function o(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function r(e,t,n,i,a,o){for(var r,s,c=++t,l=y;;){var p=e.charAt(c);switch(p){case"=":if(l===C)r=e.slice(t,c),l=k;else{if(l!==b)throw new Error("attribute equal must after attrName");l=k}break;case"'":case'"':if(l===k||l===C){if(l===C&&(o.warning('attribute value must after "="'),r=e.slice(t,c)),t=c+1,!((c=e.indexOf(p,t))>0))throw new Error("attribute value no end '"+p+"' match");s=e.slice(t,c).replace(/&#?\w+;/g,a),n.add(r,s,t-1),l=R}else{if(l!=S)throw new Error('attribute value must after "="');s=e.slice(t,c).replace(/&#?\w+;/g,a),n.add(r,s,t),o.warning('attribute "'+r+'" missed start quot('+p+")!!"),t=c+1,l=R}break;case"/":switch(l){case y:n.setTagName(e.slice(t,c));case R:case w:case _:l=_,n.closed=!0;case S:case C:case b:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),l==y&&n.setTagName(e.slice(t,c)),c;case">":switch(l){case y:n.setTagName(e.slice(t,c));case R:case w:case _:break;case S:case C:s=e.slice(t,c),"/"===s.slice(-1)&&(n.closed=!0,s=s.slice(0,-1));case b:l===b&&(s=r),l==S?(o.warning('attribute "'+s+'" missed quot(")!!'),n.add(r,s.replace(/&#?\w+;/g,a),t)):("http://www.w3.org/1999/xhtml"===i[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),n.add(s,s,t));break;case k:throw new Error("attribute value missed!!")}return c;case"\x80":p=" ";default:if(p<=" ")switch(l){case y:n.setTagName(e.slice(t,c)),l=w;break;case C:r=e.slice(t,c),l=b;break;case S:var s=e.slice(t,c).replace(/&#?\w+;/g,a);o.warning('attribute "'+s+'" missed quot(")!!'),n.add(r,s,t);case R:l=w}else switch(l){case b:n.tagName;"http://www.w3.org/1999/xhtml"===i[""]&&r.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+r+'" missed value!! "'+r+'" instead2!!'),n.add(r,r,t),t=c,l=C;break;case R:o.warning('attribute space is required"'+r+'"!!');case w:l=C,t=c;break;case k:l=S,t=c;break;case _:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function s(e,t,n){for(var i=e.tagName,a=null,o=e.length;o--;){var r=e[o],s=r.qName,c=r.value,l=s.indexOf(":");if(l>0)var u=r.prefix=s.slice(0,l),d=s.slice(l+1),m="xmlns"===u&&d;else d=s,u=null,m="xmlns"===s&&"";r.localName=d,!1!==m&&(null==a&&(a={},p(n,n={})),n[m]=a[m]=c,r.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(m,c))}for(var o=e.length;o--;){r=e[o];var u=r.prefix;u&&("xml"===u&&(r.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==u&&(r.uri=n[u||""]))}var l=i.indexOf(":");l>0?(u=e.prefix=i.slice(0,l),d=e.localName=i.slice(l+1)):(u=null,d=e.localName=i);var f=e.uri=n[u||""];if(t.startElement(f,d,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=a,!0;if(t.endElement(f,d,i),a)for(u in a)t.endPrefixMapping(u)}function c(e,t,n,i,a){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("",t),r=e.substring(t+1,o);if(/[&<]/.test(r))return/^script$/i.test(n)?(a.characters(r,0,r.length),o):(r=r.replace(/&#?\w+;/g,i),a.characters(r,0,r.length),o)}return t+1}function l(e,t,n,i){var a=i[n];return null==a&&(a=e.lastIndexOf(""),at?(n.comment(e,t+4,a-t-4),a+3):(i.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var a=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,a-t-9),n.endCDATA(),a+3}var o=h(e,t),r=o.length;if(r>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],c=r>3&&/^public$/i.test(o[2][0])&&o[3][0],l=r>4&&o[4][0],p=o[r-1];return n.startDTD(s,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),p.index+p[0].length}}return-1}function d(e,t,n){var i=e.indexOf("?>",t);if(i){var a=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(a){a[0].length;return n.processingInstruction(a[1],a[2]),i+2}return-1}return-1}function m(e){}function f(e,t){return e.__proto__=t,e}function h(e,t){var n,i=[],a=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(a.lastIndex=t,a.exec(e);n=a.exec(e);)if(i.push(n),n[1])return i}var g=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),x=new RegExp("^"+g.source+v.source+"*(?::"+g.source+v.source+"*)?$"),y=0,C=1,b=2,k=3,S=4,R=5,w=6,_=7;i.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),p(t,t={}),a(e,t,n,i,this.errorHandler),i.endDocument()}},m.prototype={setTagName:function(e){if(!x.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!x.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},f({},f.prototype)instanceof f||(f=function(e,t){function n(){}n.prototype=t,n=new n;for(t in e)n[t]=e[t];return n}),t.XMLReader=i},function(e,t,n){"use strict";function i(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(r,"")}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=new RegExp("^([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd])|^((x|X)(m|M)(l|L))|([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd-.0-9\xb7\u0300-\u036f\u203f\u2040])","g"),r=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,s=function(e){var t=[];if(e instanceof Object)for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},c=function(e,t){var n=function(e,n,i,a,r){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(a).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(o,"_"));var l=[c,"<",e,i||""];return n&&n.length>0?(l.push(">"),l.push(n),r&&l.push(c),l.push("")):l.push("/>"),l.join("")};return function e(o,r,c){var l=void 0===o?"undefined":a(o);switch((Array.isArray?Array.isArray(o):o instanceof Array)?l="array":o instanceof Date&&(l="date"),l){case"array":var p=[];return o.map(function(t){p.push(e(t,1,c+1))}),t.prettyPrint&&p.push("\n"),p.join("");case"date":return o.toJSON?o.toJSON():o+"";case"object":var u=[];for(var d in o)if(o.hasOwnProperty(d))if(o[d]instanceof Array)for(var m in o[d])o[d].hasOwnProperty(m)&&u.push(n(d,e(o[d][m],0,c+1),null,c+1,s(o[d][m]).length));else u.push(n(d,e(o[d],0,c+1),null,c+1));return t.prettyPrint&&u.length>0&&u.push("\n"),u.join("");case"function":return o();default:return t.escape?i(o):""+o}}(e,0,0)},l=function(e){var t=['"),t.join("")},p=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" "}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var n="",i="";return t&&("object"==(void 0===t?"undefined":a(t))?(t.xmlHeader&&(n=l(!!t.xmlHeader.standalone)),void 0!==t.docType&&(i="")):n=l()),t=t||{},[n,t.prettyPrint&&i?"\n":"",i,c(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")};e.exports=p},function(e,t,n){"use strict";var i=n(5),a=n(0),o={},r=function(e,t){o[t]=e[t],e[t]=function(e,n){e.SkipTask?o[t].call(this,e,n):this._addTask(t,e,n)}},s=function(e){var t=[],n={},r=0,s=0,c=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),t},l=function(){var n,i=function(){n=0,e.emit("task-list-update",{list:a.map(t,c)}),e.emit("list-update",{list:a.map(t,c)})};return function(){n||(n=setTimeout(i))}}(),p=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var i=0;ie.options.UploadQueueSize;){var a="waiting"===t[i].state||"checking"===t[i].state||"uploading"===t[i].state;t[i]&&a?i++:(n[t[i].id]&&delete n[t[i].id],t.splice(i,1),s--)}l()}},u=function n(){if(!(r>=e.options.FileParallelLimit)){for(;t[s]&&"waiting"!==t[s].state;)s++;if(!(s>=t.length)){var i=t[s];s++,r++,i.state="checking",i.params.onTaskStart&&i.params.onTaskStart(c(i)),!i.params.UploadData&&(i.params.UploadData={});var u=a.formatParams(i.api,i.params);o[i.api].call(e,u,function(t,a){e._isRunningTask(i.id)&&("checking"!==i.state&&"uploading"!==i.state||(i.state=t?"error":"success",t&&(i.error=t),r--,l(),n(),i.callback&&i.callback(t,a),"success"===i.state&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)),p())}),l(),setTimeout(n)}}},d=function(t,a){var o=n[t];if(o){var s=o&&"waiting"===o.state,c=o&&("checking"===o.state||"uploading"===o.state);if("canceled"===a&&"canceled"!==o.state||"paused"===a&&s||"paused"===a&&c){if("paused"===a&&o.params.Body&&"function"==typeof o.params.Body.pipe)return void console.error("stream not support pause");o.state=a,e.emit("inner-kill-task",{TaskId:t,toState:a});try{var d=o&&o.params&&o.params.UploadData.UploadId}catch(e){}"canceled"===a&&d&&i.removeUsing(d),l(),c&&(r--,u()),"canceled"===a&&(o.params&&(delete o.params.UploadData,delete o.params.Body,delete o.params),delete o.callback)}p()}};e._addTasks=function(t){a.each(t,function(t){e._addTask(t.api,t.params,t.callback,!0)}),l()},e._addTask=function(i,o,r,s){"sliceUploadFile"!==i||a.canFileSlice()||(i="postObject"),o=a.formatParams(i,o);var c=a.uuid();o.TaskId=c,o.onTaskReady&&o.onTaskReady(c);var d={params:o,callback:r,api:i,index:t.length,id:c,Bucket:o.Bucket,Region:o.Region,Key:o.Key,FilePath:o.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null},m=o.onHashProgress;o.onHashProgress=function(t){e._isRunningTask(d.id)&&(d.hashPercent=t.percent,m&&m(t),l())};var f=o.onProgress;return o.onProgress=function(t){e._isRunningTask(d.id)&&("checking"===d.state&&(d.state="uploading"),d.loaded=t.loaded,d.size=t.total,d.speed=t.speed,d.percent=t.percent,f&&f(t),l())},a.getFileSize(i,o,function(e,i){if(e)return void r(e);n[c]=d,t.push(d),d.size=i,!s&&l(),u(),p()}),c},e._isRunningTask=function(e){var t=n[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return a.map(t,c)},e.cancelTask=function(e){d(e,"canceled")},e.pauseTask=function(e){d(e,"paused")},e.restartTask=function(e){var t=n[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",l(),s=Math.min(s,t.index),u())},e.isUploadRunning=function(){return r||s/gi,"<$1Rule>"),i=i.replace(/<(\/?)Tags>/gi,"<$1Tag>");var a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Re.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"replication",headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function _(e,t){Re.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var i={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else e||!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=n.ReplicationConfiguration.Rule,delete n.ReplicationConfiguration.Rule),t(e,n)})}function A(e,t){Re.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function T(e,t){if(!e.WebsiteConfiguration)return void t({error:"missing param WebsiteConfiguration"});var n=Te.clone(e.WebsiteConfiguration||{}),i=n.RoutingRules||n.RoutingRule||[];i=Te.isArray(i)?i:[i],delete n.RoutingRule,delete n.RoutingRules,i.length&&(n.RoutingRules={RoutingRule:i});var a=Te.json2xml({WebsiteConfiguration:n}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"website",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function B(e,t){Re.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var a=n.WebsiteConfiguration||{};if(a.RoutingRules){var o=Te.clone(a.RoutingRules.RoutingRule||[]);o=Te.makeArray(o),a.RoutingRules=o}t(null,{WebsiteConfiguration:a,statusCode:n.statusCode,headers:n.headers})}})}function E(e,t){Re.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function O(e,t){if(!e.RefererConfiguration)return void t({error:"missing param RefererConfiguration"});var n=Te.clone(e.RefererConfiguration||{}),i=n.DomainList||{},a=i.Domains||i.Domain||[];a=Te.isArray(a)?a:[a],a.length&&(n.DomainList={Domain:a});var o=Te.json2xml({RefererConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Re.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"referer",headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function D(e,t){Re.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var a=n.RefererConfiguration||{};if(a.DomainList){var o=Te.makeArray(a.DomainList.Domain||[]);a.DomainList={Domains:o}}t(null,{RefererConfiguration:a,statusCode:n.statusCode,headers:n.headers})}})}function I(e,t){var n=e.DomainConfiguration||{},i=n.DomainRule||e.DomainRule||[];i=Te.clone(i);var a=Te.json2xml({DomainConfiguration:{DomainRule:i}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"domain",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function N(e,t){Re.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){if(e)return t(e);var i=[];try{i=n.DomainConfiguration.DomainRule||[]}catch(e){}i=Te.clone(Te.isArray(i)?i:[i]),t(null,{DomainRule:i,statusCode:n.statusCode,headers:n.headers})})}function P(e,t){Re.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function j(e,t){var n=e.OriginConfiguration||{},i=n.OriginRule||e.OriginRule||[];i=Te.clone(i);var a=Te.json2xml({OriginConfiguration:{OriginRule:i}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"origin",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function M(e,t){Re.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){if(e)return t(e);var i=[];try{i=n.OriginConfiguration.OriginRule||[]}catch(e){}i=Te.clone(Te.isArray(i)?i:[i]),t(null,{OriginRule:i,statusCode:n.statusCode,headers:n.headers})})}function U(e,t){Re.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function H(e,t){var n=Te.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(n)),Re.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function F(e,t){Re.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(e,n){if(e)return t(e);delete n.BucketLoggingStatus._xmlns,t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})})}function L(e,t){var n=Te.clone(e.InventoryConfiguration);if(n.OptionalFields){var i=n.OptionalFields||[];n.OptionalFields={Field:i}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var a=n.Destination.COSBucketDestination.Encryption;Object.keys(a).indexOf("SSECOS")>-1&&(a["SSE-COS"]=a.SSECOS,delete a.SSECOS)}var o=Te.json2xml({InventoryConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Re.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"inventory",qs:{id:e.Id},headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function z(e,t){Re.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){if(e)return t(e);var i=n.InventoryConfiguration;if(i&&i.OptionalFields&&i.OptionalFields.Field){var a=i.OptionalFields.Field;Te.isArray(a)||(a=[a]),i.OptionalFields=a}if(i.Destination&&i.Destination.COSBucketDestination&&i.Destination.COSBucketDestination.Encryption){var o=i.Destination.COSBucketDestination.Encryption;Object.keys(o).indexOf("SSE-COS")>-1&&(o.SSECOS=o["SSE-COS"],delete o["SSE-COS"])}t(null,{InventoryConfiguration:i,statusCode:n.statusCode,headers:n.headers})})}function K(e,t){Re.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken}},function(e,n){if(e)return t(e);var i=n.ListInventoryConfigurationResult,a=i.InventoryConfiguration||[];a=Te.isArray(a)?a:[a],delete i.InventoryConfiguration,Te.each(a,function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;Te.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}}),i.InventoryConfigurations=a,Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function q(e,t){Re.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function G(e,t){if(!e.AccelerateConfiguration)return void t({error:"missing param AccelerateConfiguration"});var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},i=Te.json2xml(n),a={};a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Re.call(this,{Interface:"putBucketAccelerate",Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"accelerate",headers:a},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function V(e,t){Re.call(this,{Interface:"getBucketAccelerate",Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)})}function X(e,t){Re.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(n,i){if(n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0,statusCode:a}):t(n)}i.ETag=Te.attr(i.headers,"etag",""),t(null,i)})}function W(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,Re.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions"},function(e,n){if(e)return t(e);var i=n.ListVersionsResult||{},a=i.DeleteMarker||[];a=Te.isArray(a)?a:[a];var o=i.Version||[];o=Te.isArray(o)?o:[o];var r=Te.clone(i);delete r.DeleteMarker,delete r.Version,Te.extend(r,{DeleteMarkers:a,Versions:o,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function $(e,t){var n=e.Query||{},i=e.QueryString||"";n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,Re.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,qs:n,qsStr:i,rawBody:!0},function(n,i){if(n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0}):t(n)}t(null,{Body:i.body,ETag:Te.attr(i.headers,"etag",""),statusCode:i.statusCode,headers:i.headers})})}function Q(e,t){var n=this,i=e.ContentLength,a=Te.throttleOnProgress.call(n,i,e.onProgress),o=e.Headers;o["Cache-Control"]||o["cache-control"]||(o["Cache-Control"]=""),o["Content-Type"]||o["content-type"]||(o["Content-Type"]=Be.getType(e.Key)||"application/octet-stream"),Te.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(r){r&&(o["Content-MD5"]=Te.binaryBase64(r)),void 0!==e.ContentLength&&(o["Content-Length"]=e.ContentLength),a(null,!0),Re.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:a},function(o,r){if(o)return a(null,!0),t(o);a({loaded:i,total:i},!0);var s=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});s=s.substr(s.indexOf("://")+3),r.Location=s,r.ETag=Te.attr(r.headers,"etag",""),t(null,r)})})}function J(e,t){var n=this,i={},a=e.FilePath;if(!a)return void t({error:"missing param FilePath"});i["Cache-Control"]=e.CacheControl,i["Content-Disposition"]=e.ContentDisposition,i["Content-Encoding"]=e.ContentEncoding,i["Content-MD5"]=e.ContentMD5,i["Content-Length"]=e.ContentLength,i["Content-Type"]=e.ContentType,i.Expect=e.Expect,i.Expires=e.Expires,i["x-cos-acl"]=e.ACL,i["x-cos-grant-read"]=e.GrantRead,i["x-cos-grant-write"]=e.GrantWrite,i["x-cos-grant-full-control"]=e.GrantFullControl,i["x-cos-storage-class"]=e.StorageClass,i["x-cos-mime-limit"]=e.MimeLimit,i["x-cos-traffic-limit"]=e.TrafficLimit,delete i["Content-Length"],delete i["content-length"];for(var o in e)o.indexOf("x-cos-meta-")>-1&&(i[o]=e[o]);var r=Te.throttleOnProgress.call(n,i["Content-Length"],e.onProgress);Re.call(this,{Action:"name/cos:PostObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:i,qs:e.Query,filePath:a,onProgress:r},function(i,o){if(r(null,!0),i)return t(i);if(o&&o.headers){var s=o.headers,c=s.etag||s.Etag||s.ETag||"",l=a.substr(a.lastIndexOf("/")+1),p=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key.replace(/\$\{filename\}/g,l),isLocation:!0});return t(null,{Location:p,statusCode:o.statusCode,headers:s,ETag:c})}t(null,o)})}function Y(e,t){Re.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId},function(e,n){if(e){var i=e.statusCode;return i&&204===i?t(null,{statusCode:i}):i&&404===i?t(null,{BucketNotFound:!0,statusCode:i}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})})}function Z(e,t){Re.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"acl"},function(e,n){if(e)return t(e);var i=n.AccessControlPolicy||{},a=i.Owner||{},o=i.AccessControlList&&i.AccessControlList.Grant||[];o=Te.isArray(o)?o:[o];var r=ye(i);n.headers&&n.headers["x-cos-acl"]&&(r.ACL=n.headers["x-cos-acl"]),r=Te.extend(r,{Owner:a,Grants:o,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function ee(e,t){var n=e.Headers,i="";if(e.AccessControlPolicy){var a=Te.clone(e.AccessControlPolicy||{}),o=a.Grants||a.Grant;o=Te.isArray(o)?o:[o],delete a.Grant,delete a.Grants,a.AccessControlList={Grant:o},i=Te.json2xml({AccessControlPolicy:a}),n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(i))}Te.each(n,function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=Ce(n[t]))}),Re.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:i},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function te(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,Re.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n},function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var i=n.headers||{};t(null,{AccessControlAllowOrigin:i["access-control-allow-origin"],AccessControlAllowMethods:i["access-control-allow-methods"],AccessControlAllowHeaders:i["access-control-allow-headers"],AccessControlExposeHeaders:i["access-control-expose-headers"],AccessControlMaxAge:i["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})})}function ne(e,t){var n=e.Headers;!n["Cache-Control"]&&n["cache-control"]&&(n["Cache-Control"]="");var i=e.CopySource||"",a=i.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!a)return void t({error:"CopySource format error"});var o=a[1],r=a[3],s=decodeURIComponent(a[4]);Re.call(this,{Scope:[{action:"name/cos:GetObject",bucket:o,region:r,prefix:s},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(e,n){if(e)return t(e);var i=Te.clone(n.CopyObjectResult||{});Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function ie(e,t){var n=e.CopySource||"",i=n.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!i)return void t({error:"CopySource format error"});var a=i[1],o=i[3],r=decodeURIComponent(i[4]);Re.call(this,{Scope:[{action:"name/cos:GetObject",bucket:a,region:o,prefix:r},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers},function(e,n){if(e)return t(e);var i=Te.clone(n.CopyPartResult||{});Te.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function ae(e,t){var n=e.Objects||[],i=e.Quiet;n=Te.isArray(n)?n:[n];var a=Te.json2xml({Delete:{Object:n,Quiet:i||!1}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a));var r=Te.map(n,function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}});Re.call(this,{Scope:r,method:"POST",Bucket:e.Bucket,Region:e.Region,body:a,action:"delete",headers:o},function(e,n){if(e)return t(e);var i=n.DeleteResult||{},a=i.Deleted||[],o=i.Error||[];a=Te.isArray(a)?a:[a],o=Te.isArray(o)?o:[o];var r=Te.clone(i);Te.extend(r,{Error:o,Deleted:a,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function oe(e,t){var n=e.Headers;if(!e.RestoreRequest)return void t({error:"missing param RestoreRequest"});var i=e.RestoreRequest||{},a=Te.json2xml({RestoreRequest:i});n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:a,action:"restore",headers:n},function(e,n){t(e,n)})}function re(e,t){var n=e.Tagging||{},i=n.TagSet||n.Tags||e.Tags||[];i=Te.clone(Te.isArray(i)?i:[i]);var a=Te.json2xml({Tagging:{TagSet:{Tag:i}}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(a)),Re.call(this,{Interface:"putObjectTagging",Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:a,action:"tagging",headers:o,VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function se(e,t){Re.call(this,{Interface:"getObjectTagging",Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var i={Tags:[],statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else{var a=[];try{a=n.Tagging.TagSet.Tag||[]}catch(e){}a=Te.clone(Te.isArray(a)?a:[a]),t(null,{Tags:a,statusCode:n.statusCode,headers:n.headers})}})}function ce(e,t){Re.call(this,{Interface:"deleteObjectTagging",Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function le(e,t){var n=this,i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=Be.getType(e.Key)||"application/octet-stream"),Re.call(n,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query},function(e,n){return e?t(e):(n=Te.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,Te.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)})}function pe(e,t){var n=this;Te.getFileSize("multipartUpload",e,function(){Te.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(i){i&&(e.Headers["Content-MD5"]=Te.binaryBase64(i)),Re.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null},function(e,n){if(e)return t(e);t(null,{ETag:Te.attr(n.headers,"etag",{}),statusCode:n.statusCode,headers:n.headers})})})})}function ue(e,t){for(var n=this,i=e.UploadId,a=e.Parts,o=0,r=a.length;o-1?function(e){var t=e.match(/q-url-param-list.*?(?=&)/g)[0],n="q-url-param-list="+encodeURIComponent(t.replace(/q-url-param-list=/,"")).toLowerCase(),i=new RegExp(t,"g");return e.replace(i,n)}(n.Authorization):"sign="+encodeURIComponent(n.Authorization)),n.XCosSecurityToken&&(o+="&x-cos-security-token="+n.XCosSecurityToken),n.ClientIP&&(o+="&clientIP="+n.ClientIP),n.ClientUA&&(o+="&clientUA="+n.ClientUA),n.Token&&(o+="&token="+n.Token),a&&(o+="&"+a),setTimeout(function(){t(null,{Url:o})})}});return s?(o+="?"+s.Authorization+(s.XCosSecurityToken?"&x-cos-security-token="+s.XCosSecurityToken:""),a&&(o+="&"+a)):a&&(o+="?"+a),o}function ye(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},i=e&&e.AccessControlList||{},a=i.Grant;a&&(a=Te.isArray(a)?a:[a]);var o={READ:0,WRITE:0,FULL_CONTROL:0};return a&&a.length&&Te.each(a,function(i){"qcs::cam::anyone:anyone"===i.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===i.Grantee.URI?o[i.Permission]=1:i.Grantee.ID!==e.Owner.ID&&t[n[i.Permission]].push('id="'+i.Grantee.ID+'"')}),o.FULL_CONTROL||o.WRITE&&o.READ?t.ACL="public-read-write":o.READ?t.ACL="public-read":t.ACL="private",Te.each(n,function(e){t[e]=Ce(t[e].join(","))}),t}function Ce(e){var t,n,i=e.split(","),a={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(a="{Bucket}."+a)),a=a.replace(/\{\{AppId\}\}/gi,i).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,o).replace(/\{\{.*?\}\}/gi,""),a=a.replace(/\{AppId\}/gi,i).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,o).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(a)||(a="https://"+a),"/"===a.slice(-1)&&(a=a.slice(0,-1));var s=a;return e.ForcePathStyle&&(s+="/"+t),s+="/",r&&(s+=Te.camSafeUrlEncode(r).replace(/%2F/g,"/")),e.isLocation&&(s=s.replace(/^https?:\/\//,"")),s}function ke(e,t){var n=Te.clone(e.Headers),i="";Te.each(n,function(e,t){(""===e||["content-type","cache-control"].indexOf(t.toLowerCase())>-1)&&delete n[t],"host"===t.toLowerCase()&&(i=e)}),!i&&e.SignHost&&(n.Host=e.SignHost);var a=function(e){var n=!1,i=e.Authorization;if(i)if(i.indexOf(" ")>-1)n=!1;else if(i.indexOf("q-sign-algorithm=")>-1&&i.indexOf("q-ak=")>-1&&i.indexOf("q-sign-time=")>-1&&i.indexOf("q-key-time=")>-1&&i.indexOf("q-url-param-list=")>-1)n=!0;else try{i=Ae.atob(i),i.indexOf("a=")>-1&&i.indexOf("k=")>-1&&i.indexOf("t=")>-1&&i.indexOf("r=")>-1&&i.indexOf("b=")>-1&&(n=!0)}catch(e){}n?t&&t(null,e):t&&t("authorization error")},o=this,r=e.Bucket||"",s=e.Region||"",c="name/cos:PostObject"!==e.Action&&e.Key?e.Key:"";o.options.ForcePathStyle&&r&&(c=r+"/"+c);var l="/"+c,p={},u=e.Scope;if(!u){var d=e.Action||"",m=e.ResourceKey||e.Key||"";u=e.Scope||[{action:d,bucket:r,region:s,prefix:m}]}var f=Te.md5(JSON.stringify(u));o._StsCache=o._StsCache||[],function(){var e,t;for(e=o._StsCache.length-1;e>=0;e--){t=o._StsCache[e];var n=Math.round(Te.getSkewTime(o.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)o._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===f){p=t;break}}}();var h=function(){var t=p.StartTime&&p.ExpiredTime?p.StartTime+";"+p.ExpiredTime:"",i=Te.getAuth({SecretId:p.TmpSecretId,SecretKey:p.TmpSecretKey,Method:e.Method,Pathname:l,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:o.options.SystemClockOffset,KeyTime:t}),r={Authorization:i,XCosSecurityToken:p.XCosSecurityToken||"",Token:p.Token||"",ClientIP:p.ClientIP||"",ClientUA:p.ClientUA||""};a(r)};if(p.ExpiredTime&&p.ExpiredTime-Te.getSkewTime(o.options.SystemClockOffset)/1e3>60)h();else if(o.options.getAuthorization)o.options.getAuthorization.call(o,{Bucket:r,Region:s,Method:e.Method,Key:c,Pathname:l,Query:e.Query,Headers:n,Scope:u,SystemClockOffset:o.options.SystemClockOffset},function(e){"string"==typeof e&&(e={Authorization:e}),e.TmpSecretId&&e.TmpSecretKey&&e.XCosSecurityToken&&e.ExpiredTime?(p=e||{},p.Scope=u,p.ScopeKey=f,o._StsCache.push(p),h()):a(e)});else{if(!o.options.getSTS)return function(){var t=Te.getAuth({SecretId:e.SecretId||o.options.SecretId,SecretKey:e.SecretKey||o.options.SecretKey,Method:e.Method,Pathname:l,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:o.options.SystemClockOffset}),i={Authorization:t,XCosSecurityToken:o.options.XCosSecurityToken};return a(i),i}();o.options.getSTS.call(o,{Bucket:r,Region:s},function(e){p=e||{},p.Scope=u,p.ScopeKey=f,p.TmpSecretId=p.SecretId,p.TmpSecretKey=p.SecretKey,o._StsCache.push(p),h()})}return""}function Se(e){var t=!1,n=!1,i=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var a=e.error.Code,o=e.error.Message;("RequestTimeTooSkewed"===a||"AccessDenied"===a&&"Request has expired"===o)&&(n=!0)}catch(e){}if(e)if(n&&i){var r=Date.parse(i);this.options.CorrectClockSkew&&Math.abs(Te.getSkewTime(this.options.SystemClockOffset)-r)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=r-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0);return t}function Re(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=Te.clearKey(e.qs),e.headers&&(e.headers=Te.clearKey(e.headers)),e.qs&&(e.qs=Te.clearKey(e.qs));var i=Te.clone(e.qs);e.action&&(i[e.action]="");var a=e.url||e.Url,o=e.SignHost||Ee.call(this,{Bucket:e.Bucket,Region:e.Region,Url:a});!function a(r){var s=n.options.SystemClockOffset;ke.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:i,Headers:e.headers,SignHost:o,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope},function(i,o){if(i)return void t(i);e.AuthData=o,we.call(n,e,function(i,o){i&&r<2&&(s!==n.options.SystemClockOffset||Se.call(n,i))?(e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,delete e.headers["x-cos-security-token"]),a(r+1)):t(i,o)})})}(1)}function we(e,t){var n=this,i=e.TaskId;if(!i||n._isRunningTask(i)){var a=e.Bucket,o=e.Region,r=e.Key,s=e.method||"GET",c=e.url||e.Url,l=e.body,p=e.json,u=e.rawBody;n.options.UseAccelerate&&(o="accelerate"),c=c||be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:a,region:o,object:r}),e.action&&(c=c+"?"+e.action),e.qsStr&&(c=c.indexOf("?")>-1?c+"&"+e.qsStr:c+"?"+e.qsStr);var d={method:s,url:c,headers:e.headers,qs:e.qs,filePath:e.filePath,body:l,json:p},m="x-cos-security-token";Te.isCIHost(c)&&(m="x-ci-security-token"),d.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(d.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(d.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(d.headers.clientUA=e.AuthData.ClientUA),e.AuthData.XCosSecurityToken&&(d.headers[m]=e.AuthData.XCosSecurityToken),d.headers&&(d.headers=Te.clearKey(d.headers)),d=Te.clearKey(d),e.onProgress&&"function"==typeof e.onProgress&&(d.onProgress=function(t){if(!i||n._isRunningTask(i)){var a=t?t.loaded:0;e.onProgress({loaded:a,total:t.total})}}),this.options.Timeout&&(d.timeout=this.options.Timeout),n.options.ForcePathStyle&&(d.pathStyle=n.options.ForcePathStyle),n.emit("before-send",d);var f=_e(d,function(e,a,o){if("abort"!==e){var r,s=function(e,o){if(i&&n.off("inner-kill-task",h),!r){r=!0;var s={};a&&a.statusCode&&(s.statusCode=a.statusCode),a&&a.headers&&(s.headers=a.headers),e?(e=Te.extend(e||{},s),t(e,null)):(o=Te.extend(o||{},s),t(null,o)),f=null}};if(e)return void s({error:e});var c;if(u)c={},c.body=o;else try{c=o&&o.indexOf("<")>-1&&o.indexOf(">")>-1&&Te.xml2json(o)||{}}catch(e){c=o||{}}var l=a.statusCode;return 2===Math.floor(l/100)?c.Error?void s({error:c.Error}):void s(null,c):void s({error:c.Error||c})}}),h=function e(t){t.TaskId===i&&(f&&f.abort&&f.abort(),n.off("inner-kill-task",e))};i&&n.on("inner-kill-task",h)}}var _e=n(19),Ae=n(3),Te=n(0),Be=n(20),Ee=function(e){if(!e.Bucket||!e.Bucket)return"";var t=e.Url||be({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:e.Region}),n=t.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");return new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$").test(n)?n:""},Oe={getService:i,putBucket:a,headBucket:o,getBucket:r,deleteBucket:s,putBucketAcl:c,getBucketAcl:l,putBucketCors:p,getBucketCors:u,deleteBucketCors:d,getBucketLocation:m,getBucketPolicy:h,putBucketPolicy:f,deleteBucketPolicy:g,putBucketTagging:v,getBucketTagging:x,deleteBucketTagging:y,putBucketLifecycle:C,getBucketLifecycle:b,deleteBucketLifecycle:k,putBucketVersioning:S,getBucketVersioning:R,putBucketReplication:w,getBucketReplication:_,deleteBucketReplication:A,putBucketWebsite:T,getBucketWebsite:B,deleteBucketWebsite:E,putBucketReferer:O,getBucketReferer:D,putBucketDomain:I,getBucketDomain:N,deleteBucketDomain:P,putBucketOrigin:j,getBucketOrigin:M,deleteBucketOrigin:U,putBucketLogging:H,getBucketLogging:F,putBucketInventory:L,getBucketInventory:z,listBucketInventory:K,deleteBucketInventory:q,putBucketAccelerate:G,getBucketAccelerate:V,getObject:$,headObject:X,listObjectVersions:W,putObject:Q,postObject:J,deleteObject:Y,getObjectAcl:Z,putObjectAcl:ee,optionsObject:te,putObjectCopy:ne,deleteMultipleObject:ae,restoreObject:oe,putObjectTagging:re,getObjectTagging:se,deleteObjectTagging:ce,appendObject:he,uploadPartCopy:ie,multipartInit:le,multipartUpload:pe,multipartComplete:ue,multipartList:de,multipartListPart:me,multipartAbort:fe,request:ge,getObjectUrl:xe,getAuth:ve};e.exports.init=function(e,t){t.transferToTaskMethod(Oe,"postObject"),t.transferToTaskMethod(Oe,"putObject"),Te.each(Oe,function(t,n){e.prototype[n]=Te.apiWrapper(n,t)})}},function(e,t,n){"use strict";function i(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function a(e,t){var n=[];for(var a in e)e.hasOwnProperty(a)&&n.push(t?i(a).toLowerCase():a);return n.sort(function(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),e===t?0:e>t?1:-1})}var o=function(e,t){var n,o,r,s=[],c=a(e);for(n=0;n-1||m.indexOf(f)>-1)&&(d[f]=e.headers[f]);a["x-cos-acl"]&&(d.acl=a["x-cos-acl"]),!d["Content-Type"]&&(d["Content-Type"]=""),n=wx.uploadFile({url:r,method:s,name:"file",header:a,filePath:i,formData:d,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}}),n.onProgressUpdate(function(e){c&&c({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend,progress:e.progress/100})})}else{var h=e.qs&&o(e.qs)||"";h&&(r+=(r.indexOf("?")>-1?"&":"?")+h),a["Content-Length"]&&delete a["Content-Length"],n=wx.request({url:r,method:s,header:a,dataType:"text",data:e.body,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}})}return n};e.exports=r},function(e,t,n){"use strict";var i=n(21);e.exports=new i(n(22),n(23))},function(e,t,n){"use strict";function i(){this._types=Object.create(null),this._extensions=Object.create(null);for(var e=0;em)return t(null,!1);if(n>1){if(Math.max(e[0].Size,e[1].Size)!==d)return t(null,!1)}!function i(a){if(a=c.length)return void S.emit("has_and_check_upload_id",t);var p=c[o];return C.isInArray(t,p)?v.using[p]?void e(o+1):void r.call(l,{Bucket:i,Region:a,Key:s,UploadId:p},function(t,i){l._isRunningTask(n)&&(t?(v.removeUploadId(p),e(o+1)):S.emit("upload_id_available",{UploadId:p,PartList:i.PartList}))}):(v.removeUploadId(p),void e(o+1))}(0)}),S.on("get_remote_upload_id_list",function(){o.call(l,{Bucket:i,Region:a,Key:s},function(t,a){if(l._isRunningTask(n)){if(t)return S.emit("error",t);var o=C.filter(a.UploadList,function(e){return e.Key===s&&(!c||e.StorageClass.toUpperCase()===c.toUpperCase())}).reverse().map(function(e){return e.UploadId||e.UploadID});if(o.length)S.emit("seek_local_avail_upload_id",o);else{var r,p=v.getFileId(e.FileStat,e.ChunkSize,i,s);p&&(r=v.getUploadIdList(p))&&C.each(r,function(e){v.removeUploadId(e)}),S.emit("no_available_upload_id")}}})}),S.emit("get_remote_upload_id_list")}function o(e,t){var n=this,i=[],a={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key};!function e(){n.multipartList(a,function(n,o){if(n)return t(n);i.push.apply(i,o.Upload||[]),"true"===o.IsTruncated?(a.KeyMarker=o.NextKeyMarker,a.UploadIdMarker=o.NextUploadIdMarker,e()):t(null,{UploadList:i})})}()}function r(e,t){var n=this,i=[],a={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId};!function e(){n.multipartListPart(a,function(n,o){if(n)return t(n);i.push.apply(i,o.Part||[]),"true"===o.IsTruncated?(a.PartNumberMarker=o.NextPartNumberMarker,e()):t(null,{PartList:i})})}()}function s(e,t){var n=this,i=e.TaskId,a=e.Bucket,o=e.Region,r=e.Key,s=e.UploadData,l=e.FileSize,p=e.SliceSize,u=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),d=e.FilePath,m=Math.ceil(l/p),f=0,h=e.ServerSideEncryption,g=C.filter(s.PartList,function(e){return e.Uploaded&&(f+=e.PartNumber>=m?l%p||p:p),!e.Uploaded}),v=e.onProgress;x.eachLimit(g,u,function(e,t){if(n._isRunningTask(i)){var u=e.PartNumber,m=Math.min(l,e.PartNumber*p)-(e.PartNumber-1)*p,g=0;c.call(n,{TaskId:i,Bucket:a,Region:o,Key:r,SliceSize:p,FileSize:l,PartNumber:u,ServerSideEncryption:h,FilePath:d,UploadData:s,onProgress:function(e){f+=e.loaded-g,g=e.loaded,v({loaded:f,total:l})}},function(a,o){n._isRunningTask(i)&&(a?f-=g:(f+=m-g,e.ETag=o.ETag),v({loaded:f,total:l}),t(a||null,o))})}},function(e){if(n._isRunningTask(i))return e?t(e):void t(null,{UploadId:s.UploadId,SliceList:s.PartList})})}function c(e,t){var n=this,i=e.TaskId,a=e.Bucket,o=e.Region,r=e.Key,s=e.FileSize,c=e.FilePath,l=1*e.PartNumber,p=e.SliceSize,u=e.ServerSideEncryption,d=e.UploadData,m=n.options.ChunkRetryTimes+1,f=e.Headers||{},h=p*(l-1),g=p,v=h+p;v>s&&(v=s,g=v-h);var y=["x-cos-traffic-limit","x-cos-mime-limit"],b={};C.each(f,function(e,t){y.indexOf(t)>-1&&(b[t]=e)}),C.fileSlice(c,h,v,function(s){var c=C.getFileMd5(s),p=c?C.binaryBase64(c):null,f=d.PartList[l-1];x.retry(m,function(t){n._isRunningTask(i)&&n.multipartUpload({TaskId:i,Bucket:a,Region:o,Key:r,ContentLength:g,PartNumber:l,UploadId:d.UploadId,ServerSideEncryption:u,Body:s,Headers:b,onProgress:e.onProgress,ContentMD5:p},function(e,a){if(n._isRunningTask(i))return e?t(e):(f.Uploaded=!0,t(null,a))})},function(e,a){if(n._isRunningTask(i))return t(e,a)})})}function l(e,t){var n=e.Bucket,i=e.Region,a=e.Key,o=e.UploadId,r=e.SliceList,s=this,c=this.options.ChunkRetryTimes+1,l=r.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});x.retry(c,function(e){s.multipartComplete({Bucket:n,Region:i,Key:a,UploadId:o,Parts:l},e)},function(e,n){t(e,n)})}function p(e,t){var n=e.Bucket,i=e.Region,a=e.Key,r=e.UploadId,s=e.Level||"task",c=e.AsyncLimit,l=this,p=new y;if(p.on("error",function(e){return t(e)}),p.on("get_abort_array",function(o){u.call(l,{Bucket:n,Region:i,Key:a,Headers:e.Headers,AsyncLimit:c,AbortArray:o},function(e,n){if(e)return t(e);t(null,n)})}),"bucket"===s)o.call(l,{Bucket:n,Region:i},function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])});else if("file"===s){if(!a)return t({error:"abort_upload_task_no_key"});o.call(l,{Bucket:n,Region:i,Key:a},function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])})}else{if("task"!==s)return t({error:"abort_unknown_level"});if(!r)return t({error:"abort_upload_task_no_id"});if(!a)return t({error:"abort_upload_task_no_key"});p.emit("get_abort_array",[{Key:a,UploadId:r}])}}function u(e,t){var n=e.Bucket,i=e.Region,a=e.Key,o=e.AbortArray,r=e.AsyncLimit||1,s=this,c=0,l=new Array(o.length);x.eachLimit(o,r,function(t,o){var r=c;if(a&&a!==t.Key)return l[r]={error:{KeyNotMatch:!0}},void o(null);var p=t.UploadId||t.UploadID;s.multipartAbort({Bucket:n,Region:i,Key:t.Key,Headers:e.Headers,UploadId:p},function(e){var a={Bucket:n,Region:i,Key:t.Key,UploadId:p};l[r]={error:e,task:a},o(null)}),c++},function(e){if(e)return t(e);for(var n=[],i=[],a=0,o=l.length;ai?"sliceUploadFile":"postObject";a.push({api:p,params:e,callback:l}),n._addTasks(a)}function m(e,t){var n=this,i=void 0===e.SliceSize?n.options.SliceSize:e.SliceSize,a=0,o=0,r=C.throttleOnProgress.call(n,o,e.onProgress),s=e.files.length,c=e.onFileFinish,l=Array(s),p=function(e,n,i){r(null,!0),c&&c(e,n,i),l[i.Index]={options:i,error:e,data:n},--s<=0&&t&&t(null,{files:l})},u=[];C.each(e.files,function(e,t){var n=e.FileSize,s={Index:t,TaskId:""};a+=n,C.each(e,function(e,t){"object"!==(void 0===e?"undefined":g(e))&&"function"!=typeof e&&(s[t]=e)});var c=e.onTaskReady;e.onTaskReady=function(e){s.TaskId=e,c&&c(e)};var l=0,d=e.onProgress;e.onProgress=function(e){o=o-l+e.loaded,l=e.loaded,d&&d(e),r({loaded:o,total:a})};var m=e.onFileFinish,f=function(e,t){m&&m(e,t),p&&p(e,t,s)},h=n>i?"sliceUploadFile":"postObject";u.push({api:h,params:e,callback:f})}),n._addTasks(u)}function f(e,t){var n=new y,i=this,a=e.Bucket,o=e.Region,r=e.Key,s=e.CopySource,c=s.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!c)return void t({error:"CopySource format error"});var l=c[1],p=c[3],u=decodeURIComponent(c[4]),d=void 0===e.CopySliceSize?i.options.CopySliceSize:e.CopySliceSize;d=Math.max(0,d);var m,f,g=e.CopyChunkSize||this.options.CopyChunkSize,v=this.options.CopyChunkParallelLimit,b=0;n.on("copy_slice_complete",function(e){i.multipartComplete({Bucket:a,Region:o,Key:r,UploadId:e.UploadId,Parts:e.PartList},function(e,n){if(e)return f(null,!0),t(e);f({loaded:m,total:m},!0),t(null,n)})}),n.on("get_copy_data_finish",function(e){x.eachLimit(e.PartList,v,function(t,n){var c=t.PartNumber,l=t.CopySourceRange,p=t.end-t.start,u=0;h.call(i,{Bucket:a,Region:o,Key:r,CopySource:s,UploadId:e.UploadId,PartNumber:c,CopySourceRange:l,onProgress:function(e){b+=e.loaded-u,u=e.loaded,f({loaded:b,total:m})}},function(e,i){if(e)return n(e);f({loaded:b,total:m}),b+=p-u,t.ETag=i.ETag,n(e||null,i)})},function(i){if(i)return f(null,!0),t(i);n.emit("copy_slice_complete",e)})}),n.on("get_file_size_finish",function(s){!function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,a=0;a"x-cos-meta-".length&&(s[t]=e)}),n.emit("get_file_size_finish",s)}})}function h(e,t){var n=e.TaskId,i=e.Bucket,a=e.Region,o=e.Key,r=e.CopySource,s=e.UploadId,c=1*e.PartNumber,l=e.CopySourceRange,p=this.options.ChunkRetryTimes+1,u=this;x.retry(p,function(t){u.uploadPartCopy({TaskId:n,Bucket:i,Region:a,Key:o,CopySource:r,UploadId:s,PartNumber:c,CopySourceRange:l,onProgress:e.onProgress},function(e,n){t(e||null,n)})},function(e,n){return t(e,n)})}var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v=n(5),x=n(25),y=n(4).EventProxy,C=n(0),b={sliceUploadFile:i,abortUploadTask:p,uploadFile:d,uploadFiles:m,sliceCopyFile:f};e.exports.init=function(e,t){t.transferToTaskMethod(b,"sliceUploadFile"),C.each(b,function(t,n){e.prototype[n]=C.apiWrapper(n,t)})}},function(e,t,n){"use strict";var i=function(e,t,n,i){if(i=i||function(){},!e.length||t<=0)return i();var a=0,o=0,r=0;!function s(){if(a>=e.length)return i();for(;r=e.length?i():s())})}()},a=function(e,t,n){e<1?n():function i(a){t(function(t,o){t&&a -1 ? '&' : '?') + qsStr; }