(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["addVisit~creationedit~massOperation"],{"40b3":function(module,exports,__webpack_require__){(function(e,t){module.exports=t()})(0,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s="./index.js")}({"./index.js": /*!******************!*\ !*** ./index.js ***! \******************/ /*! no static exports found */function(e,t,n){var r=n(/*! ./src/cos */"./src/cos.js");e.exports=r},"./lib/base64.js": /*!***********************!*\ !*** ./lib/base64.js ***! \***********************/ /*! no static exports found */function(e,t){var n=function(e){e=e||{};var t,n=e.Base64,r="2.1.9",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t={},n=0,r=e.length;n>>6)+a(128|63&t):a(224|t>>>12&15)+a(128|t>>>6&63)+a(128|63&t)}t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return a(240|t>>>18&7)+a(128|t>>>12&63)+a(128|t>>>6&63)+a(128|63&t)},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(e){return e.replace(c,s)},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),r=[o.charAt(n>>>18),o.charAt(n>>>12&63),t>=2?"=":o.charAt(n>>>6&63),t>=1?"=":o.charAt(63&n)];return r.join("")},d=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,l)},p=t?function(e){return(e.constructor===t.constructor?e:new t(e)).toString("base64")}:function(e){return d(u(e))},f=function(e,t){return t?p(String(e)).replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,""):p(String(e))},h=function(e){return f(e,!0)},m=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),g=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 a(55296+(n>>>10))+a(56320+(1023&n));case 3:return a((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return a((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},y=function(e){return e.replace(m,g)},v=function(e){var t=e.length,n=t%4,r=(t>0?i[e.charAt(0)]<<18:0)|(t>1?i[e.charAt(1)]<<12:0)|(t>2?i[e.charAt(2)]<<6:0)|(t>3?i[e.charAt(3)]:0),o=[a(r>>>16),a(r>>>8&255),a(255&r)];return o.length-=[0,0,2,1][n],o.join("")},C=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,v)},b=t?function(e){return(e.constructor===t.constructor?e:new t(e,"base64")).toString()}:function(e){return y(C(e))},k=function(e){return b(String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,""))},S=function(){var t=e.Base64;return e.Base64=n,t},w={VERSION:r,atob:C,btoa:d,fromBase64:k,toBase64:f,utob:u,encode:f,encodeURI:h,btou:y,decode:k,noConflict:S};return w}();e.exports=n},"./lib/beacon.min.js": /*!***************************!*\ !*** ./lib/beacon.min.js ***! \***************************/ /*! no static exports found */function(e,t,n){var r,o,i=n(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");!function(a,s){"object"==i(t)&&"undefined"!=typeof e?e.exports=s():(r=s,o="function"===typeof r?r.call(t,n,t,e):r,void 0===o||(e.exports=o))}(0,(function(){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)},t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]60*this.strategy.requestInterval*1e3},e.prototype.getUploadUrl=function(){return this.strategy.httpsUploadUrl+"?appkey="+this.appkey},e.prototype.isBlackEvent=function(e){return-1!=this.strategy.blacklist.indexOf(e)},e.prototype.isEventUpOnOff=function(){return this.strategy.isEventUpOnOff},e.prototype.isSampleEvent=function(e){return!!Object.prototype.hasOwnProperty.call(this.realSample,e)&&this.realSample[e]this.duration)return this.createSession();t=r.sessionId,n=r.sessionStart,this.getSessionStackDepth=0}catch(e){}return{sessionId:t,sessionStart:n}},e.prototype.createSession=function(){var e=Date.now(),t={sessionId:this.appkey+"_"+e.toString(),sessionStart:e};this.storage.setItem(v,JSON.stringify(t)),this.storage.setItem(a,e.toString());var n="is_new_user",r=this.storage.getItem(n);return this.getSessionStackDepth<=1&&this.beacon.onDirectUserAction("rqd_applaunched",{A21:r?"N":"Y"}),this.storage.setItem(n,JSON.stringify(!1)),t},e}();function b(){var e=navigator.userAgent,t=e.indexOf("compatible")>-1&&e.indexOf("MSIE")>-1,n=e.indexOf("Edge")>-1&&!t,r=e.indexOf("Trident")>-1&&e.indexOf("rv:11.0")>-1;if(t){new RegExp("MSIE (\\d+\\.\\d+);").test(e);var o=parseFloat(RegExp.$1);return 7==o?7:8==o?8:9==o?9:10==o?10:6}return n?-2:r?11:-1}function k(e,t){var n,r;return(n="https://tun-cos-1258344701.file.myqcloud.com/fp.js",void 0===r&&(r=Date.now()+"-"+Math.random()),new Promise((function(e,t){if(document.getElementById(r))e(void 0);else{var o=document.getElementsByTagName("head")[0],i=document.createElement("script");i.onload=function(){return function(){i.onload=null,e(void 0)}},i.onerror=function(e){i.onerror=null,o.removeChild(i),t(e)},i.src=n,i.id=r,o.appendChild(i)}}))).then((function(){(new Fingerprint).getQimei36(e,t)})).catch((function(e){})),""}var S,w=function(){return(w=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0||!window.indexedDB||/X5Lite/.test(navigator.userAgent)?(this.store=new A(t),this.dbEventCount=this.store.getCount()):(this.store=new R(e),this.getCount().then((function(e){n.dbEventCount=e})).catch((function(e){})))}return e.prototype.getCount=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.store.getCount()];case 1:return[2,e.sent()];case 2:return e.sent(),[2,Promise.reject()];case 3:return[2]}}))}))},e.prototype.insertEvent=function(e,t){return n(this,void 0,void 0,(function(){var n,o;return r(this,(function(r){switch(r.label){case 0:if(this.dbEventCount>=1e4)return[2,Promise.reject()];n=f(e.mapValue),r.label=1;case 1:return r.trys.push([1,3,,4]),this.dbEventCount++,[4,this.store.setItem(n,e)];case 2:return[2,r.sent()];case 3:return o=r.sent(),t&&t(o,e),this.dbEventCount--,[2,Promise.reject()];case 4:return[2]}}))}))},e.prototype.getEvents=function(){return n(this,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:e=[],t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.store.iterate((function(t){e.push(t)}))];case 2:return t.sent(),[2,Promise.all(e)];case 3:return t.sent(),[2,Promise.all(e)];case 4:return[2]}}))}))},e.prototype.removeEvent=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(n){switch(n.label){case 0:t=f(e.mapValue),n.label=1;case 1:return n.trys.push([1,3,,4]),this.dbEventCount--,[4,this.store.removeItem(t)];case 2:return[2,n.sent()];case 3:return n.sent(),this.dbEventCount++,[2,Promise.reject()];case 4:return[2]}}))}))},e}(),O=function(){return(O=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&i<8,t.isUnderIE8||(t.isUnderIE=i>0,e.needInitQimei&&k(e.appkey,(function(e){t.qimei36=e.q36})),t.network=new G(e),t.storage=new V(e.appkey),t.initCommonInfo(e),t.store=new _(e.appkey,t.storage),t.errorReport=new g(t.config,t.commonInfo,"web",t.network),t.strategy=new y(null==e.needQueryConfig||e.needQueryConfig,t.config,t.commonInfo,t.storage,t.network),t.logidStartTime=t.storage.getItem(X),t.logidStartTime||(t.logidStartTime=Date.now().toString(),t.storage.setItem(X,t.logidStartTime)),r=t.logidStartTime,o=Date.now()-Number.parseFloat(r),Math.floor(o/864e5)>=365&&t.storage.clear(),t.initSession(e),t.onDirectUserAction("rqd_js_init",{}),setTimeout((function(){return t.lifeCycle.emit("init")}),0),t.initDelayTime=e.delay?e.delay:1e3,t.cycleTask(t.initDelayTime)),t}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,n),r.prototype.initSession=function(e){var t=18e5;e.sessionDuration&&e.sessionDuration>3e4&&(t=e.sessionDuration),this.beaconSession=new C(this.storage,t,this)},r.prototype.initCommonInfo=function(e){var t=Number(this.storage.getItem(a));try{var n=JSON.parse(this.storage.getItem(s));(Date.now()-t>3e4||!n)&&this.storage.setItem(s,JSON.stringify([]))}catch(e){}e.uploadUrl&&(this.uploadUrl=e.uploadUrl+"?appkey="+e.appkey);var r=[window.screen.width,window.screen.height];window.devicePixelRatio&&r.push(window.devicePixelRatio),this.commonInfo={deviceId:this.storage.createDeviceId(),language:navigator&&navigator.language||"zh_CN",query:window.location.search,userAgent:navigator.userAgent,pixel:r.join("*"),channelID:e.channelID?String(e.channelID):"",openid:e.openid?String(e.openid):"",unid:e.unionid?String(e.unionid):"",sdkVersion:W},this.config.appVersion=e.versionCode?String(e.versionCode):"",this.config.strictMode=e.strictMode},r.prototype.cycleTask=function(e){var t=this;this.intervalID=window.setInterval((function(){t.pauseSearching||t.store.getEvents().then((function(e){0==e.length&&(t.pauseSearching=!0);var n=[],r=JSON.parse(t.storage.getItem(s));r||(r=[]),e&&e.forEach((function(e){var t=f(e.mapValue);-1==r.indexOf(t)&&(n.push(e),r.push(t))})),0!=n.length&&(t.storage.setItem(s,JSON.stringify(r)),t._normalLogPipeline(t.assembleData(n)))})).catch((function(e){}))}),e)},r.prototype.onReport=function(e,t,n){var r=this;if(this.isUnderIE8)this.errorReport.reportError("601","UnderIE8");else{this.pauseSearching=!1;var o=this.generateData(e,t,n);if(n&&0==this.delayTime&&!this.underWeakNet)this._normalLogPipeline(this.assembleData(o));else{var i=o.shift();i&&this.store.insertEvent(i,(function(e){e&&r.errorReport.reportError("604","insertEvent fail!")})).catch((function(e){r._normalLogPipeline(r.assembleData(o))}))}}},r.prototype.onSendBeacon=function(e,t){if(this.isUnderIE)this.errorReport.reportError("605","UnderIE");else{this.pauseSearching=!1;var n=this.assembleData(this.generateData(e,t,!0));"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(this.uploadUrl||this.strategy.getUploadUrl(),JSON.stringify(n))}},r.prototype.generateData=function(e,n,r){var o=[],i="4.5.14-web_"+(r?"direct_log_id":"normal_log_id"),a=Number(this.storage.getItem(i));return a=a||1,n=t(t({},n),{A99:r?"Y":"N",A100:a.toString(),A72:W,A88:this.logidStartTime}),a++,this.storage.setItem(i,a.toString()),o.push({eventCode:e,eventTime:Date.now().toString(),mapValue:d(n,this.config.strictMode)}),o},r.prototype.assembleData=function(e){var n=this.beaconSession.getSession();return{appVersion:this.config.appVersion?p(this.config.appVersion):"",sdkId:"js",sdkVersion:W,mainAppKey:this.config.appkey,platformId:3,common:d(t(t({},this.additionalParams),{A2:this.commonInfo.deviceId,A8:this.commonInfo.openid,A12:this.commonInfo.language,A17:this.commonInfo.pixel,A23:this.commonInfo.channelID,A50:this.commonInfo.unid,A76:n.sessionId,A101:this.commonInfo.userAgent,A102:window.location.href,A104:document.referrer,A119:this.commonInfo.query,A153:this.qimei36}),!1),events:e}},r.prototype.monitorUploadFailed=function(){this.uselessCycleTaskNum++,this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(6e4),this.underWeakNet=!0)},r.prototype.doCustomCycleTask=function(){this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(this.initDelayTime)),this.uselessCycleTaskNum=0,this.underWeakNet=!1},r}(m)}))},"./lib/crypto.js": /*!***********************!*\ !*** ./lib/crypto.js ***! \***********************/ /*! no static exports found */function(e,t,n){(function(e){var t=n(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),r=r||function(e,t){var n={},r=n.lib={},o=function(){},i=r.Base={extend:function(e){o.prototype=this;var t=new o;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=r.WordArray=i.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes;if(e=e.sigBytes,this.clamp(),r%4)for(var o=0;o>>2]|=(n[o>>>2]>>>24-o%4*8&255)<<24-(r+o)%4*8;else if(65535>>2]=n[o>>>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=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new a.init(n,t/2)}},u=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new a.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,s=o/(4*i);s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*i,o=e.min(4*t,o),t){for(var c=0;cu;u++){if(16>u)i[u]=0|e[t+u];else{var l=i[u-3]^i[u-8]^i[u-14]^i[u-16];i[u]=l<<1|l>>>31}l=(r<<5|r>>>27)+c+i[u],l=20>u?l+(1518500249+(o&a|~o&s)):40>u?l+(1859775393+(o^a^s)):60>u?l+((o&a|o&s|a&s)-1894007588):l+((o^a^s)-899497514),c=s,s=a,a=o<<30|o>>>2,o=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+a|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,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=o._createHelper(t),e.HmacSHA1=o._createHmacHelper(t)})(),function(){var e=r,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 r=e.blockSize,o=4*r;n.sigBytes>o&&(n=e.finalize(n)),n.clamp();for(var i=this._oKey=n.clone(),a=this._iKey=n.clone(),s=i.words,c=a.words,u=0;u>>2]>>>24-i%4*8&255,s=t[i+1>>>2]>>>24-(i+1)%4*8&255,c=t[i+2>>>2]>>>24-(i+2)%4*8&255,u=a<<16|s<<8|c,l=0;l<4&&i+.75*l>>6*(3-l)&63));var d=r.charAt(64);if(d)while(o.length%4)o.push(d);return o.join("")},parse:function(e){var t=e.length,r=this._map,o=r.charAt(64);if(o){var i=e.indexOf(o);-1!=i&&(t=i)}for(var a=[],s=0,c=0;c>>6-c%4*2;a[s>>>2]|=(u|l)<<24-s%4*8,s++}return n.create(a,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),"object"===t(e)?e.exports=r:window.CryptoJS=r}).call(this,n(/*! ./../node_modules/webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(e))},"./lib/json2xml.js": /*!*************************!*\ !*** ./lib/json2xml.js ***! \*************************/ /*! no static exports found */function(e,t,n){var r=n(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),o="a-zA-Z_À-ÖØ-öø-ÿͰ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿿、-퟿豈-﷏ﷰ-�",i="-.0-9·̀-ͯ‿⁀",a=new RegExp("^([^"+o+"])|^((x|X)(m|M)(l|L))|([^"+o+i+"])","g"),s=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,c=function(e){var t=[];if(e instanceof Object)for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},u=function(e,t){var n=function(e,n,r,o,i){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(o).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(a,"_"));var u=[c,"<",e,r||""];return n&&n.length>0?(u.push(">"),u.push(n),i&&u.push(c),u.push("")):u.push("/>"),u.join("")};return function e(o,i,a){var s=r(o);switch((Array.isArray?Array.isArray(o):o instanceof Array)?s="array":o instanceof Date&&(s="date"),s){case"array":var u=[];return o.map((function(t){u.push(e(t,1,a+1))})),t.prettyPrint&&u.push("\n"),u.join("");case"date":return o.toJSON?o.toJSON():o+"";case"object":var l=[];for(var p in o)if(o.hasOwnProperty(p))if(o[p]instanceof Array)for(var f=0;f0&&l.push("\n"),l.join("");case"function":return o();default:return t.escape?d(o):""+o}}(e,0,0)},l=function(e){var t=['"),t.join("")};function d(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(s,"")}e.exports=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(a){return!1}var n="",o="";t&&("object"==r(t)?(t.xmlHeader&&(n=l(!!t.xmlHeader.standalone)),"undefined"!=typeof t.docType&&(o="")):n=l()),t=t||{};var i=[n,t.prettyPrint&&o?"\n":"",o,u(e,t)];return i.join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")}},"./lib/md5.js": /*!********************!*\ !*** ./lib/md5.js ***! \********************/ /*! no static exports found */function(module,exports,__webpack_require__){(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");(function(){"use strict";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"===("undefined"===typeof 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__(/*! !webpack amd options */"./node_modules/webpack/buildin/amd-options.js"),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"===_typeof(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t,n){return new Md5(!0).update(t,n)[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>6,s[r++]=128|63&n):n<55296||n>=57344?(s[r++]=224|n>>12,s[r++]=128|n>>6&63,s[r++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),s[r++]=240|n>>18,s[r++]=128|n>>12&63,s[r++]=128|n>>6&63,s[r++]=128|63&n);else for(r=this.start;o>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(a[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}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,r,o,i,a=this.blocks;this.first?(e=a[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,r=(-1732584194^2004318071&e)+a[1]-117830708,r=(r<<12|r>>>20)+e<<0,n=(-271733879^r&(-271733879^e))+a[2]-1126478375,n=(n<<17|n>>>15)+r<<0,t=(e^n&(r^e))+a[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,r=this.h3,e+=(r^t&(n^r))+a[0]-680876936,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[1]-389564586,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[2]+606105819,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(r^t&(n^r))+a[4]-176418897,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[5]+1200080426,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[6]-1473231341,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+a[8]+1770035416,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[9]-1958414417,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[10]-42063,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+a[12]+1804603682,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[13]-40341101,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[14]-1502002290,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^r&(t^n))+a[1]-165796510,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[6]-1069501632,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[11]+643717713,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+a[5]-701558691,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[10]+38016083,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[15]-660478335,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+a[9]+568446438,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[14]-1019803690,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[3]-187363961,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+a[13]-1444681467,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[2]-51403784,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[7]+1735328473,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[12]-1926607734,t=(t<<20|t>>>12)+n<<0,o=t^n,e+=(o^r)+a[5]-378558,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[8]-2022574463,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[11]+1839030562,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[14]-35309556,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+a[1]-1530992060,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[4]+1272893353,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[7]-155497632,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[10]-1094730640,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+a[13]+681279174,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[0]-358537222,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[3]-722521979,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[6]+76029189,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+a[9]-640364487,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[12]-421815835,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[15]+530742520,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~r))+a[0]-198630844,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[7]+1126891415,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[14]-1416354905,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+a[12]+1700485571,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[3]-1894986606,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[10]-1051523,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+a[8]+1873313359,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[15]-30611744,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[6]-1560198380,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+a[4]-145523070,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[11]-1120210379,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[2]+718787259,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[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=r+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+r<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=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[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(e){if("hex"===e)return this.hex();this.finalize();var t=this.h0,n=this.h1,r=this.h2,o=this.h3,i=[255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255];return i},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,r="",o=this.array(),i=0;i<15;)e=o[i++],t=o[i++],n=o[i++],r+=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=o[i],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"==",r};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()}).call(this,__webpack_require__(/*! ./../node_modules/process/browser.js */"./node_modules/process/browser.js"),__webpack_require__(/*! ./../node_modules/webpack/buildin/global.js */"./node_modules/webpack/buildin/global.js"),__webpack_require__(/*! ./../node_modules/webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(module))},"./lib/request.js": /*!************************!*\ !*** ./lib/request.js ***! \************************/ /*! no static exports found */function(e,t,n){var r=n(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),o=function(e){switch(r(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},i=function(e,t,n,i){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"===r(e)?Object.keys(e).map((function(r){var i=encodeURIComponent(o(r))+n;return Array.isArray(e[r])?e[r].map((function(e){return i+encodeURIComponent(o(e))})).join(t):i+encodeURIComponent(o(e[r]))})).filter(Boolean).join(t):i?encodeURIComponent(o(i))+n+encodeURIComponent(o(e)):""},a=function(e,t,n){var r={};return t.getAllResponseHeaders().trim().split("\n").forEach((function(e){if(e){var t=e.indexOf(":"),n=e.substr(0,t).trim().toLowerCase(),o=e.substr(t+1).trim();r[n]=o}})),{error:e,statusCode:t.status,statusMessage:t.statusText,headers:r,body:n}},s=function(e,t){return t||"text"!==t?e.response:e.responseText},c=function(e,t){var n=(e.method||"GET").toUpperCase(),r=e.url;if(e.qs){var o=i(e.qs);o&&(r+=(-1===r.indexOf("?")?"?":"&")+o)}var c=new XMLHttpRequest;if(c.open(n,r,!0),c.responseType=e.dataType||"text",e.xhrFields)for(var u in e.xhrFields)c[u]=e.xhrFields[u];var l=e.headers;if(l)for(var d in l)l.hasOwnProperty(d)&&"content-length"!==d.toLowerCase()&&"user-agent"!==d.toLowerCase()&&"origin"!==d.toLowerCase()&&"host"!==d.toLowerCase()&&c.setRequestHeader(d,l[d]);return e.onProgress&&c.upload&&(c.upload.onprogress=e.onProgress),e.onDownloadProgress&&(c.onprogress=e.onDownloadProgress),e.timeout&&(c.timeout=e.timeout),c.ontimeout=function(e){var n=new Error("timeout");t(a(n,c))},c.onload=function(){t(a(null,c,s(c,e.dataType)))},c.onerror=function(n){var r=s(c,e.dataType);if(r)t(a(null,c,r));else{var o=c.statusText;o||0!==c.status||(o=new Error("CORS blocked or network error")),t(a(o,c,r))}},c.send(e.body||""),c};e.exports=c},"./lib/xml2json.js": /*!*************************!*\ !*** ./lib/xml2json.js ***! \*************************/ /*! no static exports found */function(e,t,n){var r=n(/*! @xmldom/xmldom */"./node_modules/@xmldom/xmldom/lib/index.js").DOMParser,o=function(){this.version="1.3.5";var e={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},t=new RegExp(/(?!xmlns)^.*:/);new RegExp(/^\s+|\s+$/g);return this.grokType=function(e){return/^\s*$/.test(e)?null:/^(?:true|false)$/i.test(e)?"true"===e.toLowerCase():isFinite(e)?parseFloat(e):e},this.parseString=function(e,t){if(e){var n=this.stringToXML(e);return n.getElementsByTagName("parsererror").length?null:this.parseXML(n,t)}return null},this.parseXML=function(n,r){for(var i in r)e[i]=r[i];var a={},s=0,c="",u=n.childNodes.length;if(u)for(var l,d,p,f=0;f=t+n||t?new java.lang.String(e,t,n)+"":e}function v(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}p.prototype.parseFromString=function(e,t){var n=this.options,r=new l,o=n.domBuilder||new h,a=n.errorHandler,s=n.locator,u=n.xmlns||{},p=/\/x?html?$/.test(t),m=p?i.HTML_ENTITIES:i.XML_ENTITIES;s&&o.setDocumentLocator(s),r.errorHandler=f(a,o,s),r.domBuilder=n.domBuilder||o,p&&(u[""]=c.HTML),u.xml=u.xml||c.XML;var g=n.normalizeLineEndings||d;return e&&"string"===typeof e?r.parse(g(e),u,m):r.errorHandler.error("invalid doc source"),o.doc},h.prototype={startDocument:function(){this.doc=(new s).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var o=this.doc,i=o.createElementNS(e,n||t),a=r.length;v(this,i),this.currentElement=i,this.locator&&m(this.locator,i);for(var s=0;s=0))throw new I(_,new Error(e.tagName+"@"+n));var o=t.length-1;while(r"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function K(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(K(e,t))return!0}while(e=e.nextSibling)}function q(){this.ownerDocument=this}function z(e,t,n){e&&e._inc++;var r=n.namespaceURI;r===i.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function G(e,t,n,r){e&&e._inc++;var o=n.namespaceURI;o===i.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function V(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{var o=t.firstChild,i=0;while(o)r[i++]=o,o=o.nextSibling;r.length=i,delete r[r.length]}}}function X(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,V(e.ownerDocument,e),t}function W(e){return e&&(e.nodeType===H.DOCUMENT_NODE||e.nodeType===H.DOCUMENT_FRAGMENT_NODE||e.nodeType===H.ELEMENT_NODE)}function Q(e){return e&&($(e)||Y(e)||J(e)||e.nodeType===H.DOCUMENT_FRAGMENT_NODE||e.nodeType===H.COMMENT_NODE||e.nodeType===H.PROCESSING_INSTRUCTION_NODE)}function J(e){return e&&e.nodeType===H.DOCUMENT_TYPE_NODE}function $(e){return e&&e.nodeType===H.ELEMENT_NODE}function Y(e){return e&&e.nodeType===H.TEXT_NODE}function Z(e,t){var n=e.childNodes||[];if(o(n,$)||J(t))return!1;var r=o(n,J);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function ee(e,t){var n=e.childNodes||[];function r(e){return $(e)&&e!==t}if(o(n,r))return!1;var i=o(n,J);return!(t&&i&&n.indexOf(i)>n.indexOf(t))}function te(e,t,n){if(!W(e))throw new I(A,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new I(_,"child not in parent");if(!Q(t)||J(t)&&e.nodeType!==H.DOCUMENT_NODE)throw new I(A,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function ne(e,t,n){var r=e.childNodes||[],i=t.childNodes||[];if(t.nodeType===H.DOCUMENT_FRAGMENT_NODE){var a=i.filter($);if(a.length>1||o(i,Y))throw new I(A,"More than one element or text in fragment");if(1===a.length&&!Z(e,n))throw new I(A,"Element in fragment can not be inserted before doctype")}if($(t)&&!Z(e,n))throw new I(A,"Only one element can be added and only after doctype");if(J(t)){if(o(r,J))throw new I(A,"Only one doctype is allowed");var s=o(r,$);if(n&&r.indexOf(s)1||o(i,Y))throw new I(A,"More than one element or text in fragment");if(1===a.length&&!ee(e,n))throw new I(A,"Element in fragment can not be inserted before doctype")}if($(t)&&!ee(e,n))throw new I(A,"Only one element can be added and only after doctype");if(J(t)){function s(e){return J(e)&&e!==n}if(o(r,s))throw new I(A,"Only one doctype is allowed");var c=o(r,$);if(n&&r.indexOf(c)=0;f--){var C=o[f];if(""===C.prefix&&C.namespace===e.namespaceURI){d=C.namespace;break}}if(d!==e.namespaceURI)for(f=o.length-1;f>=0;f--){C=o[f];if(C.namespace===e.namespaceURI){C.prefix&&(l=C.prefix+":"+u);break}}}t.push("<",l);for(var E=0;E"),n&&/^script$/i.test(u))while(c)c.data?t.push(c.data):Se(c,t,n,r,o.slice()),c=c.nextSibling;else while(c)Se(c,t,n,r,o.slice()),c=c.nextSibling;t.push("")}else t.push("/>");return;case S:case T:c=e.firstChild;while(c)Se(c,t,n,r,o.slice()),c=c.nextSibling;return;case m:return ke(t,e.name,e.value);case g:return t.push(e.data.replace(/[<&>]/g,F));case y:return t.push("");case k:return t.push("\x3c!--",e.data,"--\x3e");case w:var _=e.publicId,O=e.systemId;if(t.push("");else if(O&&"."!=O)t.push(" SYSTEM ",O,">");else{var I=e.internalSubset;I&&t.push(" [",I,"]"),t.push(">")}return;case b:return t.push("");case v:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function we(e,t,n){var r;switch(t.nodeType){case h:r=t.cloneNode(!1),r.ownerDocument=e;case T:break;case m:n=!0;break}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n){var o=t.firstChild;while(o)r.appendChild(we(e,o,n)),o=o.nextSibling}return r}function Te(e,t,n){var r=new t.constructor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var i=t[o];"object"!=typeof i&&i!=r[o]&&(r[o]=i)}switch(t.childNodes&&(r.childNodes=new B),r.ownerDocument=e,r.nodeType){case h:var a=t.attributes,s=r.attributes=new D,c=a.length;s._ownerElement=r;for(var u=0;u0},lookupPrefix:function(e){var t=this;while(t){var n=t._nsMap;if(n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e)return r;t=t.nodeType==m?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){var t=this;while(t){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==m?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return null==t}},d(f,H),d(f,H.prototype),q.prototype={nodeName:"#document",nodeType:S,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==T){var n=e.firstChild;while(n){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return oe(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===h&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),X(this,e)},replaceChild:function(e,t){oe(this,e,t,re),e.ownerDocument=this,t&&this.removeChild(t),$(e)&&(this.documentElement=e)},importNode:function(e,t){return we(this,e,t)},getElementById:function(e){var t=null;return K(this.documentElement,(function(n){if(n.nodeType==h&&n.getAttribute("id")==e)return t=n,!0})),t},getElementsByClassName:function(e){var t=u(e);return new P(this,(function(n){var r=[];return t.length>0&&K(n.documentElement,(function(o){if(o!==n&&o.nodeType===h){var i=o.getAttribute("class");if(i){var a=e===i;if(!a){var s=u(i);a=t.every(l(s))}a&&r.push(o)}}})),r}))},createElement:function(e){var t=new ae;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new B;var n=t.attributes=new D;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new ge;return e.ownerDocument=this,e.childNodes=new B,e},createTextNode:function(e){var t=new ue;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new le;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new de;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ye;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new se;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new me;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new ae,r=t.split(":"),o=n.attributes=new D;return n.childNodes=new B,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,o._ownerElement=n,n},createAttributeNS:function(e,t){var n=new se,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},p(q,H),ae.prototype={nodeType:h,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===T?this.insertBefore(e,null):ie(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 r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new P(this,(function(t){var n=[];return K(t,(function(r){r===t||r.nodeType!=h||"*"!==e&&r.tagName!=e||n.push(r)})),n}))},getElementsByTagNameNS:function(e,t){return new P(this,(function(n){var r=[];return K(n,(function(o){o===n||o.nodeType!==h||"*"!==e&&o.namespaceURI!==e||"*"!==t&&o.localName!=t||r.push(o)})),r}))}},q.prototype.getElementsByTagName=ae.prototype.getElementsByTagName,q.prototype.getElementsByTagNameNS=ae.prototype.getElementsByTagNameNS,p(ae,H),se.prototype.nodeType=m,p(se,H),ce.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(R[A])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){var r=this.data.substring(0,e),o=this.data.substring(e+t);n=r+n+o,this.nodeValue=this.data=n,this.length=n.length}},p(ce,H),ue.prototype={nodeName:"#text",nodeType:g,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 r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},p(ue,ce),le.prototype={nodeName:"#comment",nodeType:k},p(le,ce),de.prototype={nodeName:"#cdata-section",nodeType:y},p(de,ce),pe.prototype.nodeType=w,p(pe,H),fe.prototype.nodeType=E,p(fe,H),he.prototype.nodeType=C,p(he,H),me.prototype.nodeType=v,p(me,H),ge.prototype.nodeName="#document-fragment",ge.prototype.nodeType=T,p(ge,H),ye.prototype.nodeType=b,p(ye,H),ve.prototype.serializeToString=function(e,t,n){return Ce.call(e,t,n)},H.prototype.toString=Ce;try{if(Object.defineProperty){function xe(e){switch(e.nodeType){case h:case T:var t=[];e=e.firstChild;while(e)7!==e.nodeType&&8!==e.nodeType&&t.push(xe(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(P.prototype,"length",{get:function(){return N(this),this.$$length}}),Object.defineProperty(H.prototype,"textContent",{get:function(){return xe(this)},set:function(e){switch(this.nodeType){case h:case T:while(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}}}),Ee=function(e,t,n){e["$$"+t]=n}}}catch(Re){}t.DocumentType=pe,t.DOMException=I,t.DOMImplementation=L,t.Element=ae,t.Node=H,t.NodeList=B,t.XMLSerializer=ve},"./node_modules/@xmldom/xmldom/lib/entities.js": /*!*****************************************************!*\ !*** ./node_modules/@xmldom/xmldom/lib/entities.js ***! \*****************************************************/ /*! no static exports found */function(e,t,n){var r=n(/*! ./conventions */"./node_modules/@xmldom/xmldom/lib/conventions.js").freeze;t.XML_ENTITIES=r({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=r({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),t.entityMap=t.HTML_ENTITIES},"./node_modules/@xmldom/xmldom/lib/index.js": /*!**************************************************!*\ !*** ./node_modules/@xmldom/xmldom/lib/index.js ***! \**************************************************/ /*! no static exports found */function(e,t,n){var r=n(/*! ./dom */"./node_modules/@xmldom/xmldom/lib/dom.js");t.DOMImplementation=r.DOMImplementation,t.XMLSerializer=r.XMLSerializer,t.DOMParser=n(/*! ./dom-parser */"./node_modules/@xmldom/xmldom/lib/dom-parser.js").DOMParser},"./node_modules/@xmldom/xmldom/lib/sax.js": /*!************************************************!*\ !*** ./node_modules/@xmldom/xmldom/lib/sax.js ***! \************************************************/ /*! no static exports found */function(e,t,n){var r=n(/*! ./conventions */"./node_modules/@xmldom/xmldom/lib/conventions.js").NAMESPACE,o=/[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]/,i=new RegExp("[\\-\\.0-9"+o.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),a=new RegExp("^"+o.source+i.source+"*(?::"+o.source+i.source+"*)?$"),s=0,c=1,u=2,l=3,d=4,p=5,f=6,h=7;function m(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,m)}function g(){}function y(e,t,n,o,i){function a(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(n,t)?n[t]:"#"===t.charAt(0)?a(parseInt(t.substr(1).replace("x","0x"))):(i.error("entity not found:"+e),e)}function c(t){if(t>y){var n=e.substring(y,t).replace(/&#?\w+;/g,s);f&&u(y),o.characters(n,0,t-y),y=t}}function u(t,n){while(t>=d&&(n=p.exec(e)))l=n.index,d=l+n[0].length,f.lineNumber++;f.columnNumber=t-l+1}var l=0,d=0,p=/.*(?:\r\n?|\n)|.*$/g,f=o.locator,h=[{currentNSMap:t}],g={},y=0;while(1){try{var w=e.indexOf("<",y);if(w<0){if(!e.substr(y).match(/^\s*$/)){var R=o.doc,A=R.createTextNode(e.substr(y));R.appendChild(A),o.currentElement=A}return}switch(w>y&&c(w),e.charAt(w+1)){case"/":var _=e.indexOf(">",w+3),O=e.substring(w+2,_).replace(/[ \t\n\r]+$/g,""),I=h.pop();_<0?(O=e.substring(w+2).replace(/[\s<].*/,""),i.error("end tag name: "+O+" is not complete:"+I.tagName),_=w+1+O.length):O.match(/\sy?y=_:c(Math.max(w,y)+1)}}function v(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function C(e,t,n,o,i,a){function m(e,t,r){n.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),n.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,i),r)}var g,y=++t,v=s;while(1){var C=e.charAt(y);switch(C){case"=":if(v===c)g=e.slice(t,y),v=l;else{if(v!==u)throw new Error("attribute equal must after attrName");v=l}break;case"'":case'"':if(v===l||v===c){if(v===c&&(a.warning('attribute value must after "="'),g=e.slice(t,y)),t=y+1,y=e.indexOf(C,t),!(y>0))throw new Error("attribute value no end '"+C+"' match");b=e.slice(t,y),m(g,b,t-1),v=p}else{if(v!=d)throw new Error('attribute value must after "="');b=e.slice(t,y),m(g,b,t),a.warning('attribute "'+g+'" missed start quot('+C+")!!"),t=y+1,v=p}break;case"/":switch(v){case s:n.setTagName(e.slice(t,y));case p:case f:case h:v=h,n.closed=!0;case d:case c:case u:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),v==s&&n.setTagName(e.slice(t,y)),y;case">":switch(v){case s:n.setTagName(e.slice(t,y));case p:case f:case h:break;case d:case c:b=e.slice(t,y),"/"===b.slice(-1)&&(n.closed=!0,b=b.slice(0,-1));case u:v===u&&(b=g),v==d?(a.warning('attribute "'+b+'" missed quot(")!'),m(g,b,t)):(r.isHTML(o[""])&&b.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+b+'" missed value!! "'+b+'" instead!!'),m(b,b,t));break;case l:throw new Error("attribute value missed!!")}return y;case"€":C=" ";default:if(C<=" ")switch(v){case s:n.setTagName(e.slice(t,y)),v=f;break;case c:g=e.slice(t,y),v=u;break;case d:var b=e.slice(t,y);a.warning('attribute "'+b+'" missed quot(")!!'),m(g,b,t);case p:v=f;break}else switch(v){case u:n.tagName;r.isHTML(o[""])&&g.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+g+'" missed value!! "'+g+'" instead2!!'),m(g,g,t),t=y,v=c;break;case p:a.warning('attribute space is required"'+g+'"!!');case f:v=c,t=y;break;case l:v=d,t=y;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}y++}}function b(e,t,n){var o=e.tagName,i=null,a=e.length;while(a--){var s=e[a],c=s.qName,u=s.value,l=c.indexOf(":");if(l>0)var d=s.prefix=c.slice(0,l),p=c.slice(l+1),f="xmlns"===d&&p;else p=c,d=null,f="xmlns"===c&&"";s.localName=p,!1!==f&&(null==i&&(i={},w(n,n={})),n[f]=i[f]=u,s.uri=r.XMLNS,t.startPrefixMapping(f,u))}a=e.length;while(a--){s=e[a];d=s.prefix;d&&("xml"===d&&(s.uri=r.XML),"xmlns"!==d&&(s.uri=n[d||""]))}l=o.indexOf(":");l>0?(d=e.prefix=o.slice(0,l),p=e.localName=o.slice(l+1)):(d=null,p=e.localName=o);var h=e.uri=n[d||""];if(t.startElement(h,p,o,e),!e.closed)return e.currentNSMap=n,e.localNSMap=i,!0;if(t.endElement(h,p,o),i)for(d in i)Object.prototype.hasOwnProperty.call(i,d)&&t.endPrefixMapping(d)}function k(e,t,n,r,o){if(/^(?:script|textarea)$/i.test(n)){var i=e.indexOf("",t),a=e.substring(t+1,i);if(/[&<]/.test(a))return/^script$/i.test(n)?(o.characters(a,0,a.length),i):(a=a.replace(/&#?\w+;/g,r),o.characters(a,0,a.length),i)}return t+1}function S(e,t,n,r){var o=r[n];return null==o&&(o=e.lastIndexOf(""),ot?(n.comment(e,t+4,i-t-4),i+3):(r.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){i=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=R(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var c=a[1][0],u=!1,l=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],l=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var d=a[s-1];return n.startDTD(c,u,l),n.endDTD(),d.index+d[0].length}}return-1}function E(e,t,n){var r=e.indexOf("?>",t);if(r){var o=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(o){o[0].length;return n.processingInstruction(o[1],o[2]),r+2}return-1}return-1}function x(){this.attributeNames={}}function R(e,t){var n,r=[],o=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;o.lastIndex=t,o.exec(e);while(n=o.exec(e))if(r.push(n),n[1])return r}m.prototype=new Error,m.prototype.name=m.name,g.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),w(t,t={}),y(e,t,n,r,this.errorHandler),r.endDocument()}},x.prototype={setTagName:function(e){if(!a.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!a.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,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}},t.XMLReader=g,t.ParseError=m},"./node_modules/process/browser.js": /*!*****************************************!*\ !*** ./node_modules/process/browser.js ***! \*****************************************/ /*! no static exports found */function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function c(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(function(){try{n="function"===typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}})();var u,l=[],d=!1,p=-1;function f(){d&&u&&(d=!1,u.length?l=u.concat(l):p=-1,l.length&&h())}function h(){if(!d){var e=s(f);d=!0;var t=l.length;while(t){u=l,l=[];while(++p1)for(var n=1;ny)return t(null,!1);if(n>1){var r=Math.max(e[0].Size,e[1].Size);if(r!==g)return t(null,!1)}var o=function r(o){if(o=a.length)S.emit("has_and_check_upload_id",t);else{var d=a[l];if(!s.isInArray(t,d))return o.removeUploadId.call(f,d),void i(l+1);o.using[d]?i(l+1):p.call(f,{Bucket:r,Region:c,Key:u,UploadId:d,tracker:e.tracker},(function(e,t){f._isRunningTask(n)&&(e?(o.removeUploadId.call(f,d),i(l+1)):S.emit("upload_id_available",{UploadId:d,PartList:t.PartList}))}))}};l(0)}else S.emit("has_and_check_upload_id",t)})),S.on("get_remote_upload_id_list",(function(){d.call(f,{Bucket:r,Region:c,Key:u,tracker:e.tracker},(function(t,i){if(f._isRunningTask(n)){if(t)return S.emit("error",t);var a=s.filter(i.UploadList,(function(e){return e.Key===u&&(!l||e.StorageClass.toUpperCase()===l.toUpperCase())})).reverse().map((function(e){return e.UploadId||e.UploadID}));if(a.length)S.emit("seek_local_avail_upload_id",a);else{var c,d=o.getFileId(e.Body,e.ChunkSize,r,u);d&&(c=o.getUploadIdList.call(f,d))&&s.each(c,(function(e){o.removeUploadId.call(f,e)})),S.emit("no_available_upload_id")}}}))})),S.emit("get_remote_upload_id_list")}function d(e,t){var n=this,r=[],o={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key,calledBySdk:e.calledBySdk||"sliceUploadFile",tracker:e.tracker},i=function e(){n.multipartList(o,(function(n,i){if(n)return t(n);r.push.apply(r,i.Upload||[]),"true"===i.IsTruncated?(o.KeyMarker=i.NextKeyMarker,o.UploadIdMarker=i.NextUploadIdMarker,e()):t(null,{UploadList:r})}))};i()}function p(e,t){var n=this,r=[],o={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId,calledBySdk:"sliceUploadFile",tracker:e.tracker},i=function e(){n.multipartListPart(o,(function(n,i){if(n)return t(n);r.push.apply(r,i.Part||[]),"true"===i.IsTruncated?(o.PartNumberMarker=i.NextPartNumberMarker,e()):t(null,{PartList:r})}))};i()}function f(e,t){var n=this,r=e.TaskId,o=e.Bucket,a=e.Region,c=e.Key,u=e.UploadData,l=e.FileSize,d=e.SliceSize,p=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),f=e.Body,m=Math.ceil(l/d),g=0,y=e.ServerSideEncryption,v=e.Headers,C=s.filter(u.PartList,(function(e){return e["Uploaded"]&&(g+=e["PartNumber"]>=m&&l%d||d),!e["Uploaded"]})),b=e.onProgress;i.eachLimit(C,p,(function(t,i){if(n._isRunningTask(r)){var s=t["PartNumber"],p=Math.min(l,t["PartNumber"]*d)-(t["PartNumber"]-1)*d,m=0;h.call(n,{TaskId:r,Bucket:o,Region:a,Key:c,SliceSize:d,FileSize:l,PartNumber:s,ServerSideEncryption:y,Body:f,UploadData:u,Headers:v,onProgress:function(e){g+=e.loaded-m,m=e.loaded,b({loaded:g,total:l})},tracker:e.tracker},(function(e,o){n._isRunningTask(r)&&(e||o.ETag||(e='get ETag error, please add "ETag" to CORS ExposeHeader setting.( 获取ETag失败,请在CORS ExposeHeader设置中添加ETag,请参考文档:https://cloud.tencent.com/document/product/436/13318 )'),e?g-=m:(g+=p-m,t.ETag=o.ETag),b({loaded:g,total:l}),i(e||null,o))}))}}),(function(e){if(n._isRunningTask(r))return e?t(e):void t(null,{UploadId:u.UploadId,SliceList:u.PartList})}))}function h(e,t){var n=this,r=e.TaskId,o=e.Bucket,a=e.Region,c=e.Key,u=e.FileSize,l=e.Body,d=1*e.PartNumber,p=e.SliceSize,f=e.ServerSideEncryption,h=e.UploadData,m=e.Headers||{},g=n.options.ChunkRetryTimes+1,y=p*(d-1),v=p,C=y+p;C>u&&(C=u,v=C-y);var b=["x-cos-traffic-limit","x-cos-mime-limit"],k={};s.each(m,(function(e,t){b.indexOf(t)>-1&&(k[t]=e)}));var S=h.PartList[d-1];i.retry(g,(function(t){n._isRunningTask(r)&&s.fileSlice(l,y,C,!0,(function(i){n.multipartUpload({TaskId:r,Bucket:o,Region:a,Key:c,ContentLength:v,PartNumber:d,UploadId:h.UploadId,ServerSideEncryption:f,Body:i,Headers:k,onProgress:e.onProgress,calledBySdk:"sliceUploadFile",tracker:e.tracker},(function(e,o){if(n._isRunningTask(r))return e?t(e):(S.Uploaded=!0,t(null,o))}))}))}),(function(e,o){if(n._isRunningTask(r))return t(e,o)}))}function m(e,t){var n=e.Bucket,r=e.Region,o=e.Key,a=e.UploadId,s=e.SliceList,c=this,u=this.options.ChunkRetryTimes+1,l=e.Headers,d=s.map((function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));i.retry(u,(function(t){c.multipartComplete({Bucket:n,Region:r,Key:o,UploadId:a,Parts:d,Headers:l,calledBySdk:"sliceUploadFile",tracker:e.tracker},t)}),(function(e,n){t(e,n)}))}function g(e,t){var n=e.Bucket,r=e.Region,o=e.Key,i=e.UploadId,c=e.Level||"task",u=e.AsyncLimit,l=this,p=new a;if(p.on("error",(function(e){return t(e)})),p.on("get_abort_array",(function(i){y.call(l,{Bucket:n,Region:r,Key:o,Headers:e.Headers,AsyncLimit:u,AbortArray:i},t)})),"bucket"===c)d.call(l,{Bucket:n,Region:r,calledBySdk:"abortUploadTask"},(function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])}));else if("file"===c){if(!o)return t(s.error(new Error("abort_upload_task_no_key")));d.call(l,{Bucket:n,Region:r,Key:o,calledBySdk:"abortUploadTask"},(function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])}))}else{if("task"!==c)return t(s.error(new Error("abort_unknown_level")));if(!i)return t(s.error(new Error("abort_upload_task_no_id")));if(!o)return t(s.error(new Error("abort_upload_task_no_key")));p.emit("get_abort_array",[{Key:o,UploadId:i}])}}function y(e,t){var n=e.Bucket,r=e.Region,o=e.Key,a=e.AbortArray,s=e.AsyncLimit||1,c=this,u=0,l=new Array(a.length);i.eachLimit(a,s,(function(t,i){var a=u;if(o&&o!==t.Key)return l[a]={error:{KeyNotMatch:!0}},void i(null);var s=t.UploadId||t.UploadID;c.multipartAbort({Bucket:n,Region:r,Key:t.Key,Headers:e.Headers,UploadId:s},(function(e){var o={Bucket:n,Region:r,Key:t.Key,UploadId:s};l[a]={error:e,task:o},i(null)})),u++}),(function(e){if(e)return t(e);for(var n=[],r=[],o=0,i=l.length;oo?"sliceUploadFile":"putObject",m=e.onFileFinish,g=function(n,r){e.tracker&&e.tracker.formatResult(n,r),m&&m(n,r,l),t&&t(n,r)};i.push({api:h,params:e,callback:g}),n._addTasks(i)}function C(e,t){var n=this,o=void 0===e.SliceSize?n.options.SliceSize:e.SliceSize,i=0,a=0,u=s.throttleOnProgress.call(n,a,e.onProgress),l=e.files.length,d=e.onFileFinish,p=Array(l),f=function(e,n,r){u(null,!0),d&&d(e,n,r),p[r.Index]={options:r,error:e,data:n},--l<=0&&t&&t(null,{files:p})},h=[];s.each(e.files,(function(e,t){(function(){var l=e.Body,d=l.size||l.length||0,p={Index:t,TaskId:""};if(!n.options.UseRawKey&&e.Key&&"/"===e.Key.substr(0,1)&&(e.Key=e.Key.substr(1)),i+=d,n.options.EnableTracker){var m=n.options.UseAccelerate||"string"===typeof n.options.Domain&&n.options.Domain.includes("accelerate.");e.tracker=new c({bucket:e.Bucket,region:e.Region,apiName:"uploadFiles",fileKey:e.Key,fileSize:d,accelerate:m,deepTracker:n.options.DeepTracker,customId:n.options.CustomId,delay:n.options.TrackerDelay})}s.each(e,(function(e,t){"object"!==r(e)&&"function"!==typeof e&&(p[t]=e)}));var g=e.onTaskReady,y=function(e){p.TaskId=e,g&&g(e)};e.onTaskReady=y;var v=0,C=e.onProgress,b=function(e){a=a-v+e.loaded,v=e.loaded,C&&C(e),u({loaded:a,total:i})};e.onProgress=b;var k=d>o?"sliceUploadFile":"putObject",S=e.onFileFinish,w=function(t,n){e.tracker&&e.tracker.formatResult(t,n),S&&S(t,n),f&&f(t,n,p)};h.push({api:k,params:e,callback:w})})()})),n._addTasks(h)}function b(e,t){var n=new a,r=this,c=e.Bucket,u=e.Region,l=e.Key,d=e.CopySource,f=s.getSourceParams.call(this,d);if(f){var h=f.Bucket,m=f.Region,g=decodeURIComponent(f.Key),y=void 0===e.CopySliceSize?r.options.CopySliceSize:e.CopySliceSize;y=Math.max(0,y);var v,C,b=e.CopyChunkSize||this.options.CopyChunkSize,S=this.options.CopyChunkParallelLimit,w=this.options.ChunkRetryTimes+1,T=0,E=0,x={},R={},A={};n.on("copy_slice_complete",(function(n){var a={};s.each(e.Headers,(function(e,t){0===t.toLowerCase().indexOf("x-cos-meta-")&&(a[t]=e)}));var d=s.map(n.PartList,(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));i.retry(w,(function(e){r.multipartComplete({Bucket:c,Region:u,Key:l,UploadId:n.UploadId,Parts:d,calledBySdk:"sliceCopyFile"},e)}),(function(e,r){if(o.removeUsing(n.UploadId),e)return C(null,!0),t(e);o.removeUploadId(n.UploadId),C({loaded:v,total:v},!0),t(null,r)}))})),n.on("get_copy_data_finish",(function(e){var a=o.getCopyFileId(d,x,b,c,l);a&&o.saveUploadId(a,e.UploadId,r.options.UploadIdCacheLimit),o.setUsing(e.UploadId);var p=s.filter(e.PartList,(function(e){return e["Uploaded"]&&(E+=e["PartNumber"]>=T&&v%b||b),!e["Uploaded"]}));i.eachLimit(p,S,(function(t,n){var o=t.PartNumber,a=t.CopySourceRange,s=t.end-t.start;i.retry(w,(function(t){k.call(r,{Bucket:c,Region:u,Key:l,CopySource:d,UploadId:e.UploadId,PartNumber:o,CopySourceRange:a},t)}),(function(e,r){if(e)return n(e);E+=s,C({loaded:E,total:v}),t.ETag=r.ETag,n(e||null,r)}))}),(function(r){if(r)return o.removeUsing(e.UploadId),C(null,!0),t(r);n.emit("copy_slice_complete",e)}))})),n.on("get_chunk_size_finish",(function(){var i=function(){r.multipartInit({Bucket:c,Region:u,Key:l,Headers:A},(function(r,o){if(r)return t(r);e.UploadId=o.UploadId,n.emit("get_copy_data_finish",{UploadId:e.UploadId,PartList:e.PartList})}))},a=o.getCopyFileId(d,x,b,c,l),f=o.getUploadIdList(a);if(!a||!f)return i();var h=function t(a){if(a>=f.length)return i();var d=f[a];if(o.using[d])return t(a+1);p.call(r,{Bucket:c,Region:u,Key:l,UploadId:d},(function(r,i){if(r)o.removeUploadId(d),t(a+1);else{if(o.using[d])return t(a+1);var c={},u=0;s.each(i.PartList,(function(e){var t=parseInt(e.Size),n=u+t-1;c[e.PartNumber+"|"+u+"|"+n]=e.ETag,u+=t})),s.each(e.PartList,(function(e){var t=c[e.PartNumber+"|"+e.start+"|"+e.end];t&&(e.ETag=t,e.Uploaded=!0)})),n.emit("get_copy_data_finish",{UploadId:d,PartList:e.PartList})}}))};h(0)})),n.on("get_file_size_finish",(function(){if(function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,o=0;on.length&&(R[t]=e)})),n.emit("get_file_size_finish")}else t(s.error(new Error('get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.( 获取Content-Length失败,请在CORS ExposeHeader设置中添加Content-Length,请参考文档:https://cloud.tencent.com/document/product/436/13318 )')))}))}else t(s.error(new Error("CopySource format error")))}function k(e,t){var n=e.TaskId,r=e.Bucket,o=e.Region,a=e.Key,s=e.CopySource,c=e.UploadId,u=1*e.PartNumber,l=e.CopySourceRange,d=this.options.ChunkRetryTimes+1,p=this;i.retry(d,(function(e){p.uploadPartCopy({TaskId:n,Bucket:r,Region:o,Key:a,CopySource:s,UploadId:c,PartNumber:u,CopySourceRange:l},(function(t,n){e(t||null,n)}))}),(function(e,n){return t(e,n)}))}var S={sliceUploadFile:u,abortUploadTask:g,uploadFile:v,uploadFiles:C,sliceCopyFile:b};e.exports.init=function(e,t){t.transferToTaskMethod(S,"sliceUploadFile"),s.each(S,(function(t,n){e.prototype[n]=s.apiWrapper(n,t)}))}},"./src/async.js": /*!**********************!*\ !*** ./src/async.js ***! \**********************/ /*! no static exports found */function(e,t){var n=function(e,t,n,r){if(r=r||function(){},!e.length||t<=0)return r();var o=0,i=0,a=0;(function s(){if(o>=e.length)return r();while(a=e.length?r():s())}))})()},r=function(e,t,n){var r=function r(o){t((function(t,i){t&&o/gi,"<$1Rule>"),r=r.replace(/<(\/?)Tags>/gi,"<$1Tag>");var o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=i.b64(i.md5(r)),Pe.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"replication",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 _(e,t){Pe.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 r={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=i.makeArray(n.ReplicationConfiguration.Rule),delete n.ReplicationConfiguration.Rule),t(e,n)}))}function O(e,t){Pe.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 I(e,t){if(e["WebsiteConfiguration"]){var n=i.clone(e["WebsiteConfiguration"]||{}),r=n["RoutingRules"]||n["RoutingRule"]||[];r=i.isArray(r)?r:[r],delete n.RoutingRule,delete n.RoutingRules,r.length&&(n.RoutingRules={RoutingRule:r});var o=i.json2xml({WebsiteConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.b64(i.md5(o)),Pe.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"website",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})}))}else t(i.error(new Error("missing param WebsiteConfiguration")))}function B(e,t){Pe.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 r={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var o=n.WebsiteConfiguration||{};if(o["RoutingRules"]){var a=i.clone(o["RoutingRules"].RoutingRule||[]);a=i.makeArray(a),o.RoutingRules=a}t(null,{WebsiteConfiguration:o,statusCode:n.statusCode,headers:n.headers})}}))}function P(e,t){Pe.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 N(e,t){if(e["RefererConfiguration"]){var n=i.clone(e["RefererConfiguration"]||{}),r=n["DomainList"]||{},o=r["Domains"]||r["Domain"]||[];o=i.isArray(o)?o:[o],o.length&&(n.DomainList={Domain:o});var a=i.json2xml({RefererConfiguration:n}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.b64(i.md5(a)),Pe.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"referer",headers:s},(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})}))}else t(i.error(new Error("missing param RefererConfiguration")))}function D(e,t){Pe.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 r={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var o=n.RefererConfiguration||{};if(o["DomainList"]){var a=i.makeArray(o["DomainList"].Domain||[]);o.DomainList={Domains:a}}t(null,{RefererConfiguration:o,statusCode:n.statusCode,headers:n.headers})}}))}function U(e,t){var n=e["DomainConfiguration"]||{},r=n.DomainRule||e.DomainRule||[];r=i.clone(r);var o=i.json2xml({DomainConfiguration:{DomainRule:r}}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.b64(i.md5(o)),Pe.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"domain",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 M(e,t){Pe.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 r=[];try{r=n.DomainConfiguration.DomainRule||[]}catch(o){}r=i.clone(i.isArray(r)?r:[r]),t(null,{DomainRule:r,statusCode:n.statusCode,headers:n.headers})}))}function j(e,t){Pe.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 L(e,t){var n=e["OriginConfiguration"]||{},r=n.OriginRule||e.OriginRule||[];r=i.clone(r);var o=i.json2xml({OriginConfiguration:{OriginRule:r}}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.b64(i.md5(o)),Pe.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"origin",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 H(e,t){Pe.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 r=[];try{r=n.OriginConfiguration.OriginRule||[]}catch(o){}r=i.clone(i.isArray(r)?r:[r]),t(null,{OriginRule:r,statusCode:n.statusCode,headers:n.headers})}))}function F(e,t){Pe.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 K(e,t){var n=i.json2xml({BucketLoggingStatus:e["BucketLoggingStatus"]||""}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.b64(i.md5(n)),Pe.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",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 q(e,t){Pe.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);t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})}))}function z(e,t,n){var r=i.clone(t["InventoryConfiguration"]);if(r.OptionalFields){var o=r.OptionalFields||[];r.OptionalFields={Field:o}}if(r.Destination&&r.Destination.COSBucketDestination&&r.Destination.COSBucketDestination.Encryption){var a=r.Destination.COSBucketDestination.Encryption;Object.keys(a).indexOf("SSECOS")>-1&&(a["SSE-COS"]=a["SSECOS"],delete a["SSECOS"])}var s=i.json2xml({InventoryConfiguration:r}),c=t.Headers;c["Content-Type"]="application/xml",c["Content-MD5"]=i.b64(i.md5(s));var u="PUT"===e?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";Pe.call(this,{Action:u,method:e,Bucket:t.Bucket,Region:t.Region,body:s,action:"inventory",qs:{id:t["Id"]},headers:c},(function(e,t){return e&&204===e.statusCode?n(null,{statusCode:e.statusCode}):e?n(e):void n(null,{statusCode:t.statusCode,headers:t.headers})}))}function G(e,t){return z.call(this,"PUT",e,t)}function V(e,t){return z.call(this,"POST",e,t)}function X(e,t){Pe.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 r=n["InventoryConfiguration"];if(r&&r.OptionalFields&&r.OptionalFields.Field){var o=r.OptionalFields.Field;i.isArray(o)||(o=[o]),r.OptionalFields=o}if(r.Destination&&r.Destination.COSBucketDestination&&r.Destination.COSBucketDestination.Encryption){var a=r.Destination.COSBucketDestination.Encryption;Object.keys(a).indexOf("SSE-COS")>-1&&(a["SSECOS"]=a["SSE-COS"],delete a["SSE-COS"])}t(null,{InventoryConfiguration:r,statusCode:n.statusCode,headers:n.headers})}))}function W(e,t){Pe.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 r=n["ListInventoryConfigurationResult"],o=r.InventoryConfiguration||[];o=i.isArray(o)?o:[o],delete r["InventoryConfiguration"],i.each(o,(function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;i.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"])}})),r.InventoryConfigurations=o,i.extend(r,{statusCode:n.statusCode,headers:n.headers}),t(null,r)}))}function Q(e,t){Pe.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 J(e,t){if(e["AccelerateConfiguration"]){var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},r=i.json2xml(n),o={"Content-Type":"application/xml"};o["Content-MD5"]=i.b64(i.md5(r)),Pe.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"accelerate",headers:o},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t(i.error(new Error("missing param AccelerateConfiguration")))}function $(e,t){Pe.call(this,{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 Y(e,t){var n=e.ServerSideEncryptionConfiguration||{},r=n.Rule||n.Rules||[],o=i.json2xml({ServerSideEncryptionConfiguration:{Rule:r}}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.b64(i.md5(o)),Pe.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"encryption",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 Z(e,t){Pe.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},(function(e,n){if(e)if(404===e.statusCode&&"NoSuchEncryptionConfiguration"===e.code){var r={EncryptionConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var o=i.makeArray(n.EncryptionConfiguration&&n.EncryptionConfiguration.Rule||[]);n.EncryptionConfiguration={Rules:o},t(e,n)}}))}function ee(e,t){Pe.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},(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 te(e,t){Pe.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,r){if(n){var o=n.statusCode;return e.Headers["If-Modified-Since"]&&o&&304===o?t(null,{NotModified:!0,statusCode:o}):t(n)}r.ETag=i.attr(r.headers,"etag",""),t(null,r)}))}function ne(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"],Pe.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 r=n.ListVersionsResult||{},o=r.DeleteMarker||[];o=i.isArray(o)?o:[o];var a=r.Version||[];a=i.isArray(a)?a:[a];var s=i.clone(r);delete s.DeleteMarker,delete s.Version,i.extend(s,{DeleteMarkers:o,Versions:a,statusCode:n.statusCode,headers:n.headers}),t(null,s)}))}function re(e,t){var n=e.Query||{},r=e.QueryString||"",o=i.throttleOnProgress.call(this,0,e.onProgress),a=e.tracker;a&&a.setParams({signStartTime:(new Date).getTime()}),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"],Pe.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,DataType:e.DataType,headers:e.Headers,qs:n,qsStr:r,rawBody:!0,onDownloadProgress:o,tracker:a},(function(n,r){if(o(null,!0),n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0}):t(n)}t(null,{Body:r.body,ETag:i.attr(r.headers,"etag",""),statusCode:r.statusCode,headers:r.headers})}))}function oe(e,t){var n=this,r=e.ContentLength,o=i.throttleOnProgress.call(n,r,e.onProgress),a=e.Headers;a["Cache-Control"]||a["cache-control"]||(a["Cache-Control"]=""),a["Content-Type"]||a["content-type"]||(a["Content-Type"]=e.Body&&e.Body.type||"");var s=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5,c=e.tracker;s&&c&&c.setParams({md5StartTime:(new Date).getTime()}),i.getBodyMd5(s,e.Body,(function(s){s&&(c&&c.setParams({md5EndTime:(new Date).getTime()}),n.options.UploadCheckContentMd5&&(a["Content-MD5"]=i.b64(s)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(a["x-cos-meta-md5"]=s)),void 0!==e.ContentLength&&(a["Content-Length"]=e.ContentLength),o(null,!0),Pe.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:o,tracker:c},(function(a,s){if(a)return o(null,!0),t(a);o({loaded:r,total:r},!0);var c=_e({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});c=c.substr(c.indexOf("://")+3),s.Location=c,s.ETag=i.attr(s.headers,"etag",""),t(null,s)}))}),e.onHashProgress)}function ie(e,t){Pe.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId,action:e.Recursive?"recursive":""},(function(e,n){if(e){var r=e.statusCode;return r&&404===r?t(null,{BucketNotFound:!0,statusCode:r}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})}))}function ae(e,t){var n={};e.VersionId&&(n.versionId=e.VersionId),Pe.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n,action:"acl"},(function(e,n){if(e)return t(e);var r=n.AccessControlPolicy||{},o=r.Owner||{},a=r.AccessControlList&&r.AccessControlList.Grant||[];a=i.isArray(a)?a:[a];var s=Re(r);delete s.GrantWrite,n.headers&&n.headers["x-cos-acl"]&&(s.ACL=n.headers["x-cos-acl"]),s=i.extend(s,{Owner:o,Grants:a,statusCode:n.statusCode,headers:n.headers}),t(null,s)}))}function se(e,t){var n=e.Headers,r="";if(e["AccessControlPolicy"]){var o=i.clone(e["AccessControlPolicy"]||{}),a=o.Grants||o.Grant;a=i.isArray(a)?a:[a],delete o.Grant,delete o.Grants,o.AccessControlList={Grant:a},r=i.json2xml({AccessControlPolicy:o}),n["Content-Type"]="application/xml",n["Content-MD5"]=i.b64(i.md5(r))}i.each(n,(function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=Ae(n[t]))})),Pe.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:r},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))}function ce(e,t){var n=e.Headers;n["Origin"]=e["Origin"],n["Access-Control-Request-Method"]=e["AccessControlRequestMethod"],n["Access-Control-Request-Headers"]=e["AccessControlRequestHeaders"],Pe.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 r=n.headers||{};t(null,{AccessControlAllowOrigin:r["access-control-allow-origin"],AccessControlAllowMethods:r["access-control-allow-methods"],AccessControlAllowHeaders:r["access-control-allow-headers"],AccessControlExposeHeaders:r["access-control-expose-headers"],AccessControlMaxAge:r["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})}))}function ue(e,t){var n=this,r=e.Headers;r["Cache-Control"]||r["cache-control"]||(r["Cache-Control"]="");var o=e.CopySource||"",a=i.getSourceParams.call(this,o);if(a){var s=a.Bucket,c=a.Region,u=decodeURIComponent(a.Key);Pe.call(this,{Scope:[{action:"name/cos:GetObject",bucket:s,region:c,prefix:u},{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(r,o){if(r)return t(r);var a=i.clone(o.CopyObjectResult||{}),s=_e({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});i.extend(a,{Location:s,statusCode:o.statusCode,headers:o.headers}),t(null,a)}))}else t(i.error(new Error("CopySource format error")))}function le(e,t){var n=e.CopySource||"",r=i.getSourceParams.call(this,n);if(r){var o=r.Bucket,a=r.Region,s=decodeURIComponent(r.Key);Pe.call(this,{Scope:[{action:"name/cos:GetObject",bucket:o,region:a,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,qs:{partNumber:e["PartNumber"],uploadId:e["UploadId"]},headers:e.Headers},(function(e,n){if(e)return t(e);var r=i.clone(n.CopyPartResult||{});i.extend(r,{statusCode:n.statusCode,headers:n.headers}),t(null,r)}))}else t(i.error(new Error("CopySource format error")))}function de(e,t){var n=e.Objects||[],r=e.Quiet;n=i.isArray(n)?n:[n];var o=i.json2xml({Delete:{Object:n,Quiet:r||!1}}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.b64(i.md5(o));var s=i.map(n,(function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}}));Pe.call(this,{Scope:s,method:"POST",Bucket:e.Bucket,Region:e.Region,body:o,action:"delete",headers:a},(function(e,n){if(e)return t(e);var r=n.DeleteResult||{},o=r.Deleted||[],a=r.Error||[];o=i.isArray(o)?o:[o],a=i.isArray(a)?a:[a];var s=i.clone(r);i.extend(s,{Error:a,Deleted:o,statusCode:n.statusCode,headers:n.headers}),t(null,s)}))}function pe(e,t){var n=e.Headers;if(e["RestoreRequest"]){var r=e.RestoreRequest||{},o=i.json2xml({RestoreRequest:r});n["Content-Type"]="application/xml",n["Content-MD5"]=i.b64(i.md5(o)),Pe.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:o,action:"restore",headers:n},t)}else t(i.error(new Error("missing param RestoreRequest")))}function fe(e,t){var n=e["Tagging"]||{},r=n.TagSet||n.Tags||e["Tags"]||[];r=i.clone(i.isArray(r)?r:[r]);var o=i.json2xml({Tagging:{TagSet:{Tag:r}}}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.b64(i.md5(o)),Pe.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:o,action:"tagging",headers:a,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 he(e,t){Pe.call(this,{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 r={Tags:[],statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else{var o=[];try{o=n.Tagging.TagSet.Tag||[]}catch(a){}o=i.clone(i.isArray(o)?o:[o]),t(null,{Tags:o,statusCode:n.statusCode,headers:n.headers})}}))}function me(e,t){Pe.call(this,{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 ge(e,t){var n=e["SelectType"];if(!n)return t(i.error(new Error("missing param SelectType")));var r=e["SelectRequest"]||{},o=i.json2xml({SelectRequest:r}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.b64(i.md5(o)),Pe.call(this,{Action:"name/cos:GetObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"select",qs:{"select-type":e["SelectType"]},VersionId:e.VersionId,body:o,DataType:"arraybuffer",rawBody:!0},(function(e,n){if(e&&204===e.statusCode)return t(null,{statusCode:e.statusCode});if(e)return t(e);var r=i.parseSelectPayload(n.body);t(null,{statusCode:n.statusCode,headers:n.headers,Body:r.body,Payload:r.payload})}))}function ye(e,t){var n=this,r=e.Headers,o=e.tracker;r["Cache-Control"]||r["cache-control"]||(r["Cache-Control"]=""),r["Content-Type"]||r["content-type"]||(r["Content-Type"]=e.Body&&e.Body.type||"");var a=e.Body&&(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5);a&&o&&o.setParams({md5StartTime:(new Date).getTime()}),i.getBodyMd5(a,e.Body,(function(r){r&&(e.Headers["x-cos-meta-md5"]=r),a&&o&&o.setParams({md5EndTime:(new Date).getTime()}),Pe.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,tracker:o},(function(e,n){return e?(o&&o.parent&&o.parent.setParams({errorNode:"multipartInit"}),t(e)):(n=i.clone(n||{}),n&&n.InitiateMultipartUploadResult?t(null,i.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n))}))}),e.onHashProgress)}function ve(e,t){var n=this;i.getFileSize("multipartUpload",e,(function(){var r=e.tracker,o=n.options.UploadCheckContentMd5;o&&r&&r.setParams({md5StartTime:(new Date).getTime()}),i.getBodyMd5(o,e.Body,(function(a){a&&(e.Headers["Content-MD5"]=i.b64(a)),o&&r&&r.setParams({md5EndTime:(new Date).getTime()}),r&&r.setParams({partNumber:e.PartNumber}),Pe.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,tracker:r},(function(e,n){if(e)return r&&r.parent&&r.parent.setParams({errorNode:"multipartUpload"}),t(e);t(null,{ETag:i.attr(n.headers,"etag",""),statusCode:n.statusCode,headers:n.headers})}))}))}))}function Ce(e,t){for(var n=this,r=e.UploadId,o=e["Parts"],a=e.tracker,s=0,c=o.length;s-1?r(n.Authorization):"sign="+encodeURIComponent(n.Authorization)),n.SecurityToken&&(i+="&x-cos-security-token="+n.SecurityToken),n.ClientIP&&(i+="&clientIP="+n.ClientIP),n.ClientUA&&(i+="&clientUA="+n.ClientUA),n.Token&&(i+="&token="+n.Token),a&&(i+="&"+a),setTimeout((function(){t(null,{Url:i})}))}}));return u?(s+="?"+u.Authorization+(u.SecurityToken?"&x-cos-security-token="+u.SecurityToken:""),a&&(s+="&"+a)):a&&(s+="?"+a),s}function Re(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},r=e&&e.AccessControlList||{},o=r.Grant;o&&(o=i.isArray(o)?o:[o]);var a={READ:0,WRITE:0,FULL_CONTROL:0};return o&&o.length&&i.each(o,(function(r){"qcs::cam::anyone:anyone"===r.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===r.Grantee.URI?a[r.Permission]=1:r.Grantee.ID!==e.Owner.ID&&t[n[r.Permission]].push('id="'+r.Grantee.ID+'"')})),a.FULL_CONTROL||a.WRITE&&a.READ?t.ACL="public-read-write":a.READ?t.ACL="public-read":t.ACL="private",i.each(n,(function(e){t[e]=Ae(t[e].join(","))})),t}function Ae(e){var t,n,r=e.split(","),o={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(s="{Bucket}."+s)),s=s.replace(/\{\{AppId\}\}/gi,a).replace(/\{\{Bucket\}\}/gi,o).replace(/\{\{Region\}\}/gi,t).replace(/\{\{.*?\}\}/gi,""),s=s.replace(/\{AppId\}/gi,a).replace(/\{BucketName\}/gi,o).replace(/\{Bucket\}/gi,n).replace(/\{Region\}/gi,t).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(s)||(s=u+"//"+s),"/"===s.slice(-1)&&(s=s.slice(0,-1));var l=s;return e.ForcePathStyle&&(l+="/"+n),l+="/",c&&(l+=i.camSafeUrlEncode(c).replace(/%2F/g,"/")),e.isLocation&&(l=l.replace(/^https?:\/\//,"")),l}var Oe=function(e){if(!e.Bucket||!e.Region)return"";var t=void 0===e.UseAccelerate?this.options.UseAccelerate:e.UseAccelerate,n=e.Url||_e({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:t?"accelerate":e.Region}),r=n.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1"),o=new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$");return o.test(r)?r:""};function Ie(e,t){var n=i.clone(e.Headers),r="";i.each(n,(function(e,t){(""===e||["content-type","cache-control","expires"].indexOf(t.toLowerCase())>-1)&&delete n[t],"host"===t.toLowerCase()&&(r=e)}));var o=!1!==e.ForceSignHost;!r&&e.SignHost&&o&&(n.Host=e.SignHost);var a=!1,s=function(e,n){a||(a=!0,n&&n.XCosSecurityToken&&!n.SecurityToken&&(n=i.clone(n),n.SecurityToken=n.XCosSecurityToken,delete n.XCosSecurityToken),t&&t(e,n))},c=this,u=e.Bucket||"",l=e.Region||"",d=e.Key||"";c.options.ForcePathStyle&&u&&(d=u+"/"+d);var p="/"+d,f={},h=e.Scope;if(!h){var m=e.Action||"",g=e.ResourceKey||e.Key||"";h=e.Scope||[{action:m,bucket:u,region:l,prefix:g}]}var y=i.md5(JSON.stringify(h));c._StsCache=c._StsCache||[],function(){var e,t;for(e=c._StsCache.length-1;e>=0;e--){t=c._StsCache[e];var n=Math.round(i.getSkewTime(c.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)c._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===y){f=t;break}}}();var v=function(){var t="";f.StartTime&&e.Expires?t=f.StartTime+";"+(f.StartTime+1*e.Expires):f.StartTime&&f.ExpiredTime&&(t=f.StartTime+";"+f.ExpiredTime);var r=i.getAuth({SecretId:f.TmpSecretId,SecretKey:f.TmpSecretKey,Method:e.Method,Pathname:p,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:c.options.UseRawKey,SystemClockOffset:c.options.SystemClockOffset,KeyTime:t,ForceSignHost:o}),a={Authorization:r,SecurityToken:f.SecurityToken||f.XCosSecurityToken||"",Token:f.Token||"",ClientIP:f.ClientIP||"",ClientUA:f.ClientUA||""};s(null,a)},C=function(e){if(e.Authorization){var t=!1,n=e.Authorization;if(n)if(n.indexOf(" ")>-1)t=!1;else if(n.indexOf("q-sign-algorithm=")>-1&&n.indexOf("q-ak=")>-1&&n.indexOf("q-sign-time=")>-1&&n.indexOf("q-key-time=")>-1&&n.indexOf("q-url-param-list=")>-1)t=!0;else try{n=atob(n),n.indexOf("a=")>-1&&n.indexOf("k=")>-1&&n.indexOf("t=")>-1&&n.indexOf("r=")>-1&&n.indexOf("b=")>-1&&(t=!0)}catch(r){}if(!t)return i.error(new Error("getAuthorization callback params format error"))}else{if(!e.TmpSecretId)return i.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!e.TmpSecretKey)return i.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!e.SecurityToken&&!e.XCosSecurityToken)return i.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!e.ExpiredTime)return i.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(e.ExpiredTime&&10!==e.ExpiredTime.toString().length)return i.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(e.StartTime&&10!==e.StartTime.toString().length)return i.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(f.ExpiredTime&&f.ExpiredTime-i.getSkewTime(c.options.SystemClockOffset)/1e3>60)v();else if(c.options.getAuthorization)c.options.getAuthorization.call(c,{Bucket:u,Region:l,Method:e.Method,Key:d,Pathname:p,Query:e.Query,Headers:n,Scope:h,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:o},(function(e){"string"===typeof e&&(e={Authorization:e});var t=C(e);if(t)return s(t);e.Authorization?s(null,e):(f=e||{},f.Scope=h,f.ScopeKey=y,c._StsCache.push(f),v())}));else{if(!c.options.getSTS)return function(){var t=i.getAuth({SecretId:e.SecretId||c.options.SecretId,SecretKey:e.SecretKey||c.options.SecretKey,Method:e.Method,Pathname:p,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:c.options.UseRawKey,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:o}),r={Authorization:t,SecurityToken:c.options.SecurityToken||c.options.XCosSecurityToken};return s(null,r),r}();c.options.getSTS.call(c,{Bucket:u,Region:l},(function(e){f=e||{},f.Scope=h,f.ScopeKey=y,f.TmpSecretId||(f.TmpSecretId=f.SecretId),f.TmpSecretKey||(f.TmpSecretKey=f.SecretKey);var t=C(f);if(t)return s(t);c._StsCache.push(f),v()}))}return""}function Be(e){var t=!1,n=!1,r=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var o=e.error.Code,a=e.error.Message;("RequestTimeTooSkewed"===o||"AccessDenied"===o&&"Request has expired"===a)&&(n=!0)}catch(c){}if(e)if(n&&r){var s=Date.parse(r);this.options.CorrectClockSkew&&Math.abs(i.getSkewTime(this.options.SystemClockOffset)-s)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=s-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0);return t}function Pe(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=i.clearKey(e.qs),e.headers&&(e.headers=i.clearKey(e.headers)),e.qs&&(e.qs=i.clearKey(e.qs));var r=i.clone(e.qs);e.action&&(r[e.action]="");var o=e.url||e.Url,a=e.SignHost||Oe.call(this,{Bucket:e.Bucket,Region:e.Region,Url:o}),s=e.tracker,c=function o(i){var c=n.options.SystemClockOffset;s&&s.setParams({signStartTime:(new Date).getTime(),retryTimes:i-1}),Ie.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:r,Headers:e.headers,SignHost:a,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:n.options.ForceSignHost},(function(r,a){r?t(r):(s&&s.setParams({signEndTime:(new Date).getTime(),httpStartTime:(new Date).getTime()}),e.AuthData=a,Ne.call(n,e,(function(r,a){s&&s.setParams({httpEndTime:(new Date).getTime()}),r&&i<2&&(c!==n.options.SystemClockOffset||Be.call(n,r))?(e.headers&&(delete e.headers.Authorization,delete e.headers["token"],delete e.headers["clientIP"],delete e.headers["clientUA"],e.headers["x-cos-security-token"]&&delete e.headers["x-cos-security-token"],e.headers["x-ci-security-token"]&&delete e.headers["x-ci-security-token"]),o(i+1)):t(r,a)})))}))};c(1)}function Ne(e,t){var n=this,r=e.TaskId;if(!r||n._isRunningTask(r)){var a=e.Bucket,s=e.Region,c=e.Key,u=e.method||"GET",l=e.Url||e.url,d=e.body,p=e.rawBody;n.options.UseAccelerate&&(s="accelerate"),l=l||_e({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:a,region:s,object:c}),e.action&&(l=l+"?"+(i.isIOS_QQ?"".concat(e.action,"="):e.action)),e.qsStr&&(l=l.indexOf("?")>-1?l+"&"+e.qsStr:l+"?"+e.qsStr);var f={method:u,url:l,headers:e.headers,qs:e.qs,body:d},h="x-cos-security-token";if(i.isCIHost(l)&&(h="x-ci-security-token"),f.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(f.headers["token"]=e.AuthData.Token),e.AuthData.ClientIP&&(f.headers["clientIP"]=e.AuthData.ClientIP),e.AuthData.ClientUA&&(f.headers["clientUA"]=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(f.headers[h]=e.AuthData.SecurityToken),f.headers&&(f.headers=i.clearKey(f.headers)),f=i.clearKey(f),e.onProgress&&"function"===typeof e.onProgress){var m=d&&(d.size||d.length)||0;f.onProgress=function(t){if(!r||n._isRunningTask(r)){var o=t?t.loaded:0;e.onProgress({loaded:o,total:m})}}}e.onDownloadProgress&&(f.onDownloadProgress=e.onDownloadProgress),e.DataType&&(f.dataType=e.DataType),this.options.Timeout&&(f.timeout=this.options.Timeout),n.options.ForcePathStyle&&(f.pathStyle=n.options.ForcePathStyle),n.emit("before-send",f);var g=f.url.includes("accelerate."),y=f.qs?Object.keys(f.qs).map((function(e){return"".concat(e,"=").concat(f.qs[e])})).join("&"):"",v=y?f.url+"?"+y:f.url;e.tracker&&e.tracker.setParams({reqUrl:v,accelerate:g?"Y":"N"}),e.tracker&&e.tracker.parent&&e.tracker.parent.setParams({reqUrl:v,accelerate:g?"Y":"N"});var C=(n.options.Request||o)(f,(function(e){if(!e||"abort"!==e.error){var o={options:f,error:e&&e.error,statusCode:e&&e.statusCode||0,statusMessage:e&&e.statusMessage||"",headers:e&&e.headers||{},body:e&&e.body};n.emit("after-receive",o);var a,s=o.error,c=o.body,u={statusCode:o.statusCode,statusMessage:o.statusMessage,headers:o.headers},l=function(e,o){if(r&&n.off("inner-kill-task",b),!a){a=!0;var s={};u&&u.statusCode&&(s.statusCode=u.statusCode),u&&u.headers&&(s.headers=u.headers),e?(e=i.extend(e||{},s),t(e,null)):(o=i.extend(o||{},s),t(null,o)),C=null}};if(s)return l(i.error(s));var d,h=u.statusCode,m=2===Math.floor(h/100);if(p&&m)return l(null,{body:c});try{d=c&&c.indexOf("<")>-1&&c.indexOf(">")>-1&&i.xml2json(c)||{}}catch(y){d={}}var g=d&&d.Error;m?l(null,d):g?l(i.error(new Error(g.Message),{code:g.Code,error:g})):h?l(i.error(new Error(u.statusMessage),{code:""+h})):h&&l(i.error(new Error("statusCode error")))}})),b=function e(t){t.TaskId===r&&(C&&C.abort&&C.abort(),n.off("inner-kill-task",e))};r&&n.on("inner-kill-task",b)}}var De={getService:a,putBucket:s,headBucket:c,getBucket:u,deleteBucket:l,putBucketAcl:d,getBucketAcl:p,putBucketCors:f,getBucketCors:h,deleteBucketCors:m,getBucketLocation:g,getBucketPolicy:v,putBucketPolicy:y,deleteBucketPolicy:C,putBucketTagging:b,getBucketTagging:k,deleteBucketTagging:S,putBucketLifecycle:w,getBucketLifecycle:T,deleteBucketLifecycle:E,putBucketVersioning:x,getBucketVersioning:R,putBucketReplication:A,getBucketReplication:_,deleteBucketReplication:O,putBucketWebsite:I,getBucketWebsite:B,deleteBucketWebsite:P,putBucketReferer:N,getBucketReferer:D,putBucketDomain:U,getBucketDomain:M,deleteBucketDomain:j,putBucketOrigin:L,getBucketOrigin:H,deleteBucketOrigin:F,putBucketLogging:K,getBucketLogging:q,putBucketInventory:G,postBucketInventory:V,getBucketInventory:X,listBucketInventory:W,deleteBucketInventory:Q,putBucketAccelerate:J,getBucketAccelerate:$,putBucketEncryption:Y,getBucketEncryption:Z,deleteBucketEncryption:ee,getObject:re,headObject:te,listObjectVersions:ne,putObject:oe,deleteObject:ie,getObjectAcl:ae,putObjectAcl:se,optionsObject:ce,putObjectCopy:ue,deleteMultipleObject:de,restoreObject:pe,putObjectTagging:fe,getObjectTagging:he,deleteObjectTagging:me,selectObjectContent:ge,appendObject:Te,uploadPartCopy:le,multipartInit:ye,multipartUpload:ve,multipartComplete:Ce,multipartList:be,multipartListPart:ke,multipartAbort:Se,request:we,getObjectUrl:xe,getAuth:Ee};function Ue(e,t,n){i.each(["Cors","Acl"],(function(r){if(e.slice(-r.length)===r){var o=e.slice(0,-r.length)+r.toUpperCase(),a=i.apiWrapper(e,t),s=!1;n[o]=function(){!s&&console.warn("warning: cos."+o+" has been deprecated. Please Use cos."+e+" instead."),s=!0,a.apply(this,arguments)}}}))}e.exports.init=function(e,t){t.transferToTaskMethod(De,"putObject"),i.each(De,(function(t,n){e.prototype[n]=i.apiWrapper(n,t),Ue(n,t,e.prototype)}))}},"./src/cos.js": /*!********************!*\ !*** ./src/cos.js ***! \********************/ /*! no static exports found */function(e,t,n){"use strict";var r=n(/*! ./util */"./src/util.js"),o=n(/*! ./event */"./src/event.js"),i=n(/*! ./task */"./src/task.js"),a=n(/*! ./base */"./src/base.js"),s=n(/*! ./advance */"./src/advance.js"),c=n(/*! ../package.json */"./package.json"),u={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadQueueSize:1e4,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,EnableTracker:!1,DeepTracker:!1,TrackerDelay:5e3,CustomId:""},l=function(e){this.options=r.extend(r.clone(u),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格式错误,请检查"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey格式错误,请检查"),console.error("error: SecretKey format is incorrect. Please check")),r.isNode()&&(console.warn("warning: cos-js-sdk-v5 不支持 nodejs 环境使用,请改用 cos-nodejs-sdk-v5,参考文档: https://cloud.tencent.com/document/product/436/8629"),console.warn("warning: cos-js-sdk-v5 does not support nodejs environment. Please use cos-nodejs-sdk-v5 instead. See: https://cloud.tencent.com/document/product/436/8629")),o.init(this),i.init(this)};a.init(l,i),s.init(l,i),l.util={md5:r.md5,xml2json:r.xml2json,json2xml:r.json2xml,encodeBase64:r.encodeBase64},l.getAuthorization=r.getAuth,l.version=c.version,e.exports=l},"./src/event.js": /*!**********************!*\ !*** ./src/event.js ***! \**********************/ /*! no static exports found */function(e,t){var n=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){"task-list-update"===e&&console.warn('warning: Event "'+e+'" has been deprecated. Please use "list-update" instead.'),n(e).push(t)},e.off=function(e,t){for(var r=n(e),o=r.length-1;o>=0;o--)t===r[o]&&r.splice(o,1)},e.emit=function(e,t){for(var r=n(e).map((function(e){return e})),o=0;o=0;n--){var o=r[n][2];(!o||o+s=0;o--){var i=r[o];i[0]===e&&i[1]===t&&r.splice(o,1)}r.unshift([e,t,Math.round(Date.now()/1e3)]),r.length>n&&r.splice(n),d()}},removeUploadId:function(e){l.call(this),delete p.using[e];for(var t=r.length-1;t>=0;t--)r[t][1]===e&&r.splice(t,1);d()}};e.exports=p},"./src/task.js": /*!*********************!*\ !*** ./src/task.js ***! \*********************/ /*! no static exports found */function(e,t,n){var r=n(/*! ./session */"./src/session.js"),o=n(/*! ./util */"./src/util.js"),i={},a=function(e,t){i[t]=e[t],e[t]=function(e,n){e.SkipTask?i[t].call(this,e,n):this._addTask(t,e,n)}},s=function(e){var t=[],n={},a=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),e._custom&&(t._custom=e._custom),t},u=function(){var n,r=function(){n=0,e.emit("task-list-update",{list:o.map(t,c)}),e.emit("list-update",{list:o.map(t,c)})};return function(){n||(n=setTimeout(r))}}(),l=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var r=0;re.options.UploadQueueSize;){var o="waiting"===t[r].state||"checking"===t[r].state||"uploading"===t[r].state;t[r]&&o?r++:(n[t[r].id]&&delete n[t[r].id],t.splice(r,1),s--)}u()}},d=function n(){if(!(a>=e.options.FileParallelLimit)){while(t[s]&&"waiting"!==t[s].state)s++;if(!(s>=t.length)){var r=t[s];s++,a++,r.state="checking",r.params.onTaskStart&&r.params.onTaskStart(c(r)),!r.params.UploadData&&(r.params.UploadData={});var d=o.formatParams(r.api,r.params);i[r.api].call(e,d,(function(t,o){e._isRunningTask(r.id)&&("checking"!==r.state&&"uploading"!==r.state||(r.state=t?"error":"success",t&&(r.error=t),a--,u(),n(),r.callback&&r.callback(t,o),"success"===r.state&&(r.params&&(delete r.params.UploadData,delete r.params.Body,delete r.params),delete r.callback)),l())})),u(),setTimeout(n)}}},p=function(t,o){var i=n[t];if(i){var s=i&&"waiting"===i.state,c=i&&("checking"===i.state||"uploading"===i.state);if("canceled"===o&&"canceled"!==i.state||"paused"===o&&s||"paused"===o&&c){if("paused"===o&&i.params.Body&&"function"===typeof i.params.Body.pipe)return void console.error("stream not support pause");i.state=o,e.emit("inner-kill-task",{TaskId:t,toState:o});try{var p=i&&i.params&&i.params.UploadData.UploadId}catch(f){}"canceled"===o&&p&&r.removeUsing(p),u(),c&&(a--,d()),"canceled"===o&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)}l()}};e._addTasks=function(t){o.each(t,(function(t){e._addTask(t.api,t.params,t.callback,!0)})),u()};var f=!0;e._addTask=function(r,i,a,s){i=o.formatParams(r,i);var c=o.uuid();i.TaskId=c,i.onTaskReady&&i.onTaskReady(c),i.TaskReady&&(i.TaskReady(c),f&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),f=!1);var p={params:i,callback:a,api:r,index:t.length,id:c,Bucket:i.Bucket,Region:i.Region,Key:i.Key,FilePath:i.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:i._custom},h=i.onHashProgress;i.onHashProgress=function(t){e._isRunningTask(p.id)&&(p.hashPercent=t.percent,h&&h(t),u())};var m=i.onProgress;return i.onProgress=function(t){e._isRunningTask(p.id)&&("checking"===p.state&&(p.state="uploading"),p.loaded=t.loaded,p.speed=t.speed,p.percent=t.percent,m&&m(t),u())},o.getFileSize(r,i,(function(e,r){if(e)return a(o.error(e));n[c]=p,t.push(p),p.size=r,!s&&u(),d(),l()})),c},e._isRunningTask=function(e){var t=n[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return o.map(t,c)},e.cancelTask=function(e){p(e,"canceled")},e.pauseTask=function(e){p(e,"paused")},e.restartTask=function(e){var t=n[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",u(),s=Math.min(s,t.index),d())},e.isUploadRunning=function(){return a||s=0||e.indexOf("wow32")>=0?"win32":e.indexOf("win64")>=0||e.indexOf("wow64")>=0?"win64":t?"mac":"unknown os"},isMobile:function(){var e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i;return!("object"!==("undefined"===typeof navigator?"undefined":i(navigator))||!navigator.userAgent.match(e))},isAndroid:function(){var e=/(Android|Adr|Linux)/i;return!("object"!==("undefined"===typeof navigator?"undefined":i(navigator))||!navigator.userAgent.match(e))},isIOS:function(){var e=/(iPhone|iPod|iPad|iOS)/i;return!("object"!==("undefined"===typeof navigator?"undefined":i(navigator))||!navigator.userAgent.match(e))},isOtherMobile:function(){return isMobile&&!isAndroid&&!isIOS},getDeviceName:function(){if("object"!==("undefined"===typeof navigator?"undefined":i(navigator)))return"unknown device";var e=navigator.userAgent.toLowerCase();if(e.includes("app/tencent_wemeet"))return"tencent_wemeet";if(e.indexOf("maxthon")>=0){var t=e.match(/maxthon\/([\d.]+)/),n=t&&t[1]||"";return"傲游浏览器 ".concat(n).trim()}if(e.indexOf("qqbrowser")>=0){var r=e.match(/qqbrowser\/([\d.]+)/),o=r&&r[1]||"";return"QQ浏览器 ".concat(o).trim()}if(e.indexOf("se 2.x")>=0)return"搜狗浏览器";if(e.indexOf("wxwork")>=0)return"微信内置浏览器";if(e.indexOf("msie")>=0){var a=e.match(/msie ([\d.]+)/),s=a&&a[1]||"";return"IE ".concat(s).trim()}if(e.indexOf("firefox")>=0){var c=e.match(/firefox\/([\d.]+)/),u=c&&c[1]||"";return"Firefox ".concat(u).trim()}if(e.indexOf("chrome")>=0){var l=e.match(/chrome\/([\d.]+)/),d=l&&l[1]||"";return"Chrome ".concat(d).trim()}if(e.indexOf("opera")>=0){var p=e.match(/opera.([\d.]+)/),f=p&&p[1]||"";return"Opera ".concat(f).trim()}if(e.indexOf("safari")>=0){var h=e.match(/version\/([\d.]+)/),m=h&&h[1]||"";return"Safari ".concat(m).trim()}if(e.indexOf("edge")>=0){var g=e.match(/edge\/([\d.]+)/),y=g&&g[1]||"";return"edge ".concat(y).trim()}return e.substr(0,200)}},l={isMobile:u.isMobile(),isBrowser:!u.isMobile(),mobileOsType:u.isAndroid()?"android":u.isIOS?"ios":"other_mobile",pcOsType:u.getOsType()},d={deviceType:l.isMobile?"mobile":l.isBrowser?"browser":"unknown",devicePlatform:l.isMobile?l.mobileOsType:l.pcOsType,deviceName:u.getDeviceName()},p=["multipartInit","multipartUpload","multipartComplete","multipartList","multipartListPart","multipartAbort"],f=["putObject","postObject","appendObject","sliceUploadFile","uploadFile","uploadFiles"].concat(p),h=["getObject"];function m(e){return f.includes(e)?"cos_upload":h.includes(e)?"cos_download":"base_service"}function g(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function y(e){var t={},n=["tracePlatform","cossdkVersion","region","networkType","host","accelerate","requestPath","size","httpMd5","httpSign","httpFull","name","result","tookTime","errorNode","errorCode","errorMessage","errorRequestId","errorStatusCode","errorServiceName","errorType","traceId","bucket","appid","partNumber","retryTimes","reqUrl","customId","fullError","deviceType","devicePlatform","deviceName"],r=["tracePlatform","cossdkVersion","region","bucket","appid","networkType","host","accelerate","requestPath","partNumber","size","name","result","tookTime","errorRequestId","retryTimes","reqUrl","customId","deviceType","devicePlatform","deviceName"],o="Success"===e.result?r:n;for(var i in e)if(o.includes(i)){var a=g(i);t[a]=e[i]}return t}var v=function(){"use strict";function e(t){r(this,e);var n=t.parent,o=t.traceId,i=t.bucket,s=t.region,l=t.apiName,p=t.fileKey,f=t.fileSize,h=t.accelerate,m=t.customId,g=t.delay,y=t.deepTracker,v=i&&i.substr(i.lastIndexOf("-")+1)||"";this.parent=n,this.deepTracker=y,this.delay=g,this.params={cossdkVersion:a.version,region:s,networkType:"",host:"",accelerate:h?"Y":"N",requestPath:p||"",size:f||-1,httpMd5:0,httpSign:0,httpFull:0,name:l||"",result:"",tookTime:0,errorNode:"",errorCode:"",errorMessage:"",errorRequestId:"",errorStatusCode:0,errorServiceName:"",tracePlatform:"cos-js-sdk-v5",traceId:o||u.getUid(),bucket:i,appid:v,partNumber:0,retryTimes:0,reqUrl:"",customId:m||"",deviceType:d.deviceType,devicePlatform:d.devicePlatform,deviceName:d.deviceName,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:(new Date).getTime(),endTime:0},this.beacon=c(g)}return o(e,[{key:"formatResult",value:function(e,t){var n,r,o,i,a,s,c=(new Date).getTime(),l=c-this.params.startTime,d=u.getNetType(),p=e?(null===e||void 0===e?void 0:e.code)||(null===e||void 0===e||null===(n=e.error)||void 0===n?void 0:n.code)||(null===e||void 0===e||null===(r=e.error)||void 0===r?void 0:r.Code):"",f=e?(null===e||void 0===e?void 0:e.message)||(null===e||void 0===e||null===(o=e.error)||void 0===o?void 0:o.message)||(null===e||void 0===e||null===(i=e.error)||void 0===i?void 0:i.Message):"",h=e?(null===e||void 0===e?void 0:e.resource)||(null===e||void 0===e||null===(a=e.error)||void 0===a?void 0:a.resource)||(null===e||void 0===e||null===(s=e.error)||void 0===s?void 0:s.Resource):"",m=e?null===e||void 0===e?void 0:e.statusCode:t.statusCode,g=e?(null===e||void 0===e?void 0:e.headers)&&(null===e||void 0===e?void 0:e.headers["x-cos-request-id"]):(null===t||void 0===t?void 0:t.headers)&&(null===t||void 0===t?void 0:t.headers["x-cos-request-id"]),y=e?g?"Server":"Client":"";if(Object.assign(this.params,{tookTime:l,networkType:d,httpMd5:this.params.md5EndTime-this.params.md5StartTime,httpSign:this.params.signEndTime-this.params.signStartTime,httpFull:this.params.httpEndTime-this.params.httpStartTime,result:e?"Fail":"Success",errorType:y,errorCode:p,errorStatusCode:m,errorMessage:f,errorServiceName:h,errorRequestId:g}),!e||p&&f||(this.params.fullError=e?JSON.stringify(e):""),"getObject"===this.params.name&&(this.params.size=t?t.headers&&t.headers["content-length"]:-1),this.params.reqUrl)try{var v=/^http(s)?:\/\/(.*?)\//.exec(this.params.reqUrl);this.params.host=v[2]}catch(C){this.params.host=this.params.reqUrl}this.sendEvents()}},{key:"setParams",value:function(e){Object.assign(this.params,e)}},{key:"sendEvents",value:function(){if(!p.includes(this.params.name)||this.deepTracker){var e=m(this.params.name),t=y(this.params);this.beacon||(this.beacon=c(this.delay||5e3)),0===this.delay?this.beacon&&this.beacon.onDirectUserAction(e,t):this.beacon&&this.beacon.onUserAction(e,t)}}},{key:"generateSubTracker",value:function(t){return Object.assign(t,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay}),new e(t)}}]),e}();e.exports=v},"./src/util.js": /*!*********************!*\ !*** ./src/util.js ***! \*********************/ /*! no static exports found */function(e,t,n){"use strict";(function(t){var r=n(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),o=n(/*! ../lib/md5 */"./lib/md5.js"),i=n(/*! ../lib/crypto */"./lib/crypto.js"),a=n(/*! ../lib/xml2json */"./lib/xml2json.js"),s=n(/*! ../lib/json2xml */"./lib/json2xml.js"),c=n(/*! ../lib/base64 */"./lib/base64.js"),u=n(/*! ./tracker */"./src/tracker.js");function l(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function d(e,t){var n=[];for(var r in e)e.hasOwnProperty(r)&&n.push(t?l(r).toLowerCase():r);return n.sort((function(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),e===t?0:e>t?1:-1}))}var p=function(e,t){var n,r,o,i=[],a=d(e);for(n=0;n-1||f.indexOf(r)>-1)&&(t[n]=e[n])}return t},m=function(e){e=e||{};var t,n=e.SecretId,r=e.SecretKey,o=e.KeyTime,a=(e.method||e.Method||"get").toLowerCase(),s=A(e.Query||e.params||{}),c=h(A(e.Headers||e.headers||{})),u=e.Key||"";e.UseRawKey?t=e.Pathname||e.pathname||"/"+u:(t=e.Pathname||e.pathname||u,0!==t.indexOf("/")&&(t="/"+t));var l=!1!==e.ForceSignHost;if(!c.Host&&!c.host&&e.Bucket&&e.Region&&l&&(c.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),!n)throw new Error("missing param SecretId");if(!r)throw new Error("missing param SecretKey");var p=Math.round(z(e.SystemClockOffset)/1e3)-1,f=p,m=e.Expires||e.expires;f+=void 0===m?900:1*m||0;var g="sha1",y=n,v=o||p+";"+f,C=o||p+";"+f,b=d(c,!0).join(";").toLowerCase(),k=d(s,!0).join(";").toLowerCase(),S=i.HmacSHA1(C,r).toString(),w=[a,t,Y.obj2str(s,!0),Y.obj2str(c,!0),""].join("\n"),T=["sha1",v,i.SHA1(w).toString(),""].join("\n"),E=i.HmacSHA1(T,S).toString(),x=["q-sign-algorithm="+g,"q-ak="+y,"q-sign-time="+v,"q-key-time="+C,"q-header-list="+b,"q-url-param-list="+k,"q-signature="+E].join("&");return x},g=function(e,t,n){var r=t/8,o=e.slice(n,n+r);return new Uint8Array(o).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[t](o)[0]},y=function(e,t,n,r){var o=e.slice(t,n),i="";return new Uint8Array(o).forEach((function(e){i+=String.fromCharCode(e)})),r&&(i=decodeURIComponent(escape(i))),i},v=function(e){var t={},n=y(e),r={records:[]};while(e.byteLength){var o,i=g(e,32,0),a=g(e,32,4),s=i-a-16,c=0;e=e.slice(12);while(cparseInt(t[n])?1:-1;return 0},t=function(t){if(!t)return!1;var n=(t.match(/Chrome\/([.\d]+)/)||[])[1],r=(t.match(/QBCore\/([.\d]+)/)||[])[1],o=(t.match(/QQBrowser\/([.\d]+)/)||[])[1],i=n&&e(n,"53.0.2785.116")<0&&r&&e(r,"3.53.991.400")<0&&o&&e(o,"9.0.2524.400")<=0||!1;return i};return t("undefined"!==typeof navigator&&navigator.userAgent)}(),T=function(e,t,n,r,o){var i;if(e.slice?i=e.slice(t,n):e.mozSlice?i=e.mozSlice(t,n):e.webkitSlice&&(i=e.webkitSlice(t,n)),r&&w){var a=new FileReader;a.onload=function(e){i=null,o(new Blob([a.result]))},a.readAsArrayBuffer(i)}else o(i)},E=function(e,t,n,r){n=n||b,e?"string"===typeof t?n(Y.md5(t,!0)):Blob&&t instanceof Blob?Y.getFileMd5(t,(function(e,t){n(t)}),r):n():n()},x=1048576,R=function(e,t,n){var r=e.size,i=0,a=o.getCtx(),s=function o(s){if(s>=r){var c=a.digest("hex");t(null,c)}else{var u=Math.min(r,s+x);Y.fileSlice(e,s,u,!1,(function(e){S(e,(function(t){e=null,a=a.update(t,!0),i+=t.length,t=null,n&&n({loaded:i,total:r,percent:Math.round(i/r*1e4)/1e4}),o(s+x)}))}))}};s(0)};function A(e){return D(e,(function(e){return"object"===r(e)&&null!==e?A(e):e}))}function _(e,t,n){return e&&t in e?e[t]:n}function O(e,t){return N(t,(function(n,r){e[r]=t[r]})),e}function I(e){return e instanceof Array}function B(e,t){for(var n=!1,r=0;r-1,s=!i||"string"===typeof i&&i.indexOf("{Region}")>-1;if(e.indexOf("Bucket")>-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(a&&!n)return"Bucket";if(s&&!r)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e){if(a&&!n)return"Bucket";if(s&&!r)return"Region";if(!o)return"Key"}return!1},H=function(e,t){if(t=O({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};if(t&&"object"===r(t)){(function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])})();var o={"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-traffic-limit":"TrafficLimit","x-cos-mime-limit":"MimeLimit","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","Pic-Operations":"PicOperations"};Y.each(o,(function(e,r){void 0!==t[e]&&(n[r]=t[e])})),t.Headers=k(n)}}return t},F=function(e,t){return function(n,r){var o,i=this;if("function"===typeof n&&(r=n,n={}),n=H(e,n),i.options.EnableTracker)if("sliceUploadFile"===n.calledBySdk)o=n.tracker&&n.tracker.generateSubTracker({apiName:e});else if(["uploadFile","uploadFiles"].includes(e))o=null;else{var a=-1;n.Body&&(a="string"===typeof n.Body?n.Body.length:n.Body.size||n.Body.byteLength||-1),o=new u({bucket:n.Bucket,region:n.Region,apiName:e,fileKey:n.Key,fileSize:a,deepTracker:i.options.DeepTracker,customId:i.options.CustomId,delay:i.options.TrackerDelay})}n.tracker=o;var s=function(e){return e&&e.headers&&(e.headers["x-cos-request-id"]&&(e.RequestId=e.headers["x-cos-request-id"]),e.headers["x-ci-request-id"]&&(e.RequestId=e.headers["x-ci-request-id"]),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},c=function(e,t){o&&o.formatResult(e,t),r&&r(s(e),s(t))},l=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=L.call(i,e,n);if(t)return"missing param "+t;if(n.Region){if(i.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(n.Region))return"Region format error."}else{if(n.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(n.Region))return"Region format error."}i.options.CompatibilityMode||-1!==n.Region.indexOf("-")||"yfb"===n.Region||"default"===n.Region||"accelerate"===n.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(n.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(n.Bucket))if(n.AppId)n.Bucket=n.Bucket+"-"+n.AppId;else{if(!i.options.AppId)return'Bucket should format as "test-1250000000".';n.Bucket=n.Bucket+"-"+i.options.AppId}n.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete n.AppId)}!i.options.UseRawKey&&n.Key&&"/"===n.Key.substr(0,1)&&(n.Key=n.Key.substr(1))}},d=l(),p=["getAuth","getObjectUrl"].includes(e);if("function"===typeof Promise&&!p&&!r)return new Promise((function(e,o){if(r=function(t,n){t?o(t):e(n)},d)return c(Y.error(new Error(d)));t.call(i,n,c)}));if(d)return c(Y.error(new Error(d)));var f=t.call(i,n,c);return p?f:void 0}},K=function(e,t){var n,r,o=this,i=0,a=0,s=Date.now();function c(){if(r=0,t&&"function"===typeof t){n=Date.now();var o,c=Math.max(0,Math.round((a-i)/((n-s)/1e3)*100)/100)||0;o=0===a&&0===e?1:Math.floor(a/e*100)/100||0,s=n,i=a;try{t({loaded:a,total:e,speed:c,percent:o})}catch(u){}}}return function(t,n){if(t&&(a=t.loaded,e=t.total),n)clearTimeout(r),c();else{if(r)return;r=setTimeout(c,o.options.ProgressInterval)}}},q=function(e,t,n){var r;"string"===typeof t.Body?t.Body=new Blob([t.Body],{type:"text/plain"}):t.Body instanceof ArrayBuffer&&(t.Body=new Blob([t.Body])),t.Body&&(t.Body instanceof Blob||"[object File]"===t.Body.toString()||"[object Blob]"===t.Body.toString())?(r=t.Body.size,t.ContentLength=r,n(null,r)):n(Y.error(new Error("params body format error, Only allow File|Blob|String.")))},z=function(e){return Date.now()+(e||0)},G=function(e,t){var n=e;return e.message=e.message||null,"string"===typeof t?(e.error=t,e.message=t):"object"===r(t)&&null!==t&&(O(e,t),(t.code||t.name)&&(e.code=t.code||t.name),t.message&&(e.message=t.message),t.stack&&(e.stack=t.stack)),"function"===typeof Object.defineProperty&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=t&&t.name||e.name||e.code||"Error",e.code||(e.code=e.name),e.error||(e.error=A(n)),e},V=function(){return"object"===("undefined"===typeof globalThis?"undefined":r(globalThis))&&("DedicatedWorkerGlobalScope"===globalThis.constructor.name||globalThis.FileReaderSync)},X=function(){return"object"!==("undefined"===typeof window?"undefined":r(window))&&"object"===("undefined"===typeof t?"undefined":r(t))&&!V()},W=function(e){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e)},Q=function(){if("object"!==("undefined"===typeof navigator?"undefined":r(navigator)))return!1;var e=navigator.userAgent,t=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return t}(),J=function(){return"object"===("undefined"===typeof navigator?"undefined":r(navigator))&&/\sQQ/i.test(navigator.userAgent)}(),$=function(e,t){var n=c.encode(e);return t&&(n=n.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),n},Y={noop:b,formatParams:H,apiWrapper:F,xml2json:a,json2xml:s,md5:o,clearKey:k,fileSlice:T,getBodyMd5:E,getFileMd5:R,b64:M,extend:O,isArray:I,isInArray:B,makeArray:P,each:N,map:D,filter:U,clone:A,attr:_,uuid:j,camSafeUrlEncode:l,throttleOnProgress:K,getFileSize:q,getSkewTime:z,error:G,obj2str:p,getAuth:m,parseSelectPayload:v,getSourceParams:C,isBrowser:!0,isNode:X,isCIHost:W,isIOS_QQ:Q&&J,encodeBase64:$};e.exports=Y}).call(this,n(/*! ./../node_modules/process/browser.js */"./node_modules/process/browser.js"))}})}))},4450:function(e,t,n){"use strict";n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return m}));var r=n("2b7c"),o=n("bc3a"),i=n.n(o),a=n("40b3"),s=n.n(a);function c(e){return c="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},c(e)}function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(A){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new E(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return R()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=d(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(A){return{type:"throw",arg:A}}}e.wrap=l;var p={};function f(){}function h(){}function m(){}var g={};s(g,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(x([])));v&&v!==t&&n.call(v,o)&&(g=v);var C=m.prototype=f.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(o,i,a,s){var u=d(e[o],e,i);if("throw"!==u.type){var l=u.arg,p=l.value;return p&&"object"==c(p)&&n.call(p,"__await")?t.resolve(p.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(p).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function S(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=d(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function x(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function l(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){l(i,r,o,a,s,"next",e)}function s(e){l(i,r,o,a,s,"throw",e)}a(void 0)}))}}var p="tencent",f="daya-online-1303457149",h=function(){var e=d(u().mark((function e(t){var n,o,i,a,s,c,l;return u().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t.bucketName,o=t.filename,i=t.postData,a=p,s=n,c=o,l={},"tencent"===a?(s=f,c="gym/"+o,l={key:"gym/"+i.key}):l=i,e.abrupt("return",r["a"].post("/getUploadSign?pluginName="+a,{postData:l,pluginName:a,bucketName:s,filename:c}));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),m=function(){var e=d(u().mark((function e(t,n){var r,o,a,c,l,h,m,g;return u().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("ks3"!==p){e.next=16;break}for(a in r={policy:n.policy,signature:n.signature,key:n.key,acl:"public-read",KSSAccessKeyId:n.KSSAccessKeyId,name:n.name},o=new FormData,r)o.append(a,r[a]);return o.append("file",n.file),c="",l=null,e.next=9,i.a.post(t,o,{}).then((function(){c=t+n.key})).catch((function(e){l=e}));case 9:if(!c){e.next=13;break}return e.abrupt("return",c);case 13:throw new Error(l);case 14:e.next=26;break;case 16:return h="",m=null,g=new s.a({Domain:"https://oss.dayaedu.com",getAuthorization:function(){var e=d(u().mark((function e(t,r){return u().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r({Authorization:n.signature});case 1:case"end":return e.stop()}}),e)})));function t(t,n){return e.apply(this,arguments)}return t}()}),e.next=21,g.uploadFile({Bucket:f,Region:"ap-nanjing",Key:"gym/".concat(n.name),Body:n.file,SliceSize:524288e3}).then((function(e){var t;h=(null===(t=e.Location)||void 0===t?void 0:t.indexOf("http"))>=0?e.Location:"https://"+e.Location})).catch((function(e){m=e}));case 21:if(!h){e.next=25;break}return e.abrupt("return",h);case 25:throw new Error(m);case 26:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}}]);