index-ff431115-1734950731618.js 243 KB

123456789
  1. import{bb as commonjsGlobal,bc as getDefaultExportFromCjs,H as request,d as defineComponent,e as reactive,r as ref,f as createVNode,aB as NGrid,aC as NGi,x as NSpace,j as NButton,k as createTextVNode,S as nextTick,b as useMessage,A as watch,O as NUpload,l as NModal,m as modalClickMask}from"./index-efb66432-1734950731618.js";var cosJsSdkV5={exports:{}};(function(module,exports){(function(n,e){module.exports=e()})(commonjsGlobal,function(){return function(o){var n={};function e(t){if(n[t])return n[t].exports;var l=n[t]={i:t,l:!1,exports:{}};return o[t].call(l.exports,l,l.exports,e),l.l=!0,l.exports}return e.m=o,e.c=n,e.d=function(t,l,r){e.o(t,l)||Object.defineProperty(t,l,{enumerable:!0,get:r})},e.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,l){if(l&1&&(t=e(t)),l&8||l&4&&typeof t=="object"&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),l&2&&typeof t!="string")for(var u in t)e.d(r,u,(function(T){return t[T]}).bind(null,u));return r},e.n=function(t){var l=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(l,"a",l),l},e.o=function(t,l){return Object.prototype.hasOwnProperty.call(t,l)},e.p="/dist/",e(e.s="./index.js")}({"./index.js":function(o,n,e){var t=e("./src/cos.js");o.exports=t},"./lib/base64.js":function(o,n){var e=function(t){t=t||{};var l=t.Base64,r="2.1.9",u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=function(H){for(var K={},_=0,V=H.length;_<V;_++)K[H.charAt(_)]=_;return K}(u),w=String.fromCharCode,x=function(K){if(K.length<2){var _=K.charCodeAt(0);return _<128?K:_<2048?w(192|_>>>6)+w(128|_&63):w(224|_>>>12&15)+w(128|_>>>6&63)+w(128|_&63)}else{var _=65536+(K.charCodeAt(0)-55296)*1024+(K.charCodeAt(1)-56320);return w(240|_>>>18&7)+w(128|_>>>12&63)+w(128|_>>>6&63)+w(128|_&63)}},S=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,A=function(K){return K.replace(S,x)},D=function(K){var _=[0,2,1][K.length%3],V=K.charCodeAt(0)<<16|(K.length>1?K.charCodeAt(1):0)<<8|(K.length>2?K.charCodeAt(2):0),X=[u.charAt(V>>>18),u.charAt(V>>>12&63),_>=2?"=":u.charAt(V>>>6&63),_>=1?"=":u.charAt(V&63)];return X.join("")},z=t.btoa?function(H){return t.btoa(H)}:function(H){return H.replace(/[\s\S]{1,3}/g,D)},P=function(H){return z(A(H))},L=function(K,_){return _?P(String(K)).replace(/[+\/]/g,function(V){return V=="+"?"-":"_"}).replace(/=/g,""):P(String(K))},Y=function(K){return L(K,!0)},W=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),ie=function(K){switch(K.length){case 4:var _=(7&K.charCodeAt(0))<<18|(63&K.charCodeAt(1))<<12|(63&K.charCodeAt(2))<<6|63&K.charCodeAt(3),V=_-65536;return w((V>>>10)+55296)+w((V&1023)+56320);case 3:return w((15&K.charCodeAt(0))<<12|(63&K.charCodeAt(1))<<6|63&K.charCodeAt(2));default:return w((31&K.charCodeAt(0))<<6|63&K.charCodeAt(1))}},B=function(K){return K.replace(W,ie)},E=function(K){var _=K.length,V=_%4,X=(_>0?T[K.charAt(0)]<<18:0)|(_>1?T[K.charAt(1)]<<12:0)|(_>2?T[K.charAt(2)]<<6:0)|(_>3?T[K.charAt(3)]:0),G=[w(X>>>16),w(X>>>8&255),w(X&255)];return G.length-=[0,0,2,1][V],G.join("")},C=t.atob?function(H){return t.atob(H)}:function(H){return H.replace(/[\s\S]{1,4}/g,E)},k=function(H){return B(C(H))},g=function(K){return k(String(K).replace(/[-_]/g,function(_){return _=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},U=function(){var K=t.Base64;return t.Base64=l,K},F={VERSION:r,atob:C,btoa:z,fromBase64:g,toBase64:L,utob:A,encode:L,encodeURI:Y,btou:B,decode:g,noConflict:U};return F}();o.exports=e},"./lib/beacon.min.js":function(o,n,e){var t,l,r=e("./node_modules/@babel/runtime/helpers/typeof.js");(function(u,T){r(n)=="object"&&typeof o<"u"?o.exports=T():(t=T,l=typeof t=="function"?t.call(n,e,n,o):t,l!==void 0&&(o.exports=l))})(this,function(){var u=function(c,a){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,m){d.__proto__=m}||function(d,m){for(var I in m)Object.prototype.hasOwnProperty.call(m,I)&&(d[I]=m[I])},u(c,a)},T=function(){return T=Object.assign||function(c){for(var a,d=1,m=arguments.length;d<m;d++)for(var I in a=arguments[d])Object.prototype.hasOwnProperty.call(a,I)&&(c[I]=a[I]);return c},T.apply(this,arguments)};function w(h,c,a,d){return new(a||(a=Promise))(function(m,I){function M(he){try{de(d.next(he))}catch(J){I(J)}}function Q(he){try{de(d.throw(he))}catch(J){I(J)}}function de(he){var J;he.done?m(he.value):(J=he.value,J instanceof a?J:new a(function(xe){xe(J)})).then(M,Q)}de((d=d.apply(h,c||[])).next())})}function x(h,c){var a,d,m,I,M={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return I={next:Q(0),throw:Q(1),return:Q(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function Q(de){return function(he){return function(J){if(a)throw new TypeError("Generator is already executing.");for(;M;)try{if(a=1,d&&(m=2&J[0]?d.return:J[0]?d.throw||((m=d.return)&&m.call(d),0):d.next)&&!(m=m.call(d,J[1])).done)return m;switch(d=0,m&&(J=[2&J[0],m.value]),J[0]){case 0:case 1:m=J;break;case 4:return M.label++,{value:J[1],done:!1};case 5:M.label++,d=J[1],J=[0];continue;case 7:J=M.ops.pop(),M.trys.pop();continue;default:if(m=M.trys,!((m=m.length>0&&m[m.length-1])||J[0]!==6&&J[0]!==2)){M=0;continue}if(J[0]===3&&(!m||J[1]>m[0]&&J[1]<m[3])){M.label=J[1];break}if(J[0]===6&&M.label<m[1]){M.label=m[1],m=J;break}if(m&&M.label<m[2]){M.label=m[2],M.ops.push(J);break}m[2]&&M.ops.pop(),M.trys.pop();continue}J=c.call(h,M)}catch(xe){J=[6,xe],d=0}finally{a=m=0}if(5&J[0])throw J[1];return{value:J[0]?J[1]:void 0,done:!0}}([de,he])}}}var S="__BEACON_",A="__BEACON_deviceId",D="last_report_time",z="sending_event_ids",P="beacon_config",L="beacon_config_request_time",Y=function(){function h(){var c=this;this.emit=function(a,d){if(c){var m,I=c.__EventsList[a];if(I!=null&&I.length){I=I.slice();for(var M=0;M<I.length;M++){m=I[M];try{var Q=m.callback.apply(c,[d]);if(m.type===1&&c.remove(a,m.callback),Q===!1)break}catch(de){throw de}}}return c}},this.__EventsList={}}return h.prototype.indexOf=function(c,a){for(var d=0;d<c.length;d++)if(c[d].callback===a)return d;return-1},h.prototype.on=function(c,a,d){if(d===void 0&&(d=0),this){var m=this.__EventsList[c];if(m||(m=this.__EventsList[c]=[]),this.indexOf(m,a)===-1){var I={name:c,type:d||0,callback:a};return m.push(I),this}return this}},h.prototype.one=function(c,a){this.on(c,a,1)},h.prototype.remove=function(c,a){if(this){var d=this.__EventsList[c];if(!d)return null;if(!a){try{delete this.__EventsList[c]}catch(I){}return null}if(d.length){var m=this.indexOf(d,a);d.splice(m,1)}return this}},h}();function W(h,c){for(var a={},d=0,m=Object.keys(h);d<m.length;d++){var I=m[d],M=h[I];if(typeof M=="string")a[ie(I)]=ie(M);else{if(c)throw new Error("value mast be string !!!!");a[ie(String(I))]=ie(String(M))}}return a}function ie(h){if(typeof h!="string")return h;try{return h.replace(new RegExp("\\|","g"),"%7C").replace(new RegExp("\\&","g"),"%26").replace(new RegExp("\\=","g"),"%3D").replace(new RegExp("\\+","g"),"%2B")}catch(c){return""}}function B(h){return String(h.A99)+String(h.A100)}var E=function(){},C=function(){function h(c){var a=this;this.lifeCycle=new Y,this.uploadJobQueue=[],this.additionalParams={},this.delayTime=0,this._normalLogPipeline=function(d){if(!d||!d.reduce||!d.length)throw new TypeError("createPipeline 方法需要传入至少有一个 pipe 的数组");return d.length===1?function(m,I){d[0](m,I||E)}:d.reduce(function(m,I){return function(M,Q){return Q===void 0&&(Q=E),m(M,function(de){return I==null?void 0:I(de,Q)})}})}([function(d){a.send({url:a.strategy.getUploadUrl(),data:d,method:"post",contentType:"application/json;charset=UTF-8"},function(){var m=a.config.onReportSuccess;typeof m=="function"&&m(JSON.stringify(d.events))},function(){var m=a.config.onReportFail;typeof m=="function"&&m(JSON.stringify(d.events))})}]),function(d,m){if(!d)throw m instanceof Error?m:new Error(m)}(!!c.appkey,"appkey must be initial"),this.config=T({},c)}return h.prototype.onUserAction=function(c,a){this.preReport(c,a,!1)},h.prototype.onDirectUserAction=function(c,a){this.preReport(c,a,!0)},h.prototype.preReport=function(c,a,d){c?this.strategy.isEventUpOnOff()&&(this.strategy.isBlackEvent(c)||this.strategy.isSampleEvent(c)||this.onReport(c,a,d)):this.errorReport.reportError("602"," no eventCode")},h.prototype.addAdditionalParams=function(c){for(var a=0,d=Object.keys(c);a<d.length;a++){var m=d[a];this.additionalParams[m]=c[m]}},h.prototype.setChannelId=function(c){this.commonInfo.channelID=String(c)},h.prototype.setOpenId=function(c){this.commonInfo.openid=String(c)},h.prototype.setUnionid=function(c){this.commonInfo.unid=String(c)},h.prototype.getDeviceId=function(){return this.commonInfo.deviceId},h.prototype.getCommonInfo=function(){return this.commonInfo},h.prototype.removeSendingId=function(c){try{var a=JSON.parse(this.storage.getItem(z)),d=a.indexOf(c);d!=-1&&(a.splice(d,1),this.storage.setItem(z,JSON.stringify(a)))}catch(m){}},h}(),k=function(){function h(c,a,d,m){this.requestParams={},this.network=m,this.requestParams.attaid="00400014144",this.requestParams.token="6478159937",this.requestParams.product_id=c.appkey,this.requestParams.platform=d,this.requestParams.uin=a.deviceId,this.requestParams.model="",this.requestParams.os=d,this.requestParams.app_version=c.appVersion,this.requestParams.sdk_version=a.sdkVersion,this.requestParams.error_stack="",this.uploadUrl=c.isOversea?"https://htrace.wetvinfo.com/kv":"https://h.trace.qq.com/kv"}return h.prototype.reportError=function(c,a){this.requestParams._dc=Math.random(),this.requestParams.error_msg=a,this.requestParams.error_code=c,this.network.get(this.uploadUrl,{params:this.requestParams}).catch(function(d){})},h}(),g=function(){function h(c,a,d,m,I){this.strategy={isEventUpOnOff:!0,httpsUploadUrl:"https://otheve.beacon.qq.com/analytics/v2_upload",requestInterval:30,blacklist:[],samplelist:[]},this.realSample={},this.appkey="",this.needQueryConfig=!0,this.appkey=a.appkey,this.storage=m,this.needQueryConfig=c;try{var M=JSON.parse(this.storage.getItem(P));M&&this.processData(M)}catch(Q){}a.isOversea&&(this.strategy.httpsUploadUrl="https://svibeacon.onezapp.com/analytics/v2_upload"),!a.isOversea&&this.needRequestConfig()&&this.requestConfig(a.appVersion,d,I)}return h.prototype.requestConfig=function(c,a,d){var m=this;this.storage.setItem(L,Date.now().toString()),d.post("https://oth.str.beacon.qq.com/trpc.beacon.configserver.BeaconConfigService/QueryConfig",{platformId:typeof wx>"u"?"3":"4",mainAppKey:this.appkey,appVersion:c,sdkVersion:a.sdkVersion,osVersion:a.userAgent,model:"",packageName:"",params:{A3:a.deviceId}}).then(function(I){if(I.data.ret==0)try{var M=JSON.parse(I.data.beaconConfig);M&&(m.processData(M),m.storage.setItem(P,I.data.beaconConfig))}catch(Q){}else m.processData(null),m.storage.setItem(P,"")}).catch(function(I){})},h.prototype.processData=function(c){var a,d,m,I,M;this.strategy.isEventUpOnOff=(a=c==null?void 0:c.isEventUpOnOff)!==null&&a!==void 0?a:this.strategy.isEventUpOnOff,this.strategy.httpsUploadUrl=(d=c==null?void 0:c.httpsUploadUrl)!==null&&d!==void 0?d:this.strategy.httpsUploadUrl,this.strategy.requestInterval=(m=c==null?void 0:c.requestInterval)!==null&&m!==void 0?m:this.strategy.requestInterval,this.strategy.blacklist=(I=c==null?void 0:c.blacklist)!==null&&I!==void 0?I:this.strategy.blacklist,this.strategy.samplelist=(M=c==null?void 0:c.samplelist)!==null&&M!==void 0?M:this.strategy.samplelist;for(var Q=0,de=this.strategy.samplelist;Q<de.length;Q++){var he=de[Q].split(",");he.length==2&&(this.realSample[he[0]]=he[1])}},h.prototype.needRequestConfig=function(){if(!this.needQueryConfig)return!1;var c=Number(this.storage.getItem(L));return Date.now()-c>60*this.strategy.requestInterval*1e3},h.prototype.getUploadUrl=function(){return this.strategy.httpsUploadUrl+"?appkey="+this.appkey},h.prototype.isBlackEvent=function(c){return this.strategy.blacklist.indexOf(c)!=-1},h.prototype.isEventUpOnOff=function(){return this.strategy.isEventUpOnOff},h.prototype.isSampleEvent=function(c){return!!Object.prototype.hasOwnProperty.call(this.realSample,c)&&this.realSample[c]<Math.floor(Math.random()*Math.floor(1e4))},h}(),U="session_storage_key",F=function(){function h(c,a,d){this.getSessionStackDepth=0,this.beacon=d,this.storage=c,this.duration=a,this.appkey=d.config.appkey}return h.prototype.getSession=function(){this.getSessionStackDepth+=1;var c=this.storage.getItem(U);if(!c)return this.createSession();var a="",d=0;try{var m=JSON.parse(c)||{sessionId:void 0,sessionStart:void 0};if(!m.sessionId||!m.sessionStart)return this.createSession();var I=Number(this.storage.getItem(D));if(Date.now()-I>this.duration)return this.createSession();a=m.sessionId,d=m.sessionStart,this.getSessionStackDepth=0}catch(M){}return{sessionId:a,sessionStart:d}},h.prototype.createSession=function(){var c=Date.now(),a={sessionId:this.appkey+"_"+c.toString(),sessionStart:c};this.storage.setItem(U,JSON.stringify(a)),this.storage.setItem(D,c.toString());var d="is_new_user",m=this.storage.getItem(d);return this.getSessionStackDepth<=1&&this.beacon.onDirectUserAction("rqd_applaunched",{A21:m?"N":"Y"}),this.storage.setItem(d,JSON.stringify(!1)),a},h}();function H(){var h=navigator.userAgent,c=h.indexOf("compatible")>-1&&h.indexOf("MSIE")>-1,a=h.indexOf("Edge")>-1&&!c,d=h.indexOf("Trident")>-1&&h.indexOf("rv:11.0")>-1;if(c){new RegExp("MSIE (\\d+\\.\\d+);").test(h);var m=parseFloat(RegExp.$1);return m==7?7:m==8?8:m==9?9:m==10?10:6}return a?-2:d?11:-1}function K(h,c){var a,d;return(a="https://tun-cos-1258344701.file.myqcloud.com/fp.js",d===void 0&&(d=Date.now()+"-"+Math.random()),new Promise(function(m,I){if(document.getElementById(d))m(void 0);else{var M=document.getElementsByTagName("head")[0],Q=document.createElement("script");Q.onload=function(){return function(){Q.onload=null,m(void 0)}},Q.onerror=function(de){Q.onerror=null,M.removeChild(Q),I(de)},Q.src=a,Q.id=d,M.appendChild(Q)}})).then(function(){new Fingerprint().getQimei36(h,c)}).catch(function(m){}),""}var _=function(){return(_=Object.assign||function(c){for(var a,d=1,m=arguments.length;d<m;d++)for(var I in a=arguments[d])Object.prototype.hasOwnProperty.call(a,I)&&(c[I]=a[I]);return c}).apply(this,arguments)},V,X=function(){function h(c,a){a===void 0&&(a={}),this.reportOptions={},this.config=c,this.reportOptions=a}return h.canUseDB=function(){return!!(window!=null&&window.indexedDB)},h.prototype.openDB=function(){var c=this;return new Promise(function(a,d){if(!h.canUseDB())return d({message:"当前不支持 indexeddb"});var m=c.config,I=m.name,M=m.version,Q=m.stores,de=indexedDB.open(I,M);de.onsuccess=function(){c.db=de.result,a(),_({result:1,func:"open",params:JSON.stringify(c.config)},c.reportOptions)},de.onerror=function(he){var J,xe;d(he),_({result:0,func:"open",params:JSON.stringify(c.config),error_msg:(xe=(J=he.target)===null||J===void 0?void 0:J.error)===null||xe===void 0?void 0:xe.message},c.reportOptions)},de.onupgradeneeded=function(){c.db=de.result;try{Q==null||Q.forEach(function(he){c.createStore(he)})}catch(he){_({result:0,func:"open",params:JSON.stringify(c.config),error_msg:he.message},c.reportOptions),d(he)}}})},h.prototype.useStore=function(c){return this.storeName=c,this},h.prototype.deleteDB=function(){var c=this;return this.closeDB(),new Promise(function(a,d){var m=indexedDB.deleteDatabase(c.config.name);m.onsuccess=function(){return a()},m.onerror=d})},h.prototype.closeDB=function(){var c;(c=this.db)===null||c===void 0||c.close(),this.db=null},h.prototype.getStoreCount=function(){var c=this;return new Promise(function(a,d){var m=c.getStore("readonly").count();m.onsuccess=function(){return a(m.result)},m.onerror=d})},h.prototype.clearStore=function(){var c=this;return new Promise(function(a,d){var m=c.getStore("readwrite").clear();m.onsuccess=function(){return a()},m.onerror=d})},h.prototype.add=function(c,a){var d=this;return new Promise(function(m,I){var M=d.getStore("readwrite").add(c,a);M.onsuccess=function(){m(M.result)},M.onerror=I})},h.prototype.put=function(c,a){var d=this;return new Promise(function(m,I){var M=d.getStore("readwrite").put(c,a);M.onsuccess=function(){m(M.result)},M.onerror=I})},h.prototype.getStoreAllData=function(){var c=this;return new Promise(function(a,d){var m=c.getStore("readonly").openCursor(),I=[];m.onsuccess=function(){var M;if(!((M=m.result)===null||M===void 0)&&M.value){var Q=m.result.value;I.push(Q),m.result.continue()}else a(I)},m.onerror=d})},h.prototype.getDataRangeByIndex=function(c,a,d,m,I){var M=this;return new Promise(function(Q,de){var he=M.getStore().index(c),J=IDBKeyRange.bound(a,d,m,I),xe=[],Be=he.openCursor(J);Be.onsuccess=function(){var Ue;!((Ue=Be==null?void 0:Be.result)===null||Ue===void 0)&&Ue.value?(xe.push(Be==null?void 0:Be.result.value),Be==null||Be.result.continue()):Q(xe)},Be.onerror=de})},h.prototype.removeDataByIndex=function(c,a,d,m,I){var M=this;return new Promise(function(Q,de){var he=M.getStore("readwrite").index(c),J=IDBKeyRange.bound(a,d,m,I),xe=he.openCursor(J),Be=0;xe.onsuccess=function(Ue){var _e=Ue.target.result;_e?(Be+=1,_e.delete(),_e.continue()):Q(Be)},xe.onerror=de})},h.prototype.createStore=function(c){var a=c.name,d=c.indexes,m=d===void 0?[]:d,I=c.options;if(this.db){this.db.objectStoreNames.contains(a)&&this.db.deleteObjectStore(a);var M=this.db.createObjectStore(a,I);m.forEach(function(Q){M.createIndex(Q.indexName,Q.keyPath,Q.options)})}},h.prototype.getStore=function(c){var a;return c===void 0&&(c="readonly"),(a=this.db)===null||a===void 0?void 0:a.transaction(this.storeName,c).objectStore(this.storeName)},h}(),G="event_table_v3",$="eventId",re=function(){function h(c){this.isReady=!1,this.taskQueue=Promise.resolve(),this.db=new X({name:"Beacon_"+c+"_V3",version:1,stores:[{name:G,options:{keyPath:$},indexes:[{indexName:$,keyPath:$,options:{unique:!0}}]}]}),this.open()}return h.prototype.getCount=function(){var c=this;return this.readyExec(function(){return c.db.getStoreCount()})},h.prototype.setItem=function(c,a){var d=this;return this.readyExec(function(){return d.db.add({eventId:c,value:a})})},h.prototype.getItem=function(c){return w(this,void 0,void 0,function(){var a=this;return x(this,function(d){return[2,this.readyExec(function(){return a.db.getDataRangeByIndex($,c,c)})]})})},h.prototype.removeItem=function(c){var a=this;return this.readyExec(function(){return a.db.removeDataByIndex($,c,c)})},h.prototype.updateItem=function(c,a){var d=this;return this.readyExec(function(){return d.db.put({eventId:c,value:a})})},h.prototype.iterate=function(c){var a=this;return this.readyExec(function(){return a.db.getStoreAllData().then(function(d){d.forEach(function(m){c(m.value)})})})},h.prototype.open=function(){return w(this,void 0,void 0,function(){var c=this;return x(this,function(a){switch(a.label){case 0:return this.taskQueue=this.taskQueue.then(function(){return c.db.openDB()}),[4,this.taskQueue];case 1:return a.sent(),this.isReady=!0,this.db.useStore(G),[2]}})})},h.prototype.readyExec=function(c){return this.isReady?c():(this.taskQueue=this.taskQueue.then(function(){return c()}),this.taskQueue)},h}(),ue=function(){function h(c){this.keyObject={},this.storage=c}return h.prototype.getCount=function(){return this.storage.getStoreCount()},h.prototype.removeItem=function(c){this.storage.removeItem(c),delete this.keyObject[c]},h.prototype.setItem=function(c,a){var d=JSON.stringify(a);this.storage.setItem(c,d),this.keyObject[c]=a},h.prototype.iterate=function(c){for(var a=Object.keys(this.keyObject),d=0;d<a.length;d++){var m=this.storage.getItem(a[d]);c(JSON.parse(m))}},h}(),oe=function(){function h(c,a){var d=this;this.dbEventCount=0,H()>0||!window.indexedDB||/X5Lite/.test(navigator.userAgent)?(this.store=new ue(a),this.dbEventCount=this.store.getCount()):(this.store=new re(c),this.getCount().then(function(m){d.dbEventCount=m}).catch(function(m){}))}return h.prototype.getCount=function(){return w(this,void 0,void 0,function(){return x(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,this.store.getCount()];case 1:return[2,c.sent()];case 2:return c.sent(),[2,Promise.reject()];case 3:return[2]}})})},h.prototype.insertEvent=function(c,a){return w(this,void 0,void 0,function(){var d,m;return x(this,function(I){switch(I.label){case 0:if(this.dbEventCount>=1e4)return[2,Promise.reject()];d=B(c.mapValue),I.label=1;case 1:return I.trys.push([1,3,,4]),this.dbEventCount++,[4,this.store.setItem(d,c)];case 2:return[2,I.sent()];case 3:return m=I.sent(),a&&a(m,c),this.dbEventCount--,[2,Promise.reject()];case 4:return[2]}})})},h.prototype.getEvents=function(){return w(this,void 0,void 0,function(){var c;return x(this,function(a){switch(a.label){case 0:c=[],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.store.iterate(function(d){c.push(d)})];case 2:return a.sent(),[2,Promise.all(c)];case 3:return a.sent(),[2,Promise.all(c)];case 4:return[2]}})})},h.prototype.removeEvent=function(c){return w(this,void 0,void 0,function(){var a;return x(this,function(d){switch(d.label){case 0:a=B(c.mapValue),d.label=1;case 1:return d.trys.push([1,3,,4]),this.dbEventCount--,[4,this.store.removeItem(a)];case 2:return[2,d.sent()];case 3:return d.sent(),this.dbEventCount++,[2,Promise.reject()];case 4:return[2]}})})},h}(),ee=function(){return(ee=Object.assign||function(c){for(var a,d=1,m=arguments.length;d<m;d++)for(var I in a=arguments[d])Object.prototype.hasOwnProperty.call(a,I)&&(c[I]=a[I]);return c}).apply(this,arguments)};function ce(h){try{return decodeURIComponent(h.replace(/\+/g," "))}catch(c){return null}}function ae(h,c){var a=[null,void 0,"",NaN].includes(h);if(c.isSkipEmpty&&a)return null;var d=!c.isSkipEmpty&&a?"":h;try{return c.encode?encodeURIComponent(d):d}catch(m){return null}}function pe(h,c){c===void 0&&(c={encode:!0,isSkipEmpty:!1});var a=h.url,d=h.query,m=d===void 0?{}:d,I=h.hash,M=a.split("#"),Q=M[0],de=M[1],he=de===void 0?"":de,J=Q.split("?")[0],xe=[],Be=ae(I||he,c),Ue=ee(ee({},function(_e){var Le=_e.split("#"),Ve=Le[0],qe=Le[1],Ge=qe===void 0?"":qe,Ke=Ve.split("?"),We=Ke[0],Xe=Ke[1],nt=Xe===void 0?"":Xe,et=ce(Ge),it=Object.create(null);return nt.split("&").forEach(function(f){var v=f.split("="),N=v[0],q=v[1],fe=q===void 0?"":q,Re=ce(N),Me=ce(fe);Re===null||Me===null||Re===""&&Me===""||it[Re]||(it[Re]=Me)}),{url:We,query:it,hash:et}}(a).query),m);return Object.keys(Ue).forEach(function(_e){var Le=ae(_e,c),Ve=ae(Ue[_e],c);Le!==null&&Ve!==null&&xe.push(Le+"="+Ve)}),J+(xe.length?"?"+xe.join("&"):"")+(Be?"#"+Be:"")}function Z(h,c){return new Promise(function(a,d){if(c&&document.querySelectorAll("script[data-tag="+c+"]").length)return a();var m=document.createElement("script"),I=ee({type:"text/javascript",charset:"utf-8"},h);Object.keys(I).forEach(function(M){return function(Q,de,he){if(Q)return he===void 0?Q.getAttribute(de):Q.setAttribute(de,he)}(m,M,I[M])}),c&&(m.dataset.tag=c),m.onload=function(){return a()},m.onreadystatechange=function(){var M=m.readyState;["complete","loaded"].includes(M)&&(m.onreadystatechange=null,a())},m.onerror=d,document.body.appendChild(m)})}(function(h){h[h.equal=0]="equal",h[h.low=-1]="low",h[h.high=1]="high"})(V||(V={}));var ne=function(){return(ne=Object.assign||function(c){for(var a,d=1,m=arguments.length;d<m;d++)for(var I in a=arguments[d])Object.prototype.hasOwnProperty.call(a,I)&&(c[I]=a[I]);return c}).apply(this,arguments)};function ge(h,c,a,d){return new(a||(a=Promise))(function(m,I){function M(he){try{de(d.next(he))}catch(J){I(J)}}function Q(he){try{de(d.throw(he))}catch(J){I(J)}}function de(he){var J;he.done?m(he.value):(J=he.value,J instanceof a?J:new a(function(xe){xe(J)})).then(M,Q)}de((d=d.apply(h,c||[])).next())})}function me(h,c){var a,d,m,I,M={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return I={next:Q(0),throw:Q(1),return:Q(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function Q(de){return function(he){return function(J){if(a)throw new TypeError("Generator is already executing.");for(;M;)try{if(a=1,d&&(m=2&J[0]?d.return:J[0]?d.throw||((m=d.return)&&m.call(d),0):d.next)&&!(m=m.call(d,J[1])).done)return m;switch(d=0,m&&(J=[2&J[0],m.value]),J[0]){case 0:case 1:m=J;break;case 4:return M.label++,{value:J[1],done:!1};case 5:M.label++,d=J[1],J=[0];continue;case 7:J=M.ops.pop(),M.trys.pop();continue;default:if(!((m=(m=M.trys).length>0&&m[m.length-1])||J[0]!==6&&J[0]!==2)){M=0;continue}if(J[0]===3&&(!m||J[1]>m[0]&&J[1]<m[3])){M.label=J[1];break}if(J[0]===6&&M.label<m[1]){M.label=m[1],m=J;break}if(m&&M.label<m[2]){M.label=m[2],M.ops.push(J);break}m[2]&&M.ops.pop(),M.trys.pop();continue}J=c.call(h,M)}catch(xe){J=[6,xe],d=0}finally{a=m=0}if(5&J[0])throw J[1];return{value:J[0]?J[1]:void 0,done:!0}}([de,he])}}}var ve=function(){function h(){this.interceptors=[]}return h.prototype.use=function(c,a){return this.interceptors.push({resolved:c,rejected:a}),this.interceptors.length-1},h.prototype.traverse=function(c,a){a===void 0&&(a=!1);var d=Promise.resolve(c);return(a?Array.prototype.reduceRight:Array.prototype.reduce).call(this.interceptors,function(m,I){if(I){var M=I.resolved,Q=I.rejected;d=d.then(M,Q)}return m},""),d},h.prototype.eject=function(c){this.interceptors[c]&&(this.interceptors[c]=null)},h}(),ye={defaults:{timeout:0,method:"GET",mode:"cors",redirect:"follow",credentials:"same-origin"},headers:{common:{Accept:"application/json, text/plain, */*"},POST:{"Content-Type":"application/x-www-form-urlencoded"},PUT:{"Content-Type":"application/x-www-form-urlencoded"},PATCH:{"Content-Type":"application/x-www-form-urlencoded"}},baseURL:"",polyfillUrl:"https://vm.gtimg.cn/comps/script/fetch.min.js",interceptors:{request:new ve,response:new ve}},Ce=/^([a-z][a-z\d+\-.]*:)?\/\//i,Ee=Object.prototype.toString;function be(h){return ge(this,void 0,void 0,function(){var c;return me(this,function(a){switch(a.label){case 0:if(window.fetch)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Z({src:h})];case 2:return a.sent(),[3,4];case 3:throw c=a.sent(),new Error("加载 polyfill "+h+" 失败: "+c.message);case 4:return[2]}})})}function Oe(h){return["Accept","Content-Type"].forEach(function(c){return a=c,void((d=h.headers)&&Object.keys(d).forEach(function(m){m!==a&&m.toUpperCase()===a.toUpperCase()&&(d[a]=d[m],delete d[m])}));var a,d}),function(c){if(Ee.call(c)!=="[object Object]")return!1;var a=Object.getPrototypeOf(c);return a===null||a===Object.prototype}(h.body)&&(h.body=JSON.stringify(h.body),h.headers&&(h.headers["Content-Type"]="application/json;charset=utf-8")),h}function we(h){return ge(this,void 0,void 0,function(){var c,a,d,m,I,M,Q,de,he,J,xe,Be,Ue,_e,Le,Ve,qe;return me(this,function(Ge){switch(Ge.label){case 0:return c=ye.baseURL,a=ye.defaults,d=ye.interceptors,[4,be(ye.polyfillUrl)];case 1:return Ge.sent(),(m=ne(ne({},a),h)).headers||(m.headers=function(Ke){Ke===void 0&&(Ke="GET");var We=ye.headers[Ke]||{};return ne(ne({},ye.headers.common),We)}(m.method)),Oe(m),[4,d.request.traverse(m,!0)];case 2:if((I=Ge.sent())instanceof Error)throw I;return I.url=function(Ke,We){return!Ke||Ce.test(We)?We:Ke.replace(/\/+$/,"")+"/"+We.replace(/^\/+/,"")}(c,I.url),M=I.url,Q=I.timeout,de=I.params,he=I.method,J=["GET","DELETE","OPTIONS","HEAD"].includes(he===void 0?"GET":he)&&!!de,xe=J?pe({url:M,query:de}):M,Be=[],Q&&!I.signal&&(Le=new Promise(function(Ke){Ue=setTimeout(function(){Ke(new Error("timeout"))},Q)}),Be.push(Le),_e=new AbortController,I.signal=_e.signal),Be.push(fetch(xe,I).catch(function(Ke){return Ke})),[4,Promise.race(Be)];case 3:return Ve=Ge.sent(),Ue&&clearTimeout(Ue),[4,d.response.traverse(Ve)];case 4:if((qe=Ge.sent())instanceof Error)throw _e==null||_e.abort(),qe;return[2,qe]}})})}var De=function(){function h(c){ye.interceptors.request.use(function(a){var d=a.url,m=a.method,I=a.body,M=I;if(c.onReportBeforeSend){var Q=c.onReportBeforeSend({url:d,method:m,data:I?JSON.parse(I):null});M=Q!=null&&Q.data?JSON.stringify(Q.data):null}return m!="GET"&&M?T(T({},a),{body:M}):a})}return h.prototype.get=function(c,a){return w(this,void 0,void 0,function(){var d,m;return x(this,function(I){switch(I.label){case 0:return[4,we(T({url:c},a))];case 1:return[4,(d=I.sent()).json()];case 2:return m=I.sent(),[2,Promise.resolve({data:m,status:d.status,statusText:d.statusText,headers:d.headers})]}})})},h.prototype.post=function(c,a,d){return w(this,void 0,void 0,function(){var m,I;return x(this,function(M){switch(M.label){case 0:return[4,we(T({url:c,body:a,method:"POST"},d))];case 1:return[4,(m=M.sent()).json()];case 2:return I=M.sent(),[2,Promise.resolve({data:I,status:m.status,statusText:m.statusText,headers:m.headers})]}})})},h}(),He=function(){function h(c){this.appkey=c}return h.prototype.getItem=function(c){try{return window.localStorage.getItem(this.getStoreKey(c))}catch(a){return""}},h.prototype.removeItem=function(c){try{window.localStorage.removeItem(this.getStoreKey(c))}catch(a){}},h.prototype.setItem=function(c,a){try{window.localStorage.setItem(this.getStoreKey(c),a)}catch(d){}},h.prototype.setSessionItem=function(c,a){try{window.sessionStorage.setItem(this.getStoreKey(c),a)}catch(d){}},h.prototype.getSessionItem=function(c){try{return window.sessionStorage.getItem(this.getStoreKey(c))}catch(a){return""}},h.prototype.getStoreKey=function(c){return S+this.appkey+"_"+c},h.prototype.createDeviceId=function(){try{var c=window.localStorage.getItem(A);return c||(c=function(a){for(var d="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz0123456789",m="",I=0;I<a;I++)m+=d.charAt(Math.floor(Math.random()*d.length));return m}(32),window.localStorage.setItem(A,c)),c}catch(a){return""}},h.prototype.clear=function(){try{for(var c=window.localStorage.length,a=0;a<c;a++){var d=window.localStorage.key(a);(d==null?void 0:d.substr(0,9))==S&&window.localStorage.removeItem(d)}}catch(m){}},h.prototype.getStoreCount=function(){var c=0;try{c=window.localStorage.length}catch(a){}return c},h}(),Pe="logid_start",se="4.5.14-web";return function(h){function c(a){var d=h.call(this,a)||this;d.qimei36="",d.uselessCycleTaskNum=0,d.underWeakNet=!1,d.pauseSearching=!1,d.send=function(Q,de,he){d.storage.setItem(D,Date.now().toString()),d.network.post(d.uploadUrl||d.strategy.getUploadUrl(),Q.data).then(function(J){var xe;((xe=J==null?void 0:J.data)===null||xe===void 0?void 0:xe.result)==100?d.delayTime=1e3*J.data.delayTime:d.delayTime=0,de&&de(Q.data),Q.data.events.forEach(function(Be){d.store.removeEvent(Be).then(function(){d.removeSendingId(B(Be.mapValue))})}),d.doCustomCycleTask()}).catch(function(J){var xe=Q.data.events;d.errorReport.reportError(J.code?J.code.toString():"600",J.message),he&&he(Q.data);var Be=JSON.parse(d.storage.getItem(z));xe.forEach(function(Ue){Be&&Be.indexOf(B(Ue))!=-1&&d.store.insertEvent(Ue,function(_e,Le){_e&&d.errorReport.reportError("604","insertEvent fail!")}),d.removeSendingId(B(Ue))}),d.monitorUploadFailed()})};var m,I,M=H();return d.isUnderIE8=M>0&&M<8,d.isUnderIE8||(d.isUnderIE=M>0,a.needInitQimei&&K(a.appkey,function(Q){d.qimei36=Q.q36}),d.network=new De(a),d.storage=new He(a.appkey),d.initCommonInfo(a),d.store=new oe(a.appkey,d.storage),d.errorReport=new k(d.config,d.commonInfo,"web",d.network),d.strategy=new g(a.needQueryConfig==null||a.needQueryConfig,d.config,d.commonInfo,d.storage,d.network),d.logidStartTime=d.storage.getItem(Pe),d.logidStartTime||(d.logidStartTime=Date.now().toString(),d.storage.setItem(Pe,d.logidStartTime)),m=d.logidStartTime,I=Date.now()-Number.parseFloat(m),Math.floor(I/864e5)>=365&&d.storage.clear(),d.initSession(a),d.onDirectUserAction("rqd_js_init",{}),setTimeout(function(){return d.lifeCycle.emit("init")},0),d.initDelayTime=a.delay?a.delay:1e3,d.cycleTask(d.initDelayTime)),d}return function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");function m(){this.constructor=a}u(a,d),a.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}(c,h),c.prototype.initSession=function(a){var d=18e5;a.sessionDuration&&a.sessionDuration>3e4&&(d=a.sessionDuration),this.beaconSession=new F(this.storage,d,this)},c.prototype.initCommonInfo=function(a){var d=Number(this.storage.getItem(D));try{var m=JSON.parse(this.storage.getItem(z));(Date.now()-d>3e4||!m)&&this.storage.setItem(z,JSON.stringify([]))}catch(M){}a.uploadUrl&&(this.uploadUrl=a.uploadUrl+"?appkey="+a.appkey);var I=[window.screen.width,window.screen.height];window.devicePixelRatio&&I.push(window.devicePixelRatio),this.commonInfo={deviceId:this.storage.createDeviceId(),language:navigator&&navigator.language||"zh_CN",query:window.location.search,userAgent:navigator.userAgent,pixel:I.join("*"),channelID:a.channelID?String(a.channelID):"",openid:a.openid?String(a.openid):"",unid:a.unionid?String(a.unionid):"",sdkVersion:se},this.config.appVersion=a.versionCode?String(a.versionCode):"",this.config.strictMode=a.strictMode},c.prototype.cycleTask=function(a){var d=this;this.intervalID=window.setInterval(function(){d.pauseSearching||d.store.getEvents().then(function(m){m.length==0&&(d.pauseSearching=!0);var I=[],M=JSON.parse(d.storage.getItem(z));M||(M=[]),m&&m.forEach(function(Q){var de=B(Q.mapValue);M.indexOf(de)==-1&&(I.push(Q),M.push(de))}),I.length!=0&&(d.storage.setItem(z,JSON.stringify(M)),d._normalLogPipeline(d.assembleData(I)))}).catch(function(m){})},a)},c.prototype.onReport=function(a,d,m){var I=this;if(this.isUnderIE8)this.errorReport.reportError("601","UnderIE8");else{this.pauseSearching=!1;var M=this.generateData(a,d,m);if(m&&this.delayTime==0&&!this.underWeakNet)this._normalLogPipeline(this.assembleData(M));else{var Q=M.shift();Q&&this.store.insertEvent(Q,function(de){de&&I.errorReport.reportError("604","insertEvent fail!")}).catch(function(de){I._normalLogPipeline(I.assembleData(M))})}}},c.prototype.onSendBeacon=function(a,d){if(this.isUnderIE)this.errorReport.reportError("605","UnderIE");else{this.pauseSearching=!1;var m=this.assembleData(this.generateData(a,d,!0));typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.uploadUrl||this.strategy.getUploadUrl(),JSON.stringify(m))}},c.prototype.generateData=function(a,d,m){var I=[],M="4.5.14-web_"+(m?"direct_log_id":"normal_log_id"),Q=Number(this.storage.getItem(M));return Q=Q||1,d=T(T({},d),{A99:m?"Y":"N",A100:Q.toString(),A72:se,A88:this.logidStartTime}),Q++,this.storage.setItem(M,Q.toString()),I.push({eventCode:a,eventTime:Date.now().toString(),mapValue:W(d,this.config.strictMode)}),I},c.prototype.assembleData=function(a){var d=this.beaconSession.getSession();return{appVersion:this.config.appVersion?ie(this.config.appVersion):"",sdkId:"js",sdkVersion:se,mainAppKey:this.config.appkey,platformId:3,common:W(T(T({},this.additionalParams),{A2:this.commonInfo.deviceId,A8:this.commonInfo.openid,A12:this.commonInfo.language,A17:this.commonInfo.pixel,A23:this.commonInfo.channelID,A50:this.commonInfo.unid,A76:d.sessionId,A101:this.commonInfo.userAgent,A102:window.location.href,A104:document.referrer,A119:this.commonInfo.query,A153:this.qimei36}),!1),events:a}},c.prototype.monitorUploadFailed=function(){this.uselessCycleTaskNum++,this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(6e4),this.underWeakNet=!0)},c.prototype.doCustomCycleTask=function(){this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(this.initDelayTime)),this.uselessCycleTaskNum=0,this.underWeakNet=!1},c}(C)})},"./lib/crypto.js":function(o,n,e){(function(t){var l=e("./node_modules/@babel/runtime/helpers/typeof.js"),r=r||function(u,T){var w={},x=w.lib={},S=function(){},A=x.Base={extend:function(E){S.prototype=this;var C=new S;return E&&C.mixIn(E),C.hasOwnProperty("init")||(C.init=function(){C.$super.init.apply(this,arguments)}),C.init.prototype=C,C.$super=this,C},create:function(){var E=this.extend();return E.init.apply(E,arguments),E},init:function(){},mixIn:function(E){for(var C in E)E.hasOwnProperty(C)&&(this[C]=E[C]);E.hasOwnProperty("toString")&&(this.toString=E.toString)},clone:function(){return this.init.prototype.extend(this)}},D=x.WordArray=A.extend({init:function(E,C){E=this.words=E||[],this.sigBytes=C!=T?C:4*E.length},toString:function(E){return(E||P).stringify(this)},concat:function(E){var C=this.words,k=E.words,g=this.sigBytes;if(E=E.sigBytes,this.clamp(),g%4)for(var U=0;U<E;U++)C[g+U>>>2]|=(k[U>>>2]>>>24-8*(U%4)&255)<<24-8*((g+U)%4);else if(65535<k.length)for(U=0;U<E;U+=4)C[g+U>>>2]=k[U>>>2];else C.push.apply(C,k);return this.sigBytes+=E,this},clamp:function(){var E=this.words,C=this.sigBytes;E[C>>>2]&=4294967295<<32-8*(C%4),E.length=u.ceil(C/4)},clone:function(){var E=A.clone.call(this);return E.words=this.words.slice(0),E},random:function(E){for(var C=[],k=0;k<E;k+=4)C.push(4294967296*u.random()|0);return new D.init(C,E)}}),z=w.enc={},P=z.Hex={stringify:function(E){var C=E.words;E=E.sigBytes;for(var k=[],g=0;g<E;g++){var U=C[g>>>2]>>>24-8*(g%4)&255;k.push((U>>>4).toString(16)),k.push((U&15).toString(16))}return k.join("")},parse:function(E){for(var C=E.length,k=[],g=0;g<C;g+=2)k[g>>>3]|=parseInt(E.substr(g,2),16)<<24-4*(g%8);return new D.init(k,C/2)}},L=z.Latin1={stringify:function(E){var C=E.words;E=E.sigBytes;for(var k=[],g=0;g<E;g++)k.push(String.fromCharCode(C[g>>>2]>>>24-8*(g%4)&255));return k.join("")},parse:function(E){for(var C=E.length,k=[],g=0;g<C;g++)k[g>>>2]|=(E.charCodeAt(g)&255)<<24-8*(g%4);return new D.init(k,C)}},Y=z.Utf8={stringify:function(E){try{return decodeURIComponent(escape(L.stringify(E)))}catch(C){throw Error("Malformed UTF-8 data")}},parse:function(E){return L.parse(unescape(encodeURIComponent(E)))}},W=x.BufferedBlockAlgorithm=A.extend({reset:function(){this._data=new D.init,this._nDataBytes=0},_append:function(E){typeof E=="string"&&(E=Y.parse(E)),this._data.concat(E),this._nDataBytes+=E.sigBytes},_process:function(E){var C=this._data,k=C.words,g=C.sigBytes,U=this.blockSize,F=g/(4*U),F=E?u.ceil(F):u.max((F|0)-this._minBufferSize,0);if(E=F*U,g=u.min(4*E,g),E){for(var H=0;H<E;H+=U)this._doProcessBlock(k,H);H=k.splice(0,E),C.sigBytes-=g}return new D.init(H,g)},clone:function(){var E=A.clone.call(this);return E._data=this._data.clone(),E},_minBufferSize:0});x.Hasher=W.extend({cfg:A.extend(),init:function(E){this.cfg=this.cfg.extend(E),this.reset()},reset:function(){W.reset.call(this),this._doReset()},update:function(E){return this._append(E),this._process(),this},finalize:function(E){return E&&this._append(E),this._doFinalize()},blockSize:16,_createHelper:function(E){return function(C,k){return new E.init(k).finalize(C)}},_createHmacHelper:function(E){return function(C,k){return new ie.HMAC.init(E,k).finalize(C)}}});var ie=w.algo={};return w}(Math);(function(){var u=r,S=u.lib,T=S.WordArray,w=S.Hasher,x=[],S=u.algo.SHA1=w.extend({_doReset:function(){this._hash=new T.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(D,z){for(var P=this._hash.words,L=P[0],Y=P[1],W=P[2],ie=P[3],B=P[4],E=0;80>E;E++){if(16>E)x[E]=D[z+E]|0;else{var C=x[E-3]^x[E-8]^x[E-14]^x[E-16];x[E]=C<<1|C>>>31}C=(L<<5|L>>>27)+B+x[E],C=20>E?C+((Y&W|~Y&ie)+1518500249):40>E?C+((Y^W^ie)+1859775393):60>E?C+((Y&W|Y&ie|W&ie)-1894007588):C+((Y^W^ie)-899497514),B=ie,ie=W,W=Y<<30|Y>>>2,Y=L,L=C}P[0]=P[0]+L|0,P[1]=P[1]+Y|0,P[2]=P[2]+W|0,P[3]=P[3]+ie|0,P[4]=P[4]+B|0},_doFinalize:function(){var D=this._data,z=D.words,P=8*this._nDataBytes,L=8*D.sigBytes;return z[L>>>5]|=128<<24-L%32,z[(L+64>>>9<<4)+14]=Math.floor(P/4294967296),z[(L+64>>>9<<4)+15]=P,D.sigBytes=4*z.length,this._process(),this._hash},clone:function(){var D=w.clone.call(this);return D._hash=this._hash.clone(),D}});u.SHA1=w._createHelper(S),u.HmacSHA1=w._createHmacHelper(S)})(),function(){var u=r,T=u.enc.Utf8;u.algo.HMAC=u.lib.Base.extend({init:function(x,S){x=this._hasher=new x.init,typeof S=="string"&&(S=T.parse(S));var A=x.blockSize,D=4*A;S.sigBytes>D&&(S=x.finalize(S)),S.clamp();for(var z=this._oKey=S.clone(),P=this._iKey=S.clone(),L=z.words,Y=P.words,W=0;W<A;W++)L[W]^=1549556828,Y[W]^=909522486;z.sigBytes=P.sigBytes=D,this.reset()},reset:function(){var x=this._hasher;x.reset(),x.update(this._iKey)},update:function(x){return this._hasher.update(x),this},finalize:function(x){var S=this._hasher;return x=S.finalize(x),S.reset(),S.finalize(this._oKey.clone().concat(x))}})}(),function(){var u=r,T=u.lib,w=T.WordArray,x=u.enc;x.Base64={stringify:function(A){var D=A.words,z=A.sigBytes,P=this._map;A.clamp();for(var L=[],Y=0;Y<z;Y+=3)for(var W=D[Y>>>2]>>>24-Y%4*8&255,ie=D[Y+1>>>2]>>>24-(Y+1)%4*8&255,B=D[Y+2>>>2]>>>24-(Y+2)%4*8&255,E=W<<16|ie<<8|B,C=0;C<4&&Y+C*.75<z;C++)L.push(P.charAt(E>>>6*(3-C)&63));var k=P.charAt(64);if(k)for(;L.length%4;)L.push(k);return L.join("")},parse:function(A){var D=A.length,z=this._map,P=z.charAt(64);if(P){var L=A.indexOf(P);L!=-1&&(D=L)}for(var Y=[],W=0,ie=0;ie<D;ie++)if(ie%4){var B=z.indexOf(A.charAt(ie-1))<<ie%4*2,E=z.indexOf(A.charAt(ie))>>>6-ie%4*2;Y[W>>>2]|=(B|E)<<24-W%4*8,W++}return w.create(Y,W)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),l(t)==="object"?t.exports=r:window.CryptoJS=r}).call(this,e("./node_modules/webpack/buildin/module.js")(o))},"./lib/json2xml.js":function(o,n,e){var t=e("./node_modules/@babel/runtime/helpers/typeof.js"),l="a-zA-Z_À-ÖØ-öø-ÿͰ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿿、-퟿豈-﷏ﷰ-�",r="-.0-9·̀-ͯ‿⁀",u=new RegExp("^([^"+l+"])|^((x|X)(m|M)(l|L))|([^"+l+r+"])","g"),T=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,w=function(z){var P=[];if(z instanceof Object)for(var L in z)z.hasOwnProperty(L)&&P.push(L);return P},x=function(z,P){var L=function(W,ie,B,E,C){var k=P.indent!==void 0?P.indent:" ",g=P.prettyPrint?"\n"+new Array(E).join(k):"";P.removeIllegalNameCharacters&&(W=W.replace(u,"_"));var U=[g,"<",W,B||""];return ie&&ie.length>0?(U.push(">"),U.push(ie),C&&U.push(g),U.push("</"),U.push(W),U.push(">")):U.push("/>"),U.join("")};return function Y(W,ie,B){var E=t(W);switch((Array.isArray?Array.isArray(W):W instanceof Array)?E="array":W instanceof Date&&(E="date"),E){case"array":var C=[];return W.map(function(F){C.push(Y(F,1,B+1))}),P.prettyPrint&&C.push("\n"),C.join("");case"date":return W.toJSON?W.toJSON():W+"";case"object":var k=[];for(var g in W)if(W.hasOwnProperty(g))if(W[g]instanceof Array)for(var U=0;U<W[g].length;U++)W[g].hasOwnProperty(U)&&k.push(L(g,Y(W[g][U],0,B+1),null,B+1,w(W[g][U]).length));else k.push(L(g,Y(W[g],0,B+1),null,B+1));return P.prettyPrint&&k.length>0&&k.push("\n"),k.join("");case"function":return W();default:return P.escape?A(W):""+W}}(z,0,0)},S=function(z){var P=['<?xml version="1.0" encoding="UTF-8"'];return z&&P.push(' standalone="yes"'),P.push("?>"),P.join("")};function A(D){return(""+D).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(T,"")}o.exports=function(D,z){if(z||(z={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),typeof D=="string")try{D=JSON.parse(D.toString())}catch(W){return!1}var P="",L="";z&&(t(z)=="object"?(z.xmlHeader&&(P=S(!!z.xmlHeader.standalone)),typeof z.docType<"u"&&(L="<!DOCTYPE "+z.docType+">")):P=S()),z=z||{};var Y=[P,z.prettyPrint&&L?"\n":"",L,x(D,z)];return Y.join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")}},"./lib/md5.js":function(module,exports,__webpack_require__){(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");(function(){var ERROR="input is invalid type",WINDOW=(typeof window>"u"?"undefined":_typeof(window))==="object",root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&(typeof self>"u"?"undefined":_typeof(self))==="object",NODE_JS=!root.JS_MD5_NO_NODE_JS&&(typeof process>"u"?"undefined":_typeof(process))==="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&_typeof(module)==="object"&&module.exports,AMD=__webpack_require__("./node_modules/webpack/buildin/amd-options.js"),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}(root.JS_MD5_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(o){return Object.prototype.toString.call(o)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(o){return _typeof(o)==="object"&&o.buffer&&o.buffer.constructor===ArrayBuffer});var createOutputMethod=function(n){return function(e,t){return new Md5(!0).update(e,t)[n]()}},createMethod=function(){var n=createOutputMethod("hex");NODE_JS&&(n=nodeWrap(n)),n.getCtx=n.create=function(){return new Md5},n.update=function(l){return n.create().update(l)};for(var e=0;e<OUTPUT_TYPES.length;++e){var t=OUTPUT_TYPES[e];n[t]=createOutputMethod(t)}return n},nodeWrap=function nodeWrap(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function o(n){if(typeof n=="string")return crypto.createHash("md5").update(n,"utf8").digest("hex");if(n==null)throw ERROR;return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),Array.isArray(n)||ArrayBuffer.isView(n)||n.constructor===Buffer?crypto.createHash("md5").update(new Buffer(n)).digest("hex"):method(n)};return nodeMethod};function Md5(o){if(o)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var n=new ArrayBuffer(68);this.buffer8=new Uint8Array(n),this.blocks=new Uint32Array(n)}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}Md5.prototype.update=function(o,n){if(!this.finalized){for(var e,t=0,l,r=o.length,u=this.blocks,T=this.buffer8;t<r;){if(this.hashed&&(this.hashed=!1,u[0]=u[16],u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0),ARRAY_BUFFER)for(l=this.start;t<r&&l<64;++t)e=o.charCodeAt(t),n||e<128?T[l++]=e:e<2048?(T[l++]=192|e>>6,T[l++]=128|e&63):e<55296||e>=57344?(T[l++]=224|e>>12,T[l++]=128|e>>6&63,T[l++]=128|e&63):(e=65536+((e&1023)<<10|o.charCodeAt(++t)&1023),T[l++]=240|e>>18,T[l++]=128|e>>12&63,T[l++]=128|e>>6&63,T[l++]=128|e&63);else for(l=this.start;t<r&&l<64;++t)e=o.charCodeAt(t),n||e<128?u[l>>2]|=e<<SHIFT[l++&3]:e<2048?(u[l>>2]|=(192|e>>6)<<SHIFT[l++&3],u[l>>2]|=(128|e&63)<<SHIFT[l++&3]):e<55296||e>=57344?(u[l>>2]|=(224|e>>12)<<SHIFT[l++&3],u[l>>2]|=(128|e>>6&63)<<SHIFT[l++&3],u[l>>2]|=(128|e&63)<<SHIFT[l++&3]):(e=65536+((e&1023)<<10|o.charCodeAt(++t)&1023),u[l>>2]|=(240|e>>18)<<SHIFT[l++&3],u[l>>2]|=(128|e>>12&63)<<SHIFT[l++&3],u[l>>2]|=(128|e>>6&63)<<SHIFT[l++&3],u[l>>2]|=(128|e&63)<<SHIFT[l++&3]);this.lastByteIndex=l,this.bytes+=l-this.start,l>=64?(this.start=l-64,this.hash(),this.hashed=!0):this.start=l}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var o=this.blocks,n=this.lastByteIndex;o[n>>2]|=EXTRA[n&3],n>=56&&(this.hashed||this.hash(),o[0]=o[16],o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),o[14]=this.bytes<<3,o[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var o,n,e,t,l,r,u=this.blocks;this.first?(o=u[0]-680876937,o=(o<<7|o>>>25)-271733879<<0,t=(-1732584194^o&2004318071)+u[1]-117830708,t=(t<<12|t>>>20)+o<<0,e=(-271733879^t&(o^-271733879))+u[2]-1126478375,e=(e<<17|e>>>15)+t<<0,n=(o^e&(t^o))+u[3]-1316259209,n=(n<<22|n>>>10)+e<<0):(o=this.h0,n=this.h1,e=this.h2,t=this.h3,o+=(t^n&(e^t))+u[0]-680876936,o=(o<<7|o>>>25)+n<<0,t+=(e^o&(n^e))+u[1]-389564586,t=(t<<12|t>>>20)+o<<0,e+=(n^t&(o^n))+u[2]+606105819,e=(e<<17|e>>>15)+t<<0,n+=(o^e&(t^o))+u[3]-1044525330,n=(n<<22|n>>>10)+e<<0),o+=(t^n&(e^t))+u[4]-176418897,o=(o<<7|o>>>25)+n<<0,t+=(e^o&(n^e))+u[5]+1200080426,t=(t<<12|t>>>20)+o<<0,e+=(n^t&(o^n))+u[6]-1473231341,e=(e<<17|e>>>15)+t<<0,n+=(o^e&(t^o))+u[7]-45705983,n=(n<<22|n>>>10)+e<<0,o+=(t^n&(e^t))+u[8]+1770035416,o=(o<<7|o>>>25)+n<<0,t+=(e^o&(n^e))+u[9]-1958414417,t=(t<<12|t>>>20)+o<<0,e+=(n^t&(o^n))+u[10]-42063,e=(e<<17|e>>>15)+t<<0,n+=(o^e&(t^o))+u[11]-1990404162,n=(n<<22|n>>>10)+e<<0,o+=(t^n&(e^t))+u[12]+1804603682,o=(o<<7|o>>>25)+n<<0,t+=(e^o&(n^e))+u[13]-40341101,t=(t<<12|t>>>20)+o<<0,e+=(n^t&(o^n))+u[14]-1502002290,e=(e<<17|e>>>15)+t<<0,n+=(o^e&(t^o))+u[15]+1236535329,n=(n<<22|n>>>10)+e<<0,o+=(e^t&(n^e))+u[1]-165796510,o=(o<<5|o>>>27)+n<<0,t+=(n^e&(o^n))+u[6]-1069501632,t=(t<<9|t>>>23)+o<<0,e+=(o^n&(t^o))+u[11]+643717713,e=(e<<14|e>>>18)+t<<0,n+=(t^o&(e^t))+u[0]-373897302,n=(n<<20|n>>>12)+e<<0,o+=(e^t&(n^e))+u[5]-701558691,o=(o<<5|o>>>27)+n<<0,t+=(n^e&(o^n))+u[10]+38016083,t=(t<<9|t>>>23)+o<<0,e+=(o^n&(t^o))+u[15]-660478335,e=(e<<14|e>>>18)+t<<0,n+=(t^o&(e^t))+u[4]-405537848,n=(n<<20|n>>>12)+e<<0,o+=(e^t&(n^e))+u[9]+568446438,o=(o<<5|o>>>27)+n<<0,t+=(n^e&(o^n))+u[14]-1019803690,t=(t<<9|t>>>23)+o<<0,e+=(o^n&(t^o))+u[3]-187363961,e=(e<<14|e>>>18)+t<<0,n+=(t^o&(e^t))+u[8]+1163531501,n=(n<<20|n>>>12)+e<<0,o+=(e^t&(n^e))+u[13]-1444681467,o=(o<<5|o>>>27)+n<<0,t+=(n^e&(o^n))+u[2]-51403784,t=(t<<9|t>>>23)+o<<0,e+=(o^n&(t^o))+u[7]+1735328473,e=(e<<14|e>>>18)+t<<0,n+=(t^o&(e^t))+u[12]-1926607734,n=(n<<20|n>>>12)+e<<0,l=n^e,o+=(l^t)+u[5]-378558,o=(o<<4|o>>>28)+n<<0,t+=(l^o)+u[8]-2022574463,t=(t<<11|t>>>21)+o<<0,r=t^o,e+=(r^n)+u[11]+1839030562,e=(e<<16|e>>>16)+t<<0,n+=(r^e)+u[14]-35309556,n=(n<<23|n>>>9)+e<<0,l=n^e,o+=(l^t)+u[1]-1530992060,o=(o<<4|o>>>28)+n<<0,t+=(l^o)+u[4]+1272893353,t=(t<<11|t>>>21)+o<<0,r=t^o,e+=(r^n)+u[7]-155497632,e=(e<<16|e>>>16)+t<<0,n+=(r^e)+u[10]-1094730640,n=(n<<23|n>>>9)+e<<0,l=n^e,o+=(l^t)+u[13]+681279174,o=(o<<4|o>>>28)+n<<0,t+=(l^o)+u[0]-358537222,t=(t<<11|t>>>21)+o<<0,r=t^o,e+=(r^n)+u[3]-722521979,e=(e<<16|e>>>16)+t<<0,n+=(r^e)+u[6]+76029189,n=(n<<23|n>>>9)+e<<0,l=n^e,o+=(l^t)+u[9]-640364487,o=(o<<4|o>>>28)+n<<0,t+=(l^o)+u[12]-421815835,t=(t<<11|t>>>21)+o<<0,r=t^o,e+=(r^n)+u[15]+530742520,e=(e<<16|e>>>16)+t<<0,n+=(r^e)+u[2]-995338651,n=(n<<23|n>>>9)+e<<0,o+=(e^(n|~t))+u[0]-198630844,o=(o<<6|o>>>26)+n<<0,t+=(n^(o|~e))+u[7]+1126891415,t=(t<<10|t>>>22)+o<<0,e+=(o^(t|~n))+u[14]-1416354905,e=(e<<15|e>>>17)+t<<0,n+=(t^(e|~o))+u[5]-57434055,n=(n<<21|n>>>11)+e<<0,o+=(e^(n|~t))+u[12]+1700485571,o=(o<<6|o>>>26)+n<<0,t+=(n^(o|~e))+u[3]-1894986606,t=(t<<10|t>>>22)+o<<0,e+=(o^(t|~n))+u[10]-1051523,e=(e<<15|e>>>17)+t<<0,n+=(t^(e|~o))+u[1]-2054922799,n=(n<<21|n>>>11)+e<<0,o+=(e^(n|~t))+u[8]+1873313359,o=(o<<6|o>>>26)+n<<0,t+=(n^(o|~e))+u[15]-30611744,t=(t<<10|t>>>22)+o<<0,e+=(o^(t|~n))+u[6]-1560198380,e=(e<<15|e>>>17)+t<<0,n+=(t^(e|~o))+u[13]+1309151649,n=(n<<21|n>>>11)+e<<0,o+=(e^(n|~t))+u[4]-145523070,o=(o<<6|o>>>26)+n<<0,t+=(n^(o|~e))+u[11]-1120210379,t=(t<<10|t>>>22)+o<<0,e+=(o^(t|~n))+u[2]+718787259,e=(e<<15|e>>>17)+t<<0,n+=(t^(e|~o))+u[9]-343485551,n=(n<<21|n>>>11)+e<<0,this.first?(this.h0=o+1732584193<<0,this.h1=n-271733879<<0,this.h2=e-1732584194<<0,this.h3=t+271733878<<0,this.first=!1):(this.h0=this.h0+o<<0,this.h1=this.h1+n<<0,this.h2=this.h2+e<<0,this.h3=this.h3+t<<0)},Md5.prototype.hex=function(){this.finalize();var o=this.h0,n=this.h1,e=this.h2,t=this.h3;return HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(o){if(o==="hex")return this.hex();this.finalize();var n=this.h0,e=this.h1,t=this.h2,l=this.h3,r=[n&255,n>>8&255,n>>16&255,n>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,t&255,t>>8&255,t>>16&255,t>>24&255,l&255,l>>8&255,l>>16&255,l>>24&255];return r},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var o=new ArrayBuffer(16),n=new Uint32Array(o);return n[0]=this.h0,n[1]=this.h1,n[2]=this.h2,n[3]=this.h3,o},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var o,n,e,t="",l=this.array(),r=0;r<15;)o=l[r++],n=l[r++],e=l[r++],t+=BASE64_ENCODE_CHAR[o>>>2]+BASE64_ENCODE_CHAR[(o<<4|n>>>4)&63]+BASE64_ENCODE_CHAR[(n<<2|e>>>6)&63]+BASE64_ENCODE_CHAR[e&63];return o=l[r],t+=BASE64_ENCODE_CHAR[o>>>2]+BASE64_ENCODE_CHAR[o<<4&63]+"==",t};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=(function(){return exports}).call(exports,__webpack_require__,exports,module),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()}).call(this,__webpack_require__("./node_modules/process/browser.js"),__webpack_require__("./node_modules/webpack/buildin/global.js"),__webpack_require__("./node_modules/webpack/buildin/module.js")(module))},"./lib/request.js":function(o,n,e){var t=e("./node_modules/@babel/runtime/helpers/typeof.js"),l=function(S){switch(t(S)){case"string":return S;case"boolean":return S?"true":"false";case"number":return isFinite(S)?S:"";default:return""}},r=function(S,A,D,z){return A=A||"&",D=D||"=",S===null&&(S=void 0),t(S)==="object"?Object.keys(S).map(function(P){var L=encodeURIComponent(l(P))+D;return Array.isArray(S[P])?S[P].map(function(Y){return L+encodeURIComponent(l(Y))}).join(A):L+encodeURIComponent(l(S[P]))}).filter(Boolean).join(A):z?encodeURIComponent(l(z))+D+encodeURIComponent(l(S)):""},u=function(S,A,D){var z={};return A.getAllResponseHeaders().trim().split("\n").forEach(function(P){if(P){var L=P.indexOf(":"),Y=P.substr(0,L).trim().toLowerCase(),W=P.substr(L+1).trim();z[Y]=W}}),{error:S,statusCode:A.status,statusMessage:A.statusText,headers:z,body:D}},T=function(S,A){return!A&&A==="text"?S.responseText:S.response},w=function(S,A){var D=(S.method||"GET").toUpperCase(),z=S.url;if(S.qs){var P=r(S.qs);P&&(z+=(z.indexOf("?")===-1?"?":"&")+P)}var L=new XMLHttpRequest;if(L.open(D,z,!0),L.responseType=S.dataType||"text",S.xhrFields)for(var Y in S.xhrFields)L[Y]=S.xhrFields[Y];var W=S.headers;if(W)for(var ie in W)W.hasOwnProperty(ie)&&ie.toLowerCase()!=="content-length"&&ie.toLowerCase()!=="user-agent"&&ie.toLowerCase()!=="origin"&&ie.toLowerCase()!=="host"&&L.setRequestHeader(ie,W[ie]);return S.onProgress&&L.upload&&(L.upload.onprogress=S.onProgress),S.onDownloadProgress&&(L.onprogress=S.onDownloadProgress),S.timeout&&(L.timeout=S.timeout),L.ontimeout=function(B){var E=new Error("timeout");A(u(E,L))},L.onload=function(){A(u(null,L,T(L,S.dataType)))},L.onerror=function(B){var E=T(L,S.dataType);if(E)A(u(null,L,E));else{var C=L.statusText;!C&&L.status===0&&(C=new Error("CORS blocked or network error")),A(u(C,L,E))}},L.send(S.body||""),L};o.exports=w},"./lib/xml2json.js":function(o,n,e){var t=e("./node_modules/@xmldom/xmldom/lib/index.js").DOMParser,l=(function(){this.version="1.3.5";var u={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},T=new RegExp(/(?!xmlns)^.*:/);return this.grokType=function(w){return/^\s*$/.test(w)?null:/^(?:true|false)$/i.test(w)?w.toLowerCase()==="true":isFinite(w)?parseFloat(w):w},this.parseString=function(w,x){if(w){var S=this.stringToXML(w);return S.getElementsByTagName("parsererror").length?null:this.parseXML(S,x)}else return null},this.parseXML=function(w,x){for(var S in x)u[S]=x[S];var A={},D=0,z="",P=w.childNodes.length;if(P)for(var L,Y,W,ie=0;ie<w.childNodes.length;ie++)L=w.childNodes.item(ie),L.nodeType===4?u.mergeCDATA&&(z+=L.nodeValue):L.nodeType===3?z+=L.nodeValue:L.nodeType===1&&(D===0&&(A={}),u.stripElemPrefix?Y=L.nodeName.replace(T,""):Y=L.nodeName,W=l.parseXML(L),A.hasOwnProperty(Y)?(A[Y].constructor!==Array&&(A[Y]=[A[Y]]),A[Y].push(W)):(A[Y]=W,D++));return Object.keys(A).length||(A=z||""),A},this.xmlToString=function(w){try{var x=w.xml?w.xml:new XMLSerializer().serializeToString(w);return x}catch(S){return null}},this.stringToXML=function(w){try{var x=null;if(window.DOMParser){var S=new t;return x=S.parseFromString(w,"text/xml"),x}else return x=new ActiveXObject("Microsoft.XMLDOM"),x.async=!1,x.loadXML(w),x}catch(A){return null}},this}).call({}),r=function(T){return l.parseString(T)};o.exports=r},"./node_modules/@babel/runtime/helpers/classCallCheck.js":function(o,n){function e(t,l){if(!(t instanceof l))throw new TypeError("Cannot call a class as a function")}o.exports=e,o.exports.__esModule=!0,o.exports.default=o.exports},"./node_modules/@babel/runtime/helpers/createClass.js":function(o,n){function e(l,r){for(var u=0;u<r.length;u++){var T=r[u];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(l,T.key,T)}}function t(l,r,u){return r&&e(l.prototype,r),u&&e(l,u),Object.defineProperty(l,"prototype",{writable:!1}),l}o.exports=t,o.exports.__esModule=!0,o.exports.default=o.exports},"./node_modules/@babel/runtime/helpers/typeof.js":function(o,n){function e(t){"@babel/helpers - typeof";return o.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},o.exports.__esModule=!0,o.exports.default=o.exports,e(t)}o.exports=e,o.exports.__esModule=!0,o.exports.default=o.exports},"./node_modules/@xmldom/xmldom/lib/conventions.js":function(o,n,e){function t(w,x,S){if(S===void 0&&(S=Array.prototype),w&&typeof S.find=="function")return S.find.call(w,x);for(var A=0;A<w.length;A++)if(Object.prototype.hasOwnProperty.call(w,A)){var D=w[A];if(x.call(void 0,D,A,w))return D}}function l(w,x){return x===void 0&&(x=Object),x&&typeof x.freeze=="function"?x.freeze(w):w}function r(w,x){if(w===null||typeof w!="object")throw new TypeError("target is not an object");for(var S in x)Object.prototype.hasOwnProperty.call(x,S)&&(w[S]=x[S]);return w}var u=l({HTML:"text/html",isHTML:function(w){return w===u.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),T=l({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(w){return w===T.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});n.assign=r,n.find=t,n.freeze=l,n.MIME_TYPE=u,n.NAMESPACE=T},"./node_modules/@xmldom/xmldom/lib/dom-parser.js":function(o,n,e){var t=e("./node_modules/@xmldom/xmldom/lib/conventions.js"),l=e("./node_modules/@xmldom/xmldom/lib/dom.js"),r=e("./node_modules/@xmldom/xmldom/lib/entities.js"),u=e("./node_modules/@xmldom/xmldom/lib/sax.js"),T=l.DOMImplementation,w=t.NAMESPACE,x=u.ParseError,S=u.XMLReader;function A(B){return B.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function D(B){this.options=B||{locator:{}}}D.prototype.parseFromString=function(B,E){var C=this.options,k=new S,g=C.domBuilder||new P,U=C.errorHandler,F=C.locator,H=C.xmlns||{},K=/\/x?html?$/.test(E),_=K?r.HTML_ENTITIES:r.XML_ENTITIES;F&&g.setDocumentLocator(F),k.errorHandler=z(U,g,F),k.domBuilder=C.domBuilder||g,K&&(H[""]=w.HTML),H.xml=H.xml||w.XML;var V=C.normalizeLineEndings||A;return B&&typeof B=="string"?k.parse(V(B),H,_):k.errorHandler.error("invalid doc source"),g.doc};function z(B,E,C){if(!B){if(E instanceof P)return E;B=E}var k={},g=B instanceof Function;C=C||{};function U(F){var H=B[F];!H&&g&&(H=B.length==2?function(K){B(F,K)}:B),k[F]=H&&function(K){H("[xmldom "+F+"] "+K+Y(C))}||function(){}}return U("warning"),U("error"),U("fatalError"),k}function P(){this.cdata=!1}function L(B,E){E.lineNumber=B.lineNumber,E.columnNumber=B.columnNumber}P.prototype={startDocument:function(){this.doc=new T().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(B,E,C,k){var g=this.doc,U=g.createElementNS(B,C||E),F=k.length;ie(this,U),this.currentElement=U,this.locator&&L(this.locator,U);for(var H=0;H<F;H++){var B=k.getURI(H),K=k.getValue(H),C=k.getQName(H),_=g.createAttributeNS(B,C);this.locator&&L(k.getLocator(H),_),_.value=_.nodeValue=K,U.setAttributeNode(_)}},endElement:function(B,E,C){var k=this.currentElement;k.tagName,this.currentElement=k.parentNode},startPrefixMapping:function(B,E){},endPrefixMapping:function(B){},processingInstruction:function(B,E){var C=this.doc.createProcessingInstruction(B,E);this.locator&&L(this.locator,C),ie(this,C)},ignorableWhitespace:function(B,E,C){},characters:function(B,E,C){if(B=W.apply(this,arguments),B){if(this.cdata)var k=this.doc.createCDATASection(B);else var k=this.doc.createTextNode(B);this.currentElement?this.currentElement.appendChild(k):/^\s*$/.test(B)&&this.doc.appendChild(k),this.locator&&L(this.locator,k)}},skippedEntity:function(B){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(B){(this.locator=B)&&(B.lineNumber=0)},comment:function(B,E,C){B=W.apply(this,arguments);var k=this.doc.createComment(B);this.locator&&L(this.locator,k),ie(this,k)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(B,E,C){var k=this.doc.implementation;if(k&&k.createDocumentType){var g=k.createDocumentType(B,E,C);this.locator&&L(this.locator,g),ie(this,g),this.doc.doctype=g}},warning:function(B){console.warn("[xmldom warning] "+B,Y(this.locator))},error:function(B){console.error("[xmldom error] "+B,Y(this.locator))},fatalError:function(B){throw new x(B,this.locator)}};function Y(B){if(B)return"\n@"+(B.systemId||"")+"#[line:"+B.lineNumber+",col:"+B.columnNumber+"]"}function W(B,E,C){return typeof B=="string"?B.substr(E,C):B.length>=E+C||E?new java.lang.String(B,E,C)+"":B}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(B){P.prototype[B]=function(){return null}});function ie(B,E){B.currentElement?B.currentElement.appendChild(E):B.doc.appendChild(E)}n.__DOMHandler=P,n.normalizeLineEndings=A,n.DOMParser=D},"./node_modules/@xmldom/xmldom/lib/dom.js":function(o,n,e){var t=e("./node_modules/@xmldom/xmldom/lib/conventions.js"),l=t.find,r=t.NAMESPACE;function u(f){return f!==""}function T(f){return f?f.split(/[\t\n\f\r ]+/).filter(u):[]}function w(f,v){return f.hasOwnProperty(v)||(f[v]=!0),f}function x(f){if(!f)return[];var v=T(f);return Object.keys(v.reduce(w,{}))}function S(f){return function(v){return f&&f.indexOf(v)!==-1}}function A(f,v){for(var N in f)Object.prototype.hasOwnProperty.call(f,N)&&(v[N]=f[N])}function D(f,v){var N=f.prototype;if(!(N instanceof v)){let q=function(){};q.prototype=v.prototype,q=new q,A(N,q),f.prototype=N=q}N.constructor!=f&&(typeof f!="function"&&console.error("unknown Class:"+f),N.constructor=f)}var z={},P=z.ELEMENT_NODE=1,L=z.ATTRIBUTE_NODE=2,Y=z.TEXT_NODE=3,W=z.CDATA_SECTION_NODE=4,ie=z.ENTITY_REFERENCE_NODE=5,B=z.ENTITY_NODE=6,E=z.PROCESSING_INSTRUCTION_NODE=7,C=z.COMMENT_NODE=8,k=z.DOCUMENT_NODE=9,g=z.DOCUMENT_TYPE_NODE=10,U=z.DOCUMENT_FRAGMENT_NODE=11,F=z.NOTATION_NODE=12,H={},K={};H.INDEX_SIZE_ERR=(K[1]="Index size error",1),H.DOMSTRING_SIZE_ERR=(K[2]="DOMString size error",2);var _=H.HIERARCHY_REQUEST_ERR=(K[3]="Hierarchy request error",3);H.WRONG_DOCUMENT_ERR=(K[4]="Wrong document",4),H.INVALID_CHARACTER_ERR=(K[5]="Invalid character",5),H.NO_DATA_ALLOWED_ERR=(K[6]="No data allowed",6),H.NO_MODIFICATION_ALLOWED_ERR=(K[7]="No modification allowed",7);var V=H.NOT_FOUND_ERR=(K[8]="Not found",8);H.NOT_SUPPORTED_ERR=(K[9]="Not supported",9);var X=H.INUSE_ATTRIBUTE_ERR=(K[10]="Attribute in use",10);H.INVALID_STATE_ERR=(K[11]="Invalid state",11),H.SYNTAX_ERR=(K[12]="Syntax error",12),H.INVALID_MODIFICATION_ERR=(K[13]="Invalid modification",13),H.NAMESPACE_ERR=(K[14]="Invalid namespace",14),H.INVALID_ACCESS_ERR=(K[15]="Invalid access",15);function G(f,v){if(v instanceof Error)var N=v;else N=this,Error.call(this,K[f]),this.message=K[f],Error.captureStackTrace&&Error.captureStackTrace(this,G);return N.code=f,v&&(this.message=this.message+": "+v),N}G.prototype=Error.prototype,A(H,G);function $(){}$.prototype={length:0,item:function(f){return this[f]||null},toString:function(f,v){for(var N=[],q=0;q<this.length;q++)Xe(this[q],N,f,v);return N.join("")},filter:function(f){return Array.prototype.filter.call(this,f)},indexOf:function(f){return Array.prototype.indexOf.call(this,f)}};function re(f,v){this._node=f,this._refresh=v,ue(this)}function ue(f){var v=f._node._inc||f._node.ownerDocument._inc;if(f._inc!=v){var N=f._refresh(f._node);it(f,"length",N.length),A(N,f),f._inc=v}}re.prototype.item=function(f){return ue(this),this[f]},D(re,$);function oe(){}function ee(f,v){for(var N=f.length;N--;)if(f[N]===v)return N}function ce(f,v,N,q){if(q?v[ee(v,q)]=N:v[v.length++]=N,f){N.ownerElement=f;var fe=f.ownerDocument;fe&&(q&&ye(fe,f,q),ve(fe,f,N))}}function ae(f,v,N){var q=ee(v,N);if(q>=0){for(var fe=v.length-1;q<fe;)v[q]=v[++q];if(v.length=fe,f){var Re=f.ownerDocument;Re&&(ye(Re,f,N),N.ownerElement=null)}}else throw new G(V,new Error(f.tagName+"@"+N))}oe.prototype={length:0,item:$.prototype.item,getNamedItem:function(f){for(var v=this.length;v--;){var N=this[v];if(N.nodeName==f)return N}},setNamedItem:function(f){var v=f.ownerElement;if(v&&v!=this._ownerElement)throw new G(X);var N=this.getNamedItem(f.nodeName);return ce(this._ownerElement,this,f,N),N},setNamedItemNS:function(f){var v=f.ownerElement,N;if(v&&v!=this._ownerElement)throw new G(X);return N=this.getNamedItemNS(f.namespaceURI,f.localName),ce(this._ownerElement,this,f,N),N},removeNamedItem:function(f){var v=this.getNamedItem(f);return ae(this._ownerElement,this,v),v},removeNamedItemNS:function(f,v){var N=this.getNamedItemNS(f,v);return ae(this._ownerElement,this,N),N},getNamedItemNS:function(f,v){for(var N=this.length;N--;){var q=this[N];if(q.localName==v&&q.namespaceURI==f)return q}return null}};function pe(){}pe.prototype={hasFeature:function(f,v){return!0},createDocument:function(f,v,N){var q=new me;if(q.implementation=this,q.childNodes=new $,q.doctype=N||null,N&&q.appendChild(N),v){var fe=q.createElementNS(f,v);q.appendChild(fe)}return q},createDocumentType:function(f,v,N){var q=new xe;return q.name=f,q.nodeName=f,q.publicId=v||"",q.systemId=N||"",q}};function Z(){}Z.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(f,v){return d(this,f,v)},replaceChild:function(f,v){d(this,f,v,a),v&&this.removeChild(v)},removeChild:function(f){return Ee(this,f)},appendChild:function(f){return this.insertBefore(f,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(f){return et(this.ownerDocument||this,this,f)},normalize:function(){for(var f=this.firstChild;f;){var v=f.nextSibling;v&&v.nodeType==Y&&f.nodeType==Y?(this.removeChild(v),f.appendData(v.data)):(f.normalize(),f=v)}},isSupported:function(f,v){return this.ownerDocument.implementation.hasFeature(f,v)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(f){for(var v=this;v;){var N=v._nsMap;if(N){for(var q in N)if(Object.prototype.hasOwnProperty.call(N,q)&&N[q]===f)return q}v=v.nodeType==L?v.ownerDocument:v.parentNode}return null},lookupNamespaceURI:function(f){for(var v=this;v;){var N=v._nsMap;if(N&&Object.prototype.hasOwnProperty.call(N,f))return N[f];v=v.nodeType==L?v.ownerDocument:v.parentNode}return null},isDefaultNamespace:function(f){var v=this.lookupPrefix(f);return v==null}};function ne(f){return f=="<"&&"&lt;"||f==">"&&"&gt;"||f=="&"&&"&amp;"||f=='"'&&"&quot;"||"&#"+f.charCodeAt()+";"}A(z,Z),A(z,Z.prototype);function ge(f,v){if(v(f))return!0;if(f=f.firstChild)do if(ge(f,v))return!0;while(f=f.nextSibling)}function me(){this.ownerDocument=this}function ve(f,v,N){f&&f._inc++;var q=N.namespaceURI;q===r.XMLNS&&(v._nsMap[N.prefix?N.localName:""]=N.value)}function ye(f,v,N,q){f&&f._inc++;var fe=N.namespaceURI;fe===r.XMLNS&&delete v._nsMap[N.prefix?N.localName:""]}function Ce(f,v,N){if(f&&f._inc){f._inc++;var q=v.childNodes;if(N)q[q.length++]=N;else{for(var fe=v.firstChild,Re=0;fe;)q[Re++]=fe,fe=fe.nextSibling;q.length=Re,delete q[q.length]}}}function Ee(f,v){var N=v.previousSibling,q=v.nextSibling;return N?N.nextSibling=q:f.firstChild=q,q?q.previousSibling=N:f.lastChild=N,v.parentNode=null,v.previousSibling=null,v.nextSibling=null,Ce(f.ownerDocument,f),v}function be(f){return f&&(f.nodeType===Z.DOCUMENT_NODE||f.nodeType===Z.DOCUMENT_FRAGMENT_NODE||f.nodeType===Z.ELEMENT_NODE)}function Oe(f){return f&&(De(f)||He(f)||we(f)||f.nodeType===Z.DOCUMENT_FRAGMENT_NODE||f.nodeType===Z.COMMENT_NODE||f.nodeType===Z.PROCESSING_INSTRUCTION_NODE)}function we(f){return f&&f.nodeType===Z.DOCUMENT_TYPE_NODE}function De(f){return f&&f.nodeType===Z.ELEMENT_NODE}function He(f){return f&&f.nodeType===Z.TEXT_NODE}function Pe(f,v){var N=f.childNodes||[];if(l(N,De)||we(v))return!1;var q=l(N,we);return!(v&&q&&N.indexOf(q)>N.indexOf(v))}function se(f,v){var N=f.childNodes||[];function q(Re){return De(Re)&&Re!==v}if(l(N,q))return!1;var fe=l(N,we);return!(v&&fe&&N.indexOf(fe)>N.indexOf(v))}function h(f,v,N){if(!be(f))throw new G(_,"Unexpected parent node type "+f.nodeType);if(N&&N.parentNode!==f)throw new G(V,"child not in parent");if(!Oe(v)||we(v)&&f.nodeType!==Z.DOCUMENT_NODE)throw new G(_,"Unexpected node type "+v.nodeType+" for parent node type "+f.nodeType)}function c(f,v,N){var q=f.childNodes||[],fe=v.childNodes||[];if(v.nodeType===Z.DOCUMENT_FRAGMENT_NODE){var Re=fe.filter(De);if(Re.length>1||l(fe,He))throw new G(_,"More than one element or text in fragment");if(Re.length===1&&!Pe(f,N))throw new G(_,"Element in fragment can not be inserted before doctype")}if(De(v)&&!Pe(f,N))throw new G(_,"Only one element can be added and only after doctype");if(we(v)){if(l(q,we))throw new G(_,"Only one doctype is allowed");var Me=l(q,De);if(N&&q.indexOf(Me)<q.indexOf(N))throw new G(_,"Doctype can only be inserted before an element");if(!N&&Me)throw new G(_,"Doctype can not be appended since element is present")}}function a(f,v,N){var q=f.childNodes||[],fe=v.childNodes||[];if(v.nodeType===Z.DOCUMENT_FRAGMENT_NODE){var Re=fe.filter(De);if(Re.length>1||l(fe,He))throw new G(_,"More than one element or text in fragment");if(Re.length===1&&!se(f,N))throw new G(_,"Element in fragment can not be inserted before doctype")}if(De(v)&&!se(f,N))throw new G(_,"Only one element can be added and only after doctype");if(we(v)){if(l(q,function(Ye){return we(Ye)&&Ye!==N}))throw new G(_,"Only one doctype is allowed");var Me=l(q,De);if(N&&q.indexOf(Me)<q.indexOf(N))throw new G(_,"Doctype can only be inserted before an element")}}function d(f,v,N,q){h(f,v,N),f.nodeType===Z.DOCUMENT_NODE&&(q||c)(f,v,N);var fe=v.parentNode;if(fe&&fe.removeChild(v),v.nodeType===U){var Re=v.firstChild;if(Re==null)return v;var Me=v.lastChild}else Re=Me=v;var le=N?N.previousSibling:f.lastChild;Re.previousSibling=le,Me.nextSibling=N,le?le.nextSibling=Re:f.firstChild=Re,N==null?f.lastChild=Me:N.previousSibling=Me;do Re.parentNode=f;while(Re!==Me&&(Re=Re.nextSibling));return Ce(f.ownerDocument||f,f),v.nodeType==U&&(v.firstChild=v.lastChild=null),v}function m(f,v){return v.parentNode&&v.parentNode.removeChild(v),v.parentNode=f,v.previousSibling=f.lastChild,v.nextSibling=null,v.previousSibling?v.previousSibling.nextSibling=v:f.firstChild=v,f.lastChild=v,Ce(f.ownerDocument,f,v),v}me.prototype={nodeName:"#document",nodeType:k,doctype:null,documentElement:null,_inc:1,insertBefore:function(f,v){if(f.nodeType==U){for(var N=f.firstChild;N;){var q=N.nextSibling;this.insertBefore(N,v),N=q}return f}return d(this,f,v),f.ownerDocument=this,this.documentElement===null&&f.nodeType===P&&(this.documentElement=f),f},removeChild:function(f){return this.documentElement==f&&(this.documentElement=null),Ee(this,f)},replaceChild:function(f,v){d(this,f,v,a),f.ownerDocument=this,v&&this.removeChild(v),De(f)&&(this.documentElement=f)},importNode:function(f,v){return nt(this,f,v)},getElementById:function(f){var v=null;return ge(this.documentElement,function(N){if(N.nodeType==P&&N.getAttribute("id")==f)return v=N,!0}),v},getElementsByClassName:function(f){var v=x(f);return new re(this,function(N){var q=[];return v.length>0&&ge(N.documentElement,function(fe){if(fe!==N&&fe.nodeType===P){var Re=fe.getAttribute("class");if(Re){var Me=f===Re;if(!Me){var le=x(Re);Me=v.every(S(le))}Me&&q.push(fe)}}}),q})},createElement:function(f){var v=new I;v.ownerDocument=this,v.nodeName=f,v.tagName=f,v.localName=f,v.childNodes=new $;var N=v.attributes=new oe;return N._ownerElement=v,v},createDocumentFragment:function(){var f=new Le;return f.ownerDocument=this,f.childNodes=new $,f},createTextNode:function(f){var v=new de;return v.ownerDocument=this,v.appendData(f),v},createComment:function(f){var v=new he;return v.ownerDocument=this,v.appendData(f),v},createCDATASection:function(f){var v=new J;return v.ownerDocument=this,v.appendData(f),v},createProcessingInstruction:function(f,v){var N=new Ve;return N.ownerDocument=this,N.tagName=N.target=f,N.nodeValue=N.data=v,N},createAttribute:function(f){var v=new M;return v.ownerDocument=this,v.name=f,v.nodeName=f,v.localName=f,v.specified=!0,v},createEntityReference:function(f){var v=new _e;return v.ownerDocument=this,v.nodeName=f,v},createElementNS:function(f,v){var N=new I,q=v.split(":"),fe=N.attributes=new oe;return N.childNodes=new $,N.ownerDocument=this,N.nodeName=v,N.tagName=v,N.namespaceURI=f,q.length==2?(N.prefix=q[0],N.localName=q[1]):N.localName=v,fe._ownerElement=N,N},createAttributeNS:function(f,v){var N=new M,q=v.split(":");return N.ownerDocument=this,N.nodeName=v,N.name=v,N.namespaceURI=f,N.specified=!0,q.length==2?(N.prefix=q[0],N.localName=q[1]):N.localName=v,N}},D(me,Z);function I(){this._nsMap={}}I.prototype={nodeType:P,hasAttribute:function(f){return this.getAttributeNode(f)!=null},getAttribute:function(f){var v=this.getAttributeNode(f);return v&&v.value||""},getAttributeNode:function(f){return this.attributes.getNamedItem(f)},setAttribute:function(f,v){var N=this.ownerDocument.createAttribute(f);N.value=N.nodeValue=""+v,this.setAttributeNode(N)},removeAttribute:function(f){var v=this.getAttributeNode(f);v&&this.removeAttributeNode(v)},appendChild:function(f){return f.nodeType===U?this.insertBefore(f,null):m(this,f)},setAttributeNode:function(f){return this.attributes.setNamedItem(f)},setAttributeNodeNS:function(f){return this.attributes.setNamedItemNS(f)},removeAttributeNode:function(f){return this.attributes.removeNamedItem(f.nodeName)},removeAttributeNS:function(f,v){var N=this.getAttributeNodeNS(f,v);N&&this.removeAttributeNode(N)},hasAttributeNS:function(f,v){return this.getAttributeNodeNS(f,v)!=null},getAttributeNS:function(f,v){var N=this.getAttributeNodeNS(f,v);return N&&N.value||""},setAttributeNS:function(f,v,N){var q=this.ownerDocument.createAttributeNS(f,v);q.value=q.nodeValue=""+N,this.setAttributeNode(q)},getAttributeNodeNS:function(f,v){return this.attributes.getNamedItemNS(f,v)},getElementsByTagName:function(f){return new re(this,function(v){var N=[];return ge(v,function(q){q!==v&&q.nodeType==P&&(f==="*"||q.tagName==f)&&N.push(q)}),N})},getElementsByTagNameNS:function(f,v){return new re(this,function(N){var q=[];return ge(N,function(fe){fe!==N&&fe.nodeType===P&&(f==="*"||fe.namespaceURI===f)&&(v==="*"||fe.localName==v)&&q.push(fe)}),q})}},me.prototype.getElementsByTagName=I.prototype.getElementsByTagName,me.prototype.getElementsByTagNameNS=I.prototype.getElementsByTagNameNS,D(I,Z);function M(){}M.prototype.nodeType=L,D(M,Z);function Q(){}Q.prototype={data:"",substringData:function(f,v){return this.data.substring(f,f+v)},appendData:function(f){f=this.data+f,this.nodeValue=this.data=f,this.length=f.length},insertData:function(f,v){this.replaceData(f,0,v)},appendChild:function(f){throw new Error(K[_])},deleteData:function(f,v){this.replaceData(f,v,"")},replaceData:function(f,v,N){var q=this.data.substring(0,f),fe=this.data.substring(f+v);N=q+N+fe,this.nodeValue=this.data=N,this.length=N.length}},D(Q,Z);function de(){}de.prototype={nodeName:"#text",nodeType:Y,splitText:function(f){var v=this.data,N=v.substring(f);v=v.substring(0,f),this.data=this.nodeValue=v,this.length=v.length;var q=this.ownerDocument.createTextNode(N);return this.parentNode&&this.parentNode.insertBefore(q,this.nextSibling),q}},D(de,Q);function he(){}he.prototype={nodeName:"#comment",nodeType:C},D(he,Q);function J(){}J.prototype={nodeName:"#cdata-section",nodeType:W},D(J,Q);function xe(){}xe.prototype.nodeType=g,D(xe,Z);function Be(){}Be.prototype.nodeType=F,D(Be,Z);function Ue(){}Ue.prototype.nodeType=B,D(Ue,Z);function _e(){}_e.prototype.nodeType=ie,D(_e,Z);function Le(){}Le.prototype.nodeName="#document-fragment",Le.prototype.nodeType=U,D(Le,Z);function Ve(){}Ve.prototype.nodeType=E,D(Ve,Z);function qe(){}qe.prototype.serializeToString=function(f,v,N){return Ge.call(f,v,N)},Z.prototype.toString=Ge;function Ge(f,v){var N=[],q=this.nodeType==9&&this.documentElement||this,fe=q.prefix,Re=q.namespaceURI;if(Re&&fe==null){var fe=q.lookupPrefix(Re);if(fe==null)var Me=[{namespace:Re,prefix:null}]}return Xe(this,N,f,v,Me),N.join("")}function Ke(f,v,N){var q=f.prefix||"",fe=f.namespaceURI;if(!fe||q==="xml"&&fe===r.XML||fe===r.XMLNS)return!1;for(var Re=N.length;Re--;){var Me=N[Re];if(Me.prefix===q)return Me.namespace!==fe}return!0}function We(f,v,N){f.push(" ",v,'="',N.replace(/[<>&"\t\n\r]/g,ne),'"')}function Xe(f,v,N,q,fe){if(fe||(fe=[]),q)if(f=q(f),f){if(typeof f=="string"){v.push(f);return}}else return;switch(f.nodeType){case P:var Re=f.attributes,Me=Re.length,O=f.firstChild,le=f.tagName;N=r.isHTML(f.namespaceURI)||N;var Ye=le;if(!N&&!f.prefix&&f.namespaceURI){for(var Qe,$e=0;$e<Re.length;$e++)if(Re.item($e).name==="xmlns"){Qe=Re.item($e).value;break}if(!Qe)for(var i=fe.length-1;i>=0;i--){var y=fe[i];if(y.prefix===""&&y.namespace===f.namespaceURI){Qe=y.namespace;break}}if(Qe!==f.namespaceURI)for(var i=fe.length-1;i>=0;i--){var y=fe[i];if(y.namespace===f.namespaceURI){y.prefix&&(Ye=y.prefix+":"+le);break}}}v.push("<",Ye);for(var s=0;s<Me;s++){var p=Re.item(s);p.prefix=="xmlns"?fe.push({prefix:p.localName,namespace:p.value}):p.nodeName=="xmlns"&&fe.push({prefix:"",namespace:p.value})}for(var s=0;s<Me;s++){var p=Re.item(s);if(Ke(p,N,fe)){var R=p.prefix||"",b=p.namespaceURI;We(v,R?"xmlns:"+R:"xmlns",b),fe.push({prefix:R,namespace:b})}Xe(p,v,N,q,fe)}if(le===Ye&&Ke(f,N,fe)){var R=f.prefix||"",b=f.namespaceURI;We(v,R?"xmlns:"+R:"xmlns",b),fe.push({prefix:R,namespace:b})}if(O||N&&!/^(?:meta|link|img|br|hr|input)$/i.test(le)){if(v.push(">"),N&&/^script$/i.test(le))for(;O;)O.data?v.push(O.data):Xe(O,v,N,q,fe.slice()),O=O.nextSibling;else for(;O;)Xe(O,v,N,q,fe.slice()),O=O.nextSibling;v.push("</",Ye,">")}else v.push("/>");return;case k:case U:for(var O=f.firstChild;O;)Xe(O,v,N,q,fe.slice()),O=O.nextSibling;return;case L:return We(v,f.name,f.value);case Y:return v.push(f.data.replace(/[<&>]/g,ne));case W:return v.push("<![CDATA[",f.data,"]]>");case C:return v.push("<!--",f.data,"-->");case g:var j=f.publicId,te=f.systemId;if(v.push("<!DOCTYPE ",f.name),j)v.push(" PUBLIC ",j),te&&te!="."&&v.push(" ",te),v.push(">");else if(te&&te!=".")v.push(" SYSTEM ",te,">");else{var ke=f.internalSubset;ke&&v.push(" [",ke,"]"),v.push(">")}return;case E:return v.push("<?",f.target," ",f.data,"?>");case ie:return v.push("&",f.nodeName,";");default:v.push("??",f.nodeName)}}function nt(f,v,N){var q;switch(v.nodeType){case P:q=v.cloneNode(!1),q.ownerDocument=f;case U:break;case L:N=!0;break}if(q||(q=v.cloneNode(!1)),q.ownerDocument=f,q.parentNode=null,N)for(var fe=v.firstChild;fe;)q.appendChild(nt(f,fe,N)),fe=fe.nextSibling;return q}function et(f,v,N){var q=new v.constructor;for(var fe in v)if(Object.prototype.hasOwnProperty.call(v,fe)){var Re=v[fe];typeof Re!="object"&&Re!=q[fe]&&(q[fe]=Re)}switch(v.childNodes&&(q.childNodes=new $),q.ownerDocument=f,q.nodeType){case P:var Me=v.attributes,le=q.attributes=new oe,Ye=Me.length;le._ownerElement=q;for(var Qe=0;Qe<Ye;Qe++)q.setAttributeNode(et(f,Me.item(Qe),!0));break;case L:N=!0}if(N)for(var $e=v.firstChild;$e;)q.appendChild(et(f,$e,N)),$e=$e.nextSibling;return q}function it(f,v,N){f[v]=N}try{if(Object.defineProperty){let f=function(v){switch(v.nodeType){case P:case U:var N=[];for(v=v.firstChild;v;)v.nodeType!==7&&v.nodeType!==8&&N.push(f(v)),v=v.nextSibling;return N.join("");default:return v.nodeValue}};Object.defineProperty(re.prototype,"length",{get:function(){return ue(this),this.$$length}}),Object.defineProperty(Z.prototype,"textContent",{get:function(){return f(this)},set:function(v){switch(this.nodeType){case P:case U:for(;this.firstChild;)this.removeChild(this.firstChild);(v||String(v))&&this.appendChild(this.ownerDocument.createTextNode(v));break;default:this.data=v,this.value=v,this.nodeValue=v}}}),it=function(v,N,q){v["$$"+N]=q}}}catch(f){}n.DocumentType=xe,n.DOMException=G,n.DOMImplementation=pe,n.Element=I,n.Node=Z,n.NodeList=$,n.XMLSerializer=qe},"./node_modules/@xmldom/xmldom/lib/entities.js":function(o,n,e){var t=e("./node_modules/@xmldom/xmldom/lib/conventions.js").freeze;n.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),n.HTML_ENTITIES=t({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),n.entityMap=n.HTML_ENTITIES},"./node_modules/@xmldom/xmldom/lib/index.js":function(o,n,e){var t=e("./node_modules/@xmldom/xmldom/lib/dom.js");n.DOMImplementation=t.DOMImplementation,n.XMLSerializer=t.XMLSerializer,n.DOMParser=e("./node_modules/@xmldom/xmldom/lib/dom-parser.js").DOMParser},"./node_modules/@xmldom/xmldom/lib/sax.js":function(o,n,e){var t=e("./node_modules/@xmldom/xmldom/lib/conventions.js").NAMESPACE,l=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,r=new RegExp("[\\-\\.0-9"+l.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),u=new RegExp("^"+l.source+r.source+"*(?::"+l.source+r.source+"*)?$"),T=0,w=1,x=2,S=3,A=4,D=5,z=6,P=7;function L(_,V){this.message=_,this.locator=V,Error.captureStackTrace&&Error.captureStackTrace(this,L)}L.prototype=new Error,L.prototype.name=L.name;function Y(){}Y.prototype={parse:function(_,V,X){var G=this.domBuilder;G.startDocument(),g(V,V={}),W(_,V,X,G,this.errorHandler),G.endDocument()}};function W(_,V,X,G,$){function re(I){if(I>65535){I-=65536;var M=55296+(I>>10),Q=56320+(I&1023);return String.fromCharCode(M,Q)}else return String.fromCharCode(I)}function ue(I){var M=I.slice(1,-1);return Object.hasOwnProperty.call(X,M)?X[M]:M.charAt(0)==="#"?re(parseInt(M.substr(1).replace("x","0x"))):($.error("entity not found:"+I),I)}function oe(I){if(I>me){var M=_.substring(me,I).replace(/&#?\w+;/g,ue);Z&&ee(me),G.characters(M,0,I-me),me=I}}function ee(I,M){for(;I>=ae&&(M=pe.exec(_));)ce=M.index,ae=ce+M[0].length,Z.lineNumber++;Z.columnNumber=I-ce+1}for(var ce=0,ae=0,pe=/.*(?:\r\n?|\n)|.*$/g,Z=G.locator,ne=[{currentNSMap:V}],ge={},me=0;;){try{var ve=_.indexOf("<",me);if(ve<0){if(!_.substr(me).match(/^\s*$/)){var ye=G.doc,Ce=ye.createTextNode(_.substr(me));ye.appendChild(Ce),G.currentElement=Ce}return}switch(ve>me&&oe(ve),_.charAt(ve+1)){case"/":var h=_.indexOf(">",ve+3),Ee=_.substring(ve+2,h).replace(/[ \t\n\r]+$/g,""),be=ne.pop();h<0?(Ee=_.substring(ve+2).replace(/[\s<].*/,""),$.error("end tag name: "+Ee+" is not complete:"+be.tagName),h=ve+1+Ee.length):Ee.match(/\s</)&&(Ee=Ee.replace(/[\s<].*/,""),$.error("end tag name: "+Ee+" maybe not complete"),h=ve+1+Ee.length);var Oe=be.localNSMap,we=be.tagName==Ee,De=we||be.tagName&&be.tagName.toLowerCase()==Ee.toLowerCase();if(De){if(G.endElement(be.uri,be.localName,Ee),Oe)for(var He in Oe)Object.prototype.hasOwnProperty.call(Oe,He)&&G.endPrefixMapping(He);we||$.fatalError("end tag name: "+Ee+" is not match the current start tagName:"+be.tagName)}else ne.push(be);h++;break;case"?":Z&&ee(ve),h=F(_,ve,G);break;case"!":Z&&ee(ve),h=U(_,ve,G,$);break;default:Z&&ee(ve);var Pe=new H,se=ne[ne.length-1].currentNSMap,h=B(_,ve,Pe,se,ue,$),c=Pe.length;if(!Pe.closed&&k(_,h,Pe.tagName,ge)&&(Pe.closed=!0,X.nbsp||$.warning("unclosed xml attribute")),Z&&c){for(var a=ie(Z,{}),d=0;d<c;d++){var m=Pe[d];ee(m.offset),m.locator=ie(Z,{})}G.locator=a,E(Pe,G,se)&&ne.push(Pe),G.locator=Z}else E(Pe,G,se)&&ne.push(Pe);t.isHTML(Pe.uri)&&!Pe.closed?h=C(_,h,Pe.tagName,ue,G):h++}}catch(I){if(I instanceof L)throw I;$.error("element parse error: "+I),h=-1}h>me?me=h:oe(Math.max(ve,me)+1)}}function ie(_,V){return V.lineNumber=_.lineNumber,V.columnNumber=_.columnNumber,V}function B(_,V,X,G,$,re){function ue(Z,ne,ge){X.attributeNames.hasOwnProperty(Z)&&re.fatalError("Attribute "+Z+" redefined"),X.addValue(Z,ne.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,$),ge)}for(var oe,ee,ce=++V,ae=T;;){var pe=_.charAt(ce);switch(pe){case"=":if(ae===w)oe=_.slice(V,ce),ae=S;else if(ae===x)ae=S;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ae===S||ae===w)if(ae===w&&(re.warning('attribute value must after "="'),oe=_.slice(V,ce)),V=ce+1,ce=_.indexOf(pe,V),ce>0)ee=_.slice(V,ce),ue(oe,ee,V-1),ae=D;else throw new Error("attribute value no end '"+pe+"' match");else if(ae==A)ee=_.slice(V,ce),ue(oe,ee,V),re.warning('attribute "'+oe+'" missed start quot('+pe+")!!"),V=ce+1,ae=D;else throw new Error('attribute value must after "="');break;case"/":switch(ae){case T:X.setTagName(_.slice(V,ce));case D:case z:case P:ae=P,X.closed=!0;case A:case w:case x:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return re.error("unexpected end of input"),ae==T&&X.setTagName(_.slice(V,ce)),ce;case">":switch(ae){case T:X.setTagName(_.slice(V,ce));case D:case z:case P:break;case A:case w:ee=_.slice(V,ce),ee.slice(-1)==="/"&&(X.closed=!0,ee=ee.slice(0,-1));case x:ae===x&&(ee=oe),ae==A?(re.warning('attribute "'+ee+'" missed quot(")!'),ue(oe,ee,V)):((!t.isHTML(G[""])||!ee.match(/^(?:disabled|checked|selected)$/i))&&re.warning('attribute "'+ee+'" missed value!! "'+ee+'" instead!!'),ue(ee,ee,V));break;case S:throw new Error("attribute value missed!!")}return ce;case"€":pe=" ";default:if(pe<=" ")switch(ae){case T:X.setTagName(_.slice(V,ce)),ae=z;break;case w:oe=_.slice(V,ce),ae=x;break;case A:var ee=_.slice(V,ce);re.warning('attribute "'+ee+'" missed quot(")!!'),ue(oe,ee,V);case D:ae=z;break}else switch(ae){case x:X.tagName,(!t.isHTML(G[""])||!oe.match(/^(?:disabled|checked|selected)$/i))&&re.warning('attribute "'+oe+'" missed value!! "'+oe+'" instead2!!'),ue(oe,oe,V),V=ce,ae=w;break;case D:re.warning('attribute space is required"'+oe+'"!!');case z:ae=w,V=ce;break;case S:ae=A,V=ce;break;case P:throw new Error("elements closed character '/' and '>' must be connected to")}}ce++}}function E(_,V,X){for(var G=_.tagName,$=null,pe=_.length;pe--;){var re=_[pe],ue=re.qName,oe=re.value,Z=ue.indexOf(":");if(Z>0)var ee=re.prefix=ue.slice(0,Z),ce=ue.slice(Z+1),ae=ee==="xmlns"&&ce;else ce=ue,ee=null,ae=ue==="xmlns"&&"";re.localName=ce,ae!==!1&&($==null&&($={},g(X,X={})),X[ae]=$[ae]=oe,re.uri=t.XMLNS,V.startPrefixMapping(ae,oe))}for(var pe=_.length;pe--;){re=_[pe];var ee=re.prefix;ee&&(ee==="xml"&&(re.uri=t.XML),ee!=="xmlns"&&(re.uri=X[ee||""]))}var Z=G.indexOf(":");Z>0?(ee=_.prefix=G.slice(0,Z),ce=_.localName=G.slice(Z+1)):(ee=null,ce=_.localName=G);var ne=_.uri=X[ee||""];if(V.startElement(ne,ce,G,_),_.closed){if(V.endElement(ne,ce,G),$)for(ee in $)Object.prototype.hasOwnProperty.call($,ee)&&V.endPrefixMapping(ee)}else return _.currentNSMap=X,_.localNSMap=$,!0}function C(_,V,X,G,$){if(/^(?:script|textarea)$/i.test(X)){var re=_.indexOf("</"+X+">",V),ue=_.substring(V+1,re);if(/[&<]/.test(ue))return/^script$/i.test(X)?($.characters(ue,0,ue.length),re):(ue=ue.replace(/&#?\w+;/g,G),$.characters(ue,0,ue.length),re)}return V+1}function k(_,V,X,G){var $=G[X];return $==null&&($=_.lastIndexOf("</"+X+">"),$<V&&($=_.lastIndexOf("</"+X)),G[X]=$),$<V}function g(_,V){for(var X in _)Object.prototype.hasOwnProperty.call(_,X)&&(V[X]=_[X])}function U(_,V,X,G){var $=_.charAt(V+2);switch($){case"-":if(_.charAt(V+3)==="-"){var re=_.indexOf("-->",V+4);return re>V?(X.comment(_,V+4,re-V-4),re+3):(G.error("Unclosed comment"),-1)}else return-1;default:if(_.substr(V+3,6)=="CDATA["){var re=_.indexOf("]]>",V+9);return X.startCDATA(),X.characters(_,V+9,re-V-9),X.endCDATA(),re+3}var ue=K(_,V),oe=ue.length;if(oe>1&&/!doctype/i.test(ue[0][0])){var ee=ue[1][0],ce=!1,ae=!1;oe>3&&(/^public$/i.test(ue[2][0])?(ce=ue[3][0],ae=oe>4&&ue[4][0]):/^system$/i.test(ue[2][0])&&(ae=ue[3][0]));var pe=ue[oe-1];return X.startDTD(ee,ce,ae),X.endDTD(),pe.index+pe[0].length}}return-1}function F(_,V,X){var G=_.indexOf("?>",V);if(G){var $=_.substring(V,G).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return $?($[0].length,X.processingInstruction($[1],$[2]),G+2):-1}return-1}function H(){this.attributeNames={}}H.prototype={setTagName:function(_){if(!u.test(_))throw new Error("invalid tagName:"+_);this.tagName=_},addValue:function(_,V,X){if(!u.test(_))throw new Error("invalid attribute:"+_);this.attributeNames[_]=this.length,this[this.length++]={qName:_,value:V,offset:X}},length:0,getLocalName:function(_){return this[_].localName},getLocator:function(_){return this[_].locator},getQName:function(_){return this[_].qName},getURI:function(_){return this[_].uri},getValue:function(_){return this[_].value}};function K(_,V){var X,G=[],$=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for($.lastIndex=V,$.exec(_);X=$.exec(_);)if(G.push(X),X[1])return G}n.XMLReader=Y,n.ParseError=L},"./node_modules/process/browser.js":function(o,n){var e=o.exports={},t,l;function r(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?t=setTimeout:t=r}catch(W){t=r}try{typeof clearTimeout=="function"?l=clearTimeout:l=u}catch(W){l=u}})();function T(W){if(t===setTimeout)return setTimeout(W,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(W,0);try{return t(W,0)}catch(ie){try{return t.call(null,W,0)}catch(B){return t.call(this,W,0)}}}function w(W){if(l===clearTimeout)return clearTimeout(W);if((l===u||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(W);try{return l(W)}catch(ie){try{return l.call(null,W)}catch(B){return l.call(this,W)}}}var x=[],S=!1,A,D=-1;function z(){!S||!A||(S=!1,A.length?x=A.concat(x):D=-1,x.length&&P())}function P(){if(!S){var W=T(z);S=!0;for(var ie=x.length;ie;){for(A=x,x=[];++D<ie;)A&&A[D].run();D=-1,ie=x.length}A=null,S=!1,w(W)}}e.nextTick=function(W){var ie=new Array(arguments.length-1);if(arguments.length>1)for(var B=1;B<arguments.length;B++)ie[B-1]=arguments[B];x.push(new L(W,ie)),x.length===1&&!S&&T(P)};function L(W,ie){this.fun=W,this.array=ie}L.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={};function Y(){}e.on=Y,e.addListener=Y,e.once=Y,e.off=Y,e.removeListener=Y,e.removeAllListeners=Y,e.emit=Y,e.prependListener=Y,e.prependOnceListener=Y,e.listeners=function(W){return[]},e.binding=function(W){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(W){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},"./node_modules/webpack/buildin/amd-options.js":function(o,n){(function(e){o.exports=e}).call(this,{})},"./node_modules/webpack/buildin/global.js":function(o,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){typeof window=="object"&&(e=window)}o.exports=e},"./node_modules/webpack/buildin/module.js":function(o,n){o.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":function(o){o.exports=JSON.parse('{"name":"cos-js-sdk-v5","version":"1.4.20","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 test/test.js server/sts.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"},"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":{"@xmldom/xmldom":"^0.8.6"},"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.3.1","jest-environment-jsdom":"^29.3.1","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":function(o,n,e){var t=e("./node_modules/@babel/runtime/helpers/typeof.js"),l=e("./src/session.js"),r=e("./src/async.js"),u=e("./src/event.js").EventProxy,T=e("./src/util.js"),w=e("./src/tracker.js");function x(g,U){var F=this,H=new u,K=g.TaskId,_=g.Bucket,V=g.Region,X=g.Key,G=g.Body,$=g.ChunkSize||g.SliceSize||F.options.ChunkSize,re=g.AsyncLimit,ue=g.StorageClass,oe=g.ServerSideEncryption,ee,ce,ae=g.onHashProgress,pe=g.tracker;pe&&pe.setParams({chunkSize:$}),H.on("error",function(Z){if(F._isRunningTask(K))return Z.UploadId=g.UploadData.UploadId||"",U(Z)}),H.on("upload_complete",function(Z){var ne=T.extend({UploadId:g.UploadData.UploadId||""},Z);U(null,ne)}),H.on("upload_slice_complete",function(Z){var ne={};T.each(g.Headers,function(ge,me){var ve=me.toLowerCase();(ve.indexOf("x-cos-meta-")===0||ve==="pic-operations")&&(ne[me]=ge)}),L.call(F,{Bucket:_,Region:V,Key:X,UploadId:Z.UploadId,SliceList:Z.SliceList,Headers:ne,tracker:pe},function(ge,me){if(F._isRunningTask(K)){if(l.removeUsing(Z.UploadId),ge)return ce(null,!0),H.emit("error",ge);l.removeUploadId.call(F,Z.UploadId),ce({loaded:ee,total:ee},!0),H.emit("upload_complete",me)}})}),H.on("get_upload_data_finish",function(Z){var ne=l.getFileId(G,g.ChunkSize,_,X);ne&&l.saveUploadId.call(F,ne,Z.UploadId,F.options.UploadIdCacheLimit),l.setUsing(Z.UploadId),ce(null,!0),z.call(F,{TaskId:K,Bucket:_,Region:V,Key:X,Body:G,FileSize:ee,SliceSize:$,AsyncLimit:re,ServerSideEncryption:oe,UploadData:Z,Headers:g.Headers,onProgress:ce,tracker:pe},function(ge,me){if(F._isRunningTask(K)){if(ge)return ce(null,!0),H.emit("error",ge);H.emit("upload_slice_complete",me)}})}),H.on("get_file_size_finish",function(){if(ce=T.throttleOnProgress.call(F,ee,g.onProgress),g.UploadData.UploadId)H.emit("get_upload_data_finish",g.UploadData);else{var Z=T.extend({TaskId:K,Bucket:_,Region:V,Key:X,Headers:g.Headers,StorageClass:ue,Body:G,FileSize:ee,SliceSize:$,onHashProgress:ae,tracker:pe},g);S.call(F,Z,function(ne,ge){if(F._isRunningTask(K)){if(ne)return H.emit("error",ne);g.UploadData.UploadId=ge.UploadId,g.UploadData.PartList=ge.PartList,H.emit("get_upload_data_finish",g.UploadData)}})}}),ee=g.ContentLength,delete g.ContentLength,!g.Headers&&(g.Headers={}),T.each(g.Headers,function(Z,ne){ne.toLowerCase()==="content-length"&&delete g.Headers[ne]}),function(){for(var Z=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],ne=1024*1024,ge=0;ge<Z.length&&(ne=Z[ge]*1024*1024,!(ee/ne<=F.options.MaxPartNumber));ge++);g.ChunkSize=g.SliceSize=$=Math.max($,ne)}(),ee===0?(g.Body="",g.ContentLength=0,g.SkipTask=!0,F.putObject(g,U)):H.emit("get_file_size_finish")}function S(g,U){var F=g.TaskId,H=g.Bucket,K=g.Region,_=g.Key,V=g.StorageClass,X=this,G={},$=g.FileSize,re=g.SliceSize,ue=Math.ceil($/re),oe=0,ee=T.throttleOnProgress.call(X,$,g.onHashProgress),ce=function(ne,ge){var me=re*(ne-1),ve=Math.min(me+re,$),ye=ve-me;G[ne]?ge(null,{PartNumber:ne,ETag:G[ne],Size:ye}):T.fileSlice(g.Body,me,ve,!1,function(Ce){T.getFileMd5(Ce,function(Ee,be){if(Ee)return ge(T.error(Ee));var Oe='"'+be+'"';G[ne]=Oe,oe+=ye,ee({loaded:oe,total:$}),ge(null,{PartNumber:ne,ETag:Oe,Size:ye})})})},ae=function(ne,ge){var me=ne.length;if(me===0)return ge(null,!0);if(me>ue)return ge(null,!1);if(me>1){var ve=Math.max(ne[0].Size,ne[1].Size);if(ve!==re)return ge(null,!1)}var ye=function Ce(Ee){if(Ee<me){var be=ne[Ee];ce(be.PartNumber,function(Oe,we){we&&we.ETag===be.ETag&&we.Size===be.Size?Ce(Ee+1):ge(null,!1)})}else ge(null,!0)};ye(0)},pe=new u;pe.on("error",function(Z){if(X._isRunningTask(F))return U(Z)}),pe.on("upload_id_available",function(Z){var ne={},ge=[];T.each(Z.PartList,function(ye){ne[ye.PartNumber]=ye});for(var me=1;me<=ue;me++){var ve=ne[me];ve?(ve.PartNumber=me,ve.Uploaded=!0):ve={PartNumber:me,ETag:null,Uploaded:!1},ge.push(ve)}Z.PartList=ge,U(null,Z)}),pe.on("no_available_upload_id",function(){if(X._isRunningTask(F)){var Z=T.extend({Bucket:H,Region:K,Key:_,Query:T.clone(g.Query),StorageClass:V,Body:g.Body,calledBySdk:"sliceUploadFile",tracker:g.tracker},g),ne=T.clone(g.Headers);delete ne["x-cos-mime-limit"],Z.Headers=ne,X.multipartInit(Z,function(ge,me){if(X._isRunningTask(F)){if(ge)return pe.emit("error",ge);var ve=me.UploadId;if(!ve)return U(T.error(new Error("no such upload id")));pe.emit("upload_id_available",{UploadId:ve,PartList:[]})}})}}),pe.on("has_and_check_upload_id",function(Z){Z=Z.reverse(),r.eachLimit(Z,1,function(ne,ge){if(X._isRunningTask(F)){if(l.using[ne]){ge();return}D.call(X,{Bucket:H,Region:K,Key:_,UploadId:ne,tracker:g.tracker},function(me,ve){if(X._isRunningTask(F)){if(me)return l.removeUsing(ne),pe.emit("error",me);var ye=ve.PartList;ye.forEach(function(Ce){Ce.PartNumber*=1,Ce.Size*=1,Ce.ETag=Ce.ETag||""}),ae(ye,function(Ce,Ee){if(X._isRunningTask(F)){if(Ce)return pe.emit("error",Ce);Ee?ge({UploadId:ne,PartList:ye}):ge()}})}})}},function(ne){X._isRunningTask(F)&&(ee(null,!0),ne&&ne.UploadId?pe.emit("upload_id_available",ne):pe.emit("no_available_upload_id"))})}),pe.on("seek_local_avail_upload_id",function(Z){var ne=l.getFileId(g.Body,g.ChunkSize,H,_),ge=l.getUploadIdList.call(X,ne);if(!ne||!ge){pe.emit("has_and_check_upload_id",Z);return}var me=function ve(ye){if(ye>=ge.length){pe.emit("has_and_check_upload_id",Z);return}var Ce=ge[ye];if(!T.isInArray(Z,Ce)){l.removeUploadId.call(X,Ce),ve(ye+1);return}if(l.using[Ce]){ve(ye+1);return}D.call(X,{Bucket:H,Region:K,Key:_,UploadId:Ce,tracker:g.tracker},function(Ee,be){X._isRunningTask(F)&&(Ee?(l.removeUploadId.call(X,Ce),ve(ye+1)):pe.emit("upload_id_available",{UploadId:Ce,PartList:be.PartList}))})};me(0)}),pe.on("get_remote_upload_id_list",function(){A.call(X,{Bucket:H,Region:K,Key:_,tracker:g.tracker},function(Z,ne){if(X._isRunningTask(F)){if(Z)return pe.emit("error",Z);var ge=T.filter(ne.UploadList,function(ye){return ye.Key===_&&(!V||ye.StorageClass.toUpperCase()===V.toUpperCase())}).reverse().map(function(ye){return ye.UploadId||ye.UploadID});if(ge.length)pe.emit("seek_local_avail_upload_id",ge);else{var me=l.getFileId(g.Body,g.ChunkSize,H,_),ve;me&&(ve=l.getUploadIdList.call(X,me))&&T.each(ve,function(ye){l.removeUploadId.call(X,ye)}),pe.emit("no_available_upload_id")}}})}),pe.emit("get_remote_upload_id_list")}function A(g,U){var F=this,H=[],K={Bucket:g.Bucket,Region:g.Region,Prefix:g.Key,calledBySdk:g.calledBySdk||"sliceUploadFile",tracker:g.tracker},_=function V(){F.multipartList(K,function(X,G){if(X)return U(X);H.push.apply(H,G.Upload||[]),G.IsTruncated==="true"?(K.KeyMarker=G.NextKeyMarker,K.UploadIdMarker=G.NextUploadIdMarker,V()):U(null,{UploadList:H})})};_()}function D(g,U){var F=this,H=[],K={Bucket:g.Bucket,Region:g.Region,Key:g.Key,UploadId:g.UploadId,calledBySdk:"sliceUploadFile",tracker:g.tracker},_=function V(){F.multipartListPart(K,function(X,G){if(X)return U(X);H.push.apply(H,G.Part||[]),G.IsTruncated==="true"?(K.PartNumberMarker=G.NextPartNumberMarker,V()):U(null,{PartList:H})})};_()}function z(g,U){var F=this,H=g.TaskId,K=g.Bucket,_=g.Region,V=g.Key,X=g.UploadData,G=g.FileSize,$=g.SliceSize,re=Math.min(g.AsyncLimit||F.options.ChunkParallelLimit||1,256),ue=g.Body,oe=Math.ceil(G/$),ee=0,ce=g.ServerSideEncryption,ae=g.Headers,pe=T.filter(X.PartList,function(ne){return ne.Uploaded&&(ee+=ne.PartNumber>=oe&&G%$||$),!ne.Uploaded}),Z=g.onProgress;r.eachLimit(pe,re,function(ne,ge){if(F._isRunningTask(H)){var me=ne.PartNumber,ve=Math.min(G,ne.PartNumber*$)-(ne.PartNumber-1)*$,ye=0;P.call(F,{TaskId:H,Bucket:K,Region:_,Key:V,SliceSize:$,FileSize:G,PartNumber:me,ServerSideEncryption:ce,Body:ue,UploadData:X,Headers:ae,onProgress:function(Ee){ee+=Ee.loaded-ye,ye=Ee.loaded,Z({loaded:ee,total:G})},tracker:g.tracker},function(Ce,Ee){F._isRunningTask(H)&&(!Ce&&!Ee.ETag&&(Ce='get ETag error, please add "ETag" to CORS ExposeHeader setting.( 获取ETag失败,请在CORS ExposeHeader设置中添加ETag,请参考文档:https://cloud.tencent.com/document/product/436/13318 )'),Ce?ee-=ye:(ee+=ve-ye,ne.ETag=Ee.ETag),Z({loaded:ee,total:G}),ge(Ce||null,Ee))})}},function(ne){if(F._isRunningTask(H)){if(ne)return U(ne);U(null,{UploadId:X.UploadId,SliceList:X.PartList})}})}function P(g,U){var F=this,H=g.TaskId,K=g.Bucket,_=g.Region,V=g.Key,X=g.FileSize,G=g.Body,$=g.PartNumber*1,re=g.SliceSize,ue=g.ServerSideEncryption,oe=g.UploadData,ee=g.Headers||{},ce=F.options.ChunkRetryTimes+1,ae=re*($-1),pe=re,Z=ae+re;Z>X&&(Z=X,pe=Z-ae);var ne=["x-cos-traffic-limit","x-cos-mime-limit"],ge={};T.each(ee,function(ve,ye){ne.indexOf(ye)>-1&&(ge[ye]=ve)});var me=oe.PartList[$-1];r.retry(ce,function(ve){F._isRunningTask(H)&&T.fileSlice(G,ae,Z,!0,function(ye){F.multipartUpload({TaskId:H,Bucket:K,Region:_,Key:V,ContentLength:pe,PartNumber:$,UploadId:oe.UploadId,ServerSideEncryption:ue,Body:ye,Headers:ge,onProgress:g.onProgress,calledBySdk:"sliceUploadFile",tracker:g.tracker},function(Ce,Ee){if(F._isRunningTask(H))return Ce?ve(Ce):(me.Uploaded=!0,ve(null,Ee))})})},function(ve,ye){if(F._isRunningTask(H))return U(ve,ye)})}function L(g,U){var F=g.Bucket,H=g.Region,K=g.Key,_=g.UploadId,V=g.SliceList,X=this,G=this.options.ChunkRetryTimes+1,$=g.Headers,re=V.map(function(ue){return{PartNumber:ue.PartNumber,ETag:ue.ETag}});r.retry(G,function(ue){X.multipartComplete({Bucket:F,Region:H,Key:K,UploadId:_,Parts:re,Headers:$,calledBySdk:"sliceUploadFile",tracker:g.tracker},ue)},function(ue,oe){U(ue,oe)})}function Y(g,U){var F=g.Bucket,H=g.Region,K=g.Key,_=g.UploadId,V=g.Level||"task",X=g.AsyncLimit,G=this,$=new u;if($.on("error",function(re){return U(re)}),$.on("get_abort_array",function(re){W.call(G,{Bucket:F,Region:H,Key:K,Headers:g.Headers,AsyncLimit:X,AbortArray:re},U)}),V==="bucket")A.call(G,{Bucket:F,Region:H,calledBySdk:"abortUploadTask"},function(re,ue){if(re)return U(re);$.emit("get_abort_array",ue.UploadList||[])});else if(V==="file"){if(!K)return U(T.error(new Error("abort_upload_task_no_key")));A.call(G,{Bucket:F,Region:H,Key:K,calledBySdk:"abortUploadTask"},function(re,ue){if(re)return U(re);$.emit("get_abort_array",ue.UploadList||[])})}else if(V==="task"){if(!_)return U(T.error(new Error("abort_upload_task_no_id")));if(!K)return U(T.error(new Error("abort_upload_task_no_key")));$.emit("get_abort_array",[{Key:K,UploadId:_}])}else return U(T.error(new Error("abort_unknown_level")))}function W(g,U){var F=g.Bucket,H=g.Region,K=g.Key,_=g.AbortArray,V=g.AsyncLimit||1,X=this,G=0,$=new Array(_.length);r.eachLimit(_,V,function(re,ue){var oe=G;if(K&&K!==re.Key){$[oe]={error:{KeyNotMatch:!0}},ue(null);return}var ee=re.UploadId||re.UploadID;X.multipartAbort({Bucket:F,Region:H,Key:re.Key,Headers:g.Headers,UploadId:ee},function(ce){var ae={Bucket:F,Region:H,Key:re.Key,UploadId:ee};$[oe]={error:ce,task:ae},ue(null)}),G++},function(re){if(re)return U(re);for(var ue=[],oe=[],ee=0,ce=$.length;ee<ce;ee++){var ae=$[ee];ae.task&&(ae.error?oe.push(ae.task):ue.push(ae.task))}return U(null,{successList:ue,errorList:oe})})}function ie(g,U){var F=this,H=g.SliceSize===void 0?F.options.SliceSize:g.SliceSize,K=[],_=g.Body,V=_.size||_.length||0,X={TaskId:""};if(F.options.EnableTracker){var G=F.options.UseAccelerate||typeof F.options.Domain=="string"&&F.options.Domain.includes("accelerate.");g.tracker=new w({bucket:g.Bucket,region:g.Region,apiName:"uploadFile",fileKey:g.Key,fileSize:V,accelerate:G,deepTracker:F.options.DeepTracker,customId:F.options.CustomId,delay:F.options.TrackerDelay})}T.each(g,function(ce,ae){t(ce)!=="object"&&typeof ce!="function"&&(X[ae]=ce)});var $=g.onTaskReady,re=function(ae){X.TaskId=ae,$&&$(ae)};g.onTaskReady=re;var ue=V>H?"sliceUploadFile":"putObject",oe=g.onFileFinish,ee=function(ae,pe){g.tracker&&g.tracker.formatResult(ae,pe),oe&&oe(ae,pe,X),U&&U(ae,pe)};K.push({api:ue,params:g,callback:ee}),F._addTasks(K)}function B(g,U){var F=this,H=g.SliceSize===void 0?F.options.SliceSize:g.SliceSize,K=0,_=0,V=T.throttleOnProgress.call(F,_,g.onProgress),X=g.files.length,G=g.onFileFinish,$=Array(X),re=function(ee,ce,ae){V(null,!0),G&&G(ee,ce,ae),$[ae.Index]={options:ae,error:ee,data:ce},--X<=0&&U&&U(null,{files:$})},ue=[];T.each(g.files,function(oe,ee){(function(){var ce=oe.Body,ae=ce.size||ce.length||0,pe={Index:ee,TaskId:""};if(!F.options.UseRawKey&&oe.Key&&oe.Key.substr(0,1)==="/"&&(oe.Key=oe.Key.substr(1)),K+=ae,F.options.EnableTracker){var Z=F.options.UseAccelerate||typeof F.options.Domain=="string"&&F.options.Domain.includes("accelerate.");oe.tracker=new w({bucket:oe.Bucket,region:oe.Region,apiName:"uploadFiles",fileKey:oe.Key,fileSize:ae,accelerate:Z,deepTracker:F.options.DeepTracker,customId:F.options.CustomId,delay:F.options.TrackerDelay})}T.each(oe,function(Oe,we){t(Oe)!=="object"&&typeof Oe!="function"&&(pe[we]=Oe)});var ne=oe.onTaskReady,ge=function(we){pe.TaskId=we,ne&&ne(we)};oe.onTaskReady=ge;var me=0,ve=oe.onProgress,ye=function(we){_=_-me+we.loaded,me=we.loaded,ve&&ve(we),V({loaded:_,total:K})};oe.onProgress=ye;var Ce=ae>H?"sliceUploadFile":"putObject",Ee=oe.onFileFinish,be=function(we,De){oe.tracker&&oe.tracker.formatResult(we,De),Ee&&Ee(we,De),re&&re(we,De,pe)};ue.push({api:Ce,params:oe,callback:be})})()}),F._addTasks(ue)}function E(g,U){var F=new u,H=this,K=g.Bucket,_=g.Region,V=g.Key,X=g.CopySource,G=T.getSourceParams.call(this,X);if(!G){U(T.error(new Error("CopySource format error")));return}var $=G.Bucket,re=G.Region,ue=decodeURIComponent(G.Key),oe=g.CopySliceSize===void 0?H.options.CopySliceSize:g.CopySliceSize;oe=Math.max(0,oe);var ee=g.CopyChunkSize||this.options.CopyChunkSize,ce=this.options.CopyChunkParallelLimit,ae=this.options.ChunkRetryTimes+1,pe=0,Z=0,ne,ge,me={},ve={},ye={};F.on("copy_slice_complete",function(Ce){T.each(g.Headers,function(be,Oe){Oe.toLowerCase().indexOf("x-cos-meta-")});var Ee=T.map(Ce.PartList,function(be){return{PartNumber:be.PartNumber,ETag:be.ETag}});r.retry(ae,function(be){H.multipartComplete({Bucket:K,Region:_,Key:V,UploadId:Ce.UploadId,Parts:Ee,calledBySdk:"sliceCopyFile"},be)},function(be,Oe){if(l.removeUsing(Ce.UploadId),be)return ge(null,!0),U(be);l.removeUploadId(Ce.UploadId),ge({loaded:ne,total:ne},!0),U(null,Oe)})}),F.on("get_copy_data_finish",function(Ce){var Ee=l.getCopyFileId(X,me,ee,K,V);Ee&&l.saveUploadId(Ee,Ce.UploadId,H.options.UploadIdCacheLimit),l.setUsing(Ce.UploadId);var be=T.filter(Ce.PartList,function(Oe){return Oe.Uploaded&&(Z+=Oe.PartNumber>=pe&&ne%ee||ee),!Oe.Uploaded});r.eachLimit(be,ce,function(Oe,we){var De=Oe.PartNumber,He=Oe.CopySourceRange,Pe=Oe.end-Oe.start;r.retry(ae,function(se){C.call(H,{Bucket:K,Region:_,Key:V,CopySource:X,UploadId:Ce.UploadId,PartNumber:De,CopySourceRange:He},se)},function(se,h){if(se)return we(se);Z+=Pe,ge({loaded:Z,total:ne}),Oe.ETag=h.ETag,we(se||null,h)})},function(Oe){if(Oe)return l.removeUsing(Ce.UploadId),ge(null,!0),U(Oe);F.emit("copy_slice_complete",Ce)})}),F.on("get_chunk_size_finish",function(){var Ce=function(){H.multipartInit({Bucket:K,Region:_,Key:V,Headers:ye},function(De,He){if(De)return U(De);g.UploadId=He.UploadId,F.emit("get_copy_data_finish",{UploadId:g.UploadId,PartList:g.PartList})})},Ee=l.getCopyFileId(X,me,ee,K,V),be=l.getUploadIdList(Ee);if(!Ee||!be)return Ce();var Oe=function we(De){if(De>=be.length)return Ce();var He=be[De];if(l.using[He])return we(De+1);D.call(H,{Bucket:K,Region:_,Key:V,UploadId:He},function(Pe,se){if(Pe)l.removeUploadId(He),we(De+1);else{if(l.using[He])return we(De+1);var h={},c=0;T.each(se.PartList,function(a){var d=parseInt(a.Size),m=c+d-1;h[a.PartNumber+"|"+c+"|"+m]=a.ETag,c+=d}),T.each(g.PartList,function(a){var d=h[a.PartNumber+"|"+a.start+"|"+a.end];d&&(a.ETag=d,a.Uploaded=!0)}),F.emit("get_copy_data_finish",{UploadId:He,PartList:g.PartList})}})};Oe(0)}),F.on("get_file_size_finish",function(){if(function(){for(var Ee=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],be=1024*1024,Oe=0;Oe<Ee.length&&(be=Ee[Oe]*1024*1024,!(ne/be<=H.options.MaxPartNumber));Oe++);g.ChunkSize=ee=Math.max(ee,be),pe=Math.ceil(ne/ee);for(var we=[],De=1;De<=pe;De++){var He=(De-1)*ee,Pe=De*ee<ne?De*ee-1:ne-1,se={PartNumber:De,start:He,end:Pe,CopySourceRange:"bytes="+He+"-"+Pe};we.push(se)}g.PartList=we}(),g.Headers["x-cos-metadata-directive"]==="Replaced"?ye=g.Headers:ye=ve,ye["x-cos-storage-class"]=g.Headers["x-cos-storage-class"]||ve["x-cos-storage-class"],ye=T.clearKey(ye),ve["x-cos-storage-class"]==="ARCHIVE"||ve["x-cos-storage-class"]==="DEEP_ARCHIVE"){var Ce=ve["x-cos-restore"];if(!Ce||Ce==='ongoing-request="true"'){U(T.error(new Error("Unrestored archive object is not allowed to be copied")));return}}delete ye["x-cos-copy-source"],delete ye["x-cos-metadata-directive"],delete ye["x-cos-copy-source-If-Modified-Since"],delete ye["x-cos-copy-source-If-Unmodified-Since"],delete ye["x-cos-copy-source-If-Match"],delete ye["x-cos-copy-source-If-None-Match"],F.emit("get_chunk_size_finish")}),H.headObject({Bucket:$,Region:re,Key:ue},function(Ce,Ee){if(Ce){Ce.statusCode&&Ce.statusCode===404?U(T.error(Ce,{ErrorStatus:ue+" Not Exist"})):U(Ce);return}if(ne=g.FileSize=Ee.headers["content-length"],ne===void 0||!ne){U(T.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 )')));return}if(ge=T.throttleOnProgress.call(H,ne,g.onProgress),ne<=oe)g.Headers["x-cos-metadata-directive"]||(g.Headers["x-cos-metadata-directive"]="Copy"),H.putObjectCopy(g,function(Oe,we){if(Oe)return ge(null,!0),U(Oe);ge({loaded:ne,total:ne},!0),U(Oe,we)});else{var be=Ee.headers;me=be,ve={"Cache-Control":be["cache-control"],"Content-Disposition":be["content-disposition"],"Content-Encoding":be["content-encoding"],"Content-Type":be["content-type"],Expires:be.expires,"x-cos-storage-class":be["x-cos-storage-class"]},T.each(be,function(Oe,we){var De="x-cos-meta-";we.indexOf(De)===0&&we.length>De.length&&(ve[we]=Oe)}),F.emit("get_file_size_finish")}})}function C(g,U){var F=g.TaskId,H=g.Bucket,K=g.Region,_=g.Key,V=g.CopySource,X=g.UploadId,G=g.PartNumber*1,$=g.CopySourceRange,re=this.options.ChunkRetryTimes+1,ue=this;r.retry(re,function(oe){ue.uploadPartCopy({TaskId:F,Bucket:H,Region:K,Key:_,CopySource:V,UploadId:X,PartNumber:G,CopySourceRange:$},function(ee,ce){oe(ee||null,ce)})},function(oe,ee){return U(oe,ee)})}var k={sliceUploadFile:x,abortUploadTask:Y,uploadFile:ie,uploadFiles:B,sliceCopyFile:E};o.exports.init=function(g,U){U.transferToTaskMethod(k,"sliceUploadFile"),T.each(k,function(F,H){g.prototype[H]=T.apiWrapper(H,F)})}},"./src/async.js":function(o,n){var e=function(u,T,w,x){if(x=x||function(){},!u.length||T<=0)return x();var S=0,A=0,D=0;(function z(){if(S>=u.length)return x();for(;D<T&&A<u.length;)A+=1,D+=1,w(u[A-1],function(P){P?(x(P),x=function(){}):(S+=1,D-=1,S>=u.length?x():z())})})()},t=function(u,T,w){var x=function S(A){T(function(D,z){D&&A<u?S(A+1):w(D,z)})};u<1?w():x(1)},l={eachLimit:e,retry:t};o.exports=l},"./src/base.js":function(o,n,e){var t=e("./node_modules/@babel/runtime/helpers/typeof.js"),l=e("./lib/request.js"),r=e("./src/util.js");function u(i,y){typeof i=="function"&&(y=i,i={});var s=this.options.Protocol||(r.isBrowser&&(typeof location>"u"?"undefined":t(location))==="object"&&location.protocol==="http:"?"http:":"https:"),p=this.options.ServiceDomain,R=i.AppId||this.options.appId,b=i.Region;p?(p=p.replace(/\{\{AppId\}\}/gi,R||"").replace(/\{\{Region\}\}/gi,b||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(p)||(p=s+"//"+p),p.slice(-1)==="/"&&(p=p.slice(0,-1))):b?p=s+"//cos."+b+".myqcloud.com":p=s+"//service.cos.myqcloud.com";var O="",j=b?"cos."+b+".myqcloud.com":"service.cos.myqcloud.com",te=p.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");j===te&&(O=j),le.call(this,{Action:"name/cos:GetService",url:p,method:"GET",headers:i.Headers,SignHost:O},function(ke,Te){if(ke)return y(ke);var Se=Te&&Te.ListAllMyBucketsResult&&Te.ListAllMyBucketsResult.Buckets&&Te.ListAllMyBucketsResult.Buckets.Bucket||[];Se=r.isArray(Se)?Se:[Se];var Ae=Te&&Te.ListAllMyBucketsResult&&Te.ListAllMyBucketsResult.Owner||{};y(null,{Buckets:Se,Owner:Ae,statusCode:Te.statusCode,headers:Te.headers})})}function T(i,y){var s=this,p="";if(i.BucketAZConfig){var R={BucketAZConfig:i.BucketAZConfig};p=r.json2xml({CreateBucketConfiguration:R})}le.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,body:p},function(b,O){if(b)return y(b);var j=q({protocol:s.options.Protocol,domain:s.options.Domain,bucket:i.Bucket,region:i.Region,isLocation:!0});y(null,{Location:j,statusCode:O.statusCode,headers:O.headers})})}function w(i,y){le.call(this,{Action:"name/cos:HeadBucket",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,method:"HEAD"},y)}function x(i,y){var s={};s.prefix=i.Prefix||"",s.delimiter=i.Delimiter,s.marker=i.Marker,s["max-keys"]=i.MaxKeys,s["encoding-type"]=i.EncodingType,le.call(this,{Action:"name/cos:GetBucket",ResourceKey:s.prefix,method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,qs:s},function(p,R){if(p)return y(p);var b=R.ListBucketResult||{},O=b.Contents||[],j=b.CommonPrefixes||[];O=r.isArray(O)?O:[O],j=r.isArray(j)?j:[j];var te=r.clone(b);r.extend(te,{Contents:O,CommonPrefixes:j,statusCode:R.statusCode,headers:R.headers}),y(null,te)})}function S(i,y){le.call(this,{Action:"name/cos:DeleteBucket",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,method:"DELETE"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function A(i,y){var s=i.Headers,p="";if(i.AccessControlPolicy){var R=r.clone(i.AccessControlPolicy||{}),b=R.Grants||R.Grant;b=r.isArray(b)?b:[b],delete R.Grant,delete R.Grants,R.AccessControlList={Grant:b},p=r.json2xml({AccessControlPolicy:R}),s["Content-Type"]="application/xml",s["Content-MD5"]=r.b64(r.md5(p))}r.each(s,function(O,j){j.indexOf("x-cos-grant-")===0&&(s[j]=N(s[j]))}),le.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:i.Bucket,Region:i.Region,headers:s,action:"acl",body:p},function(O,j){if(O)return y(O);y(null,{statusCode:j.statusCode,headers:j.headers})})}function D(i,y){le.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"acl"},function(s,p){if(s)return y(s);var R=p.AccessControlPolicy||{},b=R.Owner||{},O=R.AccessControlList.Grant||[];O=r.isArray(O)?O:[O];var j=v(R);p.headers&&p.headers["x-cos-acl"]&&(j.ACL=p.headers["x-cos-acl"]),j=r.extend(j,{Owner:b,Grants:O,statusCode:p.statusCode,headers:p.headers}),y(null,j)})}function z(i,y){var s=i.CORSConfiguration||{},p=s.CORSRules||i.CORSRules||[];p=r.clone(r.isArray(p)?p:[p]),r.each(p,function(j){r.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(te){var ke=te+"s",Te=j[ke]||j[te]||[];delete j[ke],j[te]=r.isArray(Te)?Te:[Te]})});var R={CORSRule:p};i.ResponseVary&&(R.ResponseVary=i.ResponseVary);var b=r.json2xml({CORSConfiguration:R}),O=i.Headers;O["Content-Type"]="application/xml",O["Content-MD5"]=r.b64(r.md5(b)),le.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:b,action:"cors",headers:O},function(j,te){if(j)return y(j);y(null,{statusCode:te.statusCode,headers:te.headers})})}function P(i,y){le.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"cors"},function(s,p){if(s){if(s.statusCode===404&&s.error&&s.error.Code==="NoSuchCORSConfiguration"){var R={CORSRules:[],statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=p.CORSConfiguration||{},O=b.CORSRules||b.CORSRule||[];O=r.clone(r.isArray(O)?O:[O]);var j=b.ResponseVary;r.each(O,function(te){r.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(ke){var Te=ke+"s",Se=te[Te]||te[ke]||[];delete te[ke],te[Te]=r.isArray(Se)?Se:[Se]})}),y(null,{CORSRules:O,ResponseVary:j,statusCode:p.statusCode,headers:p.headers})})}function L(i,y){le.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"cors"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode||s.statusCode,headers:p.headers})})}function Y(i,y){le.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"location"},y)}function W(i,y){var s=i.Policy;try{typeof s=="string"&&(s=JSON.parse(s))}catch(b){}if(!s||typeof s=="string")return y(r.error(new Error("Policy format error")));var p=JSON.stringify(s);s.version||(s.version="2.0");var R=i.Headers;R["Content-Type"]="application/json",R["Content-MD5"]=r.b64(r.md5(p)),le.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:i.Bucket,Region:i.Region,action:"policy",body:p,headers:R},function(b,O){if(b&&b.statusCode===204)return y(null,{statusCode:b.statusCode});if(b)return y(b);y(null,{statusCode:O.statusCode,headers:O.headers})})}function ie(i,y){le.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"policy",rawBody:!0},function(s,p){if(s)return s.statusCode&&s.statusCode===403?y(r.error(s,{ErrorStatus:"Access Denied"})):s.statusCode&&s.statusCode===405?y(r.error(s,{ErrorStatus:"Method Not Allowed"})):s.statusCode&&s.statusCode===404?y(r.error(s,{ErrorStatus:"Policy Not Found"})):y(s);var R={};try{R=JSON.parse(p.body)}catch(b){}y(null,{Policy:R,statusCode:p.statusCode,headers:p.headers})})}function B(i,y){le.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"policy"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode||s.statusCode,headers:p.headers})})}function E(i,y){var s=i.Tagging||{},p=s.TagSet||s.Tags||i.Tags||[];p=r.clone(r.isArray(p)?p:[p]);var R=r.json2xml({Tagging:{TagSet:{Tag:p}}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:R,action:"tagging",headers:b},function(O,j){if(O&&O.statusCode===204)return y(null,{statusCode:O.statusCode});if(O)return y(O);y(null,{statusCode:j.statusCode,headers:j.headers})})}function C(i,y){le.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"tagging"},function(s,p){if(s){if(s.statusCode===404&&s.error&&(s.error==="Not Found"||s.error.Code==="NoSuchTagSet")){var R={Tags:[],statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=[];try{b=p.Tagging.TagSet.Tag||[]}catch(O){}b=r.clone(r.isArray(b)?b:[b]),y(null,{Tags:b,statusCode:p.statusCode,headers:p.headers})})}function k(i,y){le.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"tagging"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function g(i,y){var s=i.LifecycleConfiguration||{},p=s.Rules||i.Rules||[];p=r.clone(p);var R=r.json2xml({LifecycleConfiguration:{Rule:p}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:R,action:"lifecycle",headers:b},function(O,j){if(O&&O.statusCode===204)return y(null,{statusCode:O.statusCode});if(O)return y(O);y(null,{statusCode:j.statusCode,headers:j.headers})})}function U(i,y){le.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"lifecycle"},function(s,p){if(s){if(s.statusCode===404&&s.error&&s.error.Code==="NoSuchLifecycleConfiguration"){var R={Rules:[],statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=[];try{b=p.LifecycleConfiguration.Rule||[]}catch(O){}b=r.clone(r.isArray(b)?b:[b]),y(null,{Rules:b,statusCode:p.statusCode,headers:p.headers})})}function F(i,y){le.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"lifecycle"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function H(i,y){if(!i.VersioningConfiguration){y(r.error(new Error("missing param VersioningConfiguration")));return}var s=i.VersioningConfiguration||{},p=r.json2xml({VersioningConfiguration:s}),R=i.Headers;R["Content-Type"]="application/xml",R["Content-MD5"]=r.b64(r.md5(p)),le.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:p,action:"versioning",headers:R},function(b,O){if(b&&b.statusCode===204)return y(null,{statusCode:b.statusCode});if(b)return y(b);y(null,{statusCode:O.statusCode,headers:O.headers})})}function K(i,y){le.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"versioning"},function(s,p){s||!p.VersioningConfiguration&&(p.VersioningConfiguration={}),y(s,p)})}function _(i,y){var s=r.clone(i.ReplicationConfiguration),p=r.json2xml({ReplicationConfiguration:s});p=p.replace(/<(\/?)Rules>/gi,"<$1Rule>"),p=p.replace(/<(\/?)Tags>/gi,"<$1Tag>");var R=i.Headers;R["Content-Type"]="application/xml",R["Content-MD5"]=r.b64(r.md5(p)),le.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:p,action:"replication",headers:R},function(b,O){if(b&&b.statusCode===204)return y(null,{statusCode:b.statusCode});if(b)return y(b);y(null,{statusCode:O.statusCode,headers:O.headers})})}function V(i,y){le.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"replication"},function(s,p){if(s){if(s.statusCode===404&&s.error&&(s.error==="Not Found"||s.error.Code==="ReplicationConfigurationnotFoundError")){var R={ReplicationConfiguration:{Rules:[]},statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}!p.ReplicationConfiguration&&(p.ReplicationConfiguration={}),p.ReplicationConfiguration.Rule&&(p.ReplicationConfiguration.Rules=r.makeArray(p.ReplicationConfiguration.Rule),delete p.ReplicationConfiguration.Rule),y(s,p)})}function X(i,y){le.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"replication"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function G(i,y){if(!i.WebsiteConfiguration){y(r.error(new Error("missing param WebsiteConfiguration")));return}var s=r.clone(i.WebsiteConfiguration||{}),p=s.RoutingRules||s.RoutingRule||[];p=r.isArray(p)?p:[p],delete s.RoutingRule,delete s.RoutingRules,p.length&&(s.RoutingRules={RoutingRule:p});var R=r.json2xml({WebsiteConfiguration:s}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:R,action:"website",headers:b},function(O,j){if(O&&O.statusCode===204)return y(null,{statusCode:O.statusCode});if(O)return y(O);y(null,{statusCode:j.statusCode,headers:j.headers})})}function $(i,y){le.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,action:"website"},function(s,p){if(s){if(s.statusCode===404&&s.error.Code==="NoSuchWebsiteConfiguration"){var R={WebsiteConfiguration:{},statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=p.WebsiteConfiguration||{};if(b.RoutingRules){var O=r.clone(b.RoutingRules.RoutingRule||[]);O=r.makeArray(O),b.RoutingRules=O}y(null,{WebsiteConfiguration:b,statusCode:p.statusCode,headers:p.headers})})}function re(i,y){le.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"website"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function ue(i,y){if(!i.RefererConfiguration){y(r.error(new Error("missing param RefererConfiguration")));return}var s=r.clone(i.RefererConfiguration||{}),p=s.DomainList||{},R=p.Domains||p.Domain||[];R=r.isArray(R)?R:[R],R.length&&(s.DomainList={Domain:R});var b=r.json2xml({RefererConfiguration:s}),O=i.Headers;O["Content-Type"]="application/xml",O["Content-MD5"]=r.b64(r.md5(b)),le.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:b,action:"referer",headers:O},function(j,te){if(j&&j.statusCode===204)return y(null,{statusCode:j.statusCode});if(j)return y(j);y(null,{statusCode:te.statusCode,headers:te.headers})})}function oe(i,y){le.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,action:"referer"},function(s,p){if(s){if(s.statusCode===404&&s.error.Code==="NoSuchRefererConfiguration"){var R={WebsiteConfiguration:{},statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=p.RefererConfiguration||{};if(b.DomainList){var O=r.makeArray(b.DomainList.Domain||[]);b.DomainList={Domains:O}}y(null,{RefererConfiguration:b,statusCode:p.statusCode,headers:p.headers})})}function ee(i,y){var s=i.DomainConfiguration||{},p=s.DomainRule||i.DomainRule||[];p=r.clone(p);var R=r.json2xml({DomainConfiguration:{DomainRule:p}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:R,action:"domain",headers:b},function(O,j){if(O&&O.statusCode===204)return y(null,{statusCode:O.statusCode});if(O)return y(O);y(null,{statusCode:j.statusCode,headers:j.headers})})}function ce(i,y){le.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"domain"},function(s,p){if(s)return y(s);var R=[];try{R=p.DomainConfiguration.DomainRule||[]}catch(b){}R=r.clone(r.isArray(R)?R:[R]),y(null,{DomainRule:R,statusCode:p.statusCode,headers:p.headers})})}function ae(i,y){le.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"domain"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function pe(i,y){var s=i.OriginConfiguration||{},p=s.OriginRule||i.OriginRule||[];p=r.clone(p);var R=r.json2xml({OriginConfiguration:{OriginRule:p}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:R,action:"origin",headers:b},function(O,j){if(O&&O.statusCode===204)return y(null,{statusCode:O.statusCode});if(O)return y(O);y(null,{statusCode:j.statusCode,headers:j.headers})})}function Z(i,y){le.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"origin"},function(s,p){if(s)return y(s);var R=[];try{R=p.OriginConfiguration.OriginRule||[]}catch(b){}R=r.clone(r.isArray(R)?R:[R]),y(null,{OriginRule:R,statusCode:p.statusCode,headers:p.headers})})}function ne(i,y){le.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"origin"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function ge(i,y){var s=r.json2xml({BucketLoggingStatus:i.BucketLoggingStatus||""}),p=i.Headers;p["Content-Type"]="application/xml",p["Content-MD5"]=r.b64(r.md5(s)),le.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:s,action:"logging",headers:p},function(R,b){if(R&&R.statusCode===204)return y(null,{statusCode:R.statusCode});if(R)return y(R);y(null,{statusCode:b.statusCode,headers:b.headers})})}function me(i,y){le.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"logging"},function(s,p){if(s)return y(s);y(null,{BucketLoggingStatus:p.BucketLoggingStatus,statusCode:p.statusCode,headers:p.headers})})}function ve(i,y,s){var p=r.clone(y.InventoryConfiguration);if(p.OptionalFields){var R=p.OptionalFields||[];p.OptionalFields={Field:R}}if(p.Destination&&p.Destination.COSBucketDestination&&p.Destination.COSBucketDestination.Encryption){var b=p.Destination.COSBucketDestination.Encryption;Object.keys(b).indexOf("SSECOS")>-1&&(b["SSE-COS"]=b.SSECOS,delete b.SSECOS)}var O=r.json2xml({InventoryConfiguration:p}),j=y.Headers;j["Content-Type"]="application/xml",j["Content-MD5"]=r.b64(r.md5(O));var te=i==="PUT"?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";le.call(this,{Action:te,method:i,Bucket:y.Bucket,Region:y.Region,body:O,action:"inventory",qs:{id:y.Id},headers:j},function(ke,Te){if(ke&&ke.statusCode===204)return s(null,{statusCode:ke.statusCode});if(ke)return s(ke);s(null,{statusCode:Te.statusCode,headers:Te.headers})})}function ye(i,y){return ve.call(this,"PUT",i,y)}function Ce(i,y){return ve.call(this,"POST",i,y)}function Ee(i,y){le.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"inventory",qs:{id:i.Id}},function(s,p){if(s)return y(s);var R=p.InventoryConfiguration;if(R&&R.OptionalFields&&R.OptionalFields.Field){var b=R.OptionalFields.Field;r.isArray(b)||(b=[b]),R.OptionalFields=b}if(R.Destination&&R.Destination.COSBucketDestination&&R.Destination.COSBucketDestination.Encryption){var O=R.Destination.COSBucketDestination.Encryption;Object.keys(O).indexOf("SSE-COS")>-1&&(O.SSECOS=O["SSE-COS"],delete O["SSE-COS"])}y(null,{InventoryConfiguration:R,statusCode:p.statusCode,headers:p.headers})})}function be(i,y){le.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"inventory",qs:{"continuation-token":i.ContinuationToken}},function(s,p){if(s)return y(s);var R=p.ListInventoryConfigurationResult,b=R.InventoryConfiguration||[];b=r.isArray(b)?b:[b],delete R.InventoryConfiguration,r.each(b,function(O){if(O&&O.OptionalFields&&O.OptionalFields.Field){var j=O.OptionalFields.Field;r.isArray(j)||(j=[j]),O.OptionalFields=j}if(O.Destination&&O.Destination.COSBucketDestination&&O.Destination.COSBucketDestination.Encryption){var te=O.Destination.COSBucketDestination.Encryption;Object.keys(te).indexOf("SSE-COS")>-1&&(te.SSECOS=te["SSE-COS"],delete te["SSE-COS"])}}),R.InventoryConfigurations=b,r.extend(R,{statusCode:p.statusCode,headers:p.headers}),y(null,R)})}function Oe(i,y){le.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"inventory",qs:{id:i.Id}},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function we(i,y){if(!i.AccelerateConfiguration){y(r.error(new Error("missing param AccelerateConfiguration")));return}var s={AccelerateConfiguration:i.AccelerateConfiguration||{}},p=r.json2xml(s),R={};R["Content-Type"]="application/xml",R["Content-MD5"]=r.b64(r.md5(p)),le.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:p,action:"accelerate",headers:R},function(b,O){if(b)return y(b);y(null,{statusCode:O.statusCode,headers:O.headers})})}function De(i,y){le.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:i.Bucket,Region:i.Region,action:"accelerate"},function(s,p){s||!p.AccelerateConfiguration&&(p.AccelerateConfiguration={}),y(s,p)})}function He(i,y){var s=i.ServerSideEncryptionConfiguration||{},p=s.Rule||s.Rules||[],R=r.json2xml({ServerSideEncryptionConfiguration:{Rule:p}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:R,action:"encryption",headers:b},function(O,j){if(O&&O.statusCode===204)return y(null,{statusCode:O.statusCode});if(O)return y(O);y(null,{statusCode:j.statusCode,headers:j.headers})})}function Pe(i,y){le.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"encryption"},function(s,p){if(s){if(s.statusCode===404&&s.code==="NoSuchEncryptionConfiguration"){var R={EncryptionConfiguration:{Rules:[]},statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=r.makeArray(p.EncryptionConfiguration&&p.EncryptionConfiguration.Rule||[]);p.EncryptionConfiguration={Rules:b},y(s,p)})}function se(i,y){le.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"encryption"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function h(i,y){le.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:i.Bucket,Region:i.Region,Key:i.Key,VersionId:i.VersionId,headers:i.Headers},function(s,p){if(s){var R=s.statusCode;return i.Headers["If-Modified-Since"]&&R&&R===304?y(null,{NotModified:!0,statusCode:R}):y(s)}p.ETag=r.attr(p.headers,"etag",""),y(null,p)})}function c(i,y){var s={};s.prefix=i.Prefix||"",s.delimiter=i.Delimiter,s["key-marker"]=i.KeyMarker,s["version-id-marker"]=i.VersionIdMarker,s["max-keys"]=i.MaxKeys,s["encoding-type"]=i.EncodingType,le.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:s.prefix,method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,qs:s,action:"versions"},function(p,R){if(p)return y(p);var b=R.ListVersionsResult||{},O=b.DeleteMarker||[];O=r.isArray(O)?O:[O];var j=b.Version||[];j=r.isArray(j)?j:[j];var te=r.clone(b);delete te.DeleteMarker,delete te.Version,r.extend(te,{DeleteMarkers:O,Versions:j,statusCode:R.statusCode,headers:R.headers}),y(null,te)})}function a(i,y){var s=i.Query||{},p=i.QueryString||"",R=r.throttleOnProgress.call(this,0,i.onProgress),b=i.tracker;b&&b.setParams({signStartTime:new Date().getTime()}),s["response-content-type"]=i.ResponseContentType,s["response-content-language"]=i.ResponseContentLanguage,s["response-expires"]=i.ResponseExpires,s["response-cache-control"]=i.ResponseCacheControl,s["response-content-disposition"]=i.ResponseContentDisposition,s["response-content-encoding"]=i.ResponseContentEncoding,le.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:i.Bucket,Region:i.Region,Key:i.Key,VersionId:i.VersionId,DataType:i.DataType,headers:i.Headers,qs:s,qsStr:p,rawBody:!0,onDownloadProgress:R,tracker:b},function(O,j){if(R(null,!0),O){var te=O.statusCode;return i.Headers["If-Modified-Since"]&&te&&te===304?y(null,{NotModified:!0}):y(O)}y(null,{Body:j.body,ETag:r.attr(j.headers,"etag",""),statusCode:j.statusCode,headers:j.headers})})}function d(i,y){var s=this,p=i.ContentLength,R=r.throttleOnProgress.call(s,p,i.onProgress),b=i.Headers;!b["Cache-Control"]&&!b["cache-control"]&&(b["Cache-Control"]=""),!b["Content-Type"]&&!b["content-type"]&&(b["Content-Type"]=i.Body&&i.Body.type||"");var O=i.UploadAddMetaMd5||s.options.UploadAddMetaMd5||s.options.UploadCheckContentMd5,j=i.tracker;O&&j&&j.setParams({md5StartTime:new Date().getTime()}),r.getBodyMd5(O,i.Body,function(te){te&&(j&&j.setParams({md5EndTime:new Date().getTime()}),s.options.UploadCheckContentMd5&&(b["Content-MD5"]=r.b64(te)),(i.UploadAddMetaMd5||s.options.UploadAddMetaMd5)&&(b["x-cos-meta-md5"]=te)),i.ContentLength!==void 0&&(b["Content-Length"]=i.ContentLength),R(null,!0),le.call(s,{Action:"name/cos:PutObject",TaskId:i.TaskId,method:"PUT",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,qs:i.Query,body:i.Body,onProgress:R,tracker:j},function(ke,Te){if(ke)return R(null,!0),y(ke);R({loaded:p,total:p},!0);var Se=q({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:i.Bucket,region:s.options.UseAccelerate?"accelerate":i.Region,object:i.Key});Se=Se.substr(Se.indexOf("://")+3),Te.Location=Se,Te.ETag=r.attr(Te.headers,"etag",""),y(null,Te)})},i.onHashProgress)}function m(i,y){le.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,VersionId:i.VersionId,action:i.Recursive?"recursive":""},function(s,p){if(s){var R=s.statusCode;return R&&R===404?y(null,{BucketNotFound:!0,statusCode:R}):y(s)}y(null,{statusCode:p.statusCode,headers:p.headers})})}function I(i,y){var s={};i.VersionId&&(s.versionId=i.VersionId),le.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,qs:s,action:"acl"},function(p,R){if(p)return y(p);var b=R.AccessControlPolicy||{},O=b.Owner||{},j=b.AccessControlList&&b.AccessControlList.Grant||[];j=r.isArray(j)?j:[j];var te=v(b);delete te.GrantWrite,R.headers&&R.headers["x-cos-acl"]&&(te.ACL=R.headers["x-cos-acl"]),te=r.extend(te,{Owner:O,Grants:j,statusCode:R.statusCode,headers:R.headers}),y(null,te)})}function M(i,y){var s=i.Headers,p="";if(i.AccessControlPolicy){var R=r.clone(i.AccessControlPolicy||{}),b=R.Grants||R.Grant;b=r.isArray(b)?b:[b],delete R.Grant,delete R.Grants,R.AccessControlList={Grant:b},p=r.json2xml({AccessControlPolicy:R}),s["Content-Type"]="application/xml",s["Content-MD5"]=r.b64(r.md5(p))}r.each(s,function(O,j){j.indexOf("x-cos-grant-")===0&&(s[j]=N(s[j]))}),le.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:i.Bucket,Region:i.Region,Key:i.Key,action:"acl",headers:s,body:p},function(O,j){if(O)return y(O);y(null,{statusCode:j.statusCode,headers:j.headers})})}function Q(i,y){var s=i.Headers;s.Origin=i.Origin,s["Access-Control-Request-Method"]=i.AccessControlRequestMethod,s["Access-Control-Request-Headers"]=i.AccessControlRequestHeaders,le.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:s},function(p,R){if(p)return p.statusCode&&p.statusCode===403?y(null,{OptionsForbidden:!0,statusCode:p.statusCode}):y(p);var b=R.headers||{};y(null,{AccessControlAllowOrigin:b["access-control-allow-origin"],AccessControlAllowMethods:b["access-control-allow-methods"],AccessControlAllowHeaders:b["access-control-allow-headers"],AccessControlExposeHeaders:b["access-control-expose-headers"],AccessControlMaxAge:b["access-control-max-age"],statusCode:R.statusCode,headers:R.headers})})}function de(i,y){var s=this,p=i.Headers;!p["Cache-Control"]&&!p["cache-control"]&&(p["Cache-Control"]="");var R=i.CopySource||"",b=r.getSourceParams.call(this,R);if(!b){y(r.error(new Error("CopySource format error")));return}var O=b.Bucket,j=b.Region,te=decodeURIComponent(b.Key);le.call(this,{Scope:[{action:"name/cos:GetObject",bucket:O,region:j,prefix:te},{action:"name/cos:PutObject",bucket:i.Bucket,region:i.Region,prefix:i.Key}],method:"PUT",Bucket:i.Bucket,Region:i.Region,Key:i.Key,VersionId:i.VersionId,headers:i.Headers},function(ke,Te){if(ke)return y(ke);var Se=r.clone(Te.CopyObjectResult||{}),Ae=q({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:i.Bucket,region:i.Region,object:i.Key,isLocation:!0});r.extend(Se,{Location:Ae,statusCode:Te.statusCode,headers:Te.headers}),y(null,Se)})}function he(i,y){var s=i.CopySource||"",p=r.getSourceParams.call(this,s);if(!p){y(r.error(new Error("CopySource format error")));return}var R=p.Bucket,b=p.Region,O=decodeURIComponent(p.Key);le.call(this,{Scope:[{action:"name/cos:GetObject",bucket:R,region:b,prefix:O},{action:"name/cos:PutObject",bucket:i.Bucket,region:i.Region,prefix:i.Key}],method:"PUT",Bucket:i.Bucket,Region:i.Region,Key:i.Key,VersionId:i.VersionId,qs:{partNumber:i.PartNumber,uploadId:i.UploadId},headers:i.Headers},function(j,te){if(j)return y(j);var ke=r.clone(te.CopyPartResult||{});r.extend(ke,{statusCode:te.statusCode,headers:te.headers}),y(null,ke)})}function J(i,y){var s=i.Objects||[],p=i.Quiet;s=r.isArray(s)?s:[s];var R=r.json2xml({Delete:{Object:s,Quiet:p||!1}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R));var O=r.map(s,function(j){return{action:"name/cos:DeleteObject",bucket:i.Bucket,region:i.Region,prefix:j.Key}});le.call(this,{Scope:O,method:"POST",Bucket:i.Bucket,Region:i.Region,body:R,action:"delete",headers:b},function(j,te){if(j)return y(j);var ke=te.DeleteResult||{},Te=ke.Deleted||[],Se=ke.Error||[];Te=r.isArray(Te)?Te:[Te],Se=r.isArray(Se)?Se:[Se];var Ae=r.clone(ke);r.extend(Ae,{Error:Se,Deleted:Te,statusCode:te.statusCode,headers:te.headers}),y(null,Ae)})}function xe(i,y){var s=i.Headers;if(!i.RestoreRequest){y(r.error(new Error("missing param RestoreRequest")));return}var p=i.RestoreRequest||{},R=r.json2xml({RestoreRequest:p});s["Content-Type"]="application/xml",s["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:i.Bucket,Region:i.Region,Key:i.Key,VersionId:i.VersionId,body:R,action:"restore",headers:s},y)}function Be(i,y){var s=i.Tagging||{},p=s.TagSet||s.Tags||i.Tags||[];p=r.clone(r.isArray(p)?p:[p]);var R=r.json2xml({Tagging:{TagSet:{Tag:p}}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:i.Bucket,Key:i.Key,Region:i.Region,body:R,action:"tagging",headers:b,VersionId:i.VersionId},function(O,j){if(O&&O.statusCode===204)return y(null,{statusCode:O.statusCode});if(O)return y(O);y(null,{statusCode:j.statusCode,headers:j.headers})})}function Ue(i,y){le.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:i.Key,Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"tagging",VersionId:i.VersionId},function(s,p){if(s){if(s.statusCode===404&&s.error&&(s.error==="Not Found"||s.error.Code==="NoSuchTagSet")){var R={Tags:[],statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=[];try{b=p.Tagging.TagSet.Tag||[]}catch(O){}b=r.clone(r.isArray(b)?b:[b]),y(null,{Tags:b,statusCode:p.statusCode,headers:p.headers})})}function _e(i,y){le.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,action:"tagging",VersionId:i.VersionId},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function Le(i,y){var s=i.SelectType;if(!s)return y(r.error(new Error("missing param SelectType")));var p=i.SelectRequest||{},R=r.json2xml({SelectRequest:p}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:GetObject",method:"POST",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,action:"select",qs:{"select-type":i.SelectType},VersionId:i.VersionId,body:R,DataType:"arraybuffer",rawBody:!0},function(O,j){if(O&&O.statusCode===204)return y(null,{statusCode:O.statusCode});if(O)return y(O);var te=r.parseSelectPayload(j.body);y(null,{statusCode:j.statusCode,headers:j.headers,Body:te.body,Payload:te.payload})})}function Ve(i,y){var s=this,p=i.Headers,R=i.tracker;!p["Cache-Control"]&&!p["cache-control"]&&(p["Cache-Control"]=""),!p["Content-Type"]&&!p["content-type"]&&(p["Content-Type"]=i.Body&&i.Body.type||"");var b=i.Body&&(i.UploadAddMetaMd5||s.options.UploadAddMetaMd5);b&&R&&R.setParams({md5StartTime:new Date().getTime()}),r.getBodyMd5(b,i.Body,function(O){O&&(i.Headers["x-cos-meta-md5"]=O),b&&R&&R.setParams({md5EndTime:new Date().getTime()}),le.call(s,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:i.Bucket,Region:i.Region,Key:i.Key,action:"uploads",headers:i.Headers,qs:i.Query,tracker:R},function(j,te){if(j)return R&&R.parent&&R.parent.setParams({errorNode:"multipartInit"}),y(j);if(te=r.clone(te||{}),te&&te.InitiateMultipartUploadResult)return y(null,r.extend(te.InitiateMultipartUploadResult,{statusCode:te.statusCode,headers:te.headers}));y(null,te)})},i.onHashProgress)}function qe(i,y){var s=this;r.getFileSize("multipartUpload",i,function(){var p=i.tracker,R=s.options.UploadCheckContentMd5;R&&p&&p.setParams({md5StartTime:new Date().getTime()}),r.getBodyMd5(R,i.Body,function(b){b&&(i.Headers["Content-MD5"]=r.b64(b)),R&&p&&p.setParams({md5EndTime:new Date().getTime()}),p&&p.setParams({partNumber:i.PartNumber}),le.call(s,{Action:"name/cos:UploadPart",TaskId:i.TaskId,method:"PUT",Bucket:i.Bucket,Region:i.Region,Key:i.Key,qs:{partNumber:i.PartNumber,uploadId:i.UploadId},headers:i.Headers,onProgress:i.onProgress,body:i.Body||null,tracker:p},function(O,j){if(O)return p&&p.parent&&p.parent.setParams({errorNode:"multipartUpload"}),y(O);y(null,{ETag:r.attr(j.headers,"etag",""),statusCode:j.statusCode,headers:j.headers})})})})}function Ge(i,y){for(var s=this,p=i.UploadId,R=i.Parts,b=i.tracker,O=0,j=R.length;O<j;O++)R[O].ETag&&R[O].ETag.indexOf('"')===0||(R[O].ETag='"'+R[O].ETag+'"');var te=r.json2xml({CompleteMultipartUpload:{Part:R}});te=te.replace(/\n\s*/g,"");var ke=i.Headers;ke["Content-Type"]="application/xml",ke["Content-MD5"]=r.b64(r.md5(te)),le.call(this,{Action:"name/cos:CompleteMultipartUpload",method:"POST",Bucket:i.Bucket,Region:i.Region,Key:i.Key,qs:{uploadId:p},body:te,headers:ke,tracker:b},function(Te,Se){if(Te)return b&&b.parent&&b.parent.setParams({errorNode:"multipartComplete"}),y(Te);var Ae=q({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:i.Bucket,region:i.Region,object:i.Key,isLocation:!0}),Fe=Se.CompleteMultipartUploadResult||{};Fe.ProcessResults&&Fe&&Fe.ProcessResults&&(Fe.UploadResult={OriginalInfo:{Key:Fe.Key,Location:Ae,ETag:Fe.ETag,ImageInfo:Fe.ImageInfo},ProcessResults:Fe.ProcessResults},delete Fe.ImageInfo,delete Fe.ProcessResults);var Je=r.extend(Fe,{Location:Ae,statusCode:Se.statusCode,headers:Se.headers});y(null,Je)})}function Ke(i,y){var s={};s.delimiter=i.Delimiter,s["encoding-type"]=i.EncodingType,s.prefix=i.Prefix||"",s["max-uploads"]=i.MaxUploads,s["key-marker"]=i.KeyMarker,s["upload-id-marker"]=i.UploadIdMarker,s=r.clearKey(s);var p=i.tracker;p&&p.setParams({signStartTime:new Date().getTime()}),le.call(this,{Action:"name/cos:ListMultipartUploads",ResourceKey:s.prefix,method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,qs:s,action:"uploads",tracker:p},function(R,b){if(R)return p&&p.parent&&p.parent.setParams({errorNode:"multipartList"}),y(R);if(b&&b.ListMultipartUploadsResult){var O=b.ListMultipartUploadsResult.Upload||[];O=r.isArray(O)?O:[O],b.ListMultipartUploadsResult.Upload=O}var j=r.clone(b.ListMultipartUploadsResult||{});r.extend(j,{statusCode:b.statusCode,headers:b.headers}),y(null,j)})}function We(i,y){var s={},p=i.tracker;s.uploadId=i.UploadId,s["encoding-type"]=i.EncodingType,s["max-parts"]=i.MaxParts,s["part-number-marker"]=i.PartNumberMarker,le.call(this,{Action:"name/cos:ListParts",method:"GET",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,qs:s},function(R,b){if(R)return p&&p.parent&&p.parent.setParams({errorNode:"multipartListPart"}),y(R);var O=b.ListPartsResult||{},j=O.Part||[];j=r.isArray(j)?j:[j],O.Part=j;var te=r.clone(O);r.extend(te,{statusCode:b.statusCode,headers:b.headers}),y(null,te)})}function Xe(i,y){var s={};s.uploadId=i.UploadId,le.call(this,{Action:"name/cos:AbortMultipartUpload",method:"DELETE",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,qs:s},function(p,R){if(p)return y(p);y(null,{statusCode:R.statusCode,headers:R.headers})})}function nt(i,y){le.call(this,{method:i.Method,Bucket:i.Bucket,Region:i.Region,Key:i.Key,action:i.Action,headers:i.Headers,qs:i.Query,body:i.Body,Url:i.Url,rawBody:i.RawBody,DataType:i.DataType},function(s,p){if(s)return y(s);p&&p.body&&(p.Body=p.body,delete p.body),y(s,p)})}function et(i,y){var s=i.Headers;!s["Cache-Control"]&&!s["cache-control"]&&(s["Cache-Control"]=""),!s["Content-Type"]&&!s["content-type"]&&(s["Content-Type"]=i.Body&&i.Body.type||""),le.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:i.Bucket,Region:i.Region,action:"append",Key:i.Key,body:i.Body,qs:{position:i.Position},headers:i.Headers},function(p,R){if(p)return y(p);y(null,R)})}function it(i){var y=this;return r.getAuth({SecretId:i.SecretId||this.options.SecretId||"",SecretKey:i.SecretKey||this.options.SecretKey||"",Bucket:i.Bucket,Region:i.Region,Method:i.Method,Key:i.Key,Query:i.Query,Headers:i.Headers,Expires:i.Expires,UseRawKey:y.options.UseRawKey,SystemClockOffset:y.options.SystemClockOffset})}function f(i,y){var s=this,p=i.UseAccelerate===void 0?s.options.UseAccelerate:i.UseAccelerate,R=q({ForcePathStyle:s.options.ForcePathStyle,protocol:i.Protocol||s.options.Protocol,domain:i.Domain||s.options.Domain,bucket:i.Bucket,region:p?"accelerate":i.Region,object:i.Key}),b="";i.Query&&(b+=r.obj2str(i.Query)),i.QueryString&&(b+=(b?"&":"")+i.QueryString);var O=R;if(i.Sign!==void 0&&!i.Sign)return b&&(O+="?"+b),y(null,{Url:O}),O;var j=fe.call(this,{Bucket:i.Bucket,Region:i.Region,UseAccelerate:i.UseAccelerate,Url:R}),te=Re.call(this,{Action:(i.Method||"").toUpperCase()==="PUT"?"name/cos:PutObject":"name/cos:GetObject",Bucket:i.Bucket||"",Region:i.Region||"",Method:i.Method||"get",Key:i.Key,Expires:i.Expires,Headers:i.Headers,Query:i.Query,SignHost:j,ForceSignHost:i.ForceSignHost===!1?!1:s.options.ForceSignHost},function(ke,Te){if(y){if(ke){y(ke);return}var Se=function(Je){var ot=Je.match(/q-url-param-list.*?(?=&)/g)[0],rt="q-url-param-list="+encodeURIComponent(ot.replace(/q-url-param-list=/,"")).toLowerCase(),Ze=new RegExp(ot,"g"),st=Je.replace(Ze,rt);return st},Ae=R;Ae+="?"+(Te.Authorization.indexOf("q-signature")>-1?Se(Te.Authorization):"sign="+encodeURIComponent(Te.Authorization)),Te.SecurityToken&&(Ae+="&x-cos-security-token="+Te.SecurityToken),Te.ClientIP&&(Ae+="&clientIP="+Te.ClientIP),Te.ClientUA&&(Ae+="&clientUA="+Te.ClientUA),Te.Token&&(Ae+="&token="+Te.Token),b&&(Ae+="&"+b),setTimeout(function(){y(null,{Url:Ae})})}});return te?(O+="?"+te.Authorization+(te.SecurityToken?"&x-cos-security-token="+te.SecurityToken:""),b&&(O+="&"+b)):b&&(O+="?"+b),O}function v(i){var y={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},s={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},p=i&&i.AccessControlList||{},R=p.Grant;R&&(R=r.isArray(R)?R:[R]);var b={READ:0,WRITE:0,FULL_CONTROL:0};return R&&R.length&&r.each(R,function(O){O.Grantee.ID==="qcs::cam::anyone:anyone"||O.Grantee.URI==="http://cam.qcloud.com/groups/global/AllUsers"?b[O.Permission]=1:O.Grantee.ID!==i.Owner.ID&&y[s[O.Permission]].push('id="'+O.Grantee.ID+'"')}),b.FULL_CONTROL||b.WRITE&&b.READ?y.ACL="public-read-write":b.READ?y.ACL="public-read":y.ACL="private",r.each(s,function(O){y[O]=N(y[O].join(","))}),y}function N(i){var y=i.split(","),s={},p,R;for(p=0;p<y.length;)R=y[p].trim(),s[R]?y.splice(p,1):(s[R]=!0,y[p]=R,p++);return y.join(",")}function q(i){var y=i.region||"",s=i.bucket||"",p=s.substr(0,s.lastIndexOf("-")),R=s.substr(s.lastIndexOf("-")+1),b=i.domain,O=i.object;typeof b=="function"&&(b=b({Bucket:s,Region:y})),["http","https"].includes(i.protocol)&&(i.protocol=i.protocol+":");var j=i.protocol||(r.isBrowser&&(typeof location>"u"?"undefined":t(location))==="object"&&location.protocol==="http:"?"http:":"https:");b||(["cn-south","cn-south-2","cn-north","cn-east","cn-southwest","sg"].indexOf(y)>-1?b="{Region}.myqcloud.com":b="cos.{Region}.myqcloud.com",i.ForcePathStyle||(b="{Bucket}."+b)),b=b.replace(/\{\{AppId\}\}/gi,R).replace(/\{\{Bucket\}\}/gi,p).replace(/\{\{Region\}\}/gi,y).replace(/\{\{.*?\}\}/gi,""),b=b.replace(/\{AppId\}/gi,R).replace(/\{BucketName\}/gi,p).replace(/\{Bucket\}/gi,s).replace(/\{Region\}/gi,y).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(b)||(b=j+"//"+b),b.slice(-1)==="/"&&(b=b.slice(0,-1));var te=b;return i.ForcePathStyle&&(te+="/"+s),te+="/",O&&(te+=r.camSafeUrlEncode(O).replace(/%2F/g,"/")),i.isLocation&&(te=te.replace(/^https?:\/\//,"")),te}var fe=function(y){if(!y.Bucket||!y.Region)return"";var s=y.UseAccelerate===void 0?this.options.UseAccelerate:y.UseAccelerate,p=y.Url||q({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:y.Bucket,region:s?"accelerate":y.Region}),R=p.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1"),b=new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$");return b.test(R)?R:""};function Re(i,y){var s=r.clone(i.Headers),p="";r.each(s,function(Ie,Ne){(Ie===""||["content-type","cache-control","expires"].indexOf(Ne.toLowerCase())>-1)&&delete s[Ne],Ne.toLowerCase()==="host"&&(p=Ie)});var R=i.ForceSignHost!==!1;!p&&i.SignHost&&R&&(s.Host=i.SignHost);var b=!1,O=function(Ne,je){b||(b=!0,je&&je.XCosSecurityToken&&!je.SecurityToken&&(je=r.clone(je),je.SecurityToken=je.XCosSecurityToken,delete je.XCosSecurityToken),y&&y(Ne,je))},j=this,te=i.Bucket||"",ke=i.Region||"",Te=i.Key||"";j.options.ForcePathStyle&&te&&(Te=te+"/"+Te);var Se="/"+Te,Ae={},Fe=i.Scope;if(!Fe){var Je=i.Action||"",ot=i.ResourceKey||i.Key||"";Fe=i.Scope||[{action:Je,bucket:te,region:ke,prefix:ot}]}var rt=r.md5(JSON.stringify(Fe));j._StsCache=j._StsCache||[],function(){var Ie,Ne;for(Ie=j._StsCache.length-1;Ie>=0;Ie--){Ne=j._StsCache[Ie];var je=Math.round(r.getSkewTime(j.options.SystemClockOffset)/1e3)+30;if(Ne.StartTime&&je<Ne.StartTime||je>=Ne.ExpiredTime){j._StsCache.splice(Ie,1);continue}if(!Ne.ScopeLimit||Ne.ScopeLimit&&Ne.ScopeKey===rt){Ae=Ne;break}}}();var Ze=function(){var Ne="";Ae.StartTime&&i.Expires?Ne=Ae.StartTime+";"+(Ae.StartTime+i.Expires*1):Ae.StartTime&&Ae.ExpiredTime&&(Ne=Ae.StartTime+";"+Ae.ExpiredTime);var je=r.getAuth({SecretId:Ae.TmpSecretId,SecretKey:Ae.TmpSecretKey,Method:i.Method,Pathname:Se,Query:i.Query,Headers:s,Expires:i.Expires,UseRawKey:j.options.UseRawKey,SystemClockOffset:j.options.SystemClockOffset,KeyTime:Ne,ForceSignHost:R}),ze={Authorization:je,SecurityToken:Ae.SecurityToken||Ae.XCosSecurityToken||"",Token:Ae.Token||"",ClientIP:Ae.ClientIP||"",ClientUA:Ae.ClientUA||""};O(null,ze)},st=function(Ne){if(Ne.Authorization){var je=!1,ze=Ne.Authorization;if(ze)if(ze.indexOf(" ")>-1)je=!1;else if(ze.indexOf("q-sign-algorithm=")>-1&&ze.indexOf("q-ak=")>-1&&ze.indexOf("q-sign-time=")>-1&&ze.indexOf("q-key-time=")>-1&&ze.indexOf("q-url-param-list=")>-1)je=!0;else try{ze=atob(ze),ze.indexOf("a=")>-1&&ze.indexOf("k=")>-1&&ze.indexOf("t=")>-1&&ze.indexOf("r=")>-1&&ze.indexOf("b=")>-1&&(je=!0)}catch(tt){}if(!je)return r.error(new Error("getAuthorization callback params format error"))}else{if(!Ne.TmpSecretId)return r.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!Ne.TmpSecretKey)return r.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!Ne.SecurityToken&&!Ne.XCosSecurityToken)return r.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!Ne.ExpiredTime)return r.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(Ne.ExpiredTime&&Ne.ExpiredTime.toString().length!==10)return r.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(Ne.StartTime&&Ne.StartTime.toString().length!==10)return r.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(Ae.ExpiredTime&&Ae.ExpiredTime-r.getSkewTime(j.options.SystemClockOffset)/1e3>60)Ze();else if(j.options.getAuthorization)j.options.getAuthorization.call(j,{Bucket:te,Region:ke,Method:i.Method,Key:Te,Pathname:Se,Query:i.Query,Headers:s,Scope:Fe,SystemClockOffset:j.options.SystemClockOffset,ForceSignHost:R},function(Ie){typeof Ie=="string"&&(Ie={Authorization:Ie});var Ne=st(Ie);if(Ne)return O(Ne);Ie.Authorization?O(null,Ie):(Ae=Ie||{},Ae.Scope=Fe,Ae.ScopeKey=rt,j._StsCache.push(Ae),Ze())});else if(j.options.getSTS)j.options.getSTS.call(j,{Bucket:te,Region:ke},function(Ie){Ae=Ie||{},Ae.Scope=Fe,Ae.ScopeKey=rt,Ae.TmpSecretId||(Ae.TmpSecretId=Ae.SecretId),Ae.TmpSecretKey||(Ae.TmpSecretKey=Ae.SecretKey);var Ne=st(Ae);if(Ne)return O(Ne);j._StsCache.push(Ae),Ze()});else return function(){var Ie=r.getAuth({SecretId:i.SecretId||j.options.SecretId,SecretKey:i.SecretKey||j.options.SecretKey,Method:i.Method,Pathname:Se,Query:i.Query,Headers:s,Expires:i.Expires,UseRawKey:j.options.UseRawKey,SystemClockOffset:j.options.SystemClockOffset,ForceSignHost:R}),Ne={Authorization:Ie,SecurityToken:j.options.SecurityToken||j.options.XCosSecurityToken};return O(null,Ne),Ne}();return""}function Me(i){var y=!1,s=!1,p=i.headers&&(i.headers.date||i.headers.Date)||i.error&&i.error.ServerTime;try{var R=i.error.Code,b=i.error.Message;(R==="RequestTimeTooSkewed"||R==="AccessDenied"&&b==="Request has expired")&&(s=!0)}catch(j){}if(i)if(s&&p){var O=Date.parse(p);this.options.CorrectClockSkew&&Math.abs(r.getSkewTime(this.options.SystemClockOffset)-O)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=O-Date.now(),y=!0)}else Math.floor(i.statusCode/100)===5&&(y=!0);return y}function le(i,y){var s=this;!i.headers&&(i.headers={}),!i.qs&&(i.qs={}),i.VersionId&&(i.qs.versionId=i.VersionId),i.qs=r.clearKey(i.qs),i.headers&&(i.headers=r.clearKey(i.headers)),i.qs&&(i.qs=r.clearKey(i.qs));var p=r.clone(i.qs);i.action&&(p[i.action]="");var R=i.url||i.Url,b=i.SignHost||fe.call(this,{Bucket:i.Bucket,Region:i.Region,Url:R}),O=i.tracker,j=function te(ke){var Te=s.options.SystemClockOffset;O&&O.setParams({signStartTime:new Date().getTime(),retryTimes:ke-1}),Re.call(s,{Bucket:i.Bucket||"",Region:i.Region||"",Method:i.method,Key:i.Key,Query:p,Headers:i.headers,SignHost:b,Action:i.Action,ResourceKey:i.ResourceKey,Scope:i.Scope,ForceSignHost:s.options.ForceSignHost},function(Se,Ae){if(Se){y(Se);return}O&&O.setParams({signEndTime:new Date().getTime(),httpStartTime:new Date().getTime()}),i.AuthData=Ae,Ye.call(s,i,function(Fe,Je){O&&O.setParams({httpEndTime:new Date().getTime()}),Fe&&ke<2&&(Te!==s.options.SystemClockOffset||Me.call(s,Fe))?(i.headers&&(delete i.headers.Authorization,delete i.headers.token,delete i.headers.clientIP,delete i.headers.clientUA,i.headers["x-cos-security-token"]&&delete i.headers["x-cos-security-token"],i.headers["x-ci-security-token"]&&delete i.headers["x-ci-security-token"]),te(ke+1)):y(Fe,Je)})})};j(1)}function Ye(i,y){var s=this,p=i.TaskId;if(!(p&&!s._isRunningTask(p))){var R=i.Bucket,b=i.Region,O=i.Key,j=i.method||"GET",te=i.Url||i.url,ke=i.body,Te=i.rawBody;s.options.UseAccelerate&&(b="accelerate"),te=te||q({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:R,region:b,object:O}),i.action&&(te=te+"?"+(r.isIOS_QQ?"".concat(i.action,"="):i.action)),i.qsStr&&(te.indexOf("?")>-1?te=te+"&"+i.qsStr:te=te+"?"+i.qsStr);var Se={method:j,url:te,headers:i.headers,qs:i.qs,body:ke},Ae="x-cos-security-token";if(r.isCIHost(te)&&(Ae="x-ci-security-token"),Se.headers.Authorization=i.AuthData.Authorization,i.AuthData.Token&&(Se.headers.token=i.AuthData.Token),i.AuthData.ClientIP&&(Se.headers.clientIP=i.AuthData.ClientIP),i.AuthData.ClientUA&&(Se.headers.clientUA=i.AuthData.ClientUA),i.AuthData.SecurityToken&&(Se.headers[Ae]=i.AuthData.SecurityToken),Se.headers&&(Se.headers=r.clearKey(Se.headers)),Se=r.clearKey(Se),i.onProgress&&typeof i.onProgress=="function"){var Fe=ke&&(ke.size||ke.length)||0;Se.onProgress=function(Ie){if(!(p&&!s._isRunningTask(p))){var Ne=Ie?Ie.loaded:0;i.onProgress({loaded:Ne,total:Fe})}}}i.onDownloadProgress&&(Se.onDownloadProgress=i.onDownloadProgress),i.DataType&&(Se.dataType=i.DataType),this.options.Timeout&&(Se.timeout=this.options.Timeout),s.options.ForcePathStyle&&(Se.pathStyle=s.options.ForcePathStyle),s.emit("before-send",Se);var Je=Se.url.includes("accelerate."),ot=Se.qs?Object.keys(Se.qs).map(function(Ie){return"".concat(Ie,"=").concat(Se.qs[Ie])}).join("&"):"",rt=ot?Se.url+"?"+ot:Se.url;i.tracker&&i.tracker.setParams({reqUrl:rt,accelerate:Je?"Y":"N"}),i.tracker&&i.tracker.parent&&i.tracker.parent.setParams({reqUrl:rt,accelerate:Je?"Y":"N"});var Ze=(s.options.Request||l)(Se,function(Ie){if(!(Ie&&Ie.error==="abort")){var Ne={options:Se,error:Ie&&Ie.error,statusCode:Ie&&Ie.statusCode||0,statusMessage:Ie&&Ie.statusMessage||"",headers:Ie&&Ie.headers||{},body:Ie&&Ie.body};s.emit("after-receive",Ne);var je=Ne.error,ze=Ne.body,tt={statusCode:Ne.statusCode,statusMessage:Ne.statusMessage,headers:Ne.headers},pt,at=function(dt,ht){if(p&&s.off("inner-kill-task",st),!pt){pt=!0;var ft={};tt&&tt.statusCode&&(ft.statusCode=tt.statusCode),tt&&tt.headers&&(ft.headers=tt.headers),dt?(dt=r.extend(dt||{},ft),y(dt,null)):(ht=r.extend(ht||{},ft),y(null,ht)),Ze=null}};if(je)return at(r.error(je));var ct=tt.statusCode,gt=Math.floor(ct/100)===2;if(Te&&gt)return at(null,{body:ze});var ut;try{ut=ze&&ze.indexOf("<")>-1&&ze.indexOf(">")>-1&&r.xml2json(ze)||{}}catch(vt){ut={}}var lt=ut&&ut.Error;gt?at(null,ut):lt?at(r.error(new Error(lt.Message),{code:lt.Code,error:lt})):ct?at(r.error(new Error(tt.statusMessage),{code:""+ct})):ct&&at(r.error(new Error("statusCode error")))}}),st=function Ie(Ne){Ne.TaskId===p&&(Ze&&Ze.abort&&Ze.abort(),s.off("inner-kill-task",Ie))};p&&s.on("inner-kill-task",st)}}var Qe={getService:u,putBucket:T,headBucket:w,getBucket:x,deleteBucket:S,putBucketAcl:A,getBucketAcl:D,putBucketCors:z,getBucketCors:P,deleteBucketCors:L,getBucketLocation:Y,getBucketPolicy:ie,putBucketPolicy:W,deleteBucketPolicy:B,putBucketTagging:E,getBucketTagging:C,deleteBucketTagging:k,putBucketLifecycle:g,getBucketLifecycle:U,deleteBucketLifecycle:F,putBucketVersioning:H,getBucketVersioning:K,putBucketReplication:_,getBucketReplication:V,deleteBucketReplication:X,putBucketWebsite:G,getBucketWebsite:$,deleteBucketWebsite:re,putBucketReferer:ue,getBucketReferer:oe,putBucketDomain:ee,getBucketDomain:ce,deleteBucketDomain:ae,putBucketOrigin:pe,getBucketOrigin:Z,deleteBucketOrigin:ne,putBucketLogging:ge,getBucketLogging:me,putBucketInventory:ye,postBucketInventory:Ce,getBucketInventory:Ee,listBucketInventory:be,deleteBucketInventory:Oe,putBucketAccelerate:we,getBucketAccelerate:De,putBucketEncryption:He,getBucketEncryption:Pe,deleteBucketEncryption:se,getObject:a,headObject:h,listObjectVersions:c,putObject:d,deleteObject:m,getObjectAcl:I,putObjectAcl:M,optionsObject:Q,putObjectCopy:de,deleteMultipleObject:J,restoreObject:xe,putObjectTagging:Be,getObjectTagging:Ue,deleteObjectTagging:_e,selectObjectContent:Le,appendObject:et,uploadPartCopy:he,multipartInit:Ve,multipartUpload:qe,multipartComplete:Ge,multipartList:Ke,multipartListPart:We,multipartAbort:Xe,request:nt,getObjectUrl:f,getAuth:it};function $e(i,y,s){r.each(["Cors","Acl"],function(p){if(i.slice(-p.length)===p){var R=i.slice(0,-p.length)+p.toUpperCase(),b=r.apiWrapper(i,y),O=!1;s[R]=function(){!O&&console.warn("warning: cos."+R+" has been deprecated. Please Use cos."+i+" instead."),O=!0,b.apply(this,arguments)}}})}o.exports.init=function(i,y){y.transferToTaskMethod(Qe,"putObject"),r.each(Qe,function(s,p){i.prototype[p]=r.apiWrapper(p,s),$e(p,s,i.prototype)})}},"./src/cos.js":function(o,n,e){var t=e("./src/util.js"),l=e("./src/event.js"),r=e("./src/task.js"),u=e("./src/base.js"),T=e("./src/advance.js"),w=e("./package.json"),x={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1024*1024,SliceSize:1024*1024,CopyChunkParallelLimit:20,CopyChunkSize:1024*1024*10,CopySliceSize:1024*1024*10,MaxPartNumber:1e4,ProgressInterval:1e3,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadQueueSize:1e4,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,EnableTracker:!1,DeepTracker:!1,TrackerDelay:5e3,CustomId:""},S=function(D){this.options=t.extend(t.clone(x),D||{}),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(1024*1024,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1024*1024,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),this.options.SecretId&&this.options.SecretId.indexOf(" ")>-1&&(console.error("error: SecretId格式错误,请检查"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey格式错误,请检查"),console.error("error: SecretKey format is incorrect. Please check")),t.isNode()&&(console.warn("warning: cos-js-sdk-v5 不支持 nodejs 环境使用,请改用 cos-nodejs-sdk-v5,参考文档: https://cloud.tencent.com/document/product/436/8629"),console.warn("warning: cos-js-sdk-v5 does not support nodejs environment. Please use cos-nodejs-sdk-v5 instead. See: https://cloud.tencent.com/document/product/436/8629")),l.init(this),r.init(this)};u.init(S,r),T.init(S,r),S.util={md5:t.md5,xml2json:t.xml2json,json2xml:t.json2xml,encodeBase64:t.encodeBase64},S.getAuthorization=t.getAuth,S.version=w.version,o.exports=S},"./src/event.js":function(o,n){var e=function(r){var u={},T=function(x){return!u[x]&&(u[x]=[]),u[x]};r.on=function(w,x){w==="task-list-update"&&console.warn('warning: Event "'+w+'" has been deprecated. Please use "list-update" instead.'),T(w).push(x)},r.off=function(w,x){for(var S=T(w),A=S.length-1;A>=0;A--)x===S[A]&&S.splice(A,1)},r.emit=function(w,x){for(var S=T(w).map(function(D){return D}),A=0;A<S.length;A++)S[A](x)}},t=function(){e(this)};o.exports.init=e,o.exports.EventProxy=t},"./src/session.js":function(o,n,e){var t=e("./src/util.js"),l="cos_sdk_upload_cache",r=30*24*3600,u,T,w=function(){try{var P=JSON.parse(localStorage.getItem(l))}catch(L){}P||(P=[]),u=P},x=function(){try{u.length?localStorage.setItem(l,JSON.stringify(u)):localStorage.removeItem(l)}catch(P){}},S=function(){if(!u){w.call(this);for(var P=!1,L=Math.round(Date.now()/1e3),Y=u.length-1;Y>=0;Y--){var W=u[Y][2];(!W||W+r<L)&&(u.splice(Y,1),P=!0)}P&&x()}},A=function(){T||(T=setTimeout(function(){x(),T=null},400))},D={using:{},setUsing:function(P){D.using[P]=!0},removeUsing:function(P){delete D.using[P]},getFileId:function(P,L,Y,W){return P.name&&P.size&&P.lastModifiedDate&&L?t.md5([P.name,P.size,P.lastModifiedDate,L,Y,W].join("::")):null},getCopyFileId:function(P,L,Y,W,ie){var B=L["content-length"],E=L.etag||"",C=L["last-modified"];return P&&Y?t.md5([P,B,E,C,Y,W,ie].join("::")):null},getUploadIdList:function(P){if(!P)return null;S.call(this);for(var L=[],Y=0;Y<u.length;Y++)u[Y][0]===P&&L.push(u[Y][1]);return L.length?L:null},saveUploadId:function(P,L,Y){if(S.call(this),!!P){for(var W=u.length-1;W>=0;W--){var ie=u[W];ie[0]===P&&ie[1]===L&&u.splice(W,1)}u.unshift([P,L,Math.round(Date.now()/1e3)]),u.length>Y&&u.splice(Y),A()}},removeUploadId:function(P){S.call(this),delete D.using[P];for(var L=u.length-1;L>=0;L--)u[L][1]===P&&u.splice(L,1);A()}};o.exports=D},"./src/task.js":function(o,n,e){var t=e("./src/session.js"),l=e("./src/util.js"),r={},u=function(x,S){r[S]=x[S],x[S]=function(A,D){A.SkipTask?r[S].call(this,A,D):this._addTask(S,A,D)}},T=function(x){var S=[],A={},D=0,z=0,P=function(C){var k={id:C.id,Bucket:C.Bucket,Region:C.Region,Key:C.Key,FilePath:C.FilePath,state:C.state,loaded:C.loaded,size:C.size,speed:C.speed,percent:C.percent,hashPercent:C.hashPercent,error:C.error};return C.FilePath&&(k.FilePath=C.FilePath),C._custom&&(k._custom=C._custom),k},L=function(){var E,C=function(){E=0,x.emit("task-list-update",{list:l.map(S,P)}),x.emit("list-update",{list:l.map(S,P)})};return function(){E||(E=setTimeout(C))}}(),Y=function(){if(!(S.length<=x.options.UploadQueueSize)){for(var C=0;C<z&&C<S.length&&S.length>x.options.UploadQueueSize;){var k=S[C].state==="waiting"||S[C].state==="checking"||S[C].state==="uploading";!S[C]||!k?(A[S[C].id]&&delete A[S[C].id],S.splice(C,1),z--):C++}L()}},W=function E(){if(!(D>=x.options.FileParallelLimit)){for(;S[z]&&S[z].state!=="waiting";)z++;if(!(z>=S.length)){var C=S[z];z++,D++,C.state="checking",C.params.onTaskStart&&C.params.onTaskStart(P(C)),!C.params.UploadData&&(C.params.UploadData={});var k=l.formatParams(C.api,C.params);r[C.api].call(x,k,function(g,U){x._isRunningTask(C.id)&&((C.state==="checking"||C.state==="uploading")&&(C.state=g?"error":"success",g&&(C.error=g),D--,L(),E(),C.callback&&C.callback(g,U),C.state==="success"&&(C.params&&(delete C.params.UploadData,delete C.params.Body,delete C.params),delete C.callback)),Y())}),L(),setTimeout(E)}}},ie=function(C,k){var g=A[C];if(g){var U=g&&g.state==="waiting",F=g&&(g.state==="checking"||g.state==="uploading");if(k==="canceled"&&g.state!=="canceled"||k==="paused"&&U||k==="paused"&&F){if(k==="paused"&&g.params.Body&&typeof g.params.Body.pipe=="function"){console.error("stream not support pause");return}g.state=k,x.emit("inner-kill-task",{TaskId:C,toState:k});try{var H=g&&g.params&&g.params.UploadData.UploadId}catch(K){}k==="canceled"&&H&&t.removeUsing(H),L(),F&&(D--,W()),k==="canceled"&&(g.params&&(delete g.params.UploadData,delete g.params.Body,delete g.params),delete g.callback)}Y()}};x._addTasks=function(E){l.each(E,function(C){x._addTask(C.api,C.params,C.callback,!0)}),L()};var B=!0;x._addTask=function(E,C,k,g){C=l.formatParams(E,C);var U=l.uuid();C.TaskId=U,C.onTaskReady&&C.onTaskReady(U),C.TaskReady&&(C.TaskReady(U),B&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),B=!1);var F={params:C,callback:k,api:E,index:S.length,id:U,Bucket:C.Bucket,Region:C.Region,Key:C.Key,FilePath:C.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:C._custom},H=C.onHashProgress;C.onHashProgress=function(_){x._isRunningTask(F.id)&&(F.hashPercent=_.percent,H&&H(_),L())};var K=C.onProgress;return C.onProgress=function(_){x._isRunningTask(F.id)&&(F.state==="checking"&&(F.state="uploading"),F.loaded=_.loaded,F.speed=_.speed,F.percent=_.percent,K&&K(_),L())},l.getFileSize(E,C,function(_,V){if(_)return k(l.error(_));A[U]=F,S.push(F),F.size=V,!g&&L(),W(),Y()}),U},x._isRunningTask=function(E){var C=A[E];return!!(C&&(C.state==="checking"||C.state==="uploading"))},x.getTaskList=function(){return l.map(S,P)},x.cancelTask=function(E){ie(E,"canceled")},x.pauseTask=function(E){ie(E,"paused")},x.restartTask=function(E){var C=A[E];C&&(C.state==="paused"||C.state==="error")&&(C.state="waiting",L(),z=Math.min(z,C.index),W())},x.isUploadRunning=function(){return D||z<S.length}};o.exports.transferToTaskMethod=u,o.exports.init=T},"./src/tracker.js":function(o,n,e){var t=e("./node_modules/@babel/runtime/helpers/classCallCheck.js"),l=e("./node_modules/@babel/runtime/helpers/createClass.js"),r=e("./node_modules/@babel/runtime/helpers/typeof.js"),u=e("./package.json"),T=null,w=function(E){if(!T){var C=e("./lib/beacon.min.js");T=new C({appkey:"0AND0VEVB24UBGDU",versionCode:u.version,channelID:"js_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:E,sessionDuration:60*1e3})}return T},x={getUid:function(){var E=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return E()+E()+"-"+E()+"-"+E()+"-"+E()+"-"+E()+E()+E()},getNetType:function(){if((typeof navigator>"u"?"undefined":r(navigator))==="object"){var E=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return(E==null?void 0:E.type)||(E==null?void 0:E.effectiveType)||"unknown"}return"unknown"},getOsType:function(){if((typeof navigator>"u"?"undefined":r(navigator))!=="object")return"unknown os";var E=navigator.userAgent.toLowerCase(),C=/macintosh|mac os x/i.test(navigator.userAgent);return E.indexOf("win32")>=0||E.indexOf("wow32")>=0?"win32":E.indexOf("win64")>=0||E.indexOf("wow64")>=0?"win64":C?"mac":"unknown os"},isMobile:function(){var E=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i;return!!((typeof navigator>"u"?"undefined":r(navigator))==="object"&&navigator.userAgent.match(E))},isAndroid:function(){var E=/(Android|Adr|Linux)/i;return!!((typeof navigator>"u"?"undefined":r(navigator))==="object"&&navigator.userAgent.match(E))},isIOS:function(){var E=/(iPhone|iPod|iPad|iOS)/i;return!!((typeof navigator>"u"?"undefined":r(navigator))==="object"&&navigator.userAgent.match(E))},isOtherMobile:function(){return isMobile&&!isAndroid&&!isIOS},getDeviceName:function(){if((typeof navigator>"u"?"undefined":r(navigator))!=="object")return"unknown device";var E=navigator.userAgent.toLowerCase();if(E.includes("app/tencent_wemeet"))return"tencent_wemeet";if(E.indexOf("maxthon")>=0){var C=E.match(/maxthon\/([\d.]+)/),k=C&&C[1]||"";return"傲游浏览器 ".concat(k).trim()}if(E.indexOf("qqbrowser")>=0){var g=E.match(/qqbrowser\/([\d.]+)/),U=g&&g[1]||"";return"QQ浏览器 ".concat(U).trim()}if(E.indexOf("se 2.x")>=0)return"搜狗浏览器";if(E.indexOf("wxwork")>=0)return"微信内置浏览器";if(E.indexOf("msie")>=0){var F=E.match(/msie ([\d.]+)/),H=F&&F[1]||"";return"IE ".concat(H).trim()}if(E.indexOf("firefox")>=0){var K=E.match(/firefox\/([\d.]+)/),_=K&&K[1]||"";return"Firefox ".concat(_).trim()}if(E.indexOf("chrome")>=0){var V=E.match(/chrome\/([\d.]+)/),X=V&&V[1]||"";return"Chrome ".concat(X).trim()}if(E.indexOf("opera")>=0){var G=E.match(/opera.([\d.]+)/),$=G&&G[1]||"";return"Opera ".concat($).trim()}if(E.indexOf("safari")>=0){var re=E.match(/version\/([\d.]+)/),ue=re&&re[1]||"";return"Safari ".concat(ue).trim()}if(E.indexOf("edge")>=0){var oe=E.match(/edge\/([\d.]+)/),ee=oe&&oe[1]||"";return"edge ".concat(ee).trim()}return E.substr(0,200)}},S={isMobile:x.isMobile(),isBrowser:!x.isMobile(),mobileOsType:x.isAndroid()?"android":x.isIOS?"ios":"other_mobile",pcOsType:x.getOsType()},A={deviceType:S.isMobile?"mobile":S.isBrowser?"browser":"unknown",devicePlatform:S.isMobile?S.mobileOsType:S.pcOsType,deviceName:x.getDeviceName()},D=["multipartInit","multipartUpload","multipartComplete","multipartList","multipartListPart","multipartAbort"],z=["putObject","postObject","appendObject","sliceUploadFile","uploadFile","uploadFiles"].concat(D),P=["getObject"];function L(B){return z.includes(B)?"cos_upload":P.includes(B)?"cos_download":"base_service"}function Y(B){return B.replace(/([A-Z])/g,"_$1").toLowerCase()}function W(B){var E={},C=["tracePlatform","cossdkVersion","region","networkType","host","accelerate","requestPath","size","httpMd5","httpSign","httpFull","name","result","tookTime","errorNode","errorCode","errorMessage","errorRequestId","errorStatusCode","errorServiceName","errorType","traceId","bucket","appid","partNumber","retryTimes","reqUrl","customId","fullError","deviceType","devicePlatform","deviceName"],k=["tracePlatform","cossdkVersion","region","bucket","appid","networkType","host","accelerate","requestPath","partNumber","size","name","result","tookTime","errorRequestId","retryTimes","reqUrl","customId","deviceType","devicePlatform","deviceName"],g=B.result==="Success"?k:C;for(var U in B)if(g.includes(U)){var F=Y(U);E[F]=B[U]}return E}var ie=function(){function B(E){t(this,B);var C=E.parent,k=E.traceId,g=E.bucket,U=E.region,F=E.apiName,H=E.fileKey,K=E.fileSize,_=E.accelerate,V=E.customId,X=E.delay,G=E.deepTracker,$=g&&g.substr(g.lastIndexOf("-")+1)||"";this.parent=C,this.deepTracker=G,this.delay=X,this.params={cossdkVersion:u.version,region:U,networkType:"",host:"",accelerate:_?"Y":"N",requestPath:H||"",size:K||-1,httpMd5:0,httpSign:0,httpFull:0,name:F||"",result:"",tookTime:0,errorNode:"",errorCode:"",errorMessage:"",errorRequestId:"",errorStatusCode:0,errorServiceName:"",tracePlatform:"cos-js-sdk-v5",traceId:k||x.getUid(),bucket:g,appid:$,partNumber:0,retryTimes:0,reqUrl:"",customId:V||"",deviceType:A.deviceType,devicePlatform:A.devicePlatform,deviceName:A.deviceName,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:new Date().getTime(),endTime:0},this.beacon=w(X)}return l(B,[{key:"formatResult",value:function(C,k){var g,U,F,H,K,_,V=new Date().getTime(),X=V-this.params.startTime,G=x.getNetType(),$=C?(C==null?void 0:C.code)||(C==null||(g=C.error)===null||g===void 0?void 0:g.code)||(C==null||(U=C.error)===null||U===void 0?void 0:U.Code):"",re=C?(C==null?void 0:C.message)||(C==null||(F=C.error)===null||F===void 0?void 0:F.message)||(C==null||(H=C.error)===null||H===void 0?void 0:H.Message):"",ue=C?(C==null?void 0:C.resource)||(C==null||(K=C.error)===null||K===void 0?void 0:K.resource)||(C==null||(_=C.error)===null||_===void 0?void 0:_.Resource):"",oe=C?C==null?void 0:C.statusCode:k.statusCode,ee=C?(C==null?void 0:C.headers)&&(C==null?void 0:C.headers["x-cos-request-id"]):(k==null?void 0:k.headers)&&(k==null?void 0:k.headers["x-cos-request-id"]),ce=C?ee?"Server":"Client":"";if(Object.assign(this.params,{tookTime:X,networkType:G,httpMd5:this.params.md5EndTime-this.params.md5StartTime,httpSign:this.params.signEndTime-this.params.signStartTime,httpFull:this.params.httpEndTime-this.params.httpStartTime,result:C?"Fail":"Success",errorType:ce,errorCode:$,errorStatusCode:oe,errorMessage:re,errorServiceName:ue,errorRequestId:ee}),C&&(!$||!re)&&(this.params.fullError=C?JSON.stringify(C):""),this.params.name==="getObject"&&(this.params.size=k?k.headers&&k.headers["content-length"]:-1),this.params.reqUrl)try{var ae=/^http(s)?:\/\/(.*?)\//.exec(this.params.reqUrl);this.params.host=ae[2]}catch(pe){this.params.host=this.params.reqUrl}this.sendEvents()}},{key:"setParams",value:function(C){Object.assign(this.params,C)}},{key:"sendEvents",value:function(){if(!(D.includes(this.params.name)&&!this.deepTracker)){var C=L(this.params.name),k=W(this.params);this.beacon||(this.beacon=w(this.delay||5e3)),this.delay===0?this.beacon&&this.beacon.onDirectUserAction(C,k):this.beacon&&this.beacon.onUserAction(C,k)}}},{key:"generateSubTracker",value:function(C){return Object.assign(C,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay}),new B(C)}}]),B}();o.exports=ie},"./src/util.js":function(o,n,e){(function(t){var l=e("./node_modules/@babel/runtime/helpers/typeof.js"),r=e("./lib/md5.js"),u=e("./lib/crypto.js"),T=e("./lib/xml2json.js"),w=e("./lib/json2xml.js"),x=e("./lib/base64.js"),S=e("./src/tracker.js");function A(se){return encodeURIComponent(se).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function D(se,h){var c=[];for(var a in se)se.hasOwnProperty(a)&&c.push(h?A(a).toLowerCase():a);return c.sort(function(d,m){return d=d.toLowerCase(),m=m.toLowerCase(),d===m?0:d>m?1:-1})}var z=function(h,c){var a,d,m,I=[],M=D(h);for(a=0;a<M.length;a++)d=M[a],m=h[d]===void 0||h[d]===null?"":""+h[d],d=c?A(d).toLowerCase():A(d),m=A(m)||"",I.push(d+"="+m);return I.join("&")},P=["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"],L=function(h){var c={};for(var a in h){var d=a.toLowerCase();(d.indexOf("x-cos-")>-1||P.indexOf(d)>-1)&&(c[a]=h[a])}return c},Y=function(h){h=h||{};var c=h.SecretId,a=h.SecretKey,d=h.KeyTime,m=(h.method||h.Method||"get").toLowerCase(),I=V(h.Query||h.params||{}),M=L(V(h.Headers||h.headers||{})),Q=h.Key||"",de;h.UseRawKey?de=h.Pathname||h.pathname||"/"+Q:(de=h.Pathname||h.pathname||Q,de.indexOf("/")!==0&&(de="/"+de));var he=h.ForceSignHost!==!1;if(!M.Host&&!M.host&&h.Bucket&&h.Region&&he&&(M.Host=h.Bucket+".cos."+h.Region+".myqcloud.com"),!c)throw new Error("missing param SecretId");if(!a)throw new Error("missing param SecretKey");var J=Math.round(ye(h.SystemClockOffset)/1e3)-1,xe=J,Be=h.Expires||h.expires;Be===void 0?xe+=900:xe+=Be*1||0;var Ue="sha1",_e=c,Le=d||J+";"+xe,Ve=d||J+";"+xe,qe=D(M,!0).join(";").toLowerCase(),Ge=D(I,!0).join(";").toLowerCase(),Ke=u.HmacSHA1(Ve,a).toString(),We=[m,de,Pe.obj2str(I,!0),Pe.obj2str(M,!0),""].join("\n"),Xe=["sha1",Le,u.SHA1(We).toString(),""].join("\n"),nt=u.HmacSHA1(Xe,Ke).toString(),et=["q-sign-algorithm="+Ue,"q-ak="+_e,"q-sign-time="+Le,"q-key-time="+Ve,"q-header-list="+qe,"q-url-param-list="+Ge,"q-signature="+nt].join("&");return et},W=function(h,c,a){var d=c/8,m=h.slice(a,a+d);return new Uint8Array(m).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[c](m)[0]},ie=function(h,c,a,d){var m=h.slice(c,a),I="";return new Uint8Array(m).forEach(function(M){I+=String.fromCharCode(M)}),d&&(I=decodeURIComponent(escape(I))),I},B=function(h){for(var c={},a=ie(h),d={records:[]};h.byteLength;){var m=W(h,32,0),I=W(h,32,4),M=m-I-16,Q=0,de;for(h=h.slice(12);Q<I;){var he=W(h,8,Q),J=ie(h,Q+1,Q+1+he),xe=W(h,16,Q+he+2),Be=ie(h,Q+he+4,Q+he+4+xe);c[J]=Be,Q+=he+4+xe}if(c[":event-type"]==="Records")de=ie(h,Q,Q+M,!0),d.records.push(de);else if(c[":event-type"]==="Stats")de=ie(h,Q,Q+M,!0),d.stats=Pe.xml2json(de).Stats;else if(c[":event-type"]==="error"){var Ue=c[":error-code"],_e=c[":error-message"],Le=new Error(_e);Le.message=_e,Le.name=Le.code=Ue,d.error=Le}h=h.slice(Q+M+4)}return{payload:d.records.join(""),body:a}},E=function(h){var c=this.options.CopySourceParser;if(c)return c(h);var a=h.match(/^([^.]+-\d+)\.cos(v6|-cdc|-cdz|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);return a?{Bucket:a[1],Region:a[3],Key:a[7]}:null},C=function(){},k=function(h){var c={};for(var a in h)h.hasOwnProperty(a)&&h[a]!==void 0&&h[a]!==null&&(c[a]=h[a]);return c},g=function(h,c){var a,d=new FileReader;FileReader.prototype.readAsBinaryString?(a=FileReader.prototype.readAsBinaryString,d.onload=function(){c(this.result)}):FileReader.prototype.readAsArrayBuffer?a=function(I){var M="",Q=new FileReader;Q.onload=function(de){for(var he=new Uint8Array(Q.result),J=he.byteLength,xe=0;xe<J;xe++)M+=String.fromCharCode(he[xe]);c(M)},Q.readAsArrayBuffer(I)}:console.error("FileReader not support readAsBinaryString"),a.call(d,h)},U=function(){var se=function(a,d){a=a.split("."),d=d.split(".");for(var m=0;m<d.length;m++)if(a[m]!==d[m])return parseInt(a[m])>parseInt(d[m])?1:-1;return 0},h=function(a){if(!a)return!1;var d=(a.match(/Chrome\/([.\d]+)/)||[])[1],m=(a.match(/QBCore\/([.\d]+)/)||[])[1],I=(a.match(/QQBrowser\/([.\d]+)/)||[])[1],M=d&&se(d,"53.0.2785.116")<0&&m&&se(m,"3.53.991.400")<0&&I&&se(I,"9.0.2524.400")<=0||!1;return M};return h(typeof navigator<"u"&&navigator.userAgent)}(),F=function(h,c,a,d,m){var I;if(h.slice?I=h.slice(c,a):h.mozSlice?I=h.mozSlice(c,a):h.webkitSlice&&(I=h.webkitSlice(c,a)),d&&U){var M=new FileReader;M.onload=function(Q){I=null,m(new Blob([M.result]))},M.readAsArrayBuffer(I)}else m(I)},H=function(h,c,a,d){a=a||C,h?typeof c=="string"?a(Pe.md5(c,!0)):Blob&&c instanceof Blob?Pe.getFileMd5(c,function(m,I){a(I)},d):a():a()},K=1024*1024,_=function(h,c,a){var d=h.size,m=0,I=r.getCtx(),M=function Q(de){if(de>=d){var he=I.digest("hex");c(null,he);return}var J=Math.min(d,de+K);Pe.fileSlice(h,de,J,!1,function(xe){g(xe,function(Be){xe=null,I=I.update(Be,!0),m+=Be.length,Be=null,a&&a({loaded:m,total:d,percent:Math.round(m/d*1e4)/1e4}),Q(de+K)})})};M(0)};function V(se){return ee(se,function(h){return l(h)==="object"&&h!==null?V(h):h})}function X(se,h,c){return se&&h in se?se[h]:c}function G(se,h){return oe(h,function(c,a){se[a]=h[a]}),se}function $(se){return se instanceof Array}function re(se,h){for(var c=!1,a=0;a<se.length;a++)if(h===se[a]){c=!0;break}return c}function ue(se){return $(se)?se:[se]}function oe(se,h){for(var c in se)se.hasOwnProperty(c)&&h(se[c],c)}function ee(se,h){var c=$(se)?[]:{};for(var a in se)se.hasOwnProperty(a)&&(c[a]=h(se[a],a));return c}function ce(se,h){var c=$(se),a=c?[]:{};for(var d in se)se.hasOwnProperty(d)&&h(se[d],d)&&(c?a.push(se[d]):a[d]=se[d]);return a}var ae=function(h){var c,a,d,m="";for(c=0,a=h.length/2;c<a;c++)d=parseInt(h[c*2]+h[c*2+1],16),m+=String.fromCharCode(d);return btoa(m)},pe=function(){var h=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return h()+h()+"-"+h()+"-"+h()+"-"+h()+"-"+h()+h()+h()},Z=function(h,c){var a=c.Bucket,d=c.Region,m=c.Key,I=this.options.Domain,M=!I||typeof I=="string"&&I.indexOf("{Bucket}")>-1,Q=!I||typeof I=="string"&&I.indexOf("{Region}")>-1;if(h.indexOf("Bucket")>-1||h==="deleteMultipleObject"||h==="multipartList"||h==="listObjectVersions"){if(M&&!a)return"Bucket";if(Q&&!d)return"Region"}else if(h.indexOf("Object")>-1||h.indexOf("multipart")>-1||h==="sliceUploadFile"||h==="abortUploadTask"){if(M&&!a)return"Bucket";if(Q&&!d)return"Region";if(!m)return"Key"}return!1},ne=function(h,c){if(c=G({},c),h!=="getAuth"&&h!=="getV4Auth"&&h!=="getObjectUrl"){var a=c.Headers||{};if(c&&l(c)==="object"){(function(){for(var m in c)c.hasOwnProperty(m)&&m.indexOf("x-cos-")>-1&&(a[m]=c[m])})();var d={"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"};Pe.each(d,function(m,I){c[m]!==void 0&&(a[I]=c[m])}),c.Headers=k(a)}}return c},ge=function(h,c){return function(a,d){var m=this;typeof a=="function"&&(d=a,a={}),a=ne(h,a);var I;if(m.options.EnableTracker)if(a.calledBySdk==="sliceUploadFile")I=a.tracker&&a.tracker.generateSubTracker({apiName:h});else if(["uploadFile","uploadFiles"].includes(h))I=null;else{var M=-1;a.Body&&(M=typeof a.Body=="string"?a.Body.length:a.Body.size||a.Body.byteLength||-1),I=new S({bucket:a.Bucket,region:a.Region,apiName:h,fileKey:a.Key,fileSize:M,deepTracker:m.options.DeepTracker,customId:m.options.CustomId,delay:m.options.TrackerDelay})}a.tracker=I;var Q=function(_e){return _e&&_e.headers&&(_e.headers["x-cos-request-id"]&&(_e.RequestId=_e.headers["x-cos-request-id"]),_e.headers["x-ci-request-id"]&&(_e.RequestId=_e.headers["x-ci-request-id"]),_e.headers["x-cos-version-id"]&&(_e.VersionId=_e.headers["x-cos-version-id"]),_e.headers["x-cos-delete-marker"]&&(_e.DeleteMarker=_e.headers["x-cos-delete-marker"])),_e},de=function(_e,Le){I&&I.formatResult(_e,Le),d&&d(Q(_e),Q(Le))},he=function(){if(h!=="getService"&&h!=="abortUploadTask"){var _e=Z.call(m,h,a);if(_e)return"missing param "+_e;if(a.Region){if(m.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(a.Region))return"Region format error."}else{if(a.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(a.Region))return"Region format error."}!m.options.CompatibilityMode&&a.Region.indexOf("-")===-1&&a.Region!=="yfb"&&a.Region!=="default"&&a.Region!=="accelerate"&&console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(a.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(a.Bucket))if(a.AppId)a.Bucket=a.Bucket+"-"+a.AppId;else if(m.options.AppId)a.Bucket=a.Bucket+"-"+m.options.AppId;else return'Bucket should format as "test-1250000000".';a.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete a.AppId)}!m.options.UseRawKey&&a.Key&&a.Key.substr(0,1)==="/"&&(a.Key=a.Key.substr(1))}},J=he(),xe=["getAuth","getObjectUrl"].includes(h);if(typeof Promise=="function"&&!xe&&!d)return new Promise(function(Ue,_e){if(d=function(Ve,qe){Ve?_e(Ve):Ue(qe)},J)return de(Pe.error(new Error(J)));c.call(m,a,de)});if(J)return de(Pe.error(new Error(J)));var Be=c.call(m,a,de);if(xe)return Be}},me=function(h,c){var a=this,d=0,m=0,I=Date.now(),M,Q;function de(){if(Q=0,c&&typeof c=="function"){M=Date.now();var he=Math.max(0,Math.round((m-d)/((M-I)/1e3)*100)/100)||0,J;m===0&&h===0?J=1:J=Math.floor(m/h*100)/100||0,I=M,d=m;try{c({loaded:m,total:h,speed:he,percent:J})}catch(xe){}}}return function(he,J){if(he&&(m=he.loaded,h=he.total),J)clearTimeout(Q),de();else{if(Q)return;Q=setTimeout(de,a.options.ProgressInterval)}}},ve=function(h,c,a){var d;if(typeof c.Body=="string"?c.Body=new Blob([c.Body],{type:"text/plain"}):c.Body instanceof ArrayBuffer&&(c.Body=new Blob([c.Body])),c.Body&&(c.Body instanceof Blob||c.Body.toString()==="[object File]"||c.Body.toString()==="[object Blob]"))d=c.Body.size;else{a(Pe.error(new Error("params body format error, Only allow File|Blob|String.")));return}c.ContentLength=d,a(null,d)},ye=function(h){return Date.now()+(h||0)},Ce=function(h,c){var a=h;return h.message=h.message||null,typeof c=="string"?(h.error=c,h.message=c):l(c)==="object"&&c!==null&&(G(h,c),(c.code||c.name)&&(h.code=c.code||c.name),c.message&&(h.message=c.message),c.stack&&(h.stack=c.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(h,"name",{writable:!0,enumerable:!1}),Object.defineProperty(h,"message",{enumerable:!0})),h.name=c&&c.name||h.name||h.code||"Error",h.code||(h.code=h.name),h.error||(h.error=V(a)),h},Ee=function(){return(typeof globalThis>"u"?"undefined":l(globalThis))==="object"&&(globalThis.constructor.name==="DedicatedWorkerGlobalScope"||globalThis.FileReaderSync)},be=function(){return(typeof window>"u"?"undefined":l(window))!=="object"&&(typeof t>"u"?"undefined":l(t))==="object"&&!0&&!Ee()},Oe=function(h){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(h)},we=function(){if((typeof navigator>"u"?"undefined":l(navigator))!=="object")return!1;var se=navigator.userAgent,h=!!se.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return h}(),De=function(){return(typeof navigator>"u"?"undefined":l(navigator))!=="object"?!1:/\sQQ/i.test(navigator.userAgent)}(),He=function(h,c){var a=x.encode(h);return c&&(a=a.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),a},Pe={noop:C,formatParams:ne,apiWrapper:ge,xml2json:T,json2xml:w,md5:r,clearKey:k,fileSlice:F,getBodyMd5:H,getFileMd5:_,b64:ae,extend:G,isArray:$,isInArray:re,makeArray:ue,each:oe,map:ee,filter:ce,clone:V,attr:X,uuid:pe,camSafeUrlEncode:A,throttleOnProgress:me,getFileSize:ve,getSkewTime:ye,error:Ce,obj2str:z,getAuth:Y,parseSelectPayload:B,getSourceParams:E,isBrowser:!0,isNode:be,isCIHost:Oe,isIOS_QQ:we&&De,encodeBase64:He};o.exports=Pe}).call(this,e("./node_modules/process/browser.js"))}})})})(cosJsSdkV5);var cosJsSdkV5Exports=cosJsSdkV5.exports;const COS=getDefaultExportFromCjs(cosJsSdkV5Exports),ossSwitch="tencent",tencentBucket="daya-online-1303457149",getUploadSign=async o=>{const{bucketName:n,filename:e,postData:t}=o,l=ossSwitch;let r=n,u=e,T={};return r=tencentBucket,u="ktyq/"+e,T={key:"ktyq/"+t.key},request.post("/edu-app/open/getUploadSign",{data:{postData:T,pluginName:l,bucketName:r,filename:u},params:{pluginName:l}})},onFileUpload=({file:o,action:n,data:e,onProgress:t,onFinish:l,onError:r})=>{new COS({Domain:"https://oss.dayaedu.com",Protocol:"https",getAuthorization:async(T,w)=>{w({Authorization:e.signature})}}).uploadFile({Bucket:tencentBucket,Region:"ap-nanjing",Key:"ktyq/".concat(e.name),Body:e.file.file,SliceSize:1024*1024*500,onProgress:function(T){t({percent:Math.ceil((T.percent||0)*100)})}}).then(T=>{var w;((w=T.Location)==null?void 0:w.indexOf("http"))>=0?o.url=T.Location:o.url="https://"+T.Location,l()}).catch(T=>{console.log(T,"error"),r()})},onOnlyFileUpload=async(o,n)=>{{let e="",t=null;if(await new COS({Domain:"https://oss.dayaedu.com",Protocol:"https",getAuthorization:async(r,u)=>{u({Authorization:n.signature})}}).uploadFile({Bucket:tencentBucket,Region:"ap-nanjing",Key:"ktyq/".concat(n.name),Body:n.file,SliceSize:1024*1024*500}).then(r=>{var u;((u=r.Location)==null?void 0:u.indexOf("http"))>=0?e=r.Location:e="https://"+r.Location}).catch(r=>{t=r}),e)return e;throw new Error(t)}};/*!
  2. * Cropper.js v1.5.13
  3. * https://fengyuanchen.github.io/cropperjs
  4. *
  5. * Copyright 2015-present Chen Fengyuan
  6. * Released under the MIT license
  7. *
  8. * Date: 2022-11-20T05:30:46.114Z
  9. */function ownKeys(o,n){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);n&&(t=t.filter(function(l){return Object.getOwnPropertyDescriptor(o,l).enumerable})),e.push.apply(e,t)}return e}function _objectSpread2(o){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?ownKeys(Object(e),!0).forEach(function(t){_defineProperty(o,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):ownKeys(Object(e)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(e,t))})}return o}function _typeof(o){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},_typeof(o)}function _classCallCheck(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(o,n){for(var e=0;e<n.length;e++){var t=n[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(o,t.key,t)}}function _createClass(o,n,e){return n&&_defineProperties(o.prototype,n),e&&_defineProperties(o,e),Object.defineProperty(o,"prototype",{writable:!1}),o}function _defineProperty(o,n,e){return n in o?Object.defineProperty(o,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[n]=e,o}function _toConsumableArray(o){return _arrayWithoutHoles(o)||_iterableToArray(o)||_unsupportedIterableToArray(o)||_nonIterableSpread()}function _arrayWithoutHoles(o){if(Array.isArray(o))return _arrayLikeToArray(o)}function _iterableToArray(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function _unsupportedIterableToArray(o,n){if(o){if(typeof o=="string")return _arrayLikeToArray(o,n);var e=Object.prototype.toString.call(o).slice(8,-1);if(e==="Object"&&o.constructor&&(e=o.constructor.name),e==="Map"||e==="Set")return Array.from(o);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return _arrayLikeToArray(o,n)}}function _arrayLikeToArray(o,n){(n==null||n>o.length)&&(n=o.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=o[e];return t}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var IS_BROWSER=typeof window<"u"&&typeof window.document<"u",WINDOW=IS_BROWSER?window:{},IS_TOUCH_DEVICE=IS_BROWSER&&WINDOW.document.documentElement?"ontouchstart"in WINDOW.document.documentElement:!1,HAS_POINTER_EVENT=IS_BROWSER?"PointerEvent"in WINDOW:!1,NAMESPACE="cropper",ACTION_ALL="all",ACTION_CROP="crop",ACTION_MOVE="move",ACTION_ZOOM="zoom",ACTION_EAST="e",ACTION_WEST="w",ACTION_SOUTH="s",ACTION_NORTH="n",ACTION_NORTH_EAST="ne",ACTION_NORTH_WEST="nw",ACTION_SOUTH_EAST="se",ACTION_SOUTH_WEST="sw",CLASS_CROP="".concat(NAMESPACE,"-crop"),CLASS_DISABLED="".concat(NAMESPACE,"-disabled"),CLASS_HIDDEN="".concat(NAMESPACE,"-hidden"),CLASS_HIDE="".concat(NAMESPACE,"-hide"),CLASS_INVISIBLE="".concat(NAMESPACE,"-invisible"),CLASS_MODAL="".concat(NAMESPACE,"-modal"),CLASS_MOVE="".concat(NAMESPACE,"-move"),DATA_ACTION="".concat(NAMESPACE,"Action"),DATA_PREVIEW="".concat(NAMESPACE,"Preview"),DRAG_MODE_CROP="crop",DRAG_MODE_MOVE="move",DRAG_MODE_NONE="none",EVENT_CROP="crop",EVENT_CROP_END="cropend",EVENT_CROP_MOVE="cropmove",EVENT_CROP_START="cropstart",EVENT_DBLCLICK="dblclick",EVENT_TOUCH_START=IS_TOUCH_DEVICE?"touchstart":"mousedown",EVENT_TOUCH_MOVE=IS_TOUCH_DEVICE?"touchmove":"mousemove",EVENT_TOUCH_END=IS_TOUCH_DEVICE?"touchend touchcancel":"mouseup",EVENT_POINTER_DOWN=HAS_POINTER_EVENT?"pointerdown":EVENT_TOUCH_START,EVENT_POINTER_MOVE=HAS_POINTER_EVENT?"pointermove":EVENT_TOUCH_MOVE,EVENT_POINTER_UP=HAS_POINTER_EVENT?"pointerup pointercancel":EVENT_TOUCH_END,EVENT_READY="ready",EVENT_RESIZE="resize",EVENT_WHEEL="wheel",EVENT_ZOOM="zoom",MIME_TYPE_JPEG="image/jpeg",REGEXP_ACTIONS=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,REGEXP_DATA_URL=/^data:/,REGEXP_DATA_URL_JPEG=/^data:image\/jpeg;base64,/,REGEXP_TAG_NAME=/^img|canvas$/i,MIN_CONTAINER_WIDTH=200,MIN_CONTAINER_HEIGHT=100,DEFAULTS={viewMode:0,dragMode:DRAG_MODE_CROP,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:MIN_CONTAINER_WIDTH,minContainerHeight:MIN_CONTAINER_HEIGHT,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},TEMPLATE='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',isNaN=Number.isNaN||WINDOW.isNaN;function isNumber(o){return typeof o=="number"&&!isNaN(o)}var isPositiveNumber=function o(n){return n>0&&n<1/0};function isUndefined(o){return typeof o>"u"}function isObject(o){return _typeof(o)==="object"&&o!==null}var hasOwnProperty=Object.prototype.hasOwnProperty;function isPlainObject(o){if(!isObject(o))return!1;try{var n=o.constructor,e=n.prototype;return n&&e&&hasOwnProperty.call(e,"isPrototypeOf")}catch(t){return!1}}function isFunction(o){return typeof o=="function"}var slice=Array.prototype.slice;function toArray(o){return Array.from?Array.from(o):slice.call(o)}function forEach(o,n){return o&&isFunction(n)&&(Array.isArray(o)||isNumber(o.length)?toArray(o).forEach(function(e,t){n.call(o,e,t,o)}):isObject(o)&&Object.keys(o).forEach(function(e){n.call(o,o[e],e,o)})),o}var assign=Object.assign||function o(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),l=1;l<e;l++)t[l-1]=arguments[l];return isObject(n)&&t.length>0&&t.forEach(function(r){isObject(r)&&Object.keys(r).forEach(function(u){n[u]=r[u]})}),n},REGEXP_DECIMALS=/\.\d*(?:0|9){12}\d*$/;function normalizeDecimalNumber(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return REGEXP_DECIMALS.test(o)?Math.round(o*n)/n:o}var REGEXP_SUFFIX=/^width|height|left|top|marginLeft|marginTop$/;function setStyle(o,n){var e=o.style;forEach(n,function(t,l){REGEXP_SUFFIX.test(l)&&isNumber(t)&&(t="".concat(t,"px")),e[l]=t})}function hasClass(o,n){return o.classList?o.classList.contains(n):o.className.indexOf(n)>-1}function addClass(o,n){if(n){if(isNumber(o.length)){forEach(o,function(t){addClass(t,n)});return}if(o.classList){o.classList.add(n);return}var e=o.className.trim();e?e.indexOf(n)<0&&(o.className="".concat(e," ").concat(n)):o.className=n}}function removeClass(o,n){if(n){if(isNumber(o.length)){forEach(o,function(e){removeClass(e,n)});return}if(o.classList){o.classList.remove(n);return}o.className.indexOf(n)>=0&&(o.className=o.className.replace(n,""))}}function toggleClass(o,n,e){if(n){if(isNumber(o.length)){forEach(o,function(t){toggleClass(t,n,e)});return}e?addClass(o,n):removeClass(o,n)}}var REGEXP_CAMEL_CASE=/([a-z\d])([A-Z])/g;function toParamCase(o){return o.replace(REGEXP_CAMEL_CASE,"$1-$2").toLowerCase()}function getData(o,n){return isObject(o[n])?o[n]:o.dataset?o.dataset[n]:o.getAttribute("data-".concat(toParamCase(n)))}function setData(o,n,e){isObject(e)?o[n]=e:o.dataset?o.dataset[n]=e:o.setAttribute("data-".concat(toParamCase(n)),e)}function removeData(o,n){if(isObject(o[n]))try{delete o[n]}catch(e){o[n]=void 0}else if(o.dataset)try{delete o.dataset[n]}catch(e){o.dataset[n]=void 0}else o.removeAttribute("data-".concat(toParamCase(n)))}var REGEXP_SPACES=/\s\s*/,onceSupported=function(){var o=!1;if(IS_BROWSER){var n=!1,e=function(){},t=Object.defineProperty({},"once",{get:function(){return o=!0,n},set:function(r){n=r}});WINDOW.addEventListener("test",e,t),WINDOW.removeEventListener("test",e,t)}return o}();function removeListener(o,n,e){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=e;n.trim().split(REGEXP_SPACES).forEach(function(r){if(!onceSupported){var u=o.listeners;u&&u[r]&&u[r][e]&&(l=u[r][e],delete u[r][e],Object.keys(u[r]).length===0&&delete u[r],Object.keys(u).length===0&&delete o.listeners)}o.removeEventListener(r,l,t)})}function addListener(o,n,e){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=e;n.trim().split(REGEXP_SPACES).forEach(function(r){if(t.once&&!onceSupported){var u=o.listeners,T=u===void 0?{}:u;l=function(){delete T[r][e],o.removeEventListener(r,l,t);for(var x=arguments.length,S=new Array(x),A=0;A<x;A++)S[A]=arguments[A];e.apply(o,S)},T[r]||(T[r]={}),T[r][e]&&o.removeEventListener(r,T[r][e],t),T[r][e]=l,o.listeners=T}o.addEventListener(r,l,t)})}function dispatchEvent(o,n,e){var t;return isFunction(Event)&&isFunction(CustomEvent)?t=new CustomEvent(n,{detail:e,bubbles:!0,cancelable:!0}):(t=document.createEvent("CustomEvent"),t.initCustomEvent(n,!0,!0,e)),o.dispatchEvent(t)}function getOffset(o){var n=o.getBoundingClientRect();return{left:n.left+(window.pageXOffset-document.documentElement.clientLeft),top:n.top+(window.pageYOffset-document.documentElement.clientTop)}}var location$1=WINDOW.location,REGEXP_ORIGINS=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function isCrossOriginURL(o){var n=o.match(REGEXP_ORIGINS);return n!==null&&(n[1]!==location$1.protocol||n[2]!==location$1.hostname||n[3]!==location$1.port)}function addTimestamp(o){var n="timestamp=".concat(new Date().getTime());return o+(o.indexOf("?")===-1?"?":"&")+n}function getTransforms(o){var n=o.rotate,e=o.scaleX,t=o.scaleY,l=o.translateX,r=o.translateY,u=[];isNumber(l)&&l!==0&&u.push("translateX(".concat(l,"px)")),isNumber(r)&&r!==0&&u.push("translateY(".concat(r,"px)")),isNumber(n)&&n!==0&&u.push("rotate(".concat(n,"deg)")),isNumber(e)&&e!==1&&u.push("scaleX(".concat(e,")")),isNumber(t)&&t!==1&&u.push("scaleY(".concat(t,")"));var T=u.length?u.join(" "):"none";return{WebkitTransform:T,msTransform:T,transform:T}}function getMaxZoomRatio(o){var n=_objectSpread2({},o),e=0;return forEach(o,function(t,l){delete n[l],forEach(n,function(r){var u=Math.abs(t.startX-r.startX),T=Math.abs(t.startY-r.startY),w=Math.abs(t.endX-r.endX),x=Math.abs(t.endY-r.endY),S=Math.sqrt(u*u+T*T),A=Math.sqrt(w*w+x*x),D=(A-S)/S;Math.abs(D)>Math.abs(e)&&(e=D)})}),e}function getPointer(o,n){var e=o.pageX,t=o.pageY,l={endX:e,endY:t};return n?l:_objectSpread2({startX:e,startY:t},l)}function getPointersCenter(o){var n=0,e=0,t=0;return forEach(o,function(l){var r=l.startX,u=l.startY;n+=r,e+=u,t+=1}),n/=t,e/=t,{pageX:n,pageY:e}}function getAdjustedSizes(o){var n=o.aspectRatio,e=o.height,t=o.width,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=isPositiveNumber(t),u=isPositiveNumber(e);if(r&&u){var T=e*n;l==="contain"&&T>t||l==="cover"&&T<t?e=t/n:t=e*n}else r?e=t/n:u&&(t=e*n);return{width:t,height:e}}function getRotatedSizes(o){var n=o.width,e=o.height,t=o.degree;if(t=Math.abs(t)%180,t===90)return{width:e,height:n};var l=t%90*Math.PI/180,r=Math.sin(l),u=Math.cos(l),T=n*u+e*r,w=n*r+e*u;return t>90?{width:w,height:T}:{width:T,height:w}}function getSourceCanvas(o,n,e,t){var l=n.aspectRatio,r=n.naturalWidth,u=n.naturalHeight,T=n.rotate,w=T===void 0?0:T,x=n.scaleX,S=x===void 0?1:x,A=n.scaleY,D=A===void 0?1:A,z=e.aspectRatio,P=e.naturalWidth,L=e.naturalHeight,Y=t.fillColor,W=Y===void 0?"transparent":Y,ie=t.imageSmoothingEnabled,B=ie===void 0?!0:ie,E=t.imageSmoothingQuality,C=E===void 0?"low":E,k=t.maxWidth,g=k===void 0?1/0:k,U=t.maxHeight,F=U===void 0?1/0:U,H=t.minWidth,K=H===void 0?0:H,_=t.minHeight,V=_===void 0?0:_,X=document.createElement("canvas"),G=X.getContext("2d"),$=getAdjustedSizes({aspectRatio:z,width:g,height:F}),re=getAdjustedSizes({aspectRatio:z,width:K,height:V},"cover"),ue=Math.min($.width,Math.max(re.width,P)),oe=Math.min($.height,Math.max(re.height,L)),ee=getAdjustedSizes({aspectRatio:l,width:g,height:F}),ce=getAdjustedSizes({aspectRatio:l,width:K,height:V},"cover"),ae=Math.min(ee.width,Math.max(ce.width,r)),pe=Math.min(ee.height,Math.max(ce.height,u)),Z=[-ae/2,-pe/2,ae,pe];return X.width=normalizeDecimalNumber(ue),X.height=normalizeDecimalNumber(oe),G.fillStyle=W,G.fillRect(0,0,ue,oe),G.save(),G.translate(ue/2,oe/2),G.rotate(w*Math.PI/180),G.scale(S,D),G.imageSmoothingEnabled=B,G.imageSmoothingQuality=C,G.drawImage.apply(G,[o].concat(_toConsumableArray(Z.map(function(ne){return Math.floor(normalizeDecimalNumber(ne))})))),G.restore(),X}var fromCharCode=String.fromCharCode;function getStringFromCharCode(o,n,e){var t="";e+=n;for(var l=n;l<e;l+=1)t+=fromCharCode(o.getUint8(l));return t}var REGEXP_DATA_URL_HEAD=/^data:.*,/;function dataURLToArrayBuffer(o){var n=o.replace(REGEXP_DATA_URL_HEAD,""),e=atob(n),t=new ArrayBuffer(e.length),l=new Uint8Array(t);return forEach(l,function(r,u){l[u]=e.charCodeAt(u)}),t}function arrayBufferToDataURL(o,n){for(var e=[],t=8192,l=new Uint8Array(o);l.length>0;)e.push(fromCharCode.apply(null,toArray(l.subarray(0,t)))),l=l.subarray(t);return"data:".concat(n,";base64,").concat(btoa(e.join("")))}function resetAndGetOrientation(o){var n=new DataView(o),e;try{var t,l,r;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var u=n.byteLength,T=2;T+1<u;){if(n.getUint8(T)===255&&n.getUint8(T+1)===225){l=T;break}T+=1}if(l){var w=l+4,x=l+10;if(getStringFromCharCode(n,w,4)==="Exif"){var S=n.getUint16(x);if(t=S===18761,(t||S===19789)&&n.getUint16(x+2,t)===42){var A=n.getUint32(x+4,t);A>=8&&(r=x+A)}}}if(r){var D=n.getUint16(r,t),z,P;for(P=0;P<D;P+=1)if(z=r+P*12+2,n.getUint16(z,t)===274){z+=8,e=n.getUint16(z,t),n.setUint16(z,1,t);break}}}catch(L){e=1}return e}function parseOrientation(o){var n=0,e=1,t=1;switch(o){case 2:e=-1;break;case 3:n=-180;break;case 4:t=-1;break;case 5:n=90,t=-1;break;case 6:n=90;break;case 7:n=90,e=-1;break;case 8:n=-90;break}return{rotate:n,scaleX:e,scaleY:t}}var render={render:function o(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function o(){var n=this.element,e=this.options,t=this.container,l=this.cropper,r=Number(e.minContainerWidth),u=Number(e.minContainerHeight);addClass(l,CLASS_HIDDEN),removeClass(n,CLASS_HIDDEN);var T={width:Math.max(t.offsetWidth,r>=0?r:MIN_CONTAINER_WIDTH),height:Math.max(t.offsetHeight,u>=0?u:MIN_CONTAINER_HEIGHT)};this.containerData=T,setStyle(l,{width:T.width,height:T.height}),addClass(n,CLASS_HIDDEN),removeClass(l,CLASS_HIDDEN)},initCanvas:function o(){var n=this.containerData,e=this.imageData,t=this.options.viewMode,l=Math.abs(e.rotate)%180===90,r=l?e.naturalHeight:e.naturalWidth,u=l?e.naturalWidth:e.naturalHeight,T=r/u,w=n.width,x=n.height;n.height*T>n.width?t===3?w=n.height*T:x=n.width/T:t===3?x=n.width/T:w=n.height*T;var S={aspectRatio:T,naturalWidth:r,naturalHeight:u,width:w,height:x};this.canvasData=S,this.limited=t===1||t===2,this.limitCanvas(!0,!0),S.width=Math.min(Math.max(S.width,S.minWidth),S.maxWidth),S.height=Math.min(Math.max(S.height,S.minHeight),S.maxHeight),S.left=(n.width-S.width)/2,S.top=(n.height-S.height)/2,S.oldLeft=S.left,S.oldTop=S.top,this.initialCanvasData=assign({},S)},limitCanvas:function o(n,e){var t=this.options,l=this.containerData,r=this.canvasData,u=this.cropBoxData,T=t.viewMode,w=r.aspectRatio,x=this.cropped&&u;if(n){var S=Number(t.minCanvasWidth)||0,A=Number(t.minCanvasHeight)||0;T>1?(S=Math.max(S,l.width),A=Math.max(A,l.height),T===3&&(A*w>S?S=A*w:A=S/w)):T>0&&(S?S=Math.max(S,x?u.width:0):A?A=Math.max(A,x?u.height:0):x&&(S=u.width,A=u.height,A*w>S?S=A*w:A=S/w));var D=getAdjustedSizes({aspectRatio:w,width:S,height:A});S=D.width,A=D.height,r.minWidth=S,r.minHeight=A,r.maxWidth=1/0,r.maxHeight=1/0}if(e)if(T>(x?0:1)){var z=l.width-r.width,P=l.height-r.height;r.minLeft=Math.min(0,z),r.minTop=Math.min(0,P),r.maxLeft=Math.max(0,z),r.maxTop=Math.max(0,P),x&&this.limited&&(r.minLeft=Math.min(u.left,u.left+(u.width-r.width)),r.minTop=Math.min(u.top,u.top+(u.height-r.height)),r.maxLeft=u.left,r.maxTop=u.top,T===2&&(r.width>=l.width&&(r.minLeft=Math.min(0,z),r.maxLeft=Math.max(0,z)),r.height>=l.height&&(r.minTop=Math.min(0,P),r.maxTop=Math.max(0,P))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=l.width,r.maxTop=l.height},renderCanvas:function o(n,e){var t=this.canvasData,l=this.imageData;if(e){var r=getRotatedSizes({width:l.naturalWidth*Math.abs(l.scaleX||1),height:l.naturalHeight*Math.abs(l.scaleY||1),degree:l.rotate||0}),u=r.width,T=r.height,w=t.width*(u/t.naturalWidth),x=t.height*(T/t.naturalHeight);t.left-=(w-t.width)/2,t.top-=(x-t.height)/2,t.width=w,t.height=x,t.aspectRatio=u/T,t.naturalWidth=u,t.naturalHeight=T,this.limitCanvas(!0,!1)}(t.width>t.maxWidth||t.width<t.minWidth)&&(t.left=t.oldLeft),(t.height>t.maxHeight||t.height<t.minHeight)&&(t.top=t.oldTop),t.width=Math.min(Math.max(t.width,t.minWidth),t.maxWidth),t.height=Math.min(Math.max(t.height,t.minHeight),t.maxHeight),this.limitCanvas(!1,!0),t.left=Math.min(Math.max(t.left,t.minLeft),t.maxLeft),t.top=Math.min(Math.max(t.top,t.minTop),t.maxTop),t.oldLeft=t.left,t.oldTop=t.top,setStyle(this.canvas,assign({width:t.width,height:t.height},getTransforms({translateX:t.left,translateY:t.top}))),this.renderImage(n),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function o(n){var e=this.canvasData,t=this.imageData,l=t.naturalWidth*(e.width/e.naturalWidth),r=t.naturalHeight*(e.height/e.naturalHeight);assign(t,{width:l,height:r,left:(e.width-l)/2,top:(e.height-r)/2}),setStyle(this.image,assign({width:t.width,height:t.height},getTransforms(assign({translateX:t.left,translateY:t.top},t)))),n&&this.output()},initCropBox:function o(){var n=this.options,e=this.canvasData,t=n.aspectRatio||n.initialAspectRatio,l=Number(n.autoCropArea)||.8,r={width:e.width,height:e.height};t&&(e.height*t>e.width?r.height=r.width/t:r.width=r.height*t),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*l),r.height=Math.max(r.minHeight,r.height*l),r.left=e.left+(e.width-r.width)/2,r.top=e.top+(e.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=assign({},r)},limitCropBox:function o(n,e){var t=this.options,l=this.containerData,r=this.canvasData,u=this.cropBoxData,T=this.limited,w=t.aspectRatio;if(n){var x=Number(t.minCropBoxWidth)||0,S=Number(t.minCropBoxHeight)||0,A=T?Math.min(l.width,r.width,r.width+r.left,l.width-r.left):l.width,D=T?Math.min(l.height,r.height,r.height+r.top,l.height-r.top):l.height;x=Math.min(x,l.width),S=Math.min(S,l.height),w&&(x&&S?S*w>x?S=x/w:x=S*w:x?S=x/w:S&&(x=S*w),D*w>A?D=A/w:A=D*w),u.minWidth=Math.min(x,A),u.minHeight=Math.min(S,D),u.maxWidth=A,u.maxHeight=D}e&&(T?(u.minLeft=Math.max(0,r.left),u.minTop=Math.max(0,r.top),u.maxLeft=Math.min(l.width,r.left+r.width)-u.width,u.maxTop=Math.min(l.height,r.top+r.height)-u.height):(u.minLeft=0,u.minTop=0,u.maxLeft=l.width-u.width,u.maxTop=l.height-u.height))},renderCropBox:function o(){var n=this.options,e=this.containerData,t=this.cropBoxData;(t.width>t.maxWidth||t.width<t.minWidth)&&(t.left=t.oldLeft),(t.height>t.maxHeight||t.height<t.minHeight)&&(t.top=t.oldTop),t.width=Math.min(Math.max(t.width,t.minWidth),t.maxWidth),t.height=Math.min(Math.max(t.height,t.minHeight),t.maxHeight),this.limitCropBox(!1,!0),t.left=Math.min(Math.max(t.left,t.minLeft),t.maxLeft),t.top=Math.min(Math.max(t.top,t.minTop),t.maxTop),t.oldLeft=t.left,t.oldTop=t.top,n.movable&&n.cropBoxMovable&&setData(this.face,DATA_ACTION,t.width>=e.width&&t.height>=e.height?ACTION_MOVE:ACTION_ALL),setStyle(this.cropBox,assign({width:t.width,height:t.height},getTransforms({translateX:t.left,translateY:t.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function o(){this.preview(),dispatchEvent(this.element,EVENT_CROP,this.getData())}},preview={initPreview:function o(){var n=this.element,e=this.crossOrigin,t=this.options.preview,l=e?this.crossOriginUrl:this.url,r=n.alt||"The image to preview",u=document.createElement("img");if(e&&(u.crossOrigin=e),u.src=l,u.alt=r,this.viewBox.appendChild(u),this.viewBoxImage=u,!!t){var T=t;typeof t=="string"?T=n.ownerDocument.querySelectorAll(t):t.querySelector&&(T=[t]),this.previews=T,forEach(T,function(w){var x=document.createElement("img");setData(w,DATA_PREVIEW,{width:w.offsetWidth,height:w.offsetHeight,html:w.innerHTML}),e&&(x.crossOrigin=e),x.src=l,x.alt=r,x.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;"',w.innerHTML="",w.appendChild(x)})}},resetPreview:function o(){forEach(this.previews,function(n){var e=getData(n,DATA_PREVIEW);setStyle(n,{width:e.width,height:e.height}),n.innerHTML=e.html,removeData(n,DATA_PREVIEW)})},preview:function o(){var n=this.imageData,e=this.canvasData,t=this.cropBoxData,l=t.width,r=t.height,u=n.width,T=n.height,w=t.left-e.left-n.left,x=t.top-e.top-n.top;!this.cropped||this.disabled||(setStyle(this.viewBoxImage,assign({width:u,height:T},getTransforms(assign({translateX:-w,translateY:-x},n)))),forEach(this.previews,function(S){var A=getData(S,DATA_PREVIEW),D=A.width,z=A.height,P=D,L=z,Y=1;l&&(Y=D/l,L=r*Y),r&&L>z&&(Y=z/r,P=l*Y,L=z),setStyle(S,{width:P,height:L}),setStyle(S.getElementsByTagName("img")[0],assign({width:u*Y,height:T*Y},getTransforms(assign({translateX:-w*Y,translateY:-x*Y},n))))}))}},events={bind:function o(){var n=this.element,e=this.options,t=this.cropper;isFunction(e.cropstart)&&addListener(n,EVENT_CROP_START,e.cropstart),isFunction(e.cropmove)&&addListener(n,EVENT_CROP_MOVE,e.cropmove),isFunction(e.cropend)&&addListener(n,EVENT_CROP_END,e.cropend),isFunction(e.crop)&&addListener(n,EVENT_CROP,e.crop),isFunction(e.zoom)&&addListener(n,EVENT_ZOOM,e.zoom),addListener(t,EVENT_POINTER_DOWN,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&addListener(t,EVENT_WHEEL,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&addListener(t,EVENT_DBLCLICK,this.onDblclick=this.dblclick.bind(this)),addListener(n.ownerDocument,EVENT_POINTER_MOVE,this.onCropMove=this.cropMove.bind(this)),addListener(n.ownerDocument,EVENT_POINTER_UP,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&addListener(window,EVENT_RESIZE,this.onResize=this.resize.bind(this))},unbind:function o(){var n=this.element,e=this.options,t=this.cropper;isFunction(e.cropstart)&&removeListener(n,EVENT_CROP_START,e.cropstart),isFunction(e.cropmove)&&removeListener(n,EVENT_CROP_MOVE,e.cropmove),isFunction(e.cropend)&&removeListener(n,EVENT_CROP_END,e.cropend),isFunction(e.crop)&&removeListener(n,EVENT_CROP,e.crop),isFunction(e.zoom)&&removeListener(n,EVENT_ZOOM,e.zoom),removeListener(t,EVENT_POINTER_DOWN,this.onCropStart),e.zoomable&&e.zoomOnWheel&&removeListener(t,EVENT_WHEEL,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&removeListener(t,EVENT_DBLCLICK,this.onDblclick),removeListener(n.ownerDocument,EVENT_POINTER_MOVE,this.onCropMove),removeListener(n.ownerDocument,EVENT_POINTER_UP,this.onCropEnd),e.responsive&&removeListener(window,EVENT_RESIZE,this.onResize)}},handlers={resize:function o(){if(!this.disabled){var n=this.options,e=this.container,t=this.containerData,l=e.offsetWidth/t.width,r=e.offsetHeight/t.height,u=Math.abs(l-1)>Math.abs(r-1)?l:r;if(u!==1){var T,w;n.restore&&(T=this.getCanvasData(),w=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(forEach(T,function(x,S){T[S]=x*u})),this.setCropBoxData(forEach(w,function(x,S){w[S]=x*u})))}}},dblclick:function o(){this.disabled||this.options.dragMode===DRAG_MODE_NONE||this.setDragMode(hasClass(this.dragBox,CLASS_CROP)?DRAG_MODE_MOVE:DRAG_MODE_CROP)},wheel:function o(n){var e=this,t=Number(this.options.wheelZoomRatio)||.1,l=1;this.disabled||(n.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){e.wheeling=!1},50),n.deltaY?l=n.deltaY>0?1:-1:n.wheelDelta?l=-n.wheelDelta/120:n.detail&&(l=n.detail>0?1:-1),this.zoom(-l*t,n)))},cropStart:function o(n){var e=n.buttons,t=n.button;if(!(this.disabled||(n.type==="mousedown"||n.type==="pointerdown"&&n.pointerType==="mouse")&&(isNumber(e)&&e!==1||isNumber(t)&&t!==0||n.ctrlKey))){var l=this.options,r=this.pointers,u;n.changedTouches?forEach(n.changedTouches,function(T){r[T.identifier]=getPointer(T)}):r[n.pointerId||0]=getPointer(n),Object.keys(r).length>1&&l.zoomable&&l.zoomOnTouch?u=ACTION_ZOOM:u=getData(n.target,DATA_ACTION),REGEXP_ACTIONS.test(u)&&dispatchEvent(this.element,EVENT_CROP_START,{originalEvent:n,action:u})!==!1&&(n.preventDefault(),this.action=u,this.cropping=!1,u===ACTION_CROP&&(this.cropping=!0,addClass(this.dragBox,CLASS_MODAL)))}},cropMove:function o(n){var e=this.action;if(!(this.disabled||!e)){var t=this.pointers;n.preventDefault(),dispatchEvent(this.element,EVENT_CROP_MOVE,{originalEvent:n,action:e})!==!1&&(n.changedTouches?forEach(n.changedTouches,function(l){assign(t[l.identifier]||{},getPointer(l,!0))}):assign(t[n.pointerId||0]||{},getPointer(n,!0)),this.change(n))}},cropEnd:function o(n){if(!this.disabled){var e=this.action,t=this.pointers;n.changedTouches?forEach(n.changedTouches,function(l){delete t[l.identifier]}):delete t[n.pointerId||0],e&&(n.preventDefault(),Object.keys(t).length||(this.action=""),this.cropping&&(this.cropping=!1,toggleClass(this.dragBox,CLASS_MODAL,this.cropped&&this.options.modal)),dispatchEvent(this.element,EVENT_CROP_END,{originalEvent:n,action:e}))}}},change={change:function o(n){var e=this.options,t=this.canvasData,l=this.containerData,r=this.cropBoxData,u=this.pointers,T=this.action,w=e.aspectRatio,x=r.left,S=r.top,A=r.width,D=r.height,z=x+A,P=S+D,L=0,Y=0,W=l.width,ie=l.height,B=!0,E;!w&&n.shiftKey&&(w=A&&D?A/D:1),this.limited&&(L=r.minLeft,Y=r.minTop,W=L+Math.min(l.width,t.width,t.left+t.width),ie=Y+Math.min(l.height,t.height,t.top+t.height));var C=u[Object.keys(u)[0]],k={x:C.endX-C.startX,y:C.endY-C.startY},g=function(F){switch(F){case ACTION_EAST:z+k.x>W&&(k.x=W-z);break;case ACTION_WEST:x+k.x<L&&(k.x=L-x);break;case ACTION_NORTH:S+k.y<Y&&(k.y=Y-S);break;case ACTION_SOUTH:P+k.y>ie&&(k.y=ie-P);break}};switch(T){case ACTION_ALL:x+=k.x,S+=k.y;break;case ACTION_EAST:if(k.x>=0&&(z>=W||w&&(S<=Y||P>=ie))){B=!1;break}g(ACTION_EAST),A+=k.x,A<0&&(T=ACTION_WEST,A=-A,x-=A),w&&(D=A/w,S+=(r.height-D)/2);break;case ACTION_NORTH:if(k.y<=0&&(S<=Y||w&&(x<=L||z>=W))){B=!1;break}g(ACTION_NORTH),D-=k.y,S+=k.y,D<0&&(T=ACTION_SOUTH,D=-D,S-=D),w&&(A=D*w,x+=(r.width-A)/2);break;case ACTION_WEST:if(k.x<=0&&(x<=L||w&&(S<=Y||P>=ie))){B=!1;break}g(ACTION_WEST),A-=k.x,x+=k.x,A<0&&(T=ACTION_EAST,A=-A,x-=A),w&&(D=A/w,S+=(r.height-D)/2);break;case ACTION_SOUTH:if(k.y>=0&&(P>=ie||w&&(x<=L||z>=W))){B=!1;break}g(ACTION_SOUTH),D+=k.y,D<0&&(T=ACTION_NORTH,D=-D,S-=D),w&&(A=D*w,x+=(r.width-A)/2);break;case ACTION_NORTH_EAST:if(w){if(k.y<=0&&(S<=Y||z>=W)){B=!1;break}g(ACTION_NORTH),D-=k.y,S+=k.y,A=D*w}else g(ACTION_NORTH),g(ACTION_EAST),k.x>=0?z<W?A+=k.x:k.y<=0&&S<=Y&&(B=!1):A+=k.x,k.y<=0?S>Y&&(D-=k.y,S+=k.y):(D-=k.y,S+=k.y);A<0&&D<0?(T=ACTION_SOUTH_WEST,D=-D,A=-A,S-=D,x-=A):A<0?(T=ACTION_NORTH_WEST,A=-A,x-=A):D<0&&(T=ACTION_SOUTH_EAST,D=-D,S-=D);break;case ACTION_NORTH_WEST:if(w){if(k.y<=0&&(S<=Y||x<=L)){B=!1;break}g(ACTION_NORTH),D-=k.y,S+=k.y,A=D*w,x+=r.width-A}else g(ACTION_NORTH),g(ACTION_WEST),k.x<=0?x>L?(A-=k.x,x+=k.x):k.y<=0&&S<=Y&&(B=!1):(A-=k.x,x+=k.x),k.y<=0?S>Y&&(D-=k.y,S+=k.y):(D-=k.y,S+=k.y);A<0&&D<0?(T=ACTION_SOUTH_EAST,D=-D,A=-A,S-=D,x-=A):A<0?(T=ACTION_NORTH_EAST,A=-A,x-=A):D<0&&(T=ACTION_SOUTH_WEST,D=-D,S-=D);break;case ACTION_SOUTH_WEST:if(w){if(k.x<=0&&(x<=L||P>=ie)){B=!1;break}g(ACTION_WEST),A-=k.x,x+=k.x,D=A/w}else g(ACTION_SOUTH),g(ACTION_WEST),k.x<=0?x>L?(A-=k.x,x+=k.x):k.y>=0&&P>=ie&&(B=!1):(A-=k.x,x+=k.x),k.y>=0?P<ie&&(D+=k.y):D+=k.y;A<0&&D<0?(T=ACTION_NORTH_EAST,D=-D,A=-A,S-=D,x-=A):A<0?(T=ACTION_SOUTH_EAST,A=-A,x-=A):D<0&&(T=ACTION_NORTH_WEST,D=-D,S-=D);break;case ACTION_SOUTH_EAST:if(w){if(k.x>=0&&(z>=W||P>=ie)){B=!1;break}g(ACTION_EAST),A+=k.x,D=A/w}else g(ACTION_SOUTH),g(ACTION_EAST),k.x>=0?z<W?A+=k.x:k.y>=0&&P>=ie&&(B=!1):A+=k.x,k.y>=0?P<ie&&(D+=k.y):D+=k.y;A<0&&D<0?(T=ACTION_NORTH_WEST,D=-D,A=-A,S-=D,x-=A):A<0?(T=ACTION_SOUTH_WEST,A=-A,x-=A):D<0&&(T=ACTION_NORTH_EAST,D=-D,S-=D);break;case ACTION_MOVE:this.move(k.x,k.y),B=!1;break;case ACTION_ZOOM:this.zoom(getMaxZoomRatio(u),n),B=!1;break;case ACTION_CROP:if(!k.x||!k.y){B=!1;break}E=getOffset(this.cropper),x=C.startX-E.left,S=C.startY-E.top,A=r.minWidth,D=r.minHeight,k.x>0?T=k.y>0?ACTION_SOUTH_EAST:ACTION_NORTH_EAST:k.x<0&&(x-=A,T=k.y>0?ACTION_SOUTH_WEST:ACTION_NORTH_WEST),k.y<0&&(S-=D),this.cropped||(removeClass(this.cropBox,CLASS_HIDDEN),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}B&&(r.width=A,r.height=D,r.left=x,r.top=S,this.action=T,this.renderCropBox()),forEach(u,function(U){U.startX=U.endX,U.startY=U.endY})}},methods={crop:function o(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&addClass(this.dragBox,CLASS_MODAL),removeClass(this.cropBox,CLASS_HIDDEN),this.setCropBoxData(this.initialCropBoxData)),this},reset:function o(){return this.ready&&!this.disabled&&(this.imageData=assign({},this.initialImageData),this.canvasData=assign({},this.initialCanvasData),this.cropBoxData=assign({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function o(){return this.cropped&&!this.disabled&&(assign(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),removeClass(this.dragBox,CLASS_MODAL),addClass(this.cropBox,CLASS_HIDDEN)),this},replace:function o(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&n&&(this.isImg&&(this.element.src=n),e?(this.url=n,this.image.src=n,this.ready&&(this.viewBoxImage.src=n,forEach(this.previews,function(t){t.getElementsByTagName("img")[0].src=n}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(n))),this},enable:function o(){return this.ready&&this.disabled&&(this.disabled=!1,removeClass(this.cropper,CLASS_DISABLED)),this},disable:function o(){return this.ready&&!this.disabled&&(this.disabled=!0,addClass(this.cropper,CLASS_DISABLED)),this},destroy:function o(){var n=this.element;return n[NAMESPACE]?(n[NAMESPACE]=void 0,this.isImg&&this.replaced&&(n.src=this.originalUrl),this.uncreate(),this):this},move:function o(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,t=this.canvasData,l=t.left,r=t.top;return this.moveTo(isUndefined(n)?n:l+Number(n),isUndefined(e)?e:r+Number(e))},moveTo:function o(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,t=this.canvasData,l=!1;return n=Number(n),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(isNumber(n)&&(t.left=n,l=!0),isNumber(e)&&(t.top=e,l=!0),l&&this.renderCanvas(!0)),this},zoom:function o(n,e){var t=this.canvasData;return n=Number(n),n<0?n=1/(1-n):n=1+n,this.zoomTo(t.width*n/t.naturalWidth,null,e)},zoomTo:function o(n,e,t){var l=this.options,r=this.canvasData,u=r.width,T=r.height,w=r.naturalWidth,x=r.naturalHeight;if(n=Number(n),n>=0&&this.ready&&!this.disabled&&l.zoomable){var S=w*n,A=x*n;if(dispatchEvent(this.element,EVENT_ZOOM,{ratio:n,oldRatio:u/w,originalEvent:t})===!1)return this;if(t){var D=this.pointers,z=getOffset(this.cropper),P=D&&Object.keys(D).length?getPointersCenter(D):{pageX:t.pageX,pageY:t.pageY};r.left-=(S-u)*((P.pageX-z.left-r.left)/u),r.top-=(A-T)*((P.pageY-z.top-r.top)/T)}else isPlainObject(e)&&isNumber(e.x)&&isNumber(e.y)?(r.left-=(S-u)*((e.x-r.left)/u),r.top-=(A-T)*((e.y-r.top)/T)):(r.left-=(S-u)/2,r.top-=(A-T)/2);r.width=S,r.height=A,this.renderCanvas(!0)}return this},rotate:function o(n){return this.rotateTo((this.imageData.rotate||0)+Number(n))},rotateTo:function o(n){return n=Number(n),isNumber(n)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=n%360,this.renderCanvas(!0,!0)),this},scaleX:function o(n){var e=this.imageData.scaleY;return this.scale(n,isNumber(e)?e:1)},scaleY:function o(n){var e=this.imageData.scaleX;return this.scale(isNumber(e)?e:1,n)},scale:function o(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,t=this.imageData,l=!1;return n=Number(n),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(isNumber(n)&&(t.scaleX=n,l=!0),isNumber(e)&&(t.scaleY=e,l=!0),l&&this.renderCanvas(!0,!0)),this},getData:function o(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.options,t=this.imageData,l=this.canvasData,r=this.cropBoxData,u;if(this.ready&&this.cropped){u={x:r.left-l.left,y:r.top-l.top,width:r.width,height:r.height};var T=t.width/t.naturalWidth;if(forEach(u,function(S,A){u[A]=S/T}),n){var w=Math.round(u.y+u.height),x=Math.round(u.x+u.width);u.x=Math.round(u.x),u.y=Math.round(u.y),u.width=x-u.x,u.height=w-u.y}}else u={x:0,y:0,width:0,height:0};return e.rotatable&&(u.rotate=t.rotate||0),e.scalable&&(u.scaleX=t.scaleX||1,u.scaleY=t.scaleY||1),u},setData:function o(n){var e=this.options,t=this.imageData,l=this.canvasData,r={};if(this.ready&&!this.disabled&&isPlainObject(n)){var u=!1;e.rotatable&&isNumber(n.rotate)&&n.rotate!==t.rotate&&(t.rotate=n.rotate,u=!0),e.scalable&&(isNumber(n.scaleX)&&n.scaleX!==t.scaleX&&(t.scaleX=n.scaleX,u=!0),isNumber(n.scaleY)&&n.scaleY!==t.scaleY&&(t.scaleY=n.scaleY,u=!0)),u&&this.renderCanvas(!0,!0);var T=t.width/t.naturalWidth;isNumber(n.x)&&(r.left=n.x*T+l.left),isNumber(n.y)&&(r.top=n.y*T+l.top),isNumber(n.width)&&(r.width=n.width*T),isNumber(n.height)&&(r.height=n.height*T),this.setCropBoxData(r)}return this},getContainerData:function o(){return this.ready?assign({},this.containerData):{}},getImageData:function o(){return this.sized?assign({},this.imageData):{}},getCanvasData:function o(){var n=this.canvasData,e={};return this.ready&&forEach(["left","top","width","height","naturalWidth","naturalHeight"],function(t){e[t]=n[t]}),e},setCanvasData:function o(n){var e=this.canvasData,t=e.aspectRatio;return this.ready&&!this.disabled&&isPlainObject(n)&&(isNumber(n.left)&&(e.left=n.left),isNumber(n.top)&&(e.top=n.top),isNumber(n.width)?(e.width=n.width,e.height=n.width/t):isNumber(n.height)&&(e.height=n.height,e.width=n.height*t),this.renderCanvas(!0)),this},getCropBoxData:function o(){var n=this.cropBoxData,e;return this.ready&&this.cropped&&(e={left:n.left,top:n.top,width:n.width,height:n.height}),e||{}},setCropBoxData:function o(n){var e=this.cropBoxData,t=this.options.aspectRatio,l,r;return this.ready&&this.cropped&&!this.disabled&&isPlainObject(n)&&(isNumber(n.left)&&(e.left=n.left),isNumber(n.top)&&(e.top=n.top),isNumber(n.width)&&n.width!==e.width&&(l=!0,e.width=n.width),isNumber(n.height)&&n.height!==e.height&&(r=!0,e.height=n.height),t&&(l?e.height=e.width/t:r&&(e.width=e.height*t)),this.renderCropBox()),this},getCroppedCanvas:function o(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,t=getSourceCanvas(this.image,this.imageData,e,n);if(!this.cropped)return t;var l=this.getData(),r=l.x,u=l.y,T=l.width,w=l.height,x=t.width/Math.floor(e.naturalWidth);x!==1&&(r*=x,u*=x,T*=x,w*=x);var S=T/w,A=getAdjustedSizes({aspectRatio:S,width:n.maxWidth||1/0,height:n.maxHeight||1/0}),D=getAdjustedSizes({aspectRatio:S,width:n.minWidth||0,height:n.minHeight||0},"cover"),z=getAdjustedSizes({aspectRatio:S,width:n.width||(x!==1?t.width:T),height:n.height||(x!==1?t.height:w)}),P=z.width,L=z.height;P=Math.min(A.width,Math.max(D.width,P)),L=Math.min(A.height,Math.max(D.height,L));var Y=document.createElement("canvas"),W=Y.getContext("2d");Y.width=normalizeDecimalNumber(P),Y.height=normalizeDecimalNumber(L),W.fillStyle=n.fillColor||"transparent",W.fillRect(0,0,P,L);var ie=n.imageSmoothingEnabled,B=ie===void 0?!0:ie,E=n.imageSmoothingQuality;W.imageSmoothingEnabled=B,E&&(W.imageSmoothingQuality=E);var C=t.width,k=t.height,g=r,U=u,F,H,K,_,V,X;g<=-T||g>C?(g=0,F=0,K=0,V=0):g<=0?(K=-g,g=0,F=Math.min(C,T+g),V=F):g<=C&&(K=0,F=Math.min(T,C-g),V=F),F<=0||U<=-w||U>k?(U=0,H=0,_=0,X=0):U<=0?(_=-U,U=0,H=Math.min(k,w+U),X=H):U<=k&&(_=0,H=Math.min(w,k-U),X=H);var G=[g,U,F,H];if(V>0&&X>0){var $=P/T;G.push(K*$,_*$,V*$,X*$)}return W.drawImage.apply(W,[t].concat(_toConsumableArray(G.map(function(re){return Math.floor(normalizeDecimalNumber(re))})))),Y},setAspectRatio:function o(n){var e=this.options;return!this.disabled&&!isUndefined(n)&&(e.aspectRatio=Math.max(0,n)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function o(n){var e=this.options,t=this.dragBox,l=this.face;if(this.ready&&!this.disabled){var r=n===DRAG_MODE_CROP,u=e.movable&&n===DRAG_MODE_MOVE;n=r||u?n:DRAG_MODE_NONE,e.dragMode=n,setData(t,DATA_ACTION,n),toggleClass(t,CLASS_CROP,r),toggleClass(t,CLASS_MOVE,u),e.cropBoxMovable||(setData(l,DATA_ACTION,n),toggleClass(l,CLASS_CROP,r),toggleClass(l,CLASS_MOVE,u))}return this}},AnotherCropper=WINDOW.Cropper,Cropper=function(){function o(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_classCallCheck(this,o),!n||!REGEXP_TAG_NAME.test(n.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=n,this.options=assign({},DEFAULTS,isPlainObject(e)&&e),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 _createClass(o,[{key:"init",value:function(){var e=this.element,t=e.tagName.toLowerCase(),l;if(!e[NAMESPACE]){if(e[NAMESPACE]=this,t==="img"){if(this.isImg=!0,l=e.getAttribute("src")||"",this.originalUrl=l,!l)return;l=e.src}else t==="canvas"&&window.HTMLCanvasElement&&(l=e.toDataURL());this.load(l)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var l=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(REGEXP_DATA_URL.test(e)){REGEXP_DATA_URL_JPEG.test(e)?this.read(dataURLToArrayBuffer(e)):this.clone();return}var u=new XMLHttpRequest,T=this.clone.bind(this);this.reloading=!0,this.xhr=u,u.onabort=T,u.onerror=T,u.ontimeout=T,u.onprogress=function(){u.getResponseHeader("content-type")!==MIME_TYPE_JPEG&&u.abort()},u.onload=function(){t.read(u.response)},u.onloadend=function(){t.reloading=!1,t.xhr=null},r.checkCrossOrigin&&isCrossOriginURL(e)&&l.crossOrigin&&(e=addTimestamp(e)),u.open("GET",e,!0),u.responseType="arraybuffer",u.withCredentials=l.crossOrigin==="use-credentials",u.send()}}},{key:"read",value:function(e){var t=this.options,l=this.imageData,r=resetAndGetOrientation(e),u=0,T=1,w=1;if(r>1){this.url=arrayBufferToDataURL(e,MIME_TYPE_JPEG);var x=parseOrientation(r);u=x.rotate,T=x.scaleX,w=x.scaleY}t.rotatable&&(l.rotate=u),t.scalable&&(l.scaleX=T,l.scaleY=w),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,l=e.crossOrigin,r=t;this.options.checkCrossOrigin&&isCrossOriginURL(t)&&(l||(l="anonymous"),r=addTimestamp(t)),this.crossOrigin=l,this.crossOriginUrl=r;var u=document.createElement("img");l&&(u.crossOrigin=l),u.src=r||t,u.alt=e.alt||"The image to crop",this.image=u,u.onload=this.start.bind(this),u.onerror=this.stop.bind(this),addClass(u,CLASS_HIDE),e.parentNode.insertBefore(u,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var l=WINDOW.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent),r=function(x,S){assign(e.imageData,{naturalWidth:x,naturalHeight:S,aspectRatio:x/S}),e.initialImageData=assign({},e.imageData),e.sizing=!1,e.sized=!0,e.build()};if(t.naturalWidth&&!l){r(t.naturalWidth,t.naturalHeight);return}var u=document.createElement("img"),T=document.body||document.documentElement;this.sizingImage=u,u.onload=function(){r(u.width,u.height),l||T.removeChild(u)},u.src=t.src,l||(u.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;",T.appendChild(u))}},{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,l=this.image,r=e.parentNode,u=document.createElement("div");u.innerHTML=TEMPLATE;var T=u.querySelector(".".concat(NAMESPACE,"-container")),w=T.querySelector(".".concat(NAMESPACE,"-canvas")),x=T.querySelector(".".concat(NAMESPACE,"-drag-box")),S=T.querySelector(".".concat(NAMESPACE,"-crop-box")),A=S.querySelector(".".concat(NAMESPACE,"-face"));this.container=r,this.cropper=T,this.canvas=w,this.dragBox=x,this.cropBox=S,this.viewBox=T.querySelector(".".concat(NAMESPACE,"-view-box")),this.face=A,w.appendChild(l),addClass(e,CLASS_HIDDEN),r.insertBefore(T,e.nextSibling),removeClass(l,CLASS_HIDE),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,addClass(S,CLASS_HIDDEN),t.guides||addClass(S.getElementsByClassName("".concat(NAMESPACE,"-dashed")),CLASS_HIDDEN),t.center||addClass(S.getElementsByClassName("".concat(NAMESPACE,"-center")),CLASS_HIDDEN),t.background&&addClass(T,"".concat(NAMESPACE,"-bg")),t.highlight||addClass(A,CLASS_INVISIBLE),t.cropBoxMovable&&(addClass(A,CLASS_MOVE),setData(A,DATA_ACTION,ACTION_ALL)),t.cropBoxResizable||(addClass(S.getElementsByClassName("".concat(NAMESPACE,"-line")),CLASS_HIDDEN),addClass(S.getElementsByClassName("".concat(NAMESPACE,"-point")),CLASS_HIDDEN)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),isFunction(t.ready)&&addListener(e,EVENT_READY,t.ready,{once:!0}),dispatchEvent(e,EVENT_READY)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var e=this.cropper.parentNode;e&&e.removeChild(this.cropper),removeClass(this.element,CLASS_HIDDEN)}}},{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()}}],[{key:"noConflict",value:function(){return window.Cropper=AnotherCropper,o}},{key:"setDefaults",value:function(e){assign(DEFAULTS,isPlainObject(e)&&e)}}]),o}();assign(Cropper.prototype,render,preview,events,handlers,change,methods);const cropper="",Copper=defineComponent({name:"copper-image",emits:["close","cropperNo","cropperOk"],setup(o,{emit:n,expose:e}){const t=reactive({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}),l=ref(),r=x=>{const{options:S}=t;t.visible=!0,t.options=Object.assign({},S,x),nextTick(()=>{u()})},u=()=>{t.myCropper=new Cropper(l.value,{viewMode:1,dragMode:"move",aspectRatio:t.options.autoCropWidth/t.options.autoCropHeight,initialAspectRatio:1,autoCropArea:1,cropBoxMovable:!0,cropBoxResizable:!1,background:!0,movable:!0,modal:!0,preview:".before"})},T=x=>{switch(x){case"left":t.myCropper.rotate(90);break;case"right":t.myCropper.rotate(-90);break;case"zoomIn":t.myCropper.zoom(.1);break;case"zoomOut":t.myCropper.zoom(-.1);break}},w=()=>{t.confirmLoading=!0,t.myCropper.getCroppedCanvas({imageSmoothingQuality:"high"}).toBlob(x=>{console.log(x,"1212"),n("cropperOk",x),t.confirmLoading=!1})};return e({edit:r}),()=>createVNode("div",null,[createVNode(NGrid,{cols:2,xGap:24,style:{paddingTop:"12px"}},{default:()=>[createVNode(NGi,null,{default:()=>{var x,S;return[createVNode("div",{style:"width: 100%; height: 300px"},[((x=t.options)==null?void 0:x.img)&&createVNode("img",{ref:l,src:(S=t.options)==null?void 0:S.img,alt:""},null)]),createVNode(NSpace,{justify:"center",style:{paddingTop:"12px"}},{default:()=>[createVNode(NButton,{type:"primary",size:"small",onClick:()=>T("left")},{default:()=>[createTextVNode("逆时针旋转")]}),createVNode(NButton,{type:"primary",size:"small",onClick:()=>T("right")},{default:()=>[createTextVNode("顺时针旋转")]}),createVNode(NButton,{type:"primary",size:"small",onClick:()=>T("zoomIn")},{default:()=>[createTextVNode("放大")]}),createVNode(NButton,{type:"primary",size:"small",onClick:()=>T("zoomOut")},{default:()=>[createTextVNode("缩小")]})]})]}}),createVNode(NGi,null,{default:()=>[createVNode("span",{style:{fontSize:"15px",fontWeight:600,paddingBottom:"8px",display:"inline-block"}},[createTextVNode("预览图片")]),createVNode("div",{class:"before",style:{width:t.options.autoCropWidth+"px",height:t.options.autoCropHeight+"px",overflow:"hidden"}},null)]})]}),createVNode(NSpace,{justify:"end"},{default:()=>[createVNode(NButton,{type:"default",onClick:()=>{t.confirmLoading=!1,n("close"),n("cropperNo")}},{default:()=>[createTextVNode("取消")]}),createVNode(NButton,{type:"primary",loading:t.confirmLoading,onClick:w},{default:()=>[createTextVNode("确认")]})]})])}}),UploadFile=defineComponent({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(o,{emit:n,expose:e,slots:t}){const l="https://".concat(o.bucketName,".ks3-cn-beijing.ksyuncs.com/"),r=useMessage(),u=ref(!1),T=ref(!1);ref();const w=ref(),x=reactive([]),S=ref([]),A=()=>{if(o.fileList){const E=o.fileList.split("/");S.value=[{id:new Date().getTime().toString(),name:E[E.length-1],status:"finished",url:o.fileList}]}else if(Array.isArray(o.imageList)){const E=[];o.imageList.forEach(C=>{const k=C.split("/");E.push({id:Date.now().toString(),name:k[k.length-1],status:"finished",url:C})}),S.value=E}else S.value=[]};A(),watch(()=>o.imageList,()=>{A()}),watch(()=>o.fileList,()=>{A()}),e({handleClearFile:()=>{var E;(E=w.value)==null||E.clear(),console.log("清空",w.value)}});const z=ref(),P=async E=>{const C=E.file;let k=!0;if(o.size&&(k=C.file.size/1024/1024<o.size,!k))return r.error("文件大小不能超过".concat(o.size,"M")),!1;if(!k)return k;if(o.cropper)return L(C.file,g=>{const U=Object.assign({},o.options,{img:g,name:C.file.name});u.value=!0,setTimeout(()=>{var F;(F=z.value)==null||F.edit(U),console.log(z.value,"cropper")},100)}),!1;try{T.value=!0,console.log(o.path,C.file);const g=C.file.name,U=g.slice(g.lastIndexOf(".")),F="".concat(o.path).concat(o.fileName||Date.now()+U),H={filename:F,bucketName:o.bucketName,postData:{filename:F,acl:"public-read",key:F,unknowValueField:[]}},{data:K}=await getUploadSign(H);x.push({id:C.id,tempFiileBuffer:C.file,policy:K.policy,signature:K.signature,acl:"public-read",key:F,KSSAccessKeyId:K.kssAccessKeyId,name:F})}catch(g){return T.value=!1,!1}return!0},L=async(E,C)=>{const k=new FileReader;k.addEventListener("load",()=>C(k.result)),k.readAsDataURL(E)},Y=E=>{const C=x.find(k=>k.id==E.file.id);n("update:fileList",E.file.url),n("readFileInputEventAsArrayBuffer",C.tempFiileBuffer),u.value=!1,T.value=!1},W=async E=>{console.log("🚀 ~ options",E),n("update:fileList",""),n("remove"),T.value=!1},ie=({file:E,action:C,onFinish:k,onError:g,onProgress:U})=>{const F=x.find(H=>H.id==E.id);F.file=E,onFileUpload({file:E,action:C,data:F,onProgress:U,onFinish:k,onError:g})},B=async E=>{try{const C="".concat(o.path).concat(o.fileName||new Date().getTime()+".png"),k={filename:C,bucketName:o.bucketName,postData:{filename:C,acl:"public-read",key:C,unknowValueField:[]}},{data:g}=await getUploadSign(k),U={policy:g.policy,signature:g.signature,acl:"public-read",key:C,KSSAccessKeyId:g.kssAccessKeyId,name:C,file:E},F=await onOnlyFileUpload(l,U);console.log(F,"upload"),n("update:fileList",F),u.value=!1}catch(C){return!1}};return()=>createVNode("div",null,[createVNode(NUpload,{ref:w,action:l,customRequest:ie,fileList:S.value,"onUpdate:fileList":E=>S.value=E,listType:o.listType,accept:o.accept,multiple:o.multiple,max:o.max,disabled:o.disabled,showFileList:o.showFileList,showPreviewButton:!0,onBeforeUpload:E=>P(E),onFinish:E=>Y(E),onRemove:E=>W(E)},{default:()=>[o.showType==="default"&&o.listType==="image"&&createVNode(NButton,{loading:T.value,type:"primary"},{default:()=>[o.text]}),o.showType==="custom"&&t.custom&&t.custom()]}),o.tips&&createVNode("p",{style:"font-size: 13px; color: #666; padding-top: 4px;"},[o.tips]),createVNode(NModal,{maskClosable:modalClickMask,show:u.value,"onUpdate:show":E=>u.value=E,preset:"dialog",showIcon:!1,class:["modalTitle background"],title:"上传图片",style:{width:"800px"}},{default:()=>[createVNode(Copper,{ref:z,onClose:()=>u.value=!1,onCropperOk:B},null)]})])}});export{Cropper as C,UploadFile as U,onOnlyFileUpload as a,getUploadSign as g,onFileUpload as o};