System.register(["./index-legacy-6b8080dc-1763717014417.js"],function(e,t){"use strict";var o,r,n,i,a,s,c,l,u,d,h,p,f,g,m,y,v;return{setters:[e=>{e.br,o=e.bs,r=e.ab,n=e.d,i=e.e,a=e.r,s=e.f,c=e.aO,l=e.aP,u=e.x,d=e.j,h=e.k,p=e.ak,f=e.b,g=e.a5,m=e.ah,y=e.l,v=e.m}],execute:function(){var t=document.createElement("style");t.textContent='/*!\n * Cropper.js v1.6.2\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2024-04-21T07:43:02.731Z\n */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{backface-visibility:hidden;display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-wrap-box,.cropper-canvas,.cropper-drag-box,.cropper-crop-box,.cropper-modal{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-wrap-box,.cropper-canvas{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:calc(100% / 3);left:0;top:calc(100% / 3);width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:calc(100% / 3);top:0;width:calc(100% / 3)}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:before,.cropper-center:after{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-.15625vw;top:0;width:.36458333vw}.cropper-center:after{height:.36458333vw;left:0;top:-.15625vw;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-.15625vw;top:0;width:.26041667vw}.cropper-line.line-n{cursor:ns-resize;height:.26041667vw;left:0;top:-.15625vw}.cropper-line.line-w{cursor:ew-resize;left:-.15625vw;top:0;width:.26041667vw}.cropper-line.line-s{bottom:-.15625vw;cursor:ns-resize;height:.26041667vw;left:0}.cropper-point{background-color:#39f;height:.26041667vw;opacity:.75;width:.26041667vw}.cropper-point.point-e{cursor:ew-resize;margin-top:-.15625vw;right:-.15625vw;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-.15625vw;top:-.15625vw}.cropper-point.point-w{cursor:ew-resize;left:-.15625vw;margin-top:-.15625vw;top:50%}.cropper-point.point-s{bottom:-.15625vw;cursor:s-resize;left:50%;margin-left:-.15625vw}.cropper-point.point-ne{cursor:nesw-resize;right:-.15625vw;top:-.15625vw}.cropper-point.point-nw{cursor:nwse-resize;left:-.15625vw;top:-.15625vw}.cropper-point.point-sw{bottom:-.15625vw;cursor:nesw-resize;left:-.15625vw}.cropper-point.point-se{bottom:-.15625vw;cursor:nwse-resize;height:1.04166667vw;opacity:1;right:-.15625vw;width:1.04166667vw}@media (min-width: 768px){.cropper-point.point-se{height:.78125vw;width:.78125vw}}@media (min-width: 992px){.cropper-point.point-se{height:.52083333vw;width:.52083333vw}}@media (min-width: 1200px){.cropper-point.point-se{height:.26041667vw;opacity:.75;width:.26041667vw}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}\n',document.head.appendChild(t);var k={exports:{}};!function(e){var t;t=function(){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/dist/",o(o.s="./index.js")}({"./index.js": /*!******************!*\ !*** ./index.js ***! \******************/ /*! no static exports found */function(e,t,o){var r=o(/*! ./src/cos */"./src/cos.js");e.exports=r},"./lib/base64.js": /*!***********************!*\ !*** ./lib/base64.js ***! \***********************/ /*! no static exports found */function(e,t){var o=function(e){var t=(e=e||{}).Base64,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=function(e){for(var t={},o=0,r=e.length;o>>6)+n(128|63&t):n(224|t>>>12&15)+n(128|t>>>6&63)+n(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return n(240|t>>>18&7)+n(128|t>>>12&63)+n(128|t>>>6&63)+n(128|63&t)},a=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,s=function(e){return e.replace(a,i)},c=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[o.charAt(r>>>18),o.charAt(r>>>12&63),t>=2?"=":o.charAt(r>>>6&63),t>=1?"=":o.charAt(63&r)].join("")},l=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,c)},u=function(e){return l(s(e))},d=function(e,t){return t?u(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):u(String(e))},h=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),p=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))-65536;return n((t>>>10)+55296)+n(56320+(1023&t));case 3:return n((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return n((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},f=function(e){return e.replace(h,p)},g=function(e){var t=e.length,o=t%4,i=(t>0?r[e.charAt(0)]<<18:0)|(t>1?r[e.charAt(1)]<<12:0)|(t>2?r[e.charAt(2)]<<6:0)|(t>3?r[e.charAt(3)]:0),a=[n(i>>>16),n(i>>>8&255),n(255&i)];return a.length-=[0,0,2,1][o],a.join("")},m=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,g)},y=function(e){return function(e){return f(m(e))}(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};return{VERSION:"2.1.9",atob:m,btoa:l,fromBase64:y,toBase64:d,utob:s,encode:d,encodeURI:function(e){return d(e,!0)},btou:f,decode:y,noConflict:function(){var o=e.Base64;return e.Base64=t,o}}}();e.exports=o},"./lib/crypto.js": /*!***********************!*\ !*** ./lib/crypto.js ***! \***********************/ /*! no static exports found */function(e,t,o){(function(e){var t,r,n,i,a,s,c,l=o(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),u=u||function(e){var t={},o=t.lib={},r=function(){},n=o.Base={extend:function(e){r.prototype=this;var t=new r;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)}},i=o.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||s).stringify(this)},concat:function(e){var t=this.words,o=e.words,r=this.sigBytes;if(e=e.sigBytes,this.clamp(),r%4)for(var n=0;n>>2]|=(o[n>>>2]>>>24-n%4*8&255)<<24-(r+n)%4*8;else if(65535>>2]=o[n>>>2];else t.push.apply(t,o);return this.sigBytes+=e,this},clamp:function(){var t=this.words,o=this.sigBytes;t[o>>>2]&=4294967295<<32-o%4*8,t.length=e.ceil(o/4)},clone:function(){var e=n.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var o=[],r=0;r>>2]>>>24-r%4*8&255;o.push((n>>>4).toString(16)),o.push((15&n).toString(16))}return o.join("")},parse:function(e){for(var t=e.length,o=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new i.init(o,t/2)}},c=a.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var o=[],r=0;r>>2]>>>24-r%4*8&255));return o.join("")},parse:function(e){for(var t=e.length,o=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new i.init(o,t)}},l=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},u=o.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new i.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 o=this._data,r=o.words,n=o.sigBytes,a=this.blockSize,s=n/(4*a);if(t=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,n=e.min(4*t,n),t){for(var c=0;cl;l++){if(16>l)i[l]=0|e[t+l];else{var u=i[l-3]^i[l-8]^i[l-14]^i[l-16];i[l]=u<<1|u>>>31}u=(r<<5|r>>>27)+c+i[l],u=20>l?u+(1518500249+(n&a|~n&s)):40>l?u+(1859775393+(n^a^s)):60>l?u+((n&a|n&s|a&s)-1894007588):u+((n^a^s)-899497514),c=s,s=a,a=n<<30|n>>>2,n=r,r=u}o[0]=o[0]+r|0,o[1]=o[1]+n|0,o[2]=o[2]+a|0,o[3]=o[3]+s|0,o[4]=o[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,o=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(o/4294967296),t[15+(r+64>>>9<<4)]=o,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=n._createHelper(a),t.HmacSHA1=n._createHmacHelper(a),function(){var e=u,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,o){e=this._hasher=new e.init,"string"==typeof o&&(o=t.parse(o));var r=e.blockSize,n=4*r;o.sigBytes>n&&(o=e.finalize(o)),o.clamp();for(var i=this._oKey=o.clone(),a=this._iKey=o.clone(),s=i.words,c=a.words,l=0;l>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(e){var t=e.length,o=this._map,r=o.charAt(64);if(r){var n=e.indexOf(r);-1!=n&&(t=n)}for(var i=[],a=0,s=0;s>>6-s%4*2;i[a>>>2]|=(l|u)<<24-a%4*8,a++}return c.create(i,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},"object"===l(e)?e.exports=u:window.CryptoJS=u}).call(this,o(/*! ./../node_modules/webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(e))},"./lib/md5.js": /*!********************!*\ !*** ./lib/md5.js ***! \********************/ /*! no static exports found */function(e,t,o){(function(e){var t,r=o(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");!function(){var n="object"===("undefined"==typeof window?"undefined":r(window)),i=n?window:{};i.JS_MD5_NO_WINDOW&&(n=!1),!n&&"object"===("undefined"==typeof self?"undefined":r(self))&&(i=self);var a,s=!i.JS_MD5_NO_COMMON_JS&&"object"===r(e)&&e.exports,c=o(/*! !webpack amd options */"./node_modules/webpack/buildin/amd-options.js"),l=!i.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),d=[128,32768,8388608,-2147483648],h=[0,8,16,24],p=["hex","array","digest","buffer","arrayBuffer","base64"],f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),g=[];if(l){var m=new ArrayBuffer(68);a=new Uint8Array(m),g=new Uint32Array(m)}!i.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!i.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===r(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e){return function(t,o){return new v(!0).update(t,o)[e]()}};function v(e){if(e)g[0]=g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0,this.blocks=g,this.buffer8=a;else if(l){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}v.prototype.update=function(e,t){if(!this.finalized){for(var o,r,n=0,i=e.length,a=this.blocks,s=this.buffer8;n>6,s[r++]=128|63&o):o<55296||o>=57344?(s[r++]=224|o>>12,s[r++]=128|o>>6&63,s[r++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++n)),s[r++]=240|o>>18,s[r++]=128|o>>12&63,s[r++]=128|o>>6&63,s[r++]=128|63&o);else for(r=this.start;n>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[r>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=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}},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=d[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()}},v.prototype.hash=function(){var e,t,o,r,n,i,a=this.blocks;this.first?t=((t=((e=((e=a[0]-680876937)<<7|e>>>25)-271733879|0)^(o=((o=(-271733879^(r=((r=(-1732584194^2004318071&e)+a[1]-117830708)<<12|r>>>20)+e|0)&(-271733879^e))+a[2]-1126478375)<<17|o>>>15)+r|0)&(r^e))+a[3]-1316259209)<<22|t>>>10)+o|0:(e=this.h0,t=this.h1,o=this.h2,t=((t+=((e=((e+=((r=this.h3)^t&(o^r))+a[0]-680876936)<<7|e>>>25)+t|0)^(o=((o+=(t^(r=((r+=(o^e&(t^o))+a[1]-389564586)<<12|r>>>20)+e|0)&(e^t))+a[2]+606105819)<<17|o>>>15)+r|0)&(r^e))+a[3]-1044525330)<<22|t>>>10)+o|0),t=((t+=((e=((e+=(r^t&(o^r))+a[4]-176418897)<<7|e>>>25)+t|0)^(o=((o+=(t^(r=((r+=(o^e&(t^o))+a[5]+1200080426)<<12|r>>>20)+e|0)&(e^t))+a[6]-1473231341)<<17|o>>>15)+r|0)&(r^e))+a[7]-45705983)<<22|t>>>10)+o|0,t=((t+=((e=((e+=(r^t&(o^r))+a[8]+1770035416)<<7|e>>>25)+t|0)^(o=((o+=(t^(r=((r+=(o^e&(t^o))+a[9]-1958414417)<<12|r>>>20)+e|0)&(e^t))+a[10]-42063)<<17|o>>>15)+r|0)&(r^e))+a[11]-1990404162)<<22|t>>>10)+o|0,t=((t+=((e=((e+=(r^t&(o^r))+a[12]+1804603682)<<7|e>>>25)+t|0)^(o=((o+=(t^(r=((r+=(o^e&(t^o))+a[13]-40341101)<<12|r>>>20)+e|0)&(e^t))+a[14]-1502002290)<<17|o>>>15)+r|0)&(r^e))+a[15]+1236535329)<<22|t>>>10)+o|0,t=((t+=((r=((r+=(t^o&((e=((e+=(o^r&(t^o))+a[1]-165796510)<<5|e>>>27)+t|0)^t))+a[6]-1069501632)<<9|r>>>23)+e|0)^e&((o=((o+=(e^t&(r^e))+a[11]+643717713)<<14|o>>>18)+r|0)^r))+a[0]-373897302)<<20|t>>>12)+o|0,t=((t+=((r=((r+=(t^o&((e=((e+=(o^r&(t^o))+a[5]-701558691)<<5|e>>>27)+t|0)^t))+a[10]+38016083)<<9|r>>>23)+e|0)^e&((o=((o+=(e^t&(r^e))+a[15]-660478335)<<14|o>>>18)+r|0)^r))+a[4]-405537848)<<20|t>>>12)+o|0,t=((t+=((r=((r+=(t^o&((e=((e+=(o^r&(t^o))+a[9]+568446438)<<5|e>>>27)+t|0)^t))+a[14]-1019803690)<<9|r>>>23)+e|0)^e&((o=((o+=(e^t&(r^e))+a[3]-187363961)<<14|o>>>18)+r|0)^r))+a[8]+1163531501)<<20|t>>>12)+o|0,t=((t+=((r=((r+=(t^o&((e=((e+=(o^r&(t^o))+a[13]-1444681467)<<5|e>>>27)+t|0)^t))+a[2]-51403784)<<9|r>>>23)+e|0)^e&((o=((o+=(e^t&(r^e))+a[7]+1735328473)<<14|o>>>18)+r|0)^r))+a[12]-1926607734)<<20|t>>>12)+o|0,t=((t+=((i=(r=((r+=((n=t^o)^(e=((e+=(n^r)+a[5]-378558)<<4|e>>>28)+t|0))+a[8]-2022574463)<<11|r>>>21)+e|0)^e)^(o=((o+=(i^t)+a[11]+1839030562)<<16|o>>>16)+r|0))+a[14]-35309556)<<23|t>>>9)+o|0,t=((t+=((i=(r=((r+=((n=t^o)^(e=((e+=(n^r)+a[1]-1530992060)<<4|e>>>28)+t|0))+a[4]+1272893353)<<11|r>>>21)+e|0)^e)^(o=((o+=(i^t)+a[7]-155497632)<<16|o>>>16)+r|0))+a[10]-1094730640)<<23|t>>>9)+o|0,t=((t+=((i=(r=((r+=((n=t^o)^(e=((e+=(n^r)+a[13]+681279174)<<4|e>>>28)+t|0))+a[0]-358537222)<<11|r>>>21)+e|0)^e)^(o=((o+=(i^t)+a[3]-722521979)<<16|o>>>16)+r|0))+a[6]+76029189)<<23|t>>>9)+o|0,t=((t+=((i=(r=((r+=((n=t^o)^(e=((e+=(n^r)+a[9]-640364487)<<4|e>>>28)+t|0))+a[12]-421815835)<<11|r>>>21)+e|0)^e)^(o=((o+=(i^t)+a[15]+530742520)<<16|o>>>16)+r|0))+a[2]-995338651)<<23|t>>>9)+o|0,t=((t+=((r=((r+=(t^((e=((e+=(o^(t|~r))+a[0]-198630844)<<6|e>>>26)+t|0)|~o))+a[7]+1126891415)<<10|r>>>22)+e|0)^((o=((o+=(e^(r|~t))+a[14]-1416354905)<<15|o>>>17)+r|0)|~e))+a[5]-57434055)<<21|t>>>11)+o|0,t=((t+=((r=((r+=(t^((e=((e+=(o^(t|~r))+a[12]+1700485571)<<6|e>>>26)+t|0)|~o))+a[3]-1894986606)<<10|r>>>22)+e|0)^((o=((o+=(e^(r|~t))+a[10]-1051523)<<15|o>>>17)+r|0)|~e))+a[1]-2054922799)<<21|t>>>11)+o|0,t=((t+=((r=((r+=(t^((e=((e+=(o^(t|~r))+a[8]+1873313359)<<6|e>>>26)+t|0)|~o))+a[15]-30611744)<<10|r>>>22)+e|0)^((o=((o+=(e^(r|~t))+a[6]-1560198380)<<15|o>>>17)+r|0)|~e))+a[13]+1309151649)<<21|t>>>11)+o|0,t=((t+=((r=((r+=(t^((e=((e+=(o^(t|~r))+a[4]-145523070)<<6|e>>>26)+t|0)|~o))+a[11]-1120210379)<<10|r>>>22)+e|0)^((o=((o+=(e^(r|~t))+a[2]+718787259)<<15|o>>>17)+r|0)|~e))+a[9]-343485551)<<21|t>>>11)+o|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=o-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+o|0,this.h3=this.h3+r|0)},v.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,o=this.h2,r=this.h3;return u[e>>4&15]+u[15&e]+u[e>>12&15]+u[e>>8&15]+u[e>>20&15]+u[e>>16&15]+u[e>>28&15]+u[e>>24&15]+u[t>>4&15]+u[15&t]+u[t>>12&15]+u[t>>8&15]+u[t>>20&15]+u[t>>16&15]+u[t>>28&15]+u[t>>24&15]+u[o>>4&15]+u[15&o]+u[o>>12&15]+u[o>>8&15]+u[o>>20&15]+u[o>>16&15]+u[o>>28&15]+u[o>>24&15]+u[r>>4&15]+u[15&r]+u[r>>12&15]+u[r>>8&15]+u[r>>20&15]+u[r>>16&15]+u[r>>28&15]+u[r>>24&15]},v.prototype.toString=v.prototype.hex,v.prototype.digest=function(e){if("hex"===e)return this.hex();this.finalize();var t=this.h0,o=this.h1,r=this.h2,n=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},v.prototype.array=v.prototype.digest,v.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},v.prototype.buffer=v.prototype.arrayBuffer,v.prototype.base64=function(){for(var e,t,o,r="",n=this.array(),i=0;i<15;)e=n[i++],t=n[i++],o=n[i++],r+=f[e>>>2]+f[63&(e<<4|t>>>4)]+f[63&(t<<2|o>>>6)]+f[63&o];return e=n[i],r+=f[e>>>2]+f[e<<4&63]+"=="};var k=function(){var e=y("hex");e.getCtx=e.create=function(){return new v},e.update=function(t){return e.create().update(t)};for(var t=0;t0&&n.trim().split("\n").forEach(function(e){if(e){var t=e.indexOf(":"),o=e.substr(0,t).trim().toLowerCase(),n=e.substr(t+1).trim();r[o]=n}}),{error:e,statusCode:t.status,statusMessage:t.statusText,headers:r,body:o}},a=function(e,t){return t||"text"!==t?e.response:e.responseText};e.exports=function(e,t){var o,s,c,l,u=(e.method||"GET").toUpperCase(),d=e.url;if(e.qs){var h=(o=e.qs,s=s||"&",c=c||"=",null===o&&(o=void 0),"object"===r(o)?Object.keys(o).map(function(e){var t=encodeURIComponent(n(e))+c;return Array.isArray(o[e])?o[e].map(function(e){return t+encodeURIComponent(n(e))}).join(s):t+encodeURIComponent(n(o[e]))}).filter(Boolean).join(s):l?encodeURIComponent(n(l))+c+encodeURIComponent(n(o)):"");h&&(d+=(-1===d.indexOf("?")?"?":"&")+h)}var p=new XMLHttpRequest;if(p.open(u,d,!0),p.responseType=e.dataType||"text",e.xhrFields)for(var f in e.xhrFields)p[f]=e.xhrFields[f];var g=e.headers;if(g)for(var m in g)g.hasOwnProperty(m)&&"content-length"!==m.toLowerCase()&&"user-agent"!==m.toLowerCase()&&"origin"!==m.toLowerCase()&&"host"!==m.toLowerCase()&&p.setRequestHeader(m,g[m]);return e.onProgress&&p.upload&&(p.upload.onprogress=e.onProgress),e.onDownloadProgress&&(p.onprogress=e.onDownloadProgress),e.timeout&&(p.timeout=e.timeout),p.ontimeout=function(e){var o=new Error("timeout");t(i(o,p))},p.onload=function(){t(i(null,p,a(p,e.dataType)))},p.onerror=function(o){var r=a(p,e.dataType);if(r)t(i(null,p,r));else{var n=p.statusText;n||0!==p.status||(n=new Error("CORS blocked or network error")),t(i(n,p,r))}},p.send(e.body||""),p}},"./node_modules/@babel/runtime/helpers/classCallCheck.js": /*!***************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***! \***************************************************************/ /*! no static exports found */function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/createClass.js": /*!************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/createClass.js ***! \************************************************************/ /*! no static exports found */function(e,t,o){var r=o(/*! ./toPropertyKey.js */"./node_modules/@babel/runtime/helpers/toPropertyKey.js");function n(e,t){for(var o=0;o{for(const o of e){if("string"==typeof o&&t===o)return!0;if(o instanceof RegExp&&o.test(t))return!0}}:()=>!1}},"./node_modules/fast-xml-parser/src/util.js": /*!**************************************************!*\ !*** ./node_modules/fast-xml-parser/src/util.js ***! \**************************************************/ /*! no static exports found */function(e,t,o){const r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+n+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,o){if(t){const r=Object.keys(t),n=r.length;for(let i=0;i5&&"xml"===r)return f("InvalidXml","XML declaration allowed only at the start of the document.",y(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function s(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let o=1;for(t+=8;t"===e[t]&&(o--,0===o))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},n,t);const o=[];let r=!1,c=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let n=0;n"!==e[n]&&" "!==e[n]&&"\t"!==e[n]&&"\n"!==e[n]&&"\r"!==e[n];n++)g+=e[n];if(g=g.trim(),"/"===g[g.length-1]&&(g=g.substring(0,g.length-1),n--),!m(g)){let t;return t=0===g.trim().length?"Invalid space after '<'.":"Tag '"+g+"' is an invalid name.",f("InvalidTag",t,y(e,n))}const v=u(e,n);if(!1===v)return f("InvalidAttr","Attributes for '"+g+"' have open quote.",y(e,n));let k=v.value;if(n=v.index,"/"===k[k.length-1]){const o=n-k.length;k=k.substring(0,k.length-1);const i=h(k,t);if(!0!==i)return f(i.err.code,i.err.msg,y(e,o+i.err.line));r=!0}else if(d){if(!v.tagClosed)return f("InvalidTag","Closing tag '"+g+"' doesn't have proper closing.",y(e,n));if(k.trim().length>0)return f("InvalidTag","Closing tag '"+g+"' can't have attributes or invalid starting.",y(e,l));if(0===o.length)return f("InvalidTag","Closing tag '"+g+"' has not been opened.",y(e,l));{const t=o.pop();if(g!==t.tagName){let o=y(e,t.tagStartPos);return f("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+o.line+", col "+o.col+") instead of closing tag '"+g+"'.",y(e,l))}0==o.length&&(c=!0)}}else{const i=h(k,t);if(!0!==i)return f(i.err.code,i.err.msg,y(e,n-k.length+i.err.line));if(!0===c)return f("InvalidXml","Multiple possible root nodes found.",y(e,n));-1!==t.unpairedTags.indexOf(g)||o.push({tagName:g,tagStartPos:l}),r=!0}for(n++;n0)||f("InvalidXml","Invalid '"+JSON.stringify(o.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):f("InvalidXml","Start tag expected.",1)};const c='"',l="'";function u(e,t){let o="",r="",n=!1;for(;t"===e[t]&&""===r){n=!0;break}o+=e[t]}return""===r&&{value:o,index:t,tagClosed:n}}const d=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function h(e,t){const o=r.getAllMatches(e,d),n={};for(let r=0;r","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function a(e){this.options=Object.assign({},i,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=n(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=l),this.processTextOrObjNode=s,this.options.format?(this.indentate=c,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function s(e,t,o,r){const n=this.j2x(e,o+1,r.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,o):this.buildObjectNode(n.val,t,n.attrStr,o)}function c(e){return this.options.indentBy.repeat(e)}function l(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}a.prototype.build=function(e){return this.options.preserveOrder?r(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},a.prototype.j2x=function(e,t,o){let r="",n="";const i=o.join(".");for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a))if(void 0===e[a])this.isAttribute(a)&&(n+="");else if(null===e[a])this.isAttribute(a)?n+="":"?"===a[0]?n+=this.indentate(t)+"<"+a+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+a+"/"+this.tagEndChar;else if(e[a]instanceof Date)n+=this.buildTextValNode(e[a],a,"",t);else if("object"!=typeof e[a]){const o=this.isAttribute(a);if(o&&!this.ignoreAttributesFn(o,i))r+=this.buildAttrPairStr(o,""+e[a]);else if(!o)if(a===this.options.textNodeName){let t=this.options.tagValueProcessor(a,""+e[a]);n+=this.replaceEntitiesValue(t)}else n+=this.buildTextValNode(e[a],a,"",t)}else if(Array.isArray(e[a])){const r=e[a].length;let i="",s="";for(let c=0;c"+e+n}},a.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(r)+"<"+t+o+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(t,e);return n=this.replaceEntitiesValue(n),""===n?this.indentate(r)+"<"+t+o+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+o+">"+n+"0&&this.options.processEntities)for(let t=0;t`,u=!1;continue}if(p===t.commentPropName){l+=c+`\x3c!--${h[p][0][t.textNodeName]}--\x3e`,u=!0;continue}if("?"===p[0]){const e=n(h[":@"],t),o="?xml"===p?"":c;let r=h[p][0][t.textNodeName];r=0!==r.length?" "+r:"",l+=o+`<${p}${r}${e}?>`,u=!0;continue}let g=c;""!==g&&(g+=t.indentBy);const m=c+`<${p}${n(h[":@"],t)}`,y=o(h[p],t,f,g);-1!==t.unpairedTags.indexOf(p)?t.suppressUnpairedNode?l+=m+">":l+=m+"/>":y&&0!==y.length||!t.suppressEmptyNode?y&&y.endsWith(">")?l+=m+`>${y}${c}`:(l+=m+">",y&&""!==c&&(y.includes("/>")||y.includes("`):l+=m+"/>",u=!0}return l}function r(e){const t=Object.keys(e);for(let o=0;o0&&t.processEntities)for(let o=0;o0&&(r="\n"),o(e,t,"",r)}},"./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js": /*!*********************************************************************!*\ !*** ./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js ***! \*********************************************************************/ /*! no static exports found */function(e,t,o){const r=o(/*! ../util */"./node_modules/fast-xml-parser/src/util.js");function n(e,t){let o="";for(;t"===e[t]){if(h?"-"===e[t-1]&&"-"===e[t-2]&&(h=!1,r--):r--,0===r)break}else"["===e[t]?d=!0:p+=e[t];else{if(d&&a(e,t))t+=7,[entityName,val,t]=n(e,t+1),-1===val.indexOf("&")&&(o[u(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(d&&s(e,t))t+=8;else if(d&&c(e,t))t+=8;else if(d&&l(e,t))t+=9;else{if(!i)throw new Error("Invalid DOCTYPE");h=!0}r++,p=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:o,i:t}}},"./node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js": /*!**********************************************************************!*\ !*** ./node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js ***! \**********************************************************************/ /*! no static exports found */function(e,t){const o={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,o){return e}};t.buildOptions=function(e){return Object.assign({},o,e)},t.defaultOptions=o},"./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js": /*!************************************************************************!*\ !*** ./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js ***! \************************************************************************/ /*! no static exports found */function(e,t,o){const r=o(/*! ../util */"./node_modules/fast-xml-parser/src/util.js"),n=o(/*! ./xmlNode */"./node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"),i=o(/*! ./DocTypeReader */"./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"),a=o(/*! strnum */"./node_modules/strnum/strnum.js"),s=o(/*! ../ignoreAttributes */"./node_modules/fast-xml-parser/src/ignoreAttributes.js");function c(e){const t=Object.keys(e);for(let o=0;o0)){a||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,o,n,i);return null==r?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?C(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function u(e){if(this.options.removeNSPrefix){const t=e.split(":"),o="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=o+t[1])}return e}const d=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function h(e,t,o){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const o=r.getAllMatches(e,d),n=o.length,i={};for(let e=0;e",s,"Closing Tag is not closed.");let n=e.substring(s+2,t).trim();if(this.options.removeNSPrefix){const e=n.indexOf(":");-1!==e&&(n=n.substr(e+1))}this.options.transformTagName&&(n=this.options.transformTagName(n)),o&&(r=this.saveTextToParentTag(r,o,a));const i=a.substring(a.lastIndexOf(".")+1);if(n&&-1!==this.options.unpairedTags.indexOf(n))throw new Error(`Unpaired tag can not be used as closing tag: `);let c=0;i&&-1!==this.options.unpairedTags.indexOf(i)?(c=a.lastIndexOf(".",a.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=a.lastIndexOf("."),a=a.substring(0,c),o=this.tagsNodeStack.pop(),r="",s=t}else if("?"===e[s+1]){let t=k(e,s,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,o,a),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new n(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,a,t.tagName)),this.addChild(o,e,a)}s=t.closeIndex+1}else if("!--"===e.substr(s+1,3)){const t=v(e,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const n=e.substring(s+4,t-2);r=this.saveTextToParentTag(r,o,a),o.add(this.options.commentPropName,[{[this.options.textNodeName]:n}])}s=t}else if("!D"===e.substr(s+1,2)){const t=i(e,s);this.docTypeEntities=t.entities,s=t.i}else if("!["===e.substr(s+1,2)){const t=v(e,"]]>",s,"CDATA is not closed.")-2,n=e.substring(s+9,t);r=this.saveTextToParentTag(r,o,a);let i=this.parseTextData(n,o.tagname,a,!0,!1,!0,!0);null==i&&(i=""),this.options.cdataPropName?o.add(this.options.cdataPropName,[{[this.options.textNodeName]:n}]):o.add(this.options.textNodeName,i),s=t+2}else{let i=k(e,s,this.options.removeNSPrefix),c=i.tagName;const l=i.rawTagName;let u=i.tagExp,d=i.attrExpPresent,h=i.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),o&&r&&"!xml"!==o.tagname&&(r=this.saveTextToParentTag(r,o,a,!1));const p=o;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(o=this.tagsNodeStack.pop(),a=a.substring(0,a.lastIndexOf("."))),c!==t.tagname&&(a+=a?"."+c:c),this.isItStopNode(this.options.stopNodes,a,c)){let t="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===c[c.length-1]?(c=c.substr(0,c.length-1),a=a.substr(0,a.length-1),u=c):u=u.substr(0,u.length-1),s=i.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(c))s=i.closeIndex;else{const o=this.readStopNodeData(e,l,h+1);if(!o)throw new Error(`Unexpected end of ${l}`);s=o.i,t=o.tagContent}const r=new n(c);c!==u&&d&&(r[":@"]=this.buildAttributesMap(u,a,c)),t&&(t=this.parseTextData(t,c,a,!0,d,!0,!0)),a=a.substr(0,a.lastIndexOf(".")),r.add(this.options.textNodeName,t),this.addChild(o,r,a)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===c[c.length-1]?(c=c.substr(0,c.length-1),a=a.substr(0,a.length-1),u=c):u=u.substr(0,u.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const e=new n(c);c!==u&&d&&(e[":@"]=this.buildAttributesMap(u,a,c)),this.addChild(o,e,a),a=a.substr(0,a.lastIndexOf("."))}else{const e=new n(c);this.tagsNodeStack.push(o),c!==u&&d&&(e[":@"]=this.buildAttributesMap(u,a,c)),this.addChild(o,e,a),o=e}r="",s=h}}else r+=e[s];return t.child};function f(e,t,o){const r=this.options.updateTag(t.tagname,o,t[":@"]);!1===r||("string"==typeof r?(t.tagname=r,e.addChild(t)):e.addChild(t))}const g=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const o=this.docTypeEntities[t];e=e.replace(o.regx,o.val)}for(let t in this.lastEntities){const o=this.lastEntities[t];e=e.replace(o.regex,o.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const o=this.htmlEntities[t];e=e.replace(o.regex,o.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function m(e,t,o,r){return e&&(void 0===r&&(r=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,o,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function y(e,t,o){const r="*."+o;for(const n in e){const o=e[n];if(r===o||t===o)return!0}return!1}function v(e,t,o,r){const n=e.indexOf(t,o);if(-1===n)throw new Error(r);return n+t.length-1}function k(e,t,o,r=">"){const n=function(e,t,o=">"){let r,n="";for(let i=t;i",o,`${t} is not closed`);if(e.substring(o+2,i).trim()===t&&(n--,0===n))return{tagContent:e.substring(r,o),i:i};o=i}else if("?"===e[o+1])o=v(e,"?>",o+1,"StopNode is not closed.");else if("!--"===e.substr(o+1,3))o=v(e,"--\x3e",o+3,"StopNode is not closed.");else if("!["===e.substr(o+1,2))o=v(e,"]]>",o,"StopNode is not closed.")-2;else{const r=k(e,o,">");r&&((r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&n++,o=r.closeIndex)}}function C(e,t,o){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&a(e,o)}return r.isExist(e)?e:""}e.exports=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=c,this.parseXml=p,this.parseTextData=l,this.resolveNameSpace=u,this.buildAttributesMap=h,this.isItStopNode=y,this.replaceEntitiesValue=g,this.readStopNodeData=b,this.saveTextToParentTag=m,this.addChild=f,this.ignoreAttributesFn=s(this.options.ignoreAttributes)}}},"./node_modules/fast-xml-parser/src/xmlparser/XMLParser.js": /*!*****************************************************************!*\ !*** ./node_modules/fast-xml-parser/src/xmlparser/XMLParser.js ***! \*****************************************************************/ /*! no static exports found */function(e,t,o){const{buildOptions:r}=o(/*! ./OptionsBuilder */"./node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"),n=o(/*! ./OrderedObjParser */"./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"),{prettify:i}=o(/*! ./node2json */"./node_modules/fast-xml-parser/src/xmlparser/node2json.js"),a=o(/*! ../validator */"./node_modules/fast-xml-parser/src/validator.js");e.exports=class{constructor(e){this.externalEntities={},this.options=r(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const o=a.validate(e,t);if(!0!==o)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}const o=new n(this.options);o.addExternalEntities(this.externalEntities);const r=o.parseXml(e);return this.options.preserveOrder||void 0===r?r:i(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}},"./node_modules/fast-xml-parser/src/xmlparser/node2json.js": /*!*****************************************************************!*\ !*** ./node_modules/fast-xml-parser/src/xmlparser/node2json.js ***! \*****************************************************************/ /*! no static exports found */function(e,t,o){function r(e,t,o){let s;const c={};for(let l=0;l0&&(c[t.textNodeName]=s):void 0!==s&&(c[t.textNodeName]=s),c}function n(e){const t=Object.keys(e);for(let o=0;o0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}},"./node_modules/process/browser.js": /*!*****************************************!*\ !*** ./node_modules/process/browser.js ***! \*****************************************/ /*! no static exports found */function(e,t){var o,r,n=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(o===setTimeout)return setTimeout(e,0);if((o===i||!o)&&setTimeout)return o=setTimeout,setTimeout(e,0);try{return o(e,0)}catch(t){try{return o.call(null,e,0)}catch(t){return o.call(this,e,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:i}catch(e){o=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,l=[],u=!1,d=-1;function h(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!u){var e=s(h);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d1)for(var o=1;o0&&r&&"."!==i[2])return e;if(!t.leadingZeros&&n.length>0&&!r&&"."!==i[1])return e;if(t.leadingZeros&&n===e)return 0;{const o=Number(i),a=""+o;return-1!==a.search(/[eE]/)?t.eNotation?o:e:-1!==i.indexOf(".")?"0"===a&&""===s||a===s||r&&a==="-"+s?o:e:n?s===a||r+s===a?o:e:i===a||i===r+a?o:e}}return e}var a}},"./node_modules/webpack/buildin/amd-options.js": /*!****************************************!*\ !*** (webpack)/buildin/amd-options.js ***! \****************************************/ /*! no static exports found */function(e,t){(function(t){e.exports=t}).call(this,{})},"./node_modules/webpack/buildin/module.js": /*!***********************************!*\ !*** (webpack)/buildin/module.js ***! \***********************************/ /*! no static exports found */function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"./package.json": /*!**********************!*\ !*** ./package.json ***! \**********************/ /*! exports provided: name, version, description, main, types, scripts, repository, keywords, author, license, bugs, homepage, dependencies, devDependencies, default */function(e){e.exports=JSON.parse('{"name":"cos-js-sdk-v5","version":"1.10.1","description":"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)","main":"dist/cos-js-sdk-v5.js","types":"index.d.ts","scripts":{"prettier":"prettier --write src demo/demo.js demo/CIDemos/*.js test/test.js server/sts.js lib/request.js index.d.ts","server":"node server/sts.js","dev":"cross-env NODE_ENV=development webpack -w --mode=development","build":"cross-env NODE_ENV=production webpack --mode=production","cos-auth.min.js":"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m","test":"jest --runInBand --coverage","postinstall":"node scripts/patch-check.js"},"repository":{"type":"git","url":"git+https://github.com/tencentyun/cos-js-sdk-v5.git"},"keywords":[],"author":"carsonxu","license":"ISC","bugs":{"url":"https://github.com/tencentyun/cos-js-sdk-v5/issues"},"homepage":"https://github.com/tencentyun/cos-js-sdk-v5#readme","dependencies":{"fast-xml-parser":"4.5.0"},"devDependencies":{"@babel/core":"7.17.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^5.2.0","express":"^4.16.4","jest":"29.7.0","jest-environment-jsdom":"29.7.0","patch-package":"^8.0.0","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","request":"^2.87.0","terser-webpack-plugin":"4.2.3","uglifyjs":"^2.4.11","webpack":"4.46.0","webpack-cli":"4.10.0"}}')},"./src/advance.js": /*!************************!*\ !*** ./src/advance.js ***! \************************/ /*! no static exports found */function(e,t,o){var r=o(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),n=o(/*! ./session */"./src/session.js"),i=o(/*! ./async */"./src/async.js"),a=o(/*! ./event */"./src/event.js").EventProxy,s=o(/*! ./util */"./src/util.js"),c=o(/*! ./tracker */"./src/tracker.js");function l(e,t){var o=e.TaskId,r=e.Bucket,c=e.Region,l=e.Key,h=e.StorageClass,p=this,f={},g=e.FileSize,m=e.SliceSize,y=Math.ceil(g/m),v=0,k=s.throttleOnProgress.call(p,g,e.onHashProgress),b=function(t,o){var r=t.length;if(0===r)return o(null,!0);if(r>y)return o(null,!1);if(r>1&&Math.max(t[0].Size,t[1].Size)!==m)return o(null,!1);var n=function(i){if(i=a.length)C.emit("has_and_check_upload_id",t);else{var h=a[i];if(!s.isInArray(t,h))return n.removeUploadId.call(p,h),void u(i+1);n.using[h]?u(i+1):d.call(p,{Bucket:r,Region:c,Key:l,UploadId:h,tracker:e.tracker},function(e,t){p._isRunningTask(o)&&(e?(n.removeUploadId.call(p,h),u(i+1)):C.emit("upload_id_available",{UploadId:h,PartList:t.PartList}))})}};u(0)}else C.emit("has_and_check_upload_id",t)}),C.on("get_remote_upload_id_list",function(){u.call(p,{Bucket:r,Region:c,Key:l,tracker:e.tracker},function(t,i){if(p._isRunningTask(o)){if(t)return C.emit("error",t);var a=s.filter(i.UploadList,function(e){return e.Key===l&&(!h||e.StorageClass.toUpperCase()===h.toUpperCase())}).reverse().map(function(e){return e.UploadId||e.UploadID});if(a.length)C.emit("seek_local_avail_upload_id",a);else{var c,u=n.getFileId(e.Body,e.ChunkSize,r,l);u&&(c=n.getUploadIdList.call(p,u))&&s.each(c,function(e){n.removeUploadId.call(p,e)}),C.emit("no_available_upload_id")}}})}),C.emit("get_remote_upload_id_list")}function u(e,t){var o=this,r=[],n={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key,calledBySdk:e.calledBySdk||"sliceUploadFile",tracker:e.tracker},i=function(){o.multipartList(n,function(e,o){if(e)return t(e);r.push.apply(r,o.Upload||[]),"true"===o.IsTruncated?(n.KeyMarker=o.NextKeyMarker,n.UploadIdMarker=o.NextUploadIdMarker,i()):t(null,{UploadList:r})})};i()}function d(e,t){var o=this,r=[],n={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId,calledBySdk:"sliceUploadFile",tracker:e.tracker},i=function(){o.multipartListPart(n,function(e,o){if(e)return t(e);r.push.apply(r,o.Part||[]),"true"===o.IsTruncated?(n.PartNumberMarker=o.NextPartNumberMarker,i()):t(null,{PartList:r})})};i()}function h(e,t){var o=this,r=e.TaskId,n=e.Bucket,a=e.Region,c=e.Key,l=e.UploadData,u=e.FileSize,d=e.SliceSize,h=Math.min(e.AsyncLimit||o.options.ChunkParallelLimit||1,256),f=e.Body,g=Math.ceil(u/d),m=0,y=e.ServerSideEncryption,v=e.Headers,k=s.filter(l.PartList,function(e){return e.Uploaded&&(m+=e.PartNumber>=g&&u%d||d),!e.Uploaded}),b=e.onProgress;o.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] 开始并发上传各个分块")}),i.eachLimit(k,h,function(t,i){if(o._isRunningTask(r)){var s=t.PartNumber,h=Math.min(u,t.PartNumber*d)-(t.PartNumber-1)*d,g=0;o.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] 分块").concat(s,"开始上传")}),p.call(o,{TaskId:r,Bucket:n,Region:a,Key:c,SliceSize:d,FileSize:u,PartNumber:s,ServerSideEncryption:y,Body:f,UploadData:l,Headers:v,onProgress:function(e){m+=e.loaded-g,g=e.loaded,b({loaded:m,total:u})},tracker:e.tracker},function(n,a){o._isRunningTask(r)&&(n||a.ETag||(n='get ETag error, please add "ETag" to CORS ExposeHeader setting.( 获取ETag失败,请在CORS ExposeHeader设置中添加ETag,请参考文档:https://cloud.tencent.com/document/product/436/13318 )',o.logger.error({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] 分块").concat(s,"上传请求成功,但是未获取到 eTag")})),n?(m-=g,o.logger.info({cate:"RESULT",tag:"upload",msg:"[key=".concat(e.Key,"] 分块").concat(s,"上传失败")})):(m+=h-g,t.ETag=a.ETag),o.logger.info({cate:"RESULT",tag:"upload",msg:"[key=".concat(e.Key,"] 分块").concat(s,"上传成功")}),b({loaded:m,total:u}),i(n||null,a))})}},function(e){if(o._isRunningTask(r))return e?t(e):void t(null,{UploadId:l.UploadId,SliceList:l.PartList})})}function p(e,t){var o=this,r=e.TaskId,n=e.Bucket,a=e.Region,c=e.Key,l=e.FileSize,u=e.Body,d=1*e.PartNumber,h=e.SliceSize,p=e.ServerSideEncryption,f=e.UploadData,g=e.Headers||{},m=o.options.ChunkRetryTimes+1,y=h*(d-1),v=h,k=y+h;k>l&&(v=(k=l)-y);var b=["x-cos-traffic-limit","x-cos-mime-limit"],C={};s.each(g,function(e,t){b.indexOf(t)>-1&&(C[t]=e)});var x=f.PartList[d-1];i.retry(m,function(t){o._isRunningTask(r)&&s.fileSlice(u,y,k,!0,function(i){o.multipartUpload({TaskId:r,Bucket:n,Region:a,Key:c,ContentLength:v,PartNumber:d,UploadId:f.UploadId,ServerSideEncryption:p,Body:i,Headers:C,onProgress:e.onProgress,calledBySdk:"sliceUploadFile",tracker:e.tracker},function(e,n){if(o._isRunningTask(r))return e?t(e):(x.Uploaded=!0,t(null,n))})})},function(e,n){if(o._isRunningTask(r))return t(e,n)})}function f(e,t){var o=e.Bucket,r=e.Region,n=e.Key,a=e.UploadId,s=e.SliceList,c=this,l=this.options.ChunkRetryTimes+1,u=e.Headers,d=s.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});i.retry(l,function(t){c.multipartComplete({Bucket:o,Region:r,Key:n,UploadId:a,Parts:d,Headers:u,calledBySdk:"sliceUploadFile",tracker:e.tracker},t)},function(e,o){t(e,o)})}function g(e,t){var o=e.Bucket,r=e.Region,n=e.Key,a=e.AbortArray,s=e.AsyncLimit||1,c=this,l=0,u=new Array(a.length);i.eachLimit(a,s,function(t,i){var a=l;if(n&&n!==t.Key)return u[a]={error:{KeyNotMatch:!0}},void i(null);var s=t.UploadId||t.UploadID;c.multipartAbort({Bucket:o,Region:r,Key:t.Key,Headers:e.Headers,UploadId:s},function(e){var n={Bucket:o,Region:r,Key:t.Key,UploadId:s};u[a]={error:e,task:n},i(null)}),l++},function(e){if(e)return t(e);for(var o=[],r=[],n=0,i=u.length;nn?"sliceUploadFile":"putObject";e.tracker=new c({Beacon:o.options.BeaconReporter,clsReporter:o.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFile",realApi:h,fileKey:e.Key,fileSize:l,accelerate:d,deepTracker:o.options.DeepTracker,customId:o.options.CustomId,delay:o.options.TrackerDelay})}s.each(e,function(e,t){"object"!==r(e)&&"function"!=typeof e&&(u[t]=e)});var p=e.onTaskReady;e.onTaskReady=function(e){u.TaskId=e,p&&p(e)};var f=l>n?"sliceUploadFile":"putObject",g=e.onFileFinish;i.push({api:f,params:e,callback:function(o,r){e.tracker&&e.tracker.report(o,r),g&&g(o,r,u),t&&t(o,r)}}),o._addTasks(i)},uploadFiles:function(e,t){var o=this,n=void 0===e.SliceSize?o.options.SliceSize:e.SliceSize,i=0,a=0,l=s.throttleOnProgress.call(o,a,e.onProgress),u=e.files.length,d=e.onFileFinish,h=Array(u),p=function(e,o,r){l(null,!0),d&&d(e,o,r),h[r.Index]={options:r,error:e,data:o},--u<=0&&t&&t(null,{files:h})},f=[];s.each(e.files,function(e,t){!function(){var u=e.Body,d=u.size||u.length||0,h={Index:t,TaskId:""};if(!o.options.UseRawKey&&e.Key&&"/"===e.Key.substr(0,1)&&(e.Key=e.Key.substr(1)),i+=d,o.options.EnableReporter){var g=o.options.UseAccelerate||"string"==typeof o.options.Domain&&o.options.Domain.includes("accelerate."),m=d>n?"sliceUploadFile":"putObject";e.tracker=new c({Beacon:o.options.BeaconReporter,clsReporter:o.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFiles",realApi:m,fileKey:e.Key,fileSize:d,accelerate:g,deepTracker:o.options.DeepTracker,customId:o.options.CustomId,delay:o.options.TrackerDelay})}s.each(e,function(e,t){"object"!==r(e)&&"function"!=typeof e&&(h[t]=e)});var y=e.onTaskReady;e.onTaskReady=function(e){h.TaskId=e,y&&y(e)};var v=0,k=e.onProgress;e.onProgress=function(e){a=a-v+e.loaded,v=e.loaded,k&&k(e),l({loaded:a,total:i})};var b=d>n?"sliceUploadFile":"putObject",C=e.onFileFinish;f.push({api:b,params:e,callback:function(t,o){e.tracker&&e.tracker.report(t,o),C&&C(t,o),p&&p(t,o,h)}})}()}),o._addTasks(f)},sliceCopyFile:function(e,t){var o=new a,r=this,c=e.Bucket,l=e.Region,u=e.Key,h=e.CopySource,p=s.getSourceParams.call(this,h);if(p){var f=p.Bucket,g=p.Region,y=decodeURIComponent(p.Key),v=void 0===e.CopySliceSize?r.options.CopySliceSize:e.CopySliceSize;v=Math.max(0,v);var k,b,C=e.CopyChunkSize||this.options.CopyChunkSize,x=this.options.CopyChunkParallelLimit,w=this.options.ChunkRetryTimes+1,S=0,R=0,T={},B={},A={};o.on("copy_slice_complete",function(o){s.each(e.Headers,function(e,t){t.toLowerCase().indexOf("x-cos-meta-")});var a=s.map(o.PartList,function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});i.retry(w,function(t){r.multipartComplete({Bucket:c,Region:l,Key:u,UploadId:o.UploadId,Parts:a,tracker:e.tracker,calledBySdk:"sliceCopyFile"},t)},function(e,r){if(n.removeUsing(o.UploadId),e)return b(null,!0),t(e);n.removeUploadId(o.UploadId),b({loaded:k,total:k},!0),t(null,r)})}),o.on("get_copy_data_finish",function(a){var d=n.getCopyFileId(h,T,C,c,u);d&&n.saveUploadId(d,a.UploadId,r.options.UploadIdCacheLimit),n.setUsing(a.UploadId);var p=s.filter(a.PartList,function(e){return e.Uploaded&&(R+=e.PartNumber>=S&&k%C||C),!e.Uploaded});i.eachLimit(p,x,function(t,o){var n=t.PartNumber,s=t.CopySourceRange,d=t.end-t.start;i.retry(w,function(t){m.call(r,{Bucket:c,Region:l,Key:u,CopySource:h,UploadId:a.UploadId,PartNumber:n,CopySourceRange:s,tracker:e.tracker,calledBySdk:"sliceCopyFile"},t)},function(e,r){if(e)return o(e);b({loaded:R+=d,total:k}),t.ETag=r.ETag,o(e||null,r)})},function(e){if(e)return n.removeUsing(a.UploadId),b(null,!0),t(e);o.emit("copy_slice_complete",a)})}),o.on("get_chunk_size_finish",function(){var i=function(){r.multipartInit({Bucket:c,Region:l,Key:u,Headers:A,tracker:e.tracker,calledBySdk:"sliceCopyFile"},function(r,n){if(r)return t(r);e.UploadId=n.UploadId,o.emit("get_copy_data_finish",{UploadId:e.UploadId,PartList:e.PartList})})},a=n.getCopyFileId(h,T,C,c,u),p=n.getUploadIdList(a);if(!a||!p)return i();var f=function(t){if(t>=p.length)return i();var a=p[t];if(n.using[a])return f(t+1);d.call(r,{Bucket:c,Region:l,Key:u,UploadId:a,tracker:e.tracker,calledBySdk:"sliceCopyFile"},function(r,i){if(r)n.removeUploadId(a),f(t+1);else{if(n.using[a])return f(t+1);var c={},l=0;s.each(i.PartList,function(e){var t=parseInt(e.Size),o=l+t-1;c[e.PartNumber+"|"+l+"|"+o]=e.ETag,l+=t}),s.each(e.PartList,function(e){var t=c[e.PartNumber+"|"+e.start+"|"+e.end];t&&(e.ETag=t,e.Uploaded=!0)}),o.emit("get_copy_data_finish",{UploadId:a,PartList:e.PartList})}})};f(0)}),o.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],o=1048576,n=0;n11&&(B[t]=e)}),o.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")))}};e.exports.init=function(e,t){t.transferToTaskMethod(y,"sliceUploadFile"),s.each(y,function(t,o){e.prototype[o]=s.apiWrapper(o,t)})}},"./src/async.js": /*!**********************!*\ !*** ./src/async.js ***! \**********************/ /*! no static exports found */function(e,t){var o={eachLimit:function(e,t,o,r){if(r=r||function(){},!e.length||t<=0)return r();var n=0,i=0,a=0;!function s(){if(n>=e.length)return r();for(;a=e.length?r():s())})}()},retry:function(e,t,o){var r=function(n){t(function(t,i){t&&n-1&&(i["SSE-COS"]=i.SSECOS,delete i.SSECOS)}var a=c.json2xml({InventoryConfiguration:r}),s=t.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=c.b64(c.md5(a));var l="PUT"===e?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";y.call(this,{Action:l,method:e,Bucket:t.Bucket,Region:t.Region,body:a,action:"inventory",qs:{id:t.Id},headers:s,tracker:t.tracker},function(e,t){return e&&204===e.statusCode?o(null,{statusCode:e.statusCode}):e?o(e):void o(null,{statusCode:t.statusCode,headers:t.headers})})}function u(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},o={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},r=(e&&e.AccessControlList||{}).Grant;r&&(r=c.isArray(r)?r:[r]);var n={READ:0,WRITE:0,FULL_CONTROL:0};return r&&r.length&&c.each(r,function(r){var i=r.Grantee.URI&&r.Grantee.URI.endsWith("/groups/global/AllUsers");"qcs::cam::anyone:anyone"===r.Grantee.ID||i?n[r.Permission]=1:r.Grantee.ID!==e.Owner.ID&&t[o[r.Permission]].push('id="'+r.Grantee.ID+'"')}),n.FULL_CONTROL||n.WRITE&&n.READ?t.ACL="public-read-write":n.READ?t.ACL="public-read":t.ACL="private",c.each(o,function(e){t[e]=d(t[e].join(","))}),t}function d(e){var t,o,r=e.split(","),n={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(a="{Bucket}."+a)),a=(a=a.replace(/\{\{AppId\}\}/gi,i).replace(/\{\{Bucket\}\}/gi,r).replace(/\{\{Region\}\}/gi,t).replace(/\{\{.*?\}\}/gi,"")).replace(/\{AppId\}/gi,i).replace(/\{BucketName\}/gi,r).replace(/\{Bucket\}/gi,o).replace(/\{Region\}/gi,t).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(a)||(a=l+"//"+a),"/"===a.slice(-1)&&(a=a.slice(0,-1));var u=a;return e.ForcePathStyle&&(u+="/"+o),u+="/",s&&(u+=c.camSafeUrlEncode(s).replace(/%2F/g,"/")),e.isLocation&&(u=u.replace(/^https?:\/\//,"")),u}var p=function(e){if(!(e.Url||e.Bucket&&e.Region))return"";var t=void 0===e.UseAccelerate?this.options.UseAccelerate:e.UseAccelerate;return(e.Url||h({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:t?"accelerate":e.Region})).replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1")};function f(e,t){var o=c.clone(e.Headers),r="";c.each(o,function(e,t){(""===e||["content-type","cache-control","expires"].indexOf(t.toLowerCase())>-1)&&delete o[t],"host"===t.toLowerCase()&&(r=e)});var n=!1!==e.ForceSignHost;!r&&e.SignHost&&n&&(o.Host=e.SignHost);var i=!1,a=function(e,o){i||(i=!0,o&&o.XCosSecurityToken&&!o.SecurityToken&&((o=c.clone(o)).SecurityToken=o.XCosSecurityToken,delete o.XCosSecurityToken),t&&t(e,o))},s=this,l=e.Bucket||"",u=e.Region||"",d=e.Key||"";s.options.ForcePathStyle&&l&&(d=l+"/"+d);var h="/"+d,p={},f=e.Scope;if(!f){var g=e.Action||"",m=e.ResourceKey||e.Key||"";f=e.Scope||[{action:g,bucket:l,region:u,prefix:m}]}var y=c.md5(JSON.stringify(f));s._StsCache=s._StsCache||[],function(){var e,t;for(e=s._StsCache.length-1;e>=0;e--){t=s._StsCache[e];var o=Math.round(c.getSkewTime(s.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&o=t.ExpiredTime)s._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===y){p=t;break}}}();var v=function(){var t="";p.StartTime&&e.Expires?t=p.StartTime+";"+(p.StartTime+1*e.Expires):p.StartTime&&p.ExpiredTime&&(t=p.StartTime+";"+p.ExpiredTime);var r={Authorization:c.getAuth({SecretId:p.TmpSecretId,SecretKey:p.TmpSecretKey,Method:e.Method,Pathname:h,Query:e.Query,Headers:o,Expires:e.Expires,UseRawKey:s.options.UseRawKey,SystemClockOffset:s.options.SystemClockOffset,KeyTime:t,ForceSignHost:n}),SecurityToken:p.SecurityToken||p.XCosSecurityToken||"",Token:p.Token||"",ClientIP:p.ClientIP||"",ClientUA:p.ClientUA||"",SignFrom:"client"};a(null,r)},k=function(e){if(e.Authorization){var t=!1,o=e.Authorization;if(o)if(o.indexOf(" ")>-1)t=!1;else if(o.indexOf("q-sign-algorithm=")>-1&&o.indexOf("q-ak=")>-1&&o.indexOf("q-sign-time=")>-1&&o.indexOf("q-key-time=")>-1&&o.indexOf("q-url-param-list=")>-1)t=!0;else try{(o=atob(o)).indexOf("a=")>-1&&o.indexOf("k=")>-1&&o.indexOf("t=")>-1&&o.indexOf("r=")>-1&&o.indexOf("b=")>-1&&(t=!0)}catch(r){}if(!t)return c.error(new Error("getAuthorization callback params format error"))}else{if(!e.TmpSecretId)return c.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!e.TmpSecretKey)return c.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!e.SecurityToken&&!e.XCosSecurityToken)return c.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!e.ExpiredTime)return c.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(e.ExpiredTime&&10!==e.ExpiredTime.toString().length)return c.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(e.StartTime&&10!==e.StartTime.toString().length)return c.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(p.ExpiredTime&&p.ExpiredTime-c.getSkewTime(s.options.SystemClockOffset)/1e3>60)v();else if(s.options.getAuthorization)s.options.getAuthorization.call(s,{Bucket:l,Region:u,Method:e.Method,Key:d,Pathname:h,Query:e.Query,Headers:o,Scope:f,SystemClockOffset:s.options.SystemClockOffset,ForceSignHost:n},function(e){"string"==typeof e&&(e={Authorization:e});var t=k(e);if(t)return a(t);e.Authorization?a(null,e):((p=e||{}).Scope=f,p.ScopeKey=y,s._StsCache.push(p),v())});else{if(!s.options.getSTS)return function(){var t="";if(s.options.StartTime&&e.Expires){if(10!==s.options.StartTime.toString().length)return a(c.error(new Error('params "StartTime" should be 10 digits')));t=s.options.StartTime+";"+(s.options.StartTime+1*e.Expires)}else if(s.options.StartTime&&s.options.ExpiredTime){if(10!==s.options.StartTime.toString().length)return a(c.error(new Error('params "StartTime" should be 10 digits')));if(10!==s.options.ExpiredTime.toString().length)return a(c.error(new Error('params "ExpiredTime" should be 10 digits')));t=s.options.StartTime+";"+1*s.options.ExpiredTime}var r={Authorization:c.getAuth({SecretId:e.SecretId||s.options.SecretId,SecretKey:e.SecretKey||s.options.SecretKey,Method:e.Method,Pathname:h,Query:e.Query,Headers:o,Expires:e.Expires,KeyTime:t,UseRawKey:s.options.UseRawKey,SystemClockOffset:s.options.SystemClockOffset,ForceSignHost:n}),SecurityToken:s.options.SecurityToken||s.options.XCosSecurityToken,SignFrom:"client"};return a(null,r),r}();s.options.getSTS.call(s,{Bucket:l,Region:u},function(e){(p=e||{}).Scope=f,p.ScopeKey=y,p.TmpSecretId||(p.TmpSecretId=p.SecretId),p.TmpSecretKey||(p.TmpSecretKey=p.SecretKey);var t=k(p);if(t)return a(t);s._StsCache.push(p),v()})}return""}function g(e){var t=!1,o=!1,r=!1,n=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var i=e.error.Code,a=e.error.Message;("RequestTimeTooSkewed"===i||"AccessDenied"===i&&"Request has expired"===a)&&(o=!0)}catch(l){}if(e)if(o&&n){var s=Date.parse(n);this.options.CorrectClockSkew&&Math.abs(c.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,r=!1):("timeout"===e.message||"CORS blocked or network error"===e.message)&&(t=!0,r=this.options.AutoSwitchHost);return{canRetry:t,networkError:r}}function m(e){var t=e.requestUrl,o=e.clientCalcSign,r=e.networkError;return!!this.options.AutoSwitchHost&&!!t&&!!o&&!!r&&/^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/.test(t)&&!/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/.test(t)}function y(e,t){var o=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=c.clearKey(e.qs),e.headers&&(e.headers=c.clearKey(e.headers)),e.qs&&(e.qs=c.clearKey(e.qs));var r=c.clone(e.qs);e.action&&(r[e.action]="");var n=e.url||e.Url,i=e.SignHost||p.call(this,{Bucket:e.Bucket,Region:e.Region,Url:n}),s=e.tracker,l=function(n){var c=o.options.SystemClockOffset;s&&s.setParams({signStartTime:(new Date).getTime(),httpRetryTimes:n-1}),e.SwitchHost&&(i=i.replace(/myqcloud.com/,"tencentcos.cn"));var u=a(a({},e),{},{Query:r,SignHost:i,ForceSignHost:o.options.ForceSignHost});delete u.tracker,o.logger.debug({cate:"PROCESS",tag:"base",msg:"开始计算签名, opt=".concat(JSON.stringify(u))}),f.call(o,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:r,Headers:e.headers,SignHost:i,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:o.options.ForceSignHost,SwitchHost:e.SwitchHost},function(r,i){if(r)return o.logger.error({cate:"PROCESS",tag:"base",msg:"签名获取失败, err=".concat(JSON.stringify(r.message))}),void t(r);s&&s.setParams({signEndTime:(new Date).getTime(),httpStartTime:(new Date).getTime()}),e.AuthData=i,o.logger.debug({cate:"PROCESS",tag:"base",msg:"签名获取成功"}),o.logger.info({cate:"PROCESS",tag:"base",msg:"准备发起请求"}),v.call(o,e,function(r,a){s&&s.setParams({httpEndTime:(new Date).getTime()});var u=!1,d=!1;if(r){var h=g.call(o,r);u=h.canRetry||c!==o.options.SystemClockOffset,d=h.networkError,o.logger.error({cate:"PROCESS",tag:"network",msg:"请求失败, err=".concat(JSON.stringify(r),", canRetry=").concat(u,", networkError=").concat(d,", tryTimes=").concat(n)})}if(r&&n<4&&u){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"]);var p=m.call(o,{requestUrl:(null==r?void 0:r.url)||"",clientCalcSign:"client"===i.SignFrom,networkError:d});e.SwitchHost=p,e.headers["x-cos-sdk-retry"]=!0,o.logger.info({cate:"PROCESS",tag:"base",msg:"重试请求, 重试第".concat(n,"次")}),l(n+1)}else o.logger.info({cate:"PROCESS",tag:"base",msg:"请求完成"}),t(r,a)})})};l(1)}function v(e,t){var o=this,r=e.TaskId;if(!r||o._isRunningTask(r)){var n=e.Bucket,i=e.Region,a=e.Key,l=e.method||"GET",u=e.Url||e.url,d=e.body,p=e.rawBody;o.options.UseAccelerate&&(i="accelerate"),u=u||h({ForcePathStyle:o.options.ForcePathStyle,protocol:o.options.Protocol,domain:o.options.Domain,bucket:n,region:i,object:a}),e.SwitchHost&&(u=u.replace(/myqcloud.com/,"tencentcos.cn"));var f=a?u:"";e.action&&(u=u+"?"+(c.isIOS_QQ?"".concat(e.action,"="):e.action)),e.qsStr&&(u=u.indexOf("?")>-1?u+"&"+e.qsStr:u+"?"+e.qsStr);var g={method:l,url:u,headers:e.headers,qs:e.qs,body:d},m="x-cos-security-token";if(c.isCIHost(u)&&(m="x-ci-security-token"),g.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(g.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(g.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(g.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(g.headers[m]=e.AuthData.SecurityToken),e.Action&&(g.action=e.Action),g.key=e.Key||e.ResourceKey,g.headers&&(g.headers=c.clearKey(g.headers)),g=c.clearKey(g),e.onProgress&&"function"==typeof e.onProgress){var y=d&&(d.size||d.length)||0;g.onProgress=function(t){if(!r||o._isRunningTask(r)){var n=t?t.loaded:0;e.onProgress({loaded:n,total:y})}}}e.onDownloadProgress&&(g.onDownloadProgress=e.onDownloadProgress),e.DataType&&(g.dataType=e.DataType),this.options.Timeout&&(g.timeout=this.options.Timeout),o.options.ForcePathStyle&&(g.pathStyle=o.options.ForcePathStyle);var v=c.uuid();o.logger.info({cate:"PROCESS",tag:"network",msg:"[Request] ".concat(v,", requestOpt=").concat(JSON.stringify(g))}),o.emit("before-send",g);var k,b=g.url.includes("accelerate."),C=g.qs?Object.keys(g.qs).map(function(e){return"".concat(e,"=").concat(g.qs[e])}).join("&"):"",x=C?g.url+"?"+C:g.url;e.tracker&&(e.tracker.setParams({url:x,httpMethod:g.method,accelerate:b,httpSize:(null===(k=g.body)||void 0===k?void 0:k.size)||0}),e.tracker.parent&&!e.tracker.parent.params.url&&e.tracker.parent.setParams({url:f,accelerate:b}));var w=(o.options.Request||s)(g,function(n){if(!n||"abort"!==n.error){var i={options:g,error:n&&n.error,statusCode:n&&n.statusCode||0,statusMessage:n&&n.statusMessage||"",headers:n&&n.headers||{},body:n&&n.body};o.emit("after-receive",i);var a,s=i.error,l=i.body,u={statusCode:i.statusCode,statusMessage:i.statusMessage,headers:i.headers},d=s?"[error]":"[success]";o.logger.info({cate:"PROCESS",tag:"network",msg:"[Response] ".concat(v,", ").concat(d,", response=").concat(JSON.stringify(u))});var h=function(n,i){if(r&&o.off("inner-kill-task",S),!a){a=!0;var s={};if(u&&u.statusCode&&(s.statusCode=u.statusCode),u&&u.headers&&(s.headers=u.headers),n)g.url&&(s.url=g.url),g.method&&(s.method=g.method),n=c.extend(n||{},s),t(n,null);else{if("name/cos:PutObject"===e.Action){var l={};for(var d in e.headers)l[d.toLowerCase()]=e.headers[d];l["x-cos-callback"]?i.Error?(i.CallbackError=c.clone(i.Error),delete i.Error):i.CallbackBody=c.clone(i):l["x-cos-return-body"]&&(i.Error?(i.ReturnError=c.clone(i.Error),delete i.Error):i.ReturnBody=c.clone(i))}i=c.extend(i||{},s),t(null,i)}w=null}};if(s)return h(c.error(s));var f=u.statusCode,m=2===Math.floor(f/100);if(p){if(m)return h(null,{body:l});if(l instanceof Blob)return void c.readAsBinaryString(l,function(e){var t=c.parseResBody(e),o=t.Error||t;return h(c.error(new Error(o.Message||"response body error"),{code:o.Code,error:o}))})}var y=c.parseResBody(l),k=y.Error||y;m?h(null,y):k?h(c.error(new Error(k.Message),{code:k.Code,error:k})):f?h(c.error(new Error(u.statusMessage),{code:""+f})):f&&h(c.error(new Error("statusCode error")))}}),S=function(e){e.TaskId===r&&(w&&w.abort&&w.abort(),o.off("inner-kill-task",S))};r&&o.on("inner-kill-task",S)}}var k={getService:function(e,t){var o=this.options.Protocol||(c.isBrowser&&"object"===("undefined"==typeof location?"undefined":n(location))&&"http:"===location.protocol?"http:":"https:"),r=this.options.ServiceDomain,i=e.AppId||this.options.appId,a=e.Region;r?(r=r.replace(/\{\{AppId\}\}/gi,i||"").replace(/\{\{Region\}\}/gi,a||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(r)||(r=o+"//"+r),"/"===r.slice(-1)&&(r=r.slice(0,-1))):r=a?o+"//cos."+a+".myqcloud.com":o+"//service.cos.myqcloud.com";var s="",l=a?"cos."+a+".myqcloud.com":"service.cos.myqcloud.com";l===r.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1")&&(s=l),y.call(this,{Action:"name/cos:GetService",url:r,method:"GET",headers:e.Headers,SignHost:s,tracker:e.tracker},function(e,o){if(e)return t(e);var r=o&&o.ListAllMyBucketsResult&&o.ListAllMyBucketsResult.Buckets&&o.ListAllMyBucketsResult.Buckets.Bucket||[];r=c.isArray(r)?r:[r];var n=o&&o.ListAllMyBucketsResult&&o.ListAllMyBucketsResult.Owner||{};t(null,{Buckets:r,Owner:n,statusCode:o.statusCode,headers:o.headers})})},putBucket:function(e,t){var o=this,r="";if(e.BucketAZConfig){var n={BucketAZConfig:e.BucketAZConfig};r=c.json2xml({CreateBucketConfiguration:n})}y.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:r,tracker:e.tracker},function(r,n){if(r)return t(r);var i=h({protocol:o.options.Protocol,domain:o.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});t(null,{Location:i,statusCode:n.statusCode,headers:n.headers})})},headBucket:function(e,t){y.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD",tracker:e.tracker},t)},getBucket:function(e,t){var o={};o.prefix=e.Prefix||"",o.delimiter=e.Delimiter,o.marker=e.Marker,o["max-keys"]=e.MaxKeys,o["encoding-type"]=e.EncodingType,y.call(this,{Action:"name/cos:GetBucket",ResourceKey:o.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:o,tracker:e.tracker},function(e,o){if(e)return t(e);var r=o.ListBucketResult||{},n=r.Contents||[],i=r.CommonPrefixes||[];n=c.isArray(n)?n:[n],i=c.isArray(i)?i:[i];var a=c.clone(r);c.extend(a,{Contents:n,CommonPrefixes:i,statusCode:o.statusCode,headers:o.headers}),t(null,a)})},deleteBucket:function(e,t){y.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE",tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},putBucketAcl:function(e,t){var o=e.Headers,r="";if(e.AccessControlPolicy){var n=c.clone(e.AccessControlPolicy||{}),i=n.Grants||n.Grant;i=c.isArray(i)?i:[i],delete n.Grant,delete n.Grants,n.AccessControlList={Grant:i},r=c.json2xml({AccessControlPolicy:n}),o["Content-Type"]="application/xml",o["Content-MD5"]=c.b64(c.md5(r))}c.each(o,function(e,t){0===t.indexOf("x-cos-grant-")&&(o[t]=d(o[t]))}),y.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:o,action:"acl",body:r,tracker:e.tracker},function(e,o){if(e)return t(e);t(null,{statusCode:o.statusCode,headers:o.headers})})},getBucketAcl:function(e,t){y.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl",tracker:e.tracker},function(e,o){if(e)return t(e);var r=o.AccessControlPolicy||{},n=r.Owner||{},i=r.AccessControlList.Grant||[];i=c.isArray(i)?i:[i];var a=u(r);o.headers&&o.headers["x-cos-acl"]&&(a.ACL=o.headers["x-cos-acl"]),a=c.extend(a,{Owner:n,Grants:i,statusCode:o.statusCode,headers:o.headers}),t(null,a)})},putBucketCors:function(e,t){var o=(e.CORSConfiguration||{}).CORSRules||e.CORSRules||[];o=c.clone(c.isArray(o)?o:[o]),c.each(o,function(e){c.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(t){var o=t+"s",r=e[o]||e[t]||[];delete e[o],e[t]=c.isArray(r)?r:[r]})});var r={CORSRule:o};e.ResponseVary&&(r.ResponseVary=e.ResponseVary);var n=c.json2xml({CORSConfiguration:r}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=c.b64(c.md5(n)),y.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"cors",headers:i,tracker:e.tracker},function(e,o){if(e)return t(e);t(null,{statusCode:o.statusCode,headers:o.headers})})},getBucketCors:function(e,t){y.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},function(e,o){if(e)if(404===e.statusCode&&e.error&&"NoSuchCORSConfiguration"===e.error.Code){var r={CORSRules:[],statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var n=o.CORSConfiguration||{},i=n.CORSRules||n.CORSRule||[];i=c.clone(c.isArray(i)?i:[i]);var a=n.ResponseVary;c.each(i,function(e){c.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(t){var o=t+"s",r=e[o]||e[t]||[];delete e[t],e[o]=c.isArray(r)?r:[r]})}),t(null,{CORSRules:i,ResponseVary:a,statusCode:o.statusCode,headers:o.headers})}})},deleteBucketCors:function(e,t){y.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode||e.statusCode,headers:o.headers})})},getBucketLocation:function(e,t){y.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location",tracker:e.tracker},t)},getBucketPolicy:function(e,t){y.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0,tracker:e.tracker},function(e,o){if(e)return e.statusCode&&403===e.statusCode?t(c.error(e,{ErrorStatus:"Access Denied"})):e.statusCode&&405===e.statusCode?t(c.error(e,{ErrorStatus:"Method Not Allowed"})):e.statusCode&&404===e.statusCode?t(c.error(e,{ErrorStatus:"Policy Not Found"})):t(e);var r={};try{r=JSON.parse(o.body)}catch(n){}t(null,{Policy:r,statusCode:o.statusCode,headers:o.headers})})},putBucketPolicy:function(e,t){var o=e.Policy;try{"string"==typeof o&&(o=JSON.parse(o))}catch(i){}if(!o||"string"==typeof o)return t(c.error(new Error("Policy format error")));var r=JSON.stringify(o);o.version||(o.version="2.0");var n=e.Headers;n["Content-Type"]="application/json",n["Content-MD5"]=c.b64(c.md5(r)),y.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:r,headers:n,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},deleteBucketPolicy:function(e,t){y.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode||e.statusCode,headers:o.headers})})},putBucketTagging:function(e,t){var o=e.Tagging||{},r=o.TagSet||o.Tags||e.Tags||[];r=c.clone(c.isArray(r)?r:[r]);var n=c.json2xml({Tagging:{TagSet:{Tag:r}}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=c.b64(c.md5(n)),y.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"tagging",headers:i,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},getBucketTagging:function(e,t){y.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},function(e,o){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 n=[];try{n=o.Tagging.TagSet.Tag||[]}catch(i){}n=c.clone(c.isArray(n)?n:[n]),t(null,{Tags:n,statusCode:o.statusCode,headers:o.headers})}})},deleteBucketTagging:function(e,t){y.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},putBucketLifecycle:function(e,t){var o=(e.LifecycleConfiguration||{}).Rules||e.Rules||[];o=c.clone(o);var r=c.json2xml({LifecycleConfiguration:{Rule:o}}),n=e.Headers;n["Content-Type"]="application/xml",n["Content-MD5"]=c.b64(c.md5(r)),y.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"lifecycle",headers:n,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},getBucketLifecycle:function(e,t){y.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},function(e,o){if(e)if(404===e.statusCode&&e.error&&"NoSuchLifecycleConfiguration"===e.error.Code){var r={Rules:[],statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var n=[];try{n=o.LifecycleConfiguration.Rule||[]}catch(i){}n=c.clone(c.isArray(n)?n:[n]),t(null,{Rules:n,statusCode:o.statusCode,headers:o.headers})}})},deleteBucketLifecycle:function(e,t){y.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},putBucketVersioning:function(e,t){if(e.VersioningConfiguration){var o=e.VersioningConfiguration||{},r=c.json2xml({VersioningConfiguration:o}),n=e.Headers;n["Content-Type"]="application/xml",n["Content-MD5"]=c.b64(c.md5(r)),y.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"versioning",headers:n,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})}else t(c.error(new Error("missing param VersioningConfiguration")))},getBucketVersioning:function(e,t){y.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning",tracker:e.tracker},function(e,o){e||!o.VersioningConfiguration&&(o.VersioningConfiguration={}),t(e,o)})},putBucketReplication:function(e,t){var o=c.clone(e.ReplicationConfiguration),r=c.json2xml({ReplicationConfiguration:o});r=(r=r.replace(/<(\/?)Rules>/gi,"<$1Rule>")).replace(/<(\/?)Tags>/gi,"<$1Tag>");var n=e.Headers;n["Content-Type"]="application/xml",n["Content-MD5"]=c.b64(c.md5(r)),y.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"replication",headers:n,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},getBucketReplication:function(e,t){y.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},function(e,o){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!o.ReplicationConfiguration&&(o.ReplicationConfiguration={}),o.ReplicationConfiguration.Rule&&(o.ReplicationConfiguration.Rules=c.makeArray(o.ReplicationConfiguration.Rule),delete o.ReplicationConfiguration.Rule),t(e,o)})},deleteBucketReplication:function(e,t){y.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},putBucketWebsite:function(e,t){if(e.WebsiteConfiguration){var o=c.clone(e.WebsiteConfiguration||{}),r=o.RoutingRules||o.RoutingRule||[];r=c.isArray(r)?r:[r],delete o.RoutingRule,delete o.RoutingRules,r.length&&(o.RoutingRules={RoutingRule:r});var n=c.json2xml({WebsiteConfiguration:o}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=c.b64(c.md5(n)),y.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"website",headers:i,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})}else t(c.error(new Error("missing param WebsiteConfiguration")))},getBucketWebsite:function(e,t){y.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website",tracker:e.tracker},function(e,o){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 n=o.WebsiteConfiguration||{};if(n.RoutingRules){var i=c.clone(n.RoutingRules.RoutingRule||[]);i=c.makeArray(i),n.RoutingRules=i}t(null,{WebsiteConfiguration:n,statusCode:o.statusCode,headers:o.headers})}})},deleteBucketWebsite:function(e,t){y.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website",tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},putBucketReferer:function(e,t){if(e.RefererConfiguration){var o=c.clone(e.RefererConfiguration||{}),r=o.DomainList||{},n=r.Domains||r.Domain||[];(n=c.isArray(n)?n:[n]).length&&(o.DomainList={Domain:n});var i=c.json2xml({RefererConfiguration:o}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=c.b64(c.md5(i)),y.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"referer",headers:a,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})}else t(c.error(new Error("missing param RefererConfiguration")))},getBucketReferer:function(e,t){y.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer",tracker:e.tracker},function(e,o){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 n=o.RefererConfiguration||{};if(n.DomainList){var i=c.makeArray(n.DomainList.Domain||[]);n.DomainList={Domains:i}}t(null,{RefererConfiguration:n,statusCode:o.statusCode,headers:o.headers})}})},putBucketDomain:function(e,t){var o=(e.DomainConfiguration||{}).DomainRule||e.DomainRule||[];o=c.clone(o);var r=c.json2xml({DomainConfiguration:{DomainRule:o}}),n=e.Headers;n["Content-Type"]="application/xml",n["Content-MD5"]=c.b64(c.md5(r)),y.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"domain",headers:n,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},getBucketDomain:function(e,t){y.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},function(e,o){if(e)return t(e);var r=[];try{r=o.DomainConfiguration.DomainRule||[]}catch(n){}r=c.clone(c.isArray(r)?r:[r]),t(null,{DomainRule:r,statusCode:o.statusCode,headers:o.headers})})},deleteBucketDomain:function(e,t){y.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},putBucketOrigin:function(e,t){var o=(e.OriginConfiguration||{}).OriginRule||e.OriginRule||[];o=c.clone(o);var r=c.json2xml({OriginConfiguration:{OriginRule:o}}),n=e.Headers;n["Content-Type"]="application/xml",n["Content-MD5"]=c.b64(c.md5(r)),y.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"origin",headers:n,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},getBucketOrigin:function(e,t){y.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},function(e,o){if(e)return t(e);var r=[];try{r=o.OriginConfiguration.OriginRule||[]}catch(n){}r=c.clone(c.isArray(r)?r:[r]),t(null,{OriginRule:r,statusCode:o.statusCode,headers:o.headers})})},deleteBucketOrigin:function(e,t){y.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},putBucketLogging:function(e,t){var o=c.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=c.b64(c.md5(o)),y.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"logging",headers:r,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},getBucketLogging:function(e,t){y.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging",tracker:e.tracker},function(e,o){if(e)return t(e);t(null,{BucketLoggingStatus:o.BucketLoggingStatus,statusCode:o.statusCode,headers:o.headers})})},putBucketInventory:function(e,t){return l.call(this,"PUT",e,t)},postBucketInventory:function(e,t){return l.call(this,"POST",e,t)},getBucketInventory:function(e,t){y.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},function(e,o){if(e)return t(e);var r=o.InventoryConfiguration;if(r&&r.OptionalFields&&r.OptionalFields.Field){var n=r.OptionalFields.Field;c.isArray(n)||(n=[n]),r.OptionalFields=n}if(r.Destination&&r.Destination.COSBucketDestination&&r.Destination.COSBucketDestination.Encryption){var i=r.Destination.COSBucketDestination.Encryption;Object.keys(i).indexOf("SSE-COS")>-1&&(i.SSECOS=i["SSE-COS"],delete i["SSE-COS"])}t(null,{InventoryConfiguration:r,statusCode:o.statusCode,headers:o.headers})})},listBucketInventory:function(e,t){y.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken},tracker:e.tracker},function(e,o){if(e)return t(e);var r=o.ListInventoryConfigurationResult,n=r.InventoryConfiguration||[];n=c.isArray(n)?n:[n],delete r.InventoryConfiguration,c.each(n,function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;c.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var o=e.Destination.COSBucketDestination.Encryption;Object.keys(o).indexOf("SSE-COS")>-1&&(o.SSECOS=o["SSE-COS"],delete o["SSE-COS"])}}),r.InventoryConfigurations=n,c.extend(r,{statusCode:o.statusCode,headers:o.headers}),t(null,r)})},deleteBucketInventory:function(e,t){y.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},putBucketAccelerate:function(e,t){if(e.AccelerateConfiguration){var o={AccelerateConfiguration:e.AccelerateConfiguration||{}},r=c.json2xml(o),n={"Content-Type":"application/xml"};n["Content-MD5"]=c.b64(c.md5(r)),y.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"accelerate",headers:n,tracker:e.tracker},function(e,o){if(e)return t(e);t(null,{statusCode:o.statusCode,headers:o.headers})})}else t(c.error(new Error("missing param AccelerateConfiguration")))},getBucketAccelerate:function(e,t){y.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate",tracker:e.tracker},function(e,o){e||!o.AccelerateConfiguration&&(o.AccelerateConfiguration={}),t(e,o)})},putBucketEncryption:function(e,t){var o=e.ServerSideEncryptionConfiguration||{},r=o.Rule||o.Rules||[],n=c.json2xml({ServerSideEncryptionConfiguration:{Rule:r}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=c.b64(c.md5(n)),y.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"encryption",headers:i,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},getBucketEncryption:function(e,t){y.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption",tracker:e.tracker},function(e,o){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 n=c.makeArray(o.EncryptionConfiguration&&o.EncryptionConfiguration.Rule||[]);o.EncryptionConfiguration={Rules:n},t(e,o)}})},deleteBucketEncryption:function(e,t){y.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption",tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},getObject:function(e,t){var o=this;if(o.logger.info({cate:"PROCESS",tag:"download",msg:"[key=".concat(e.Key,"] getObject开始")}),this.options.ObjectKeySimplifyCheck&&"/"===c.simplifyPath(e.Key))t(c.error(new Error("The Getobject Key is illegal")));else{var r=e.Query||{},n=e.QueryString||"",i=c.throttleOnProgress.call(this,0,e.onProgress),a=e.tracker;a&&a.setParams({signStartTime:(new Date).getTime()}),r["response-content-type"]=e.ResponseContentType,r["response-content-language"]=e.ResponseContentLanguage,r["response-expires"]=e.ResponseExpires,r["response-cache-control"]=e.ResponseCacheControl,r["response-content-disposition"]=e.ResponseContentDisposition,r["response-content-encoding"]=e.ResponseContentEncoding,y.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:r,qsStr:n,rawBody:!0,onDownloadProgress:i,tracker:a},function(r,n){if(i(null,!0),r){var a=r.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0}):t(r)}t(null,{Body:n.body,ETag:c.attr(n.headers,"etag",""),statusCode:n.statusCode,headers:n.headers}),o.logger.info({cate:"PROCESS",tag:"download",msg:"[key=".concat(e.Key,"] getObject结束")})})}},headObject:function(e,t){y.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},function(o,r){if(o){var n=o.statusCode;return e.Headers["If-Modified-Since"]&&n&&304===n?t(null,{NotModified:!0,statusCode:n}):t(o)}r.ETag=c.attr(r.headers,"etag",""),t(null,r)})},listObjectVersions:function(e,t){var o={};o.prefix=e.Prefix||"",o.delimiter=e.Delimiter,o["key-marker"]=e.KeyMarker,o["version-id-marker"]=e.VersionIdMarker,o["max-keys"]=e.MaxKeys,o["encoding-type"]=e.EncodingType,y.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:o.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:o,action:"versions",tracker:e.tracker},function(e,o){if(e)return t(e);var r=o.ListVersionsResult||{},n=r.DeleteMarker||[];n=c.isArray(n)?n:[n];var i=r.Version||[];i=c.isArray(i)?i:[i];var a=c.clone(r);delete a.DeleteMarker,delete a.Version,c.extend(a,{DeleteMarkers:n,Versions:i,statusCode:o.statusCode,headers:o.headers}),t(null,a)})},putObject:function(e,t){var o=this,r=e.ContentLength,n=c.throttleOnProgress.call(o,r,e.onProgress);o.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] putObject开始")});var i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=e.Body&&e.Body.type||"");var a=e.UploadAddMetaMd5||o.options.UploadAddMetaMd5||o.options.UploadCheckContentMd5,s=e.tracker;a&&s&&s.setParams({md5StartTime:(new Date).getTime()}),a&&o.logger.debug({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] 开始计算 md5")}),c.getBodyMd5(a,e.Body,function(a){a&&(o.logger.debug({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] md5: ").concat(a,",md5Base64=").concat(c.b64(a))}),s&&s.setParams({md5EndTime:(new Date).getTime()}),o.options.UploadCheckContentMd5&&(i["Content-MD5"]=c.b64(a)),(e.UploadAddMetaMd5||o.options.UploadAddMetaMd5)&&(i["x-cos-meta-md5"]=a)),void 0!==e.ContentLength&&(i["Content-Length"]=e.ContentLength),n(null,!0),y.call(o,{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:n,tracker:s},function(i,a){if(i)return o.logger.error({cate:"ERROR",tag:"upload",msg:"上传失败,错误信息:".concat(JSON.stringify(i))}),n(null,!0),t(i);n({loaded:r,total:r},!0);var s=h({ForcePathStyle:o.options.ForcePathStyle,protocol:o.options.Protocol,domain:o.options.Domain,bucket:e.Bucket,region:o.options.UseAccelerate?"accelerate":e.Region,object:e.Key});s=s.substr(s.indexOf("://")+3),a.Location=s,a.ETag=c.attr(a.headers,"etag",""),o.logger.info({cate:"RESULT",tag:"upload",msg:"上传成功,Location=".concat(s)}),o.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] putObject结束")}),t(null,a)})},e.onHashProgress)},deleteObject:function(e,t){y.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":"",tracker:e.tracker},function(e,o){if(e){var r=e.statusCode;return r&&404===r?t(null,{BucketNotFound:!0,statusCode:r}):t(e)}t(null,{statusCode:o.statusCode,headers:o.headers})})},getObjectAcl:function(e,t){var o={};e.VersionId&&(o.versionId=e.VersionId),y.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:o,action:"acl",tracker:e.tracker},function(e,o){if(e)return t(e);var r=o.AccessControlPolicy||{},n=r.Owner||{},i=r.AccessControlList&&r.AccessControlList.Grant||[];i=c.isArray(i)?i:[i];var a=u(r);delete a.GrantWrite,o.headers&&o.headers["x-cos-acl"]&&(a.ACL=o.headers["x-cos-acl"]),a=c.extend(a,{Owner:n,Grants:i,statusCode:o.statusCode,headers:o.headers}),t(null,a)})},putObjectAcl:function(e,t){var o=e.Headers,r="";if(e.AccessControlPolicy){var n=c.clone(e.AccessControlPolicy||{}),i=n.Grants||n.Grant;i=c.isArray(i)?i:[i],delete n.Grant,delete n.Grants,n.AccessControlList={Grant:i},r=c.json2xml({AccessControlPolicy:n}),o["Content-Type"]="application/xml",o["Content-MD5"]=c.b64(c.md5(r))}c.each(o,function(e,t){0===t.indexOf("x-cos-grant-")&&(o[t]=d(o[t]))}),y.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:o,body:r,tracker:e.tracker},function(e,o){if(e)return t(e);t(null,{statusCode:o.statusCode,headers:o.headers})})},optionsObject:function(e,t){var o=e.Headers;o.Origin=e.Origin,o["Access-Control-Request-Method"]=e.AccessControlRequestMethod,o["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,y.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:o,tracker:e.tracker},function(e,o){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var r=o.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:o.statusCode,headers:o.headers})})},putObjectCopy:function(e,t){var o=this,r=e.Headers;r["Cache-Control"]||r["cache-control"]||(r["Cache-Control"]="");var n=e.CopySource||"",i=c.getSourceParams.call(this,n);if(i){var a=i.Bucket,s=i.Region,l=decodeURIComponent(i.Key);y.call(this,{Scope:[{action:"name/cos:GetObject",bucket:a,region:s,prefix:l},{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,tracker:e.tracker},function(r,n){if(r)return t(r);var i=c.clone(n.CopyObjectResult||{}),a=h({ForcePathStyle:o.options.ForcePathStyle,protocol:o.options.Protocol,domain:o.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});c.extend(i,{Location:a,statusCode:n.statusCode,headers:n.headers}),t(null,i)})}else t(c.error(new Error("CopySource format error")))},deleteMultipleObject:function(e,t){var o=e.Objects||[],r=e.Quiet;o=c.isArray(o)?o:[o];var n=c.json2xml({Delete:{Object:o,Quiet:r||!1}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=c.b64(c.md5(n));var a=c.map(o,function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}});y.call(this,{Scope:a,method:"POST",Bucket:e.Bucket,Region:e.Region,body:n,action:"delete",headers:i,tracker:e.tracker},function(e,o){if(e)return t(e);var r=o.DeleteResult||{},n=r.Deleted||[],i=r.Error||[];n=c.isArray(n)?n:[n],i=c.isArray(i)?i:[i];var a=c.clone(r);c.extend(a,{Error:i,Deleted:n,statusCode:o.statusCode,headers:o.headers}),t(null,a)})},restoreObject:function(e,t){var o=e.Headers;if(e.RestoreRequest){var r=e.RestoreRequest||{},n=c.json2xml({RestoreRequest:r});o["Content-Type"]="application/xml",o["Content-MD5"]=c.b64(c.md5(n)),y.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:n,action:"restore",headers:o,tracker:e.tracker},t)}else t(c.error(new Error("missing param RestoreRequest")))},putObjectTagging:function(e,t){var o=e.Tagging||{},r=o.TagSet||o.Tags||e.Tags||[];r=c.clone(c.isArray(r)?r:[r]);var n=c.json2xml({Tagging:{TagSet:{Tag:r}}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=c.b64(c.md5(n)),y.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:n,action:"tagging",headers:i,VersionId:e.VersionId,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},getObjectTagging:function(e,t){y.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,tracker:e.tracker},function(e,o){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 n=[];try{n=o.Tagging.TagSet.Tag||[]}catch(i){}n=c.clone(c.isArray(n)?n:[n]),t(null,{Tags:n,statusCode:o.statusCode,headers:o.headers})}})},deleteObjectTagging:function(e,t){y.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,tracker:e.tracker},function(e,o){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:o.statusCode,headers:o.headers})})},selectObjectContent:function(e,t){if(!e.SelectType)return t(c.error(new Error("missing param SelectType")));var o=e.SelectRequest||{},r=c.json2xml({SelectRequest:o}),n=e.Headers;n["Content-Type"]="application/xml",n["Content-MD5"]=c.b64(c.md5(r)),y.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:r,DataType:"arraybuffer",rawBody:!0,tracker:e.tracker},function(e,o){if(e&&204===e.statusCode)return t(null,{statusCode:e.statusCode});if(e)return t(e);var r=c.parseSelectPayload(o.body);t(null,{statusCode:o.statusCode,headers:o.headers,Body:r.body,Payload:r.payload})})},appendObject:function(e,t){var o=e.Headers;o["Cache-Control"]||o["cache-control"]||(o["Cache-Control"]=""),o["Content-Type"]||o["content-type"]||(o["Content-Type"]=e.Body&&e.Body.type||""),y.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:e.Bucket,Region:e.Region,action:"append",Key:e.Key,body:e.Body,qs:{position:e.Position},headers:e.Headers,tracker:e.tracker},function(e,o){if(e)return t(e);t(null,o)})},uploadPartCopy:function(e,t){var o=e.CopySource||"",r=c.getSourceParams.call(this,o);if(r){var n=r.Bucket,i=r.Region,a=decodeURIComponent(r.Key);y.call(this,{Scope:[{action:"name/cos:GetObject",bucket:n,region:i,prefix:a},{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,tracker:e.tracker},function(e,o){if(e)return t(e);var r=c.clone(o.CopyPartResult||{});c.extend(r,{statusCode:o.statusCode,headers:o.headers}),t(null,r)})}else t(c.error(new Error("CopySource format error")))},multipartInit:function(e,t){var o=this,r=e.Headers,n=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 i=e.Body&&(e.UploadAddMetaMd5||o.options.UploadAddMetaMd5);i&&n&&n.setParams({md5StartTime:(new Date).getTime()}),c.getBodyMd5(i,e.Body,function(r){r&&(e.Headers["x-cos-meta-md5"]=r),i&&n&&n.setParams({md5EndTime:(new Date).getTime()}),y.call(o,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:n},function(e,o){return e?(n&&n.parent&&n.parent.setParams({errorNode:"multipartInit"}),t(e)):(o=c.clone(o||{}))&&o.InitiateMultipartUploadResult?t(null,c.extend(o.InitiateMultipartUploadResult,{statusCode:o.statusCode,headers:o.headers})):void t(null,o)})},e.onHashProgress)},multipartUpload:function(e,t){var o=this;c.getFileSize("multipartUpload",e,function(){var r=e.tracker,n=o.options.UploadCheckContentMd5;n&&r&&r.setParams({md5StartTime:(new Date).getTime()}),c.getBodyMd5(n,e.Body,function(i){i&&(e.Headers["Content-MD5"]=c.b64(i)),n&&r&&r.setParams({md5EndTime:(new Date).getTime()}),r&&r.setParams({partNumber:e.PartNumber}),y.call(o,{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,o){if(e)return r&&r.parent&&r.parent.setParams({errorNode:"multipartUpload"}),t(e);t(null,{ETag:c.attr(o.headers,"etag",""),statusCode:o.statusCode,headers:o.headers})})})})},multipartComplete:function(e,t){for(var o=this,r=e.UploadId,n=e.Parts,i=e.tracker,a=0,s=n.length;a-1?function(e){var t=e.match(/q-url-param-list.*?(?=&)/g)[0],o="q-url-param-list="+encodeURIComponent(t.replace(/q-url-param-list=/,"")).toLowerCase(),r=new RegExp(t,"g");return e.replace(r,o)}(o.Authorization):"sign="+encodeURIComponent(o.Authorization)),o.SecurityToken&&(r+="&x-cos-security-token="+o.SecurityToken),o.ClientIP&&(r+="&clientIP="+o.ClientIP),o.ClientUA&&(r+="&clientUA="+o.ClientUA),o.Token&&(r+="&token="+o.Token),i&&(r+="&"+i),setTimeout(function(){t(null,{Url:r})})}});return l?(a+="?"+l.Authorization+(l.SecurityToken?"&x-cos-security-token="+l.SecurityToken:""),i&&(a+="&"+i)):i&&(a+="?"+i),a},getAuth:function(e){return c.getAuth({SecretId:e.SecretId||this.options.SecretId||"",SecretKey:e.SecretKey||this.options.SecretKey||"",Bucket:e.Bucket,Region:e.Region,Method:e.Method,Key:e.Key,Query:e.Query,Headers:e.Headers,Expires:e.Expires,UseRawKey:this.options.UseRawKey,SystemClockOffset:this.options.SystemClockOffset})}};e.exports.init=function(e,t){t.transferToTaskMethod(k,"putObject"),c.each(k,function(t,o){e.prototype[o]=c.apiWrapper(o,t),function(e,t,o){c.each(["Cors","Acl"],function(r){if(e.slice(-r.length)===r){var n=e.slice(0,-r.length)+r.toUpperCase(),i=c.apiWrapper(e,t),a=!1;o[n]=function(){!a&&console.warn("warning: cos."+n+" has been deprecated. Please Use cos."+e+" instead."),a=!0,i.apply(this,arguments)}}})}(o,t,e.prototype)})}},"./src/cos.js": /*!********************!*\ !*** ./src/cos.js ***! \********************/ /*! no static exports found */function(e,t,o){var r=o(/*! ./util */"./src/util.js"),n=o(/*! ./event */"./src/event.js"),i=o(/*! ./task */"./src/task.js"),a=o(/*! ./base */"./src/base.js"),s=o(/*! ./advance */"./src/advance.js"),c=o(/*! ./logger */"./src/logger.js"),l=o(/*! ../package.json */"./package.json"),u={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",StartTime:0,ExpiredTime:0,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,AutoSwitchHost:!0,CopySourceParser:null,ObjectKeySimplifyCheck:!0,DeepTracker:!1,TrackerDelay:5e3,CustomId:"",BeaconReporter:null,ClsReporter:null,EnableLog:!1,EnableLogcat:!1,LogLevel:"VERBOSE",ClsLogger:null,LogExtras:{}},d=function(e){var t,o,a=this;if(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.EnableReporter=this.options.BeaconReporter||this.options.ClsReporter,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.log("Tip: Next.js、Nuxt.js 等服务端渲染技术可正常使用JavaScript SDK,请忽略下方 nodejs 环境警告"),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")),this.options.ForcePathStyle)throw console.warn("cos-js-sdk-v5不再支持使用path-style,仅支持使用virtual-hosted-style,参考文档:https://cloud.tencent.com/document/product/436/96243"),new Error("ForcePathStyle is not supported");n.init(this),i.init(this),this.logger=new c({enableLog:this.options.EnableLog,enableLogcat:this.options.EnableLogcat,level:null!==(t=this.options.LogLevel)&&void 0!==t?t:"VERBOSE",clsLogger:this.options.ClsLogger,logExtras:null!==(o=this.options.LogExtras)&&void 0!==o?o:{}}),this.options.EnableLog&&(n.init(this.logger),this.logger.on("log-message",function(e){a.emit("log-message",e)}))};a.init(d,i),s.init(d,i),d.util={md5:r.md5,xml2json:r.xml2json,json2xml:r.json2xml,encodeBase64:r.encodeBase64},d.getAuthorization=r.getAuth,d.version=l.version,e.exports=d},"./src/event.js": /*!**********************!*\ !*** ./src/event.js ***! \**********************/ /*! no static exports found */function(e,t){var o=function(e){var t={},o=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.'),o(e).push(t)},e.off=function(e,t){for(var r=o(e),n=r.length-1;n>=0;n--)t===r[n]&&r.splice(n,1)},e.emit=function(e,t){for(var r=o(e).map(function(e){return e}),n=0;n=0;o--){var n=r[o][2];(!n||n+2592e3=0;n--){var i=r[n];i[0]===e&&i[1]===t&&r.splice(n,1)}r.unshift([e,t,Math.round(Date.now()/1e3)]),r.length>o&&r.splice(o),u()}},removeUploadId:function(e){l.call(this),delete d.using[e];for(var t=r.length-1;t>=0;t--)r[t][1]===e&&r.splice(t,1);u()}};e.exports=d},"./src/task.js": /*!*********************!*\ !*** ./src/task.js ***! \*********************/ /*! no static exports found */function(e,t,o){var r=o(/*! ./session */"./src/session.js"),n=o(/*! ./util */"./src/util.js"),i={};e.exports.transferToTaskMethod=function(e,t){i[t]=e[t],e[t]=function(e,o){e.SkipTask?i[t].call(this,e,o):this._addTask(t,e,o)}},e.exports.init=function(e){var t,o,a=[],s={},c=0,l=0,u=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},d=(o=function(){t=0,e.emit("task-list-update",{list:n.map(a,u)}),e.emit("list-update",{list:n.map(a,u)})},function(){t||(t=setTimeout(o))}),h=function(){if(!(a.length<=e.options.UploadQueueSize)){for(var t=0;te.options.UploadQueueSize;){var o="waiting"===a[t].state||"checking"===a[t].state||"uploading"===a[t].state;a[t]&&o?t++:(s[a[t].id]&&delete s[a[t].id],a.splice(t,1),l--)}d()}},p=function(){if(!(c>=e.options.FileParallelLimit)){for(;a[l]&&"waiting"!==a[l].state;)l++;if(!(l>=a.length)){var t=a[l];l++,c++,t.state="checking",t.params.onTaskStart&&t.params.onTaskStart(u(t)),!t.params.UploadData&&(t.params.UploadData={});var o=n.formatParams(t.api,t.params);i[t.api].call(e,o,function(o,r){e._isRunningTask(t.id)&&("checking"!==t.state&&"uploading"!==t.state||(t.state=o?"error":"success",o&&(t.error=o),c--,d(),p(),t.callback&&t.callback(o,r),"success"===t.state&&(t.params&&(delete t.params.UploadData,delete t.params.Body,delete t.params),delete t.callback)),h())}),d(),setTimeout(p)}}},f=function(t,o){var n=s[t];if(n){var i=n&&"waiting"===n.state,a=n&&("checking"===n.state||"uploading"===n.state);if("canceled"===o&&"canceled"!==n.state||"paused"===o&&i||"paused"===o&&a){n.state=o,e.emit("inner-kill-task",{TaskId:t,toState:o});try{var l=n&&n.params&&n.params.UploadData.UploadId}catch(u){}"canceled"===o&&l&&r.removeUsing(l),d(),a&&(c--,p()),"canceled"===o&&(n.params&&(delete n.params.UploadData,delete n.params.Body,delete n.params),delete n.callback)}h()}};e._addTasks=function(t){n.each(t,function(t){e._addTask(t.api,t.params,t.callback,!0)}),d()};var g=!0;e._addTask=function(t,o,r,i){o=n.formatParams(t,o);var c=n.uuid();o.TaskId=c,o.onTaskReady&&o.onTaskReady(c),o.TaskReady&&(o.TaskReady(c),g&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),g=!1);var l={params:o,callback:r,api:t,index:a.length,id:c,Bucket:o.Bucket,Region:o.Region,Key:o.Key,FilePath:o.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:o._custom},u=o.onHashProgress;o.onHashProgress=function(t){e._isRunningTask(l.id)&&(l.hashPercent=t.percent,u&&u(t),d())};var f=o.onProgress;return o.onProgress=function(t){e._isRunningTask(l.id)&&("checking"===l.state&&(l.state="uploading"),l.loaded=t.loaded,l.speed=t.speed,l.percent=t.percent,f&&f(t),d())},n.getFileSize(t,o,function(e,t){if(e)return r(n.error(e));s[c]=l,a.push(l),l.size=t,!i&&d(),p(),h()}),c},e._isRunningTask=function(e){var t=s[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return n.map(a,u)},e.cancelTask=function(e){f(e,"canceled")},e.pauseTask=function(e){f(e,"paused")},e.restartTask=function(e){var t=s[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",d(),l=Math.min(l,t.index),p())},e.isUploadRunning=function(){return c||l=0||e.indexOf("wow32")>=0?"win32":e.indexOf("win64")>=0||e.indexOf("wow64")>=0?"win64":t?"mac":"unknown os"},p=function(){return!("object"!==("undefined"==typeof navigator?"undefined":i(navigator))||!navigator.userAgent.match(/(Android|Adr|Linux)/i))},f=function(){return!("object"!==("undefined"==typeof navigator?"undefined":i(navigator))||!navigator.userAgent.match(/(iPhone|iPod|iPad|iOS)/i))},g=function(){return"object"!==("undefined"==typeof navigator?"undefined":i(navigator))?"unknown device":navigator.userAgent},m=!("object"!==("undefined"==typeof navigator?"undefined":i(navigator))||!navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)),y=p()?"android":f?"ios":"other_mobile",v=h(),k=m?y:v,b=g(),C=d();function x(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}var w=function(){function e(t){r(this,e);var o=t.parent,n=t.traceId,i=t.bucket,c=t.region,u=t.apiName,d=t.realApi,h=t.httpMethod,p=t.fileKey,f=t.fileSize,g=t.accelerate,m=t.customId,y=t.delay,v=t.deepTracker,x=t.Beacon,w=t.clsReporter,S=i&&i.substr(i.lastIndexOf("-")+1)||"";this.parent=o,this.deepTracker=v,this.delay=y,w&&!this.clsReporter&&(this.clsReporter=w),this.params={sdkVersionName:"cos-js-sdk-v5",sdkVersionCode:a.version,osName:k,networkType:"",requestName:u||"",requestResult:"",realApi:d,bucket:i,region:c,accelerate:g,httpMethod:h,url:"",host:"",httpDomain:"",requestPath:p||"",userAgent:b,networkProtocol:C,errorType:"",errorCode:"",errorName:"",errorMessage:"",errorRequestId:"",errorHttpCode:0,errorServiceName:"",errorNode:"",httpTookTime:0,httpSize:f||0,httpMd5:0,httpSign:0,httpFullTime:0,httpSpeed:0,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:(new Date).getTime(),endTime:0,traceId:n||l(),appid:S,partNumber:0,httpRetryTimes:0,customId:m||"",partTime:0},x&&(this.beacon=function(e,t){if(!s){if("function"!=typeof e)throw new Error("Beacon not found");s=new e({appkey:"0WEB05PY6MHRGK0U",versionCode:a.version,channelID:"js_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:t,sessionDuration:6e4})}return s}(x,y))}return n(e,[{key:"formatResult",value:function(e,t){var o,r,n,i,a,s,l=(new Date).getTime(),d=u(),h=e?(null==e?void 0:e.code)||(null==e||null===(o=e.error)||void 0===o?void 0:o.code)||(null==e||null===(r=e.error)||void 0===r?void 0:r.Code):"",p=e?(null==e?void 0:e.message)||(null==e||null===(n=e.error)||void 0===n?void 0:n.message)||(null==e||null===(i=e.error)||void 0===i?void 0:i.Message):"",f=p,g=e?(null==e?void 0:e.resource)||(null==e||null===(a=e.error)||void 0===a?void 0:a.resource)||(null==e||null===(s=e.error)||void 0===s?void 0:s.Resource):"",m=e?null==e?void 0:e.statusCode:t.statusCode,y=e?(null==e?void 0:e.headers)&&(null==e?void 0:e.headers["x-cos-request-id"]):(null==t?void 0:t.headers)&&(null==t?void 0:t.headers["x-cos-request-id"]),v=e?y?"Server":"Client":"";"getObject"===this.params.requestName&&(this.params.httpSize=t?t.headers&&t.headers["content-length"]:0);var k="sliceUploadFile"===this.params.realApi,b="sliceCopyFile"===this.params.realApi;if(k||b){var C=this.params.httpSize/1024/this.params.partTime;Object.assign(this.params,{httpSpeed:C<0?0:C.toFixed(3)})}else{var x=l-this.params.startTime,w=this.params.httpEndTime-this.params.httpStartTime,S=this.params.httpSize/1024/(w/1e3),R=this.params.md5EndTime-this.params.md5StartTime,T=this.params.signEndTime-this.params.signStartTime;this.parent&&(this.parent.addParamValue("httpTookTime",c(w)),this.parent.addParamValue("httpFullTime",c(x)),this.parent.addParamValue("httpMd5",c(R)),this.parent.addParamValue("httpSign",c(T)),["multipartUpload","uploadPartCopy","putObjectCopy"].includes(this.params.requestName)&&this.parent.addParamValue("partTime",c(w))),Object.assign(this.params,{httpFullTime:c(x),httpMd5:c(R),httpSign:c(T),httpTookTime:c(w),httpSpeed:S<0?0:S.toFixed(3)})}if(Object.assign(this.params,{networkType:d,requestResult:e?"Failure":"Success",errorType:v,errorCode:h,errorHttpCode:m,errorName:f,errorMessage:p,errorServiceName:g,errorRequestId:y}),!e||h&&p||(this.params.fullError=e?JSON.stringify(e):""),this.params.url){try{var B=/^http(s)?:\/\/(.*?)\//.exec(this.params.url);this.params.host=B[2]}catch(A){this.params.host=this.params.url}this.params.httpDomain=this.params.host}}},{key:"report",value:function(e,t){if(this.beacon||this.clsReporter){this.formatResult(e,t);var o=function(e){var t,o={},r=["sdkVersionName","sdkVersionCode","osName","networkType","requestName","requestResult","bucket","region","appid","accelerate","url","host","requestPath","userAgent","networkProtocol","httpMethod","httpSize","httpSpeed","httpTookTime","httpMd5","httpSign","httpFullTime","httpDomain","partNumber","httpRetryTimes","customId","traceId","realApi"],n=[].concat(r,["errorNode","errorCode","errorName","errorMessage","errorRequestId","errorHttpCode","errorServiceName","errorType","fullError"]),i="Success"===e.requestResult?r:n;for(var a in e)i.includes(a)&&(o[x(a)]=e[a]);return o.request_name=e.realApi?(t=e.realApi,["putObject","sliceUploadFile","uploadFile","uploadFiles"].includes(t)?"UploadTask":"getObject"===t?"DownloadTask":["putObjectCopy","sliceCopyFile"].includes(t)?"CopyTask":t):e.requestName,o}(this.params);this.beacon&&this.sendEventsToBeacon(o),this.clsReporter&&this.sendEventsToCLS(o)}}},{key:"setParams",value:function(e){Object.assign(this.params,e)}},{key:"addParamValue",value:function(e,t){this.params[e]=(+this.params[e]+ +t).toFixed(3)}},{key:"sendEventsToBeacon",value:function(e){if("sliceUploadFile"!==this.params.requestName&&"sliceUploadFile"!==this.params.realApi||this.deepTracker){var t="qcloud_track_cos_sdk";0===this.delay?this.beacon&&this.beacon.onDirectUserAction(t,e):this.beacon&&this.beacon.onUserAction(t,e)}}},{key:"sendEventsToCLS",value:function(e){var t=!(0!==this.delay);this.clsReporter.log(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,accelerate:this.params.accelerate,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay,clsReporter:this.clsReporter}),new e(t)}}])}();e.exports=w},"./src/util.js": /*!*********************!*\ !*** ./src/util.js ***! \*********************/ /*! no static exports found */function(e,t,o){(function(t){var r=o(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");function n(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return i(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==o.return||o.return()}finally{if(c)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=Array(t);ot?1:-1})}var v,k=["cache-control","content-disposition","content-encoding","content-length","content-md5","expect","expires","host","if-match","if-modified-since","if-none-match","if-unmodified-since","origin","range","transfer-encoding","pic-operations"],b=function(e,t,o){var r=t/8,n=e.slice(o,o+r);return new Uint8Array(n).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[t](n)[0]},C=function(e,t,o,r){var n=e.slice(t,o),i="";return new Uint8Array(n).forEach(function(e){i+=String.fromCharCode(e)}),r&&(i=decodeURIComponent(escape(i))),i},x=function(){},w=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&void 0!==e[o]&&null!==e[o]&&(t[o]=e[o]);return t},S=function(e,t){var o,r=new FileReader;FileReader.prototype.readAsBinaryString?(o=FileReader.prototype.readAsBinaryString,r.onload=function(){t(this.result)}):FileReader.prototype.readAsArrayBuffer?o=function(e){var o="",r=new FileReader;r.onload=function(e){for(var n=new Uint8Array(r.result),i=n.byteLength,a=0;aparseInt(t[o])?1:-1;return 0},function(e){if(!e)return!1;var t=(e.match(/Chrome\/([.\d]+)/)||[])[1],o=(e.match(/QBCore\/([.\d]+)/)||[])[1],r=(e.match(/QQBrowser\/([.\d]+)/)||[])[1];return t&&v(t,"53.0.2785.116")<0&&o&&v(o,"3.53.991.400")<0&&r&&v(r,"9.0.2524.400")<=0||!1}("undefined"!=typeof navigator&&navigator.userAgent)),T=1048576;function B(e){return I(e,function(e){return"object"===r(e)&&null!==e?B(e):e})}function A(e,t){return P(t,function(o,r){e[r]=t[r]}),e}function E(e){return e instanceof Array}function O(e){return"[object Object]"===Object.prototype.toString.call(e)}function P(e,t){for(var o in e)e.hasOwnProperty(o)&&t(e[o],o)}function I(e,t){var o=E(e)?[]:{};for(var r in e)e.hasOwnProperty(r)&&(o[r]=t(e[r],r));return o}var j=function(e,t){var o=t.Bucket,r=t.Region,n=t.Key,i=this.options.Domain,a=!i||"string"==typeof i&&i.indexOf("{Bucket}")>-1,s=!i||"string"==typeof i&&i.indexOf("{Region}")>-1;if(e.indexOf("Bucket")>-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(a&&!o)return"Bucket";if(s&&!r)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e||"uploadFile"===e){if(a&&!o)return"Bucket";if(s&&!r)return"Region";if(!n)return"Key"}return!1},D=function(e,t){if(t=A({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var o=t.Headers||{};t&&"object"===r(t)&&(function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(o[e]=t[e])}(),L.each({"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","x-cos-callback":"Callback","x-cos-callback-var":"CallbackVar","x-cos-return-body":"ReturnBody"},function(e,r){void 0!==t[e]&&(o[r]=t[e])}),t.Headers=w(o))}return t},M=function(e){return Date.now()+(e||0)},N="object"===("undefined"==typeof navigator?"undefined":r(navigator))&&!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),U="object"===("undefined"==typeof navigator?"undefined":r(navigator))&&/\sQQ/i.test(navigator.userAgent),L={noop:x,formatParams:D,apiWrapper:function(e,t){return function(o,r){var n,i=this;if("function"==typeof o&&(r=o,o={}),o=D(e,o),i.options.EnableReporter)if("sliceUploadFile"===o.calledBySdk||"sliceCopyFile"===o.calledBySdk)n=o.tracker&&o.tracker.generateSubTracker({apiName:e});else if(["uploadFile","uploadFiles"].includes(e))n=null;else{var a=0;o.Body&&(a="string"==typeof o.Body?o.Body.length:o.Body.size||o.Body.byteLength||0);var s=i.options.UseAccelerate||"string"==typeof i.options.Domain&&i.options.Domain.includes("accelerate.");n=new f({Beacon:i.options.BeaconReporter,clsReporter:i.options.ClsReporter,bucket:o.Bucket,region:o.Region,apiName:e,realApi:e,accelerate:s,fileKey:o.Key,fileSize:a,deepTracker:i.options.DeepTracker,customId:i.options.CustomId,delay:i.options.TrackerDelay})}o.tracker=n;var c=function(e){return e&&e.headers&&(e.headers["x-ci-request-id"]&&(e.RequestId=e.headers["x-ci-request-id"]),e.headers["x-cos-request-id"]&&(e.RequestId=e.headers["x-cos-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},l=function(e,t){n&&n.report(e,t),r&&r(c(e),c(t))},u=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=j.call(i,e,o);if(t)return"missing param "+t;if(o.Region){if(i.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(o.Region))return"Region format error."}else{if(o.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(o.Region))return"Region format error."}i.options.CompatibilityMode||-1!==o.Region.indexOf("-")||"yfb"===o.Region||"default"===o.Region||"accelerate"===o.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(o.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(o.Bucket))if(o.AppId)o.Bucket=o.Bucket+"-"+o.AppId;else{if(!i.options.AppId)return'Bucket should format as "test-1250000000".';o.Bucket=o.Bucket+"-"+i.options.AppId}o.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete o.AppId)}!i.options.UseRawKey&&o.Key&&"/"===o.Key.substr(0,1)&&(o.Key=o.Key.substr(1))}}(),d=["getAuth","getObjectUrl"].includes(e);if("function"==typeof Promise&&!d&&!r)return new Promise(function(e,n){if(r=function(t,o){t?n(t):e(o)},u)return l(L.error(new Error(u)));t.call(i,o,l)});if(u)return l(L.error(new Error(u)));var h=t.call(i,o,l);return d?h:void 0}},xml2json:function(e){var t=d.parse(e);return g(t),t},json2xml:function(e){return h.build(e)},md5:a,clearKey:w,fileSlice:function(e,t,o,r,n){var i;if(e.slice?i=e.slice(t,o):e.mozSlice?i=e.mozSlice(t,o):e.webkitSlice&&(i=e.webkitSlice(t,o)),r&&R){var a=new FileReader;a.onload=function(e){i=null,n(new Blob([a.result]))},a.readAsArrayBuffer(i)}else n(i)},getBodyMd5:function(e,t,o,r){o=o||x,e?"string"==typeof t?o(L.md5(t,!0)):Blob&&t instanceof Blob?L.getFileMd5(t,function(e,t){o(t)},r):o():o()},getFileMd5:function(e,t,o){var r=e.size,n=0,i=a.getCtx(),s=function(a){if(a>=r){var c=i.digest("hex");t(null,c)}else{var l=Math.min(r,a+T);L.fileSlice(e,a,l,!1,function(e){S(e,function(t){e=null,i=i.update(t,!0),n+=t.length,t=null,o&&o({loaded:n,total:r,percent:Math.round(n/r*1e4)/1e4}),s(a+T)})})}};s(0)},b64:function(e){var t,o,r,n="";for(t=0,o=e.length/2;t-1||r.indexOf("x-ci-")>-1||k.indexOf(r)>-1)&&(t[o]=e[o])}return t}(B(e.Headers||e.headers||{})),l=e.Key||"";e.UseRawKey?t=e.Pathname||e.pathname||"/"+l:0!==(t=e.Pathname||e.pathname||l).indexOf("/")&&(t="/"+t);var u=!1!==e.ForceSignHost;if(!c.Host&&!c.host&&e.Bucket&&e.Region&&u&&(c.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),!o)throw new Error("missing param SecretId");if(!r)throw new Error("missing param SecretKey");var d=Math.round(M(e.SystemClockOffset)/1e3)-1,h=d,p=e.Expires||e.expires;h+=void 0===p?900:1*p||0;var f=o,g=n||d+";"+h,m=n||d+";"+h,v=y(c,!0).join(";").toLowerCase(),b=y(a,!0).join(";").toLowerCase(),C=s.HmacSHA1(m,r).toString(),x=[i,t,L.obj2str(a,!0),L.obj2str(c,!0),""].join("\n"),w=["sha1",g,s.SHA1(x).toString(),""].join("\n");return["q-sign-algorithm=sha1","q-ak="+f,"q-sign-time="+g,"q-key-time="+m,"q-header-list="+v,"q-url-param-list="+b,"q-signature="+s.HmacSHA1(w,C).toString()].join("&")},parseSelectPayload:function(e){for(var t={},o=C(e),r={records:[]};e.byteLength;){var n,i=b(e,32,0),a=b(e,32,4),s=i-a-16,c=0;for(e=e.slice(12);c{const{bucketName:t,filename:o,postData:n}=e,i="tencent";let a=t,s=o,c={};return a=C,s="ktyq/"+o,c={key:"ktyq/"+n.key},r.post("/edu-app/open/getUploadSign",{data:{postData:c,pluginName:i,bucketName:a,filename:s},params:{pluginName:i}})}),w=e("o",({file:e,action:t,data:o,onProgress:r,onFinish:n,onError:i})=>{new b({Domain:"https://oss.dayaedu.com",Protocol:"https",getAuthorization:async(e,t)=>{t({Authorization:o.signature})}}).uploadFile({Bucket:C,Region:"ap-nanjing",Key:`ktyq/${o.name}`,Body:o.file.file,SliceSize:524288e3,onProgress:function(e){r({percent:Math.ceil(100*(e.percent||0))})}}).then(t=>{t.Location?.indexOf("http")>=0?e.url=t.Location:e.url="https://"+t.Location,n()}).catch(e=>{console.log(e,"error"),i()})}),S=e("a",async(e,t)=>{{let e="",o=null;const r=new b({Domain:"https://oss.dayaedu.com",Protocol:"https",getAuthorization:async(e,o)=>{o({Authorization:t.signature})}});if(await r.uploadFile({Bucket:C,Region:"ap-nanjing",Key:`ktyq/${t.name}`,Body:t.file,SliceSize:524288e3}).then(t=>{e=t.Location?.indexOf("http")>=0?t.Location:"https://"+t.Location}).catch(e=>{o=e}),e)return e;throw new Error(o)}}); /*! * Cropper.js v1.6.2 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2024-04-21T07:43:05.335Z */ function R(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,r)}return o}function T(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,r=new Array(t);o0&&e<1/0};function Ae(e){return void 0===e}function Ee(e){return"object"===A(e)&&null!==e}var Oe=Object.prototype.hasOwnProperty;function Pe(e){if(!Ee(e))return!1;try{var t=e.constructor,o=t.prototype;return t&&o&&Oe.call(o,"isPrototypeOf")}catch(r){return!1}}function Ie(e){return"function"==typeof e}var je=Array.prototype.slice;function De(e){return Array.from?Array.from(e):je.call(e)}function Me(e,t){return e&&Ie(t)&&(Array.isArray(e)||Te(e.length)?De(e).forEach(function(o,r){t.call(e,o,r,e)}):Ee(e)&&Object.keys(e).forEach(function(o){t.call(e,e[o],o,e)})),e}var Ne=Object.assign||function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r0&&o.forEach(function(t){Ee(t)&&Object.keys(t).forEach(function(o){e[o]=t[o]})}),e},Ue=/\.\d*(?:0|9){12}\d*$/;function Le(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return Ue.test(e)?Math.round(e*t)/t:e}var _e=/^width|height|left|top|marginLeft|marginTop$/;function He(e,t){var o=e.style;Me(t,function(e,t){_e.test(t)&&Te(e)&&(e="".concat(e,"px")),o[t]=e})}function Ke(e,t){if(t)if(Te(e.length))Me(e,function(e){Ke(e,t)});else if(e.classList)e.classList.add(t);else{var o=e.className.trim();o?o.indexOf(t)<0&&(e.className="".concat(o," ").concat(t)):e.className=t}}function Fe(e,t){t&&(Te(e.length)?Me(e,function(e){Fe(e,t)}):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function ze(e,t,o){t&&(Te(e.length)?Me(e,function(e){ze(e,t,o)}):o?Ke(e,t):Fe(e,t))}var qe=/([a-z\d])([A-Z])/g;function Ve(e){return e.replace(qe,"$1-$2").toLowerCase()}function Ge(e,t){return Ee(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Ve(t)))}function We(e,t,o){Ee(o)?e[t]=o:e.dataset?e.dataset[t]=o:e.setAttribute("data-".concat(Ve(t)),o)}var Xe=/\s\s*/,$e=function(){var e=!1;if(I){var t=!1,o=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});j.addEventListener("test",o,r),j.removeEventListener("test",o,r)}return e}();function Ye(e,t,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=o;t.trim().split(Xe).forEach(function(t){if(!$e){var i=e.listeners;i&&i[t]&&i[t][o]&&(n=i[t][o],delete i[t][o],0===Object.keys(i[t]).length&&delete i[t],0===Object.keys(i).length&&delete e.listeners)}e.removeEventListener(t,n,r)})}function Qe(e,t,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=o;t.trim().split(Xe).forEach(function(t){if(r.once&&!$e){var i=e.listeners,a=void 0===i?{}:i;n=function(){delete a[t][o],e.removeEventListener(t,n,r);for(var i=arguments.length,s=new Array(i),c=0;c1&&void 0!==arguments[1]?arguments[1]:"contain",i=Be(r),a=Be(o);if(i&&a){var s=o*t;"contain"===n&&s>r||"cover"===n&&s=8&&(i=c+u)}}}if(i){var d,h,p=o.getUint16(i,r);for(h=0;h=0?n:200),height:Math.max(o.offsetHeight,i>=0?i:100)};this.containerData=a,He(r,{width:a.width,height:a.height}),Ke(e,Q),Fe(r,Q)},initCanvas:function(){var e=this.containerData,t=this.imageData,o=this.options.viewMode,r=Math.abs(t.rotate)%180==90,n=r?t.naturalHeight:t.naturalWidth,i=r?t.naturalWidth:t.naturalHeight,a=n/i,s=e.width,c=e.height;e.height*a>e.width?3===o?s=e.height*a:c=e.width/a:3===o?c=e.width/a:s=e.height*a;var l={aspectRatio:a,naturalWidth:n,naturalHeight:i,width:s,height:c};this.canvasData=l,this.limited=1===o||2===o,this.limitCanvas(!0,!0),l.width=Math.min(Math.max(l.width,l.minWidth),l.maxWidth),l.height=Math.min(Math.max(l.height,l.minHeight),l.maxHeight),l.left=(e.width-l.width)/2,l.top=(e.height-l.height)/2,l.oldLeft=l.left,l.oldTop=l.top,this.initialCanvasData=Ne({},l)},limitCanvas:function(e,t){var o=this.options,r=this.containerData,n=this.canvasData,i=this.cropBoxData,a=o.viewMode,s=n.aspectRatio,c=this.cropped&&i;if(e){var l=Number(o.minCanvasWidth)||0,u=Number(o.minCanvasHeight)||0;a>1?(l=Math.max(l,r.width),u=Math.max(u,r.height),3===a&&(u*s>l?l=u*s:u=l/s)):a>0&&(l?l=Math.max(l,c?i.width:0):u?u=Math.max(u,c?i.height:0):c&&(l=i.width,(u=i.height)*s>l?l=u*s:u=l/s));var d=at({aspectRatio:s,width:l,height:u});l=d.width,u=d.height,n.minWidth=l,n.minHeight=u,n.maxWidth=1/0,n.maxHeight=1/0}if(t)if(a>(c?0:1)){var h=r.width-n.width,p=r.height-n.height;n.minLeft=Math.min(0,h),n.minTop=Math.min(0,p),n.maxLeft=Math.max(0,h),n.maxTop=Math.max(0,p),c&&this.limited&&(n.minLeft=Math.min(i.left,i.left+(i.width-n.width)),n.minTop=Math.min(i.top,i.top+(i.height-n.height)),n.maxLeft=i.left,n.maxTop=i.top,2===a&&(n.width>=r.width&&(n.minLeft=Math.min(0,h),n.maxLeft=Math.max(0,h)),n.height>=r.height&&(n.minTop=Math.min(0,p),n.maxTop=Math.max(0,p))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=r.width,n.maxTop=r.height},renderCanvas:function(e,t){var o=this.canvasData,r=this.imageData;if(t){var n=function(e){var t=e.width,o=e.height,r=e.degree;if(90==(r=Math.abs(r)%180))return{width:o,height:t};var n=r%90*Math.PI/180,i=Math.sin(n),a=Math.cos(n),s=t*a+o*i,c=t*i+o*a;return r>90?{width:c,height:s}:{width:s,height:c}}({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),i=n.width,a=n.height,s=o.width*(i/o.naturalWidth),c=o.height*(a/o.naturalHeight);o.left-=(s-o.width)/2,o.top-=(c-o.height)/2,o.width=s,o.height=c,o.aspectRatio=i/a,o.naturalWidth=i,o.naturalHeight=a,this.limitCanvas(!0,!1)}(o.width>o.maxWidth||o.widtho.maxHeight||o.heightt.width?n.height=n.width/o:n.width=n.height*o),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*r),n.height=Math.max(n.minHeight,n.height*r),n.left=t.left+(t.width-n.width)/2,n.top=t.top+(t.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=Ne({},n)},limitCropBox:function(e,t){var o=this.options,r=this.containerData,n=this.canvasData,i=this.cropBoxData,a=this.limited,s=o.aspectRatio;if(e){var c=Number(o.minCropBoxWidth)||0,l=Number(o.minCropBoxHeight)||0,u=a?Math.min(r.width,n.width,n.width+n.left,r.width-n.left):r.width,d=a?Math.min(r.height,n.height,n.height+n.top,r.height-n.top):r.height;c=Math.min(c,r.width),l=Math.min(l,r.height),s&&(c&&l?l*s>c?l=c/s:c=l*s:c?l=c/s:l&&(c=l*s),d*s>u?d=u/s:u=d*s),i.minWidth=Math.min(c,u),i.minHeight=Math.min(l,d),i.maxWidth=u,i.maxHeight=d}t&&(a?(i.minLeft=Math.max(0,n.left),i.minTop=Math.max(0,n.top),i.maxLeft=Math.min(r.width,n.left+n.width)-i.width,i.maxTop=Math.min(r.height,n.top+n.height)-i.height):(i.minLeft=0,i.minTop=0,i.maxLeft=r.width-i.width,i.maxTop=r.height-i.height))},renderCropBox:function(){var e=this.options,t=this.containerData,o=this.cropBoxData;(o.width>o.maxWidth||o.widtho.maxHeight||o.height=t.width&&o.height>=t.height?_:U),He(this.cropBox,Ne({width:o.width,height:o.height},nt({translateX:o.left,translateY:o.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Je(this.element,se,this.getData())}},dt={initPreview:function(){var e=this.element,t=this.crossOrigin,o=this.options.preview,r=t?this.crossOriginUrl:this.url,n=e.alt||"The image to preview",i=document.createElement("img");if(t&&(i.crossOrigin=t),i.src=r,i.alt=n,this.viewBox.appendChild(i),this.viewBoxImage=i,o){var a=o;"string"==typeof o?a=e.ownerDocument.querySelectorAll(o):o.querySelector&&(a=[o]),this.previews=a,Me(a,function(e){var o=document.createElement("img");We(e,re,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(o.crossOrigin=t),o.src=r,o.alt=n,o.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(o)})}},resetPreview:function(){Me(this.previews,function(e){var t=Ge(e,re);He(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(Ee(e[t]))try{delete e[t]}catch(o){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(o){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(Ve(t)))}(e,re)})},preview:function(){var e=this.imageData,t=this.canvasData,o=this.cropBoxData,r=o.width,n=o.height,i=e.width,a=e.height,s=o.left-t.left-e.left,c=o.top-t.top-e.top;this.cropped&&!this.disabled&&(He(this.viewBoxImage,Ne({width:i,height:a},nt(Ne({translateX:-s,translateY:-c},e)))),Me(this.previews,function(t){var o=Ge(t,re),l=o.width,u=o.height,d=l,h=u,p=1;r&&(h=n*(p=l/r)),n&&h>u&&(d=r*(p=u/n),h=u),He(t,{width:d,height:h}),He(t.getElementsByTagName("img")[0],Ne({width:i*p,height:a*p},nt(Ne({translateX:-s*p,translateY:-c*p},e))))}))}},ht={bind:function(){var e=this.element,t=this.options,o=this.cropper;Ie(t.cropstart)&&Qe(e,ue,t.cropstart),Ie(t.cropmove)&&Qe(e,le,t.cropmove),Ie(t.cropend)&&Qe(e,ce,t.cropend),Ie(t.crop)&&Qe(e,se,t.crop),Ie(t.zoom)&&Qe(e,ve,t.zoom),Qe(o,he,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Qe(o,ye,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Qe(o,de,this.onDblclick=this.dblclick.bind(this)),Qe(e.ownerDocument,pe,this.onCropMove=this.cropMove.bind(this)),Qe(e.ownerDocument,fe,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Qe(window,me,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,o=this.cropper;Ie(t.cropstart)&&Ye(e,ue,t.cropstart),Ie(t.cropmove)&&Ye(e,le,t.cropmove),Ie(t.cropend)&&Ye(e,ce,t.cropend),Ie(t.crop)&&Ye(e,se,t.crop),Ie(t.zoom)&&Ye(e,ve,t.zoom),Ye(o,he,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Ye(o,ye,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Ye(o,de,this.onDblclick),Ye(e.ownerDocument,pe,this.onCropMove),Ye(e.ownerDocument,fe,this.onCropEnd),t.responsive&&Ye(window,me,this.onResize)}},pt={resize:function(){if(!this.disabled){var e,t,o=this.options,r=this.container,n=this.containerData,i=r.offsetWidth/n.width,a=r.offsetHeight/n.height,s=Math.abs(i-1)>Math.abs(a-1)?i:a;1!==s&&(o.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),o.restore&&(this.setCanvasData(Me(e,function(t,o){e[o]=t*s})),this.setCropBoxData(Me(t,function(e,o){t[o]=e*s}))))}},dblclick:function(){var e,t;this.disabled||this.options.dragMode===ae||this.setDragMode((e=this.dragBox,t=$,(e.classList?e.classList.contains(t):e.className.indexOf(t)>-1)?ie:ne))},wheel:function(e){var t=this,o=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*o,e)))},cropStart:function(e){var t=e.buttons,o=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(Te(t)&&1!==t||Te(o)&&0!==o||e.ctrlKey))){var r,n=this.options,i=this.pointers;e.changedTouches?Me(e.changedTouches,function(e){i[e.identifier]=it(e)}):i[e.pointerId||0]=it(e),r=Object.keys(i).length>1&&n.zoomable&&n.zoomOnTouch?H:Ge(e.target,oe),be.test(r)&&!1!==Je(this.element,ue,{originalEvent:e,action:r})&&(e.preventDefault(),this.action=r,this.cropping=!1,r===L&&(this.cropping=!0,Ke(this.dragBox,ee)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var o=this.pointers;e.preventDefault(),!1!==Je(this.element,le,{originalEvent:e,action:t})&&(e.changedTouches?Me(e.changedTouches,function(e){Ne(o[e.identifier]||{},it(e,!0))}):Ne(o[e.pointerId||0]||{},it(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,o=this.pointers;e.changedTouches?Me(e.changedTouches,function(e){delete o[e.identifier]}):delete o[e.pointerId||0],t&&(e.preventDefault(),Object.keys(o).length||(this.action=""),this.cropping&&(this.cropping=!1,ze(this.dragBox,ee,this.cropped&&this.options.modal)),Je(this.element,ce,{originalEvent:e,action:t}))}}},ft={change:function(e){var t,o=this.options,r=this.canvasData,n=this.containerData,i=this.cropBoxData,a=this.pointers,s=this.action,c=o.aspectRatio,l=i.left,u=i.top,d=i.width,h=i.height,p=l+d,f=u+h,g=0,m=0,y=n.width,v=n.height,k=!0;!c&&e.shiftKey&&(c=d&&h?d/h:1),this.limited&&(g=i.minLeft,m=i.minTop,y=g+Math.min(n.width,r.width,r.left+r.width),v=m+Math.min(n.height,r.height,r.top+r.height));var b=a[Object.keys(a)[0]],C={x:b.endX-b.startX,y:b.endY-b.startY},x=function(e){switch(e){case K:p+C.x>y&&(C.x=y-p);break;case F:l+C.xv&&(C.y=v-f)}};switch(s){case U:l+=C.x,u+=C.y;break;case K:if(C.x>=0&&(p>=y||c&&(u<=m||f>=v))){k=!1;break}x(K),(d+=C.x)<0&&(s=F,l-=d=-d),c&&(h=d/c,u+=(i.height-h)/2);break;case q:if(C.y<=0&&(u<=m||c&&(l<=g||p>=y))){k=!1;break}x(q),h-=C.y,u+=C.y,h<0&&(s=z,u-=h=-h),c&&(d=h*c,l+=(i.width-d)/2);break;case F:if(C.x<=0&&(l<=g||c&&(u<=m||f>=v))){k=!1;break}x(F),d-=C.x,l+=C.x,d<0&&(s=K,l-=d=-d),c&&(h=d/c,u+=(i.height-h)/2);break;case z:if(C.y>=0&&(f>=v||c&&(l<=g||p>=y))){k=!1;break}x(z),(h+=C.y)<0&&(s=q,u-=h=-h),c&&(d=h*c,l+=(i.width-d)/2);break;case V:if(c){if(C.y<=0&&(u<=m||p>=y)){k=!1;break}x(q),h-=C.y,u+=C.y,d=h*c}else x(q),x(K),C.x>=0?pm&&(h-=C.y,u+=C.y):(h-=C.y,u+=C.y);d<0&&h<0?(s=X,u-=h=-h,l-=d=-d):d<0?(s=G,l-=d=-d):h<0&&(s=W,u-=h=-h);break;case G:if(c){if(C.y<=0&&(u<=m||l<=g)){k=!1;break}x(q),h-=C.y,u+=C.y,d=h*c,l+=i.width-d}else x(q),x(F),C.x<=0?l>g?(d-=C.x,l+=C.x):C.y<=0&&u<=m&&(k=!1):(d-=C.x,l+=C.x),C.y<=0?u>m&&(h-=C.y,u+=C.y):(h-=C.y,u+=C.y);d<0&&h<0?(s=W,u-=h=-h,l-=d=-d):d<0?(s=V,l-=d=-d):h<0&&(s=X,u-=h=-h);break;case X:if(c){if(C.x<=0&&(l<=g||f>=v)){k=!1;break}x(F),d-=C.x,l+=C.x,h=d/c}else x(z),x(F),C.x<=0?l>g?(d-=C.x,l+=C.x):C.y>=0&&f>=v&&(k=!1):(d-=C.x,l+=C.x),C.y>=0?f=0&&(p>=y||f>=v)){k=!1;break}x(K),h=(d+=C.x)/c}else x(z),x(K),C.x>=0?p=0&&f>=v&&(k=!1):d+=C.x,C.y>=0?fMath.abs(o)&&(o=c)})}),o}(a),e),k=!1;break;case L:if(!C.x||!C.y){k=!1;break}t=Ze(this.cropper),l=b.startX-t.left,u=b.startY-t.top,d=i.minWidth,h=i.minHeight,C.x>0?s=C.y>0?W:V:C.x<0&&(l-=d,s=C.y>0?X:G),C.y<0&&(u-=h),this.cropped||(Fe(this.cropBox,Q),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}k&&(i.width=d,i.height=h,i.left=l,i.top=u,this.action=s,this.renderCropBox()),Me(a,function(e){e.startX=e.endX,e.startY=e.endY})}},gt={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Ke(this.dragBox,ee),Fe(this.cropBox,Q),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Ne({},this.initialImageData),this.canvasData=Ne({},this.initialCanvasData),this.cropBoxData=Ne({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Ne(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Fe(this.dragBox,ee),Ke(this.cropBox,Q)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,Me(this.previews,function(t){t.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Fe(this.cropper,Y)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Ke(this.cropper,Y)),this},destroy:function(){var e=this.element;return e[N]?(e[N]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,o=this.canvasData,r=o.left,n=o.top;return this.moveTo(Ae(e)?e:r+Number(e),Ae(t)?t:n+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,o=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(Te(e)&&(o.left=e,r=!0),Te(t)&&(o.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var o=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(o.width*e/o.naturalWidth,null,t)},zoomTo:function(e,t,o){var r=this.options,n=this.canvasData,i=n.width,a=n.height,s=n.naturalWidth,c=n.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&r.zoomable){var l=s*e,u=c*e;if(!1===Je(this.element,ve,{ratio:e,oldRatio:i/s,originalEvent:o}))return this;if(o){var d=this.pointers,h=Ze(this.cropper),p=d&&Object.keys(d).length?function(e){var t=0,o=0,r=0;return Me(e,function(e){var n=e.startX,i=e.startY;t+=n,o+=i,r+=1}),{pageX:t/=r,pageY:o/=r}}(d):{pageX:o.pageX,pageY:o.pageY};n.left-=(l-i)*((p.pageX-h.left-n.left)/i),n.top-=(u-a)*((p.pageY-h.top-n.top)/a)}else Pe(t)&&Te(t.x)&&Te(t.y)?(n.left-=(l-i)*((t.x-n.left)/i),n.top-=(u-a)*((t.y-n.top)/a)):(n.left-=(l-i)/2,n.top-=(u-a)/2);n.width=l,n.height=u,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return Te(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,Te(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(Te(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,o=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(Te(e)&&(o.scaleX=e,r=!0),Te(t)&&(o.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=this.options,r=this.imageData,n=this.canvasData,i=this.cropBoxData;if(this.ready&&this.cropped){e={x:i.left-n.left,y:i.top-n.top,width:i.width,height:i.height};var a=r.width/r.naturalWidth;if(Me(e,function(t,o){e[o]=t/a}),t){var s=Math.round(e.y+e.height),c=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=c-e.x,e.height=s-e.y}}else e={x:0,y:0,width:0,height:0};return o.rotatable&&(e.rotate=r.rotate||0),o.scalable&&(e.scaleX=r.scaleX||1,e.scaleY=r.scaleY||1),e},setData:function(e){var t=this.options,o=this.imageData,r=this.canvasData,n={};if(this.ready&&!this.disabled&&Pe(e)){var i=!1;t.rotatable&&Te(e.rotate)&&e.rotate!==o.rotate&&(o.rotate=e.rotate,i=!0),t.scalable&&(Te(e.scaleX)&&e.scaleX!==o.scaleX&&(o.scaleX=e.scaleX,i=!0),Te(e.scaleY)&&e.scaleY!==o.scaleY&&(o.scaleY=e.scaleY,i=!0)),i&&this.renderCanvas(!0,!0);var a=o.width/o.naturalWidth;Te(e.x)&&(n.left=e.x*a+r.left),Te(e.y)&&(n.top=e.y*a+r.top),Te(e.width)&&(n.width=e.width*a),Te(e.height)&&(n.height=e.height*a),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?Ne({},this.containerData):{}},getImageData:function(){return this.sized?Ne({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&Me(["left","top","width","height","naturalWidth","naturalHeight"],function(o){t[o]=e[o]}),t},setCanvasData:function(e){var t=this.canvasData,o=t.aspectRatio;return this.ready&&!this.disabled&&Pe(e)&&(Te(e.left)&&(t.left=e.left),Te(e.top)&&(t.top=e.top),Te(e.width)?(t.width=e.width,t.height=e.width/o):Te(e.height)&&(t.height=e.height,t.width=e.height*o),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,o,r=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&Pe(e)&&(Te(e.left)&&(r.left=e.left),Te(e.top)&&(r.top=e.top),Te(e.width)&&e.width!==r.width&&(t=!0,r.width=e.width),Te(e.height)&&e.height!==r.height&&(o=!0,r.height=e.height),n&&(t?r.height=r.width/n:o&&(r.width=r.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,o=function(e,t,o,r){var n=t.aspectRatio,i=t.naturalWidth,a=t.naturalHeight,s=t.rotate,c=void 0===s?0:s,l=t.scaleX,u=void 0===l?1:l,d=t.scaleY,h=void 0===d?1:d,p=o.aspectRatio,f=o.naturalWidth,g=o.naturalHeight,m=r.fillColor,y=void 0===m?"transparent":m,v=r.imageSmoothingEnabled,k=void 0===v||v,b=r.imageSmoothingQuality,C=void 0===b?"low":b,x=r.maxWidth,w=void 0===x?1/0:x,S=r.maxHeight,R=void 0===S?1/0:S,T=r.minWidth,B=void 0===T?0:T,A=r.minHeight,E=void 0===A?0:A,P=document.createElement("canvas"),I=P.getContext("2d"),j=at({aspectRatio:p,width:w,height:R}),D=at({aspectRatio:p,width:B,height:E},"cover"),M=Math.min(j.width,Math.max(D.width,f)),N=Math.min(j.height,Math.max(D.height,g)),U=at({aspectRatio:n,width:w,height:R}),L=at({aspectRatio:n,width:B,height:E},"cover"),_=Math.min(U.width,Math.max(L.width,i)),H=Math.min(U.height,Math.max(L.height,a)),K=[-_/2,-H/2,_,H];return P.width=Le(M),P.height=Le(N),I.fillStyle=y,I.fillRect(0,0,M,N),I.save(),I.translate(M/2,N/2),I.rotate(c*Math.PI/180),I.scale(u,h),I.imageSmoothingEnabled=k,I.imageSmoothingQuality=C,I.drawImage.apply(I,[e].concat(O(K.map(function(e){return Math.floor(Le(e))})))),I.restore(),P}(this.image,this.imageData,t,e);if(!this.cropped)return o;var r=this.getData(e.rounded),n=r.x,i=r.y,a=r.width,s=r.height,c=o.width/Math.floor(t.naturalWidth);1!==c&&(n*=c,i*=c,a*=c,s*=c);var l=a/s,u=at({aspectRatio:l,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),d=at({aspectRatio:l,width:e.minWidth||0,height:e.minHeight||0},"cover"),h=at({aspectRatio:l,width:e.width||(1!==c?o.width:a),height:e.height||(1!==c?o.height:s)}),p=h.width,f=h.height;p=Math.min(u.width,Math.max(d.width,p)),f=Math.min(u.height,Math.max(d.height,f));var g=document.createElement("canvas"),m=g.getContext("2d");g.width=Le(p),g.height=Le(f),m.fillStyle=e.fillColor||"transparent",m.fillRect(0,0,p,f);var y=e.imageSmoothingEnabled,v=void 0===y||y,k=e.imageSmoothingQuality;m.imageSmoothingEnabled=v,k&&(m.imageSmoothingQuality=k);var b,C,x,w,S,R,T=o.width,B=o.height,A=n,E=i;A<=-a||A>T?(A=0,b=0,x=0,S=0):A<=0?(x=-A,A=0,S=b=Math.min(T,a+A)):A<=T&&(x=0,S=b=Math.min(a,T-A)),b<=0||E<=-s||E>B?(E=0,C=0,w=0,R=0):E<=0?(w=-E,E=0,R=C=Math.min(B,s+E)):E<=B&&(w=0,R=C=Math.min(s,B-E));var P=[A,E,b,C];if(S>0&&R>0){var I=p/a;P.push(x*I,w*I,S*I,R*I)}return m.drawImage.apply(m,[o].concat(O(P.map(function(e){return Math.floor(Le(e))})))),g},setAspectRatio:function(e){var t=this.options;return this.disabled||Ae(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,o=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var n=e===ne,i=t.movable&&e===ie;e=n||i?e:ae,t.dragMode=e,We(o,oe,e),ze(o,$,n),ze(o,te,i),t.cropBoxMovable||(We(r,oe,e),ze(r,$,n),ze(r,te,i))}return this}},mt=j.Cropper,yt=e("C",function(){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t||!we.test(t.tagName))throw new Error("The first argument is required and must be an or element.");this.element=t,this.options=Ne({},Se,Pe(o)&&o),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return t=e,o=[{key:"init",value:function(){var e,t=this.element,o=t.tagName.toLowerCase();if(!t[N]){if(t[N]=this,"img"===o){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===o&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var o=this.element,r=this.options;if(r.rotatable||r.scalable||(r.checkOrientation=!1),r.checkOrientation&&window.ArrayBuffer)if(Ce.test(e))xe.test(e)?this.read((n=e.replace(ct,""),i=atob(n),a=new ArrayBuffer(i.length),Me(s=new Uint8Array(a),function(e,t){s[t]=i.charCodeAt(t)}),a)):this.clone();else{var n,i,a,s,c=new XMLHttpRequest,l=this.clone.bind(this);this.reloading=!0,this.xhr=c,c.onabort=l,c.onerror=l,c.ontimeout=l,c.onprogress=function(){c.getResponseHeader("content-type")!==ke&&c.abort()},c.onload=function(){t.read(c.response)},c.onloadend=function(){t.reloading=!1,t.xhr=null},r.checkCrossOrigin&&ot(e)&&o.crossOrigin&&(e=rt(e)),c.open("GET",e,!0),c.responseType="arraybuffer",c.withCredentials="use-credentials"===o.crossOrigin,c.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,o=this.imageData,r=lt(e),n=0,i=1,a=1;if(r>1){this.url=function(e,t){for(var o=[],r=new Uint8Array(e);r.length>0;)o.push(st.apply(null,De(r.subarray(0,8192)))),r=r.subarray(8192);return"data:".concat(t,";base64,").concat(btoa(o.join("")))}(e,ke);var s=function(e){var t=0,o=1,r=1;switch(e){case 2:o=-1;break;case 3:t=-180;break;case 4:r=-1;break;case 5:t=90,r=-1;break;case 6:t=90;break;case 7:t=90,o=-1;break;case 8:t=-90}return{rotate:t,scaleX:o,scaleY:r}}(r);n=s.rotate,i=s.scaleX,a=s.scaleY}t.rotatable&&(o.rotate=n),t.scalable&&(o.scaleX=i,o.scaleY=a),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,o=e.crossOrigin,r=t;this.options.checkCrossOrigin&&ot(t)&&(o||(o="anonymous"),r=rt(t)),this.crossOrigin=o,this.crossOriginUrl=r;var n=document.createElement("img");o&&(n.crossOrigin=o),n.src=r||t,n.alt=e.alt||"The image to crop",this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),Ke(n,J),e.parentNode.insertBefore(n,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var o=j.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(j.navigator.userAgent),r=function(t,o){Ne(e.imageData,{naturalWidth:t,naturalHeight:o,aspectRatio:t/o}),e.initialImageData=Ne({},e.imageData),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||o){var n=document.createElement("img"),i=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){r(n.width,n.height),o||i.removeChild(n)},n.src=t.src,o||(n.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",i.appendChild(n))}else r(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,o=this.image,r=e.parentNode,n=document.createElement("div");n.innerHTML='
';var i=n.querySelector(".".concat(N,"-container")),a=i.querySelector(".".concat(N,"-canvas")),s=i.querySelector(".".concat(N,"-drag-box")),c=i.querySelector(".".concat(N,"-crop-box")),l=c.querySelector(".".concat(N,"-face"));this.container=r,this.cropper=i,this.canvas=a,this.dragBox=s,this.cropBox=c,this.viewBox=i.querySelector(".".concat(N,"-view-box")),this.face=l,a.appendChild(o),Ke(e,Q),r.insertBefore(i,e.nextSibling),Fe(o,J),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,Ke(c,Q),t.guides||Ke(c.getElementsByClassName("".concat(N,"-dashed")),Q),t.center||Ke(c.getElementsByClassName("".concat(N,"-center")),Q),t.background&&Ke(i,"".concat(N,"-bg")),t.highlight||Ke(l,Z),t.cropBoxMovable&&(Ke(l,te),We(l,oe,U)),t.cropBoxResizable||(Ke(c.getElementsByClassName("".concat(N,"-line")),Q),Ke(c.getElementsByClassName("".concat(N,"-point")),Q)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),Ie(t.ready)&&Qe(e,ge,t.ready,{once:!0}),Je(e,ge)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var e=this.cropper.parentNode;e&&e.removeChild(this.cropper),Fe(this.element,Q)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],r=[{key:"noConflict",value:function(){return window.Cropper=mt,e}},{key:"setDefaults",value:function(e){Ne(Se,Pe(e)&&e)}}],o&&E(t.prototype,o),r&&E(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,o,r}());Ne(yt.prototype,ut,dt,ht,pt,ft,gt);const vt=n({name:"copper-image",emits:["close","cropperNo","cropperOk"],setup(e,{emit:t,expose:o}){const r=i({visible:!1,img:null,confirmLoading:!1,options:{img:"",autoCrop:!0,autoCropWidth:180,autoCropHeight:180,fixedBox:!0,full:!1,enlarge:1,previewsCircle:!0,centerBox:!0,outputType:"png",title:"修改头像",name:null},previews:{},url:{upload:"/sys/common/saveToImgByStr"},myCropper:null}),n=a(),f=()=>{r.myCropper=new yt(n.value,{viewMode:1,dragMode:"move",aspectRatio:r.options.autoCropWidth/r.options.autoCropHeight,initialAspectRatio:1,autoCropArea:1,cropBoxMovable:!0,cropBoxResizable:!1,background:!0,movable:!0,modal:!0,preview:".before"})},g=e=>{switch(e){case"left":r.myCropper.rotate(90);break;case"right":r.myCropper.rotate(-90);break;case"zoomIn":r.myCropper.zoom(.1);break;case"zoomOut":r.myCropper.zoom(-.1)}},m=()=>{r.confirmLoading=!0,r.myCropper.getCroppedCanvas({imageSmoothingQuality:"high"}).toBlob(e=>{console.log(e,"1212"),t("cropperOk",e),r.confirmLoading=!1})};return o({edit:e=>{const{options:t}=r;r.visible=!0,r.options=Object.assign({},t,e),p(()=>{f()})}}),()=>s("div",null,[s(c,{cols:2,xGap:24,style:{paddingTop:"12px"}},{default:()=>[s(l,null,{default:()=>[s("div",{style:"width: 100%; height: 300px"},[r.options?.img&&s("img",{ref:n,src:r.options?.img,alt:""},null)]),s(u,{justify:"center",style:{paddingTop:"12px"}},{default:()=>[s(d,{type:"primary",size:"small",onClick:()=>g("left")},{default:()=>[h("逆时针旋转")]}),s(d,{type:"primary",size:"small",onClick:()=>g("right")},{default:()=>[h("顺时针旋转")]}),s(d,{type:"primary",size:"small",onClick:()=>g("zoomIn")},{default:()=>[h("放大")]}),s(d,{type:"primary",size:"small",onClick:()=>g("zoomOut")},{default:()=>[h("缩小")]})]})]}),s(l,null,{default:()=>[s("span",{style:{fontSize:"15px",fontWeight:600,paddingBottom:"8px",display:"inline-block"}},[h("预览图片")]),s("div",{class:"before",style:{width:r.options.autoCropWidth+"px",height:r.options.autoCropHeight+"px",overflow:"hidden"}},null)]})]}),s(u,{justify:"end"},{default:()=>[s(d,{type:"default",onClick:()=>{r.confirmLoading=!1,t("close"),t("cropperNo")}},{default:()=>[h("取消")]}),s(d,{type:"primary",loading:r.confirmLoading,onClick:m},{default:()=>[h("确认")]})]})])}});e("U",n({name:"upload-file",props:{fileList:{type:String,default:""},imageList:{type:Array,default:()=>[]},accept:{type:String,default:".jpg,.png,.jpeg,.gif"},listType:{type:String,default:"image-card"},showType:{type:String,default:"default"},showFileList:{type:Boolean,default:!0},text:{type:String,default:"上传文件"},size:{type:Number,default:5},max:{type:Number,default:1},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tips:{type:String,default:""},bucketName:{type:String,default:"gyt"},path:{type:String,default:""},fileName:{type:String,default:""},cropper:{type:Boolean,default:!1},options:{type:Object,default:()=>({viewMode:0,autoCrop:!0,enlarge:1,autoCropWidth:200,autoCropHeight:200,fixedBox:!1,previewsCircle:!0,title:"上传图片"})}},emits:["update:fileList","close","readFileInputEventAsArrayBuffer","remove"],setup(e,{emit:t,expose:o,slots:r}){const n=`https://${e.bucketName}.ks3-cn-beijing.ksyuncs.com/`,c=f(),l=a(!1),u=a(!1);a();const h=a(),p=i([]),k=a([]),b=()=>{if(e.fileList){const t=e.fileList.split("/");k.value=[{id:(new Date).getTime().toString(),name:t[t.length-1],status:"finished",url:e.fileList}]}else if(Array.isArray(e.imageList)){const t=[];e.imageList.forEach(e=>{const o=e.split("/");t.push({id:Date.now().toString(),name:o[o.length-1],status:"finished",url:e})}),k.value=t}else k.value=[]};b(),g(()=>e.imageList,()=>{b()}),g(()=>e.fileList,()=>{b()}),o({handleClearFile:()=>{h.value?.clear(),console.log("清空",h.value)}});const C=a(),R=async(e,t)=>{const o=new FileReader;o.addEventListener("load",()=>t(o.result)),o.readAsDataURL(e)},T=({file:e,action:t,onFinish:o,onError:r,onProgress:n})=>{const i=p.find(t=>t.id==e.id);i.file=e,w({file:e,action:t,data:i,onProgress:n,onFinish:o,onError:r})},B=async o=>{try{const r=`${e.path}${e.fileName||(new Date).getTime()+".png"}`,i={filename:r,bucketName:e.bucketName,postData:{filename:r,acl:"public-read",key:r,unknowValueField:[]}},{data:a}=await x(i),s={policy:a.policy,signature:a.signature,acl:"public-read",key:r,KSSAccessKeyId:a.kssAccessKeyId,name:r,file:o},c=await S(n,s);console.log(c,"upload"),t("update:fileList",c),l.value=!1}catch{return!1}};return()=>s("div",null,[s(m,{ref:h,action:n,customRequest:T,fileList:k.value,"onUpdate:fileList":e=>k.value=e,listType:e.listType,accept:e.accept,multiple:e.multiple,max:e.max,disabled:e.disabled,showFileList:e.showFileList,showPreviewButton:!0,onBeforeUpload:t=>(async t=>{const o=t.file;let r=!0;if(e.size&&(r=o.file.size/1024/1024{const r=Object.assign({},e.options,{img:t,name:o.file.name});l.value=!0,setTimeout(()=>{C.value?.edit(r),console.log(C.value,"cropper")},100)}),!1;try{u.value=!0,console.log(e.path,o.file);const t=o.file.name,r=t.slice(t.lastIndexOf(".")),n=`${e.path}${e.fileName||Date.now()+r}`,i={filename:n,bucketName:e.bucketName,postData:{filename:n,acl:"public-read",key:n,unknowValueField:[]}},{data:a}=await x(i);p.push({id:o.id,tempFiileBuffer:o.file,policy:a.policy,signature:a.signature,acl:"public-read",key:n,KSSAccessKeyId:a.kssAccessKeyId,name:n})}catch{return u.value=!1,!1}return!0})(t),onFinish:e=>(e=>{const o=p.find(t=>t.id==e.file.id);t("update:fileList",e.file.url),t("readFileInputEventAsArrayBuffer",o.tempFiileBuffer),l.value=!1,u.value=!1})(e),onRemove:e=>(async e=>{console.log("🚀 ~ options",e),t("update:fileList",""),t("remove"),u.value=!1})(e)},{default:()=>["default"===e.showType&&"image"===e.listType&&s(d,{loading:u.value,type:"primary"},{default:()=>[e.text]}),"custom"===e.showType&&r.custom&&r.custom()]}),e.tips&&s("p",{style:"font-size: 13px; color: #666; padding-top: 4px;"},[e.tips]),s(y,{maskClosable:v,show:l.value,"onUpdate:show":e=>l.value=e,preset:"dialog",showIcon:!1,class:["modalTitle background"],title:"上传图片",style:{width:"800px"}},{default:()=>[s(vt,{ref:C,onClose:()=>l.value=!1,onCropperOk:B},null)]})])}}))}}});