@qxs-bns/utils 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -1
- package/index.js +2 -2
- package/package.json +1 -4
- package/src/device.cjs +1 -1
- package/src/device.js +20 -17
- package/src/file-operations.cjs +1 -1
- package/src/file-operations.js +56 -51
- package/types/index.d.ts +10 -7
- package/vendor/ali-oss/dist/aliyun-oss-sdk.js.cjs +83 -0
- package/vendor/ali-oss/dist/aliyun-oss-sdk.js.js +20175 -0
- package/lib/aliyun-upload-sdk-1.5.6.min.cjs +0 -6
- package/lib/aliyun-upload-sdk-1.5.6.min.js +0 -1986
- /package/{_virtual/aliyun-oss-sdk.cjs → vendor/ali-oss/dist/aliyun-oss-sdk.js?commonjs-module.cjs} +0 -0
- /package/{_virtual/aliyun-oss-sdk.js → vendor/ali-oss/dist/aliyun-oss-sdk.js?commonjs-module.js} +0 -0
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";(function(H){function E(_){if(A[_])return A[_].exports;var k=A[_]={i:_,l:!1,exports:{}};return H[_].call(k.exports,k,k.exports,E),k.l=!0,k.exports}var A={};E.m=H,E.c=A,E.d=function(_,k,R){E.o(_,k)||Object.defineProperty(_,k,{configurable:!1,enumerable:!0,get:R})},E.n=function(_){var k=_&&_.__esModule?function(){return _.default}:function(){return _};return E.d(k,"a",k),k},E.o=function(_,k){return Object.prototype.hasOwnProperty.call(_,k)},E.p="",E(E.s=13)})([function(H,E,A){(function(_){(function(k,R){H.exports=E=R()})(0,function(){var k=k||function(R,r){var c;if(typeof window!="undefined"&&window.crypto&&(c=window.crypto),typeof self!="undefined"&&self.crypto&&(c=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(c=globalThis.crypto),!c&&typeof window!="undefined"&&window.msCrypto&&(c=window.msCrypto),!c&&_!==void 0&&_.crypto&&(c=_.crypto),!c)try{c=A(28)}catch(y){}var d=function(){if(c){if(typeof c.getRandomValues=="function")try{return c.getRandomValues(new Uint32Array(1))[0]}catch(y){}if(typeof c.randomBytes=="function")try{return c.randomBytes(4).readInt32LE()}catch(y){}}throw new Error("Native crypto module could not be used to get secure random number.")},u=Object.create||function(){function y(){}return function(S){var M;return y.prototype=S,M=new y,y.prototype=null,M}}(),o={},i=o.lib={},a=i.Base=function(){return{extend:function(y){var S=u(this);return y&&S.mixIn(y),S.hasOwnProperty("init")&&this.init!==S.init||(S.init=function(){S.$super.init.apply(this,arguments)}),S.init.prototype=S,S.$super=this,S},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var S in y)y.hasOwnProperty(S)&&(this[S]=y[S]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),h=i.WordArray=a.extend({init:function(y,S){y=this.words=y||[],this.sigBytes=S!=null?S:4*y.length},toString:function(y){return(y||m).stringify(this)},concat:function(y){var S=this.words,M=y.words,L=this.sigBytes,z=y.sigBytes;if(this.clamp(),L%4)for(var V=0;V<z;V++){var q=M[V>>>2]>>>24-V%4*8&255;S[L+V>>>2]|=q<<24-(L+V)%4*8}else for(var W=0;W<z;W+=4)S[L+W>>>2]=M[W>>>2];return this.sigBytes+=z,this},clamp:function(){var y=this.words,S=this.sigBytes;y[S>>>2]&=4294967295<<32-S%4*8,y.length=R.ceil(S/4)},clone:function(){var y=a.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var S=[],M=0;M<y;M+=4)S.push(d());return new h.init(S,y)}}),l=o.enc={},m=l.Hex={stringify:function(y){for(var S=y.words,M=y.sigBytes,L=[],z=0;z<M;z++){var V=S[z>>>2]>>>24-z%4*8&255;L.push((V>>>4).toString(16)),L.push((15&V).toString(16))}return L.join("")},parse:function(y){for(var S=y.length,M=[],L=0;L<S;L+=2)M[L>>>3]|=parseInt(y.substr(L,2),16)<<24-L%8*4;return new h.init(M,S/2)}},p=l.Latin1={stringify:function(y){for(var S=y.words,M=y.sigBytes,L=[],z=0;z<M;z++){var V=S[z>>>2]>>>24-z%4*8&255;L.push(String.fromCharCode(V))}return L.join("")},parse:function(y){for(var S=y.length,M=[],L=0;L<S;L++)M[L>>>2]|=(255&y.charCodeAt(L))<<24-L%4*8;return new h.init(M,S)}},w=l.Utf8={stringify:function(y){try{return decodeURIComponent(escape(p.stringify(y)))}catch(S){throw new Error("Malformed UTF-8 data")}},parse:function(y){return p.parse(unescape(encodeURIComponent(y)))}},B=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=w.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var S,M=this._data,L=M.words,z=M.sigBytes,V=this.blockSize,q=4*V,W=z/q;W=y?R.ceil(W):R.max((0|W)-this._minBufferSize,0);var s=W*V,g=R.min(4*s,z);if(s){for(var b=0;b<s;b+=V)this._doProcessBlock(L,b);S=L.splice(0,s),M.sigBytes-=g}return new h.init(S,g)},clone:function(){var y=a.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0}),I=(i.Hasher=B.extend({cfg:a.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){B.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){return y&&this._append(y),this._doFinalize()},blockSize:16,_createHelper:function(y){return function(S,M){return new y.init(M).finalize(S)}},_createHmacHelper:function(y){return function(S,M){return new I.HMAC.init(y,M).finalize(S)}}}),o.algo={});return o}(Math);return k})}).call(E,A(4))},function(H,E,A){function _(r,c){if(!(r instanceof c))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var k=function(){function r(c,d){for(var u=0;u<d.length;u++){var o=d[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}return function(c,d,u){return d&&r(c.prototype,d),u&&r(c,u),c}}(),R=function(){function r(){_(this,r)}return k(r,null,[{key:"detectIEVersion",value:function(){for(var c=4,d=document.createElement("div"),u=d.getElementsByTagName("i");d.innerHTML="<!--[if gt IE "+c+"]><i></i><![endif]-->",u[0];)c++;return c>4&&c}},{key:"extend",value:function(c,d){for(var u in d)Object.prototype.hasOwnProperty.call(d,u)&&d[u]&&(c[u]=d[u])}},{key:"isArray",value:function(c){return Object.prototype.toString.call(arg)==="[object Array]"}},{key:"getFileType",value:function(c){return c=c.toLowerCase(),/.mp4|.flv|.m3u8|.avi|.rm|.rmvb|.mpeg|.mpg|.mov|.wmv|.3gp|.asf|.dat|.dv|.f4v|.gif|.m2t|.m4v|.mj2|.mjpeg|.mpe|.mts|.ogg|.qt|.swf|.ts|.vob|.wmv|.webm/.test(c)?"video":/.mp3|.wav|.ape|.cda|.au|.midi|.mac|.aac|.ac3|.acm|.amr|.caf|.flac|.m4a|.ra|.wma/.test(c)?"audio":/.bmp|.jpg|.jpeg|.png/.test(c)?"img":"other"}},{key:"isImage",value:function(c){return c=c.toLowerCase(),!!/.jpg|.jpeg|.png/.test(c)}},{key:"ISODateString",value:function(c){function d(u){return u<10?"0"+u:u}return c.getUTCFullYear()+"-"+d(c.getUTCMonth()+1)+"-"+d(c.getUTCDate())+"T"+d(c.getUTCHours())+":"+d(c.getUTCMinutes())+":"+d(c.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(c){return!!/^\d+$/.test(c)}}]),r}();E.default=R},function(H,E,A){(function(_,k){H.exports=k(A(0))})(0,function(_){return function(k){function R(p,w,B,I,y,S,M){var L=p+(w&B|~w&I)+y+M;return(L<<S|L>>>32-S)+w}function r(p,w,B,I,y,S,M){var L=p+(w&I|B&~I)+y+M;return(L<<S|L>>>32-S)+w}function c(p,w,B,I,y,S,M){var L=p+(w^B^I)+y+M;return(L<<S|L>>>32-S)+w}function d(p,w,B,I,y,S,M){var L=p+(B^(w|~I))+y+M;return(L<<S|L>>>32-S)+w}var u=_,o=u.lib,i=o.WordArray,a=o.Hasher,h=u.algo,l=[];(function(){for(var p=0;p<64;p++)l[p]=4294967296*k.abs(k.sin(p+1))|0})();var m=h.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(p,w){for(var B=0;B<16;B++){var I=w+B,y=p[I];p[I]=16711935&(y<<8|y>>>24)|4278255360&(y<<24|y>>>8)}var S=this._hash.words,M=p[w+0],L=p[w+1],z=p[w+2],V=p[w+3],q=p[w+4],W=p[w+5],s=p[w+6],g=p[w+7],b=p[w+8],P=p[w+9],x=p[w+10],F=p[w+11],j=p[w+12],N=p[w+13],K=p[w+14],X=p[w+15],O=S[0],D=S[1],U=S[2],C=S[3];O=R(O,D,U,C,M,7,l[0]),C=R(C,O,D,U,L,12,l[1]),U=R(U,C,O,D,z,17,l[2]),D=R(D,U,C,O,V,22,l[3]),O=R(O,D,U,C,q,7,l[4]),C=R(C,O,D,U,W,12,l[5]),U=R(U,C,O,D,s,17,l[6]),D=R(D,U,C,O,g,22,l[7]),O=R(O,D,U,C,b,7,l[8]),C=R(C,O,D,U,P,12,l[9]),U=R(U,C,O,D,x,17,l[10]),D=R(D,U,C,O,F,22,l[11]),O=R(O,D,U,C,j,7,l[12]),C=R(C,O,D,U,N,12,l[13]),U=R(U,C,O,D,K,17,l[14]),D=R(D,U,C,O,X,22,l[15]),O=r(O,D,U,C,L,5,l[16]),C=r(C,O,D,U,s,9,l[17]),U=r(U,C,O,D,F,14,l[18]),D=r(D,U,C,O,M,20,l[19]),O=r(O,D,U,C,W,5,l[20]),C=r(C,O,D,U,x,9,l[21]),U=r(U,C,O,D,X,14,l[22]),D=r(D,U,C,O,q,20,l[23]),O=r(O,D,U,C,P,5,l[24]),C=r(C,O,D,U,K,9,l[25]),U=r(U,C,O,D,V,14,l[26]),D=r(D,U,C,O,b,20,l[27]),O=r(O,D,U,C,N,5,l[28]),C=r(C,O,D,U,z,9,l[29]),U=r(U,C,O,D,g,14,l[30]),D=r(D,U,C,O,j,20,l[31]),O=c(O,D,U,C,W,4,l[32]),C=c(C,O,D,U,b,11,l[33]),U=c(U,C,O,D,F,16,l[34]),D=c(D,U,C,O,K,23,l[35]),O=c(O,D,U,C,L,4,l[36]),C=c(C,O,D,U,q,11,l[37]),U=c(U,C,O,D,g,16,l[38]),D=c(D,U,C,O,x,23,l[39]),O=c(O,D,U,C,N,4,l[40]),C=c(C,O,D,U,M,11,l[41]),U=c(U,C,O,D,V,16,l[42]),D=c(D,U,C,O,s,23,l[43]),O=c(O,D,U,C,P,4,l[44]),C=c(C,O,D,U,j,11,l[45]),U=c(U,C,O,D,X,16,l[46]),D=c(D,U,C,O,z,23,l[47]),O=d(O,D,U,C,M,6,l[48]),C=d(C,O,D,U,g,10,l[49]),U=d(U,C,O,D,K,15,l[50]),D=d(D,U,C,O,W,21,l[51]),O=d(O,D,U,C,j,6,l[52]),C=d(C,O,D,U,V,10,l[53]),U=d(U,C,O,D,x,15,l[54]),D=d(D,U,C,O,L,21,l[55]),O=d(O,D,U,C,b,6,l[56]),C=d(C,O,D,U,X,10,l[57]),U=d(U,C,O,D,s,15,l[58]),D=d(D,U,C,O,N,21,l[59]),O=d(O,D,U,C,q,6,l[60]),C=d(C,O,D,U,F,10,l[61]),U=d(U,C,O,D,z,15,l[62]),D=d(D,U,C,O,P,21,l[63]),S[0]=S[0]+O|0,S[1]=S[1]+D|0,S[2]=S[2]+U|0,S[3]=S[3]+C|0},_doFinalize:function(){var p=this._data,w=p.words,B=8*this._nDataBytes,I=8*p.sigBytes;w[I>>>5]|=128<<24-I%32;var y=k.floor(B/4294967296),S=B;w[15+(I+64>>>9<<4)]=16711935&(y<<8|y>>>24)|4278255360&(y<<24|y>>>8),w[14+(I+64>>>9<<4)]=16711935&(S<<8|S>>>24)|4278255360&(S<<24|S>>>8),p.sigBytes=4*(w.length+1),this._process();for(var M=this._hash,L=M.words,z=0;z<4;z++){var V=L[z];L[z]=16711935&(V<<8|V>>>24)|4278255360&(V<<24|V>>>8)}return M},clone:function(){var p=a.clone.call(this);return p._hash=this._hash.clone(),p}});u.MD5=a._createHelper(m),u.HmacMD5=a._createHmacHelper(m)}(Math),_.MD5})},function(H,E,A){Object.defineProperty(E,"__esModule",{value:!0}),E.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},E.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},E.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(H,E){var A;A=function(){return this}();try{A=A||Function("return this")()||(0,eval)("this")}catch(_){typeof window=="object"&&(A=window)}H.exports=A},function(H,E,A){function _(m){return m&&m.__esModule?m:{default:m}}function k(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var R=function(){function m(p,w){for(var B=0;B<w.length;B++){var I=w[B];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(p,I.key,I)}}return function(p,w,B){return w&&m(p.prototype,w),B&&m(p,B),p}}(),r=A(6),c=_(r),d=A(25),u=_(d),o=A(7),i=_(o),a=A(8),h=_(a),l=function(){function m(p){k(this,m);var w=h.default.os.name,B=h.default.os.version||"",I=h.default.browser.name,y=h.default.browser.version||"",S=window.location.href,M="";S&&(M=h.default.getHost(S));var L="pc";h.default.os.ipad?L="pad":(h.default.os.iphone||h.default.os.android)&&(L="phone"),this._ri=c.default.create(),this.initParam={APIVersion:"0.6.0",lv:"1",av:i.default.version,pd:"upload",sm:"upload",md:"uploader",uuid:m.getUuid(),os:w,ov:B,et:I,ev:y,uat:navigator.userAgent,app_n:M,tt:L,dm:"h5",ut:""}}return R(m,[{key:"log",value:function(p,w){w&&w.ri?(this._ri=w.ri,delete w.ri):this._ri=c.default.create(),w&&w.ut&&(this.initParam.ut=w.ut,delete w.ut),this.initParam.t=new Date().getTime(),this.initParam.ll=p=="20006"?"error":"info",this.initParam.ri=this._ri,this.initParam.e=p;var B=[];if(w)for(var I in w)B.push(I+"="+w[I]);var y=B.join("&");this.initParam.args=encodeURIComponent(y==""?"0":y);var S=[];for(var I in this.initParam)S.push(I+"="+this.initParam[I]);var M=S.join("&");AliyunUpload&&AliyunUpload.__logTestCallback__?AliyunUpload.__logTestCallback__(M):new Image(0,0).src="https://videocloud.cn-hangzhou.log.aliyuncs.com/logstores/upload/track?"+M}}],[{key:"getUuid",value:function(){var p=u.default.get("p_h5_upload_u");return p||(p=c.default.create(),u.default.set("p_h5_upload_u",p,730)),p}},{key:"getClientId",value:function(){return u.default.get("p_h5_upload_clientId")}},{key:"setClientId",value:function(p){return p||(p=c.default.create()),u.default.set("p_h5_upload_clientId",p,730),p}}]),m}();E.default=l},function(H,E,A){function _(r,c){if(!(r instanceof c))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var k=function(){function r(c,d){for(var u=0;u<d.length;u++){var o=d[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}return function(c,d,u){return d&&r(c.prototype,d),u&&r(c,u),c}}(),R=function(){function r(){_(this,r)}return k(r,null,[{key:"create",value:function(c,d){var u,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[];if(d=d||o.length,c)for(u=0;u<c;u++)i[u]=o[0|Math.random()*d];else{var a;for(i[8]=i[13]=i[18]=i[23]="-",i[14]="4",u=0;u<36;u++)i[u]||(a=0|16*Math.random(),i[u]=o[u==19?3&a|8:a])}return i.join("")}}]),r}();E.default=R},function(H,E,A){Object.defineProperty(E,"__esModule",{value:!0});var _={version:"1.5.0"};E.default=_},function(H,E,A){function _(o,i){if(!(o instanceof i))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var k=function(){function o(i,a){for(var h=0;h<a.length;h++){var l=a[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(i,l.key,l)}}return function(i,a,h){return a&&o(i.prototype,a),h&&o(i,h),i}}(),R=function(o){var i=navigator.userAgent,a="other";if(o.ios)return"iOS";if(o.android)return"android";if(i.indexOf("Baiduspider")>-1)return"Baiduspider";if(i.indexOf("PlayStation")>-1)return"PS4";var h=navigator.platform=="Win32"||navigator.platform=="Windows"||i.indexOf("Windows")>-1,l=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return l&&(a="macOS"),navigator.platform=="X11"&&!h&&!l&&(a="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(a="Linux"),h?"windows":a},r=function(){var o=navigator.userAgent,i="";return(o.indexOf("Windows NT 5.0")>-1||o.indexOf("Windows 2000")>-1)&&(i="2000"),(o.indexOf("Windows NT 5.1")>-1||o.indexOf("Windows XP")>-1)&&(i="XP"),(o.indexOf("Windows NT 5.2")>-1||o.indexOf("Windows 2003")>-1)&&(i="2003"),(o.indexOf("Windows NT 6.0")>-1||o.indexOf("Windows Vista")>-1)&&(i="Vista"),(o.indexOf("Windows NT 6.1")>-1||o.indexOf("Windows 7")>-1)&&(i="7"),(o.indexOf("Windows NT 6.2")>-1||o.indexOf("Windows 8")>-1)&&(i="8"),(o.indexOf("Windows NT 6.3")>-1||o.indexOf("Windows 8.1")>-1)&&(i="8.1"),(o.indexOf("Windows NT 10")>-1||o.indexOf("Windows 10")>-1)&&(i="10"),i},c=function(o){var i=navigator.userAgent.toLowerCase();return o.chrome?"Chrome":o.firefox?"Firefox":o.safari?"Safari":o.webview?"webview":o.ie?/edge/.test(i)?"Edge":"IE":/baiduspider/.test(i)?"Baiduspider":/ucweb/.test(i)||/UCBrowser/.test(i)?"UC":/opera/.test(i)?"Opera":/ucweb/.test(i)?"UC":/360se/.test(i)?"360浏览器":/bidubrowser/.test(i)?"百度浏览器":/metasr/.test(i)?"搜狗浏览器":/lbbrowser/.test(i)?"猎豹浏览器":/micromessenger/.test(i)?"微信内置浏览器":/qqbrowser/.test(i)?"QQ浏览器":/playstation/.test(i)?"PS4浏览器":void 0},d=function(){var o={},i={},a=navigator.userAgent,h=navigator.platform,l=a.match(/Web[kK]it[\/]{0,1}([\d.]+)/),m=a.match(/(Android);?[\s\/]+([\d.]+)?/),p=!!a.match(/\(Macintosh\; Intel /),w=a.match(/(iPad).*OS\s([\d_]+)/),B=a.match(/(iPod)(.*OS\s([\d_]+))?/),I=!w&&a.match(/(iPhone\sOS)\s([\d_]+)/),y=a.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),S=/Win\d{2}|Windows/.test(h),M=a.match(/Windows Phone ([\d.]+)/),L=y&&a.match(/TouchPad/),z=a.match(/Kindle\/([\d.]+)/),V=a.match(/Silk\/([\d._]+)/),q=a.match(/(BlackBerry).*Version\/([\d.]+)/),W=a.match(/(BB10).*Version\/([\d.]+)/),s=a.match(/(RIM\sTablet\sOS)\s([\d.]+)/),g=a.match(/PlayBook/),b=a.match(/Chrome\/([\d.]+)/)||a.match(/CriOS\/([\d.]+)/),P=a.match(/Firefox\/([\d.]+)/),x=a.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),F=a.match(/MSIE\s([\d.]+)/)||a.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),j=!b&&a.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),N=j||a.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((i.webkit=!!l)&&(i.version=l[1]),m&&(o.android=!0,o.version=m[2]),I&&!B&&(o.ios=o.iphone=!0,o.version=I[2].replace(/_/g,".")),w&&(o.ios=o.ipad=!0,o.version=w[2].replace(/_/g,".")),B&&(o.ios=o.ipod=!0,o.version=B[3]?B[3].replace(/_/g,"."):null),M&&(o.wp=!0,o.version=M[1]),y&&(o.webos=!0,o.version=y[2]),L&&(o.touchpad=!0),q&&(o.blackberry=!0,o.version=q[2]),W&&(o.bb10=!0,o.version=W[2]),s&&(o.rimtabletos=!0,o.version=s[2]),g&&(i.playbook=!0),z&&(o.kindle=!0,o.version=z[1]),V&&(i.silk=!0,i.version=V[1]),!V&&o.android&&a.match(/Kindle Fire/)&&(i.silk=!0),b&&(i.chrome=!0,i.version=b[1]),P&&(i.firefox=!0,i.version=P[1]),x&&(o.firefoxos=!0,o.version=x[1]),F&&(i.ie=!0,i.version=F[1]),N&&(p||o.ios||S||m)&&(i.safari=!0,o.ios||(i.version=N[1])),j&&(i.webview=!0),p){var K=a.match(/[\d]*_[\d]*_[\d]*/);K&&K.length>0&&K[0]&&(o.version=K[0].replace(/_/g,"."))}return o.tablet=!!(w||g||m&&!a.match(/Mobile/)||P&&a.match(/Tablet/)||F&&!a.match(/Phone/)&&a.match(/Touch/)),o.phone=!(o.tablet||o.ipod||!(m||I||y||q||W||b&&a.match(/Android/)||b&&a.match(/CriOS\/([\d.]+)/)||P&&a.match(/Mobile/)||F&&a.match(/Touch/))),o.pc=!o.tablet&&!o.phone,p?o.name="macOS":S?(o.name="windows",o.version=r()):o.name=R(o),i.name=c(i),{os:o,browser:i}}(),u=function(){function o(){_(this,o)}return k(o,null,[{key:"getHost",value:function(i){var l="";if(i===void 0||i==null||i=="")return"";var a=i.indexOf("//"),h=i;a>-1&&(h=i.substring(a+2));var l=h,m=h.split("/");return m&&m.length>0&&(l=m[0]),m=l.split(":"),m&&m.length>0&&(l=m[0]),l}},{key:"os",get:function(){return d.os}},{key:"browser",get:function(){var i=d.browser;return i.name||(i.name=c()),i}}]),o}();E.default=u},function(H,E,A){function _(r,c){if(!(r instanceof c))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var k=function(){function r(c,d){for(var u=0;u<d.length;u++){var o=d[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}return function(c,d,u){return d&&r(c.prototype,d),u&&r(c,u),c}}(),R=function(){function r(){_(this,r)}return k(r,null,[{key:"get",value:function(c,d,u,o,i){var a;u=u||function(){},typeof XMLHttpRequest=="undefined"&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(h){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(h){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(h){}throw new Error("This browser does not support XMLHttpRequest.")}),a=new XMLHttpRequest,a.onreadystatechange=function(){a.readyState===4&&(a.status===200?d(a.responseText):u(a.responseText))};try{o===void 0&&(o=!0),a.open("GET",c,o),i&&(a.withCredentials=!0)}catch(h){return void u(h)}try{a.send()}catch(h){u(h)}}},{key:"post",value:function(c,d,u,o,i,a){var h;u=u||function(){},typeof XMLHttpRequest=="undefined"&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(l){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(l){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(l){}throw new Error("This browser does not support XMLHttpRequest.")}),h=new XMLHttpRequest,h.onreadystatechange=function(){h.readyState===4&&(h.status===200?d(h.responseText):u(h.responseText))};try{i===void 0&&(i=!0),h.open("POST",c,i),a&&(h.withCredentials=!0)}catch(l){return void u(l)}h.setRequestHeader("Content-type","application/x-www-form-urlencoded");try{h.send(o)}catch(l){u(l)}}}]),r}();E.default=R},function(H,E,A){function _(d,u){if(!(d instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var k=function(){function d(u,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(u,a.key,a)}}return function(u,o,i){return o&&d(u.prototype,o),i&&d(u,i),u}}(),R=A(27),r=A(31),c=(A(11),function(){function d(){_(this,d)}return k(d,null,[{key:"randomUUID",value:function(){for(var u=[],o="0123456789abcdef",i=0;i<36;i++)u[i]=o.substr(Math.floor(16*Math.random()),1);return u[14]="4",u[19]=o.substr(3&u[19]|8,1),u[8]=u[13]=u[18]=u[23]="-",u.join("")}},{key:"aliyunEncodeURI",value:function(u){var o=encodeURIComponent(u);return o=o.replace(/\+/g,"%20").replace(/\*/g,"%2A").replace(/%7E/g,"~").replace(/!/g,"%21").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}},{key:"makeUTF8sort",value:function(u,o,i){if(!u)throw new Error("PrismPlayer Error: vid should not be null!");var a=[];for(var h in u)a.push(h);for(var l=a.sort(),m="",p=l.length,h=0;h<p;h++){var w=d.aliyunEncodeURI(l[h]),B=d.aliyunEncodeURI(u[l[h]]);m==""?m=w+o+B:m+=i+w+o+B}return m}},{key:"makeChangeSiga",value:function(u,o){if(!u)throw new Error("PrismPlayer Error: vid should not be null!");return r.stringify(R("GET&"+d.aliyunEncodeURI("/")+"&"+d.aliyunEncodeURI(d.makeUTF8sort(u,"=","&")),o+"&"))}}]),d}());E.default=c},function(H,E,A){(function(_,k){H.exports=k(A(0))})(0,function(_){return _.enc.Utf8})},function(H,E,A){(function(_,k){H.exports=k(A(0))})(0,function(_){return _.enc.Hex})},function(H,E,A){H.exports=A(14)},function(H,E,A){var _,k,R=A(15),r=function(d){return d&&d.__esModule?d:{default:d}}(R),c={Vod:r.default};_=[],(k=function(){return c}.apply(E,_))!==void 0&&(H.exports=k),FileReader.prototype.readAsBinaryString||(FileReader.prototype.readAsBinaryString=function(d){var u="",o=this,i=new FileReader;i.onload=function(a){for(var h=new Uint8Array(i.result),l=h.byteLength,m=0;m<l;m++)u+=String.fromCharCode(h[m]);o.content=u,o.onload()},i.readAsArrayBuffer(d)}),window.AliyunUpload=c},function(H,E,A){function _(W){return W&&W.__esModule?W:{default:W}}function k(W,s){if(!(W instanceof s))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var R=function(){function W(s,g){for(var b=0;b<g.length;b++){var P=g[b];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(s,P.key,P)}}return function(s,g,b){return g&&W(s.prototype,g),b&&W(s,b),s}}(),r=A(16),c=A(3),d=A(17),u=_(d),o=A(19),i=_(o),a=A(24),h=_(a),l=A(5),m=_(l),p=A(1),w=_(p),B=A(6),I=_(B),y=A(26),S=_(y),M=A(32),L=_(M),z=A(33),V=_(z),q=(A(2),function(){function W(s){k(this,W),this.options=s,this.options.partSize=this.options.partSize||c.UPLOADDEFAULT.PARTSIZE,this.options.parallel=this.options.parallel||c.UPLOADDEFAULT.PARALLEL,this.options.region=this.options.region||"cn-shanghai",this.options.cname=this.options.cname||!1,this.options.localCheckpoint=this.options.localCheckpoint||!1,this.options.enableUploadProgress=this.options.enableUploadProgress||!0,this._ossCreditor=new Object,this._state=r.VODSTATE.INIT,this._uploadList=[],this._curIndex=-1,this._ossUpload=null,this._log=new m.default,this._retryCount=0,this._retryTotal=this.options.retryCount||3,this._retryDuration=this.options.retryDuration||2,this._state=r.VODSTATE.INIT,this._uploadWay="vod",this._onbeforeunload=!1,this._invalidUserId=!1,this._initEvent()}return R(W,[{key:"init",value:function(s,g,b,P){return this._retryCount=0,!(b&&!P||!b&&P)&&!(s&&!g||!s&&g)&&(this._ossCreditor.accessKeyId=s,this._ossCreditor.accessKeySecret=g,this._ossCreditor.securityToken=b,this._ossCreditor.expireTime=P,!0)}},{key:"addFile",value:function(s,g,b,P,x,F){if(!s)return!1;if(s.size==0)try{this.options.onUploadFailed({file:s},"EmptyFile","文件大小为0,不能上传")}catch(X){}for(var j=(this.options,0);j<this._uploadList.length;j++)if(this._uploadList[j].file==s)return!1;var N=new Object;if(N.file=s,N._endpoint=g,N._bucket=b,N._object=P,N.state=r.UPLOADSTATE.INIT,N.isImage=w.default.isImage(s.name),x&&(N.videoInfo=x?JSON.parse(x).Vod:{},N.userData=i.default.encode(x)),N.ri=I.default.create(),this._uploadList.push(N),!N.isImage&&this.options.enableUploadProgress){var K=this;V.default.getMd5(s,function(X,O){N.fileHash=X,N.fileMd5=O;var D=K._getCheckoutpoint(N);K.options.localCheckpoint||D?K.addFileCallback(N):K._getCheckoutpointFromCloud(N,function(U){if(U.UploadPoint){var C=JSON.parse(U.UploadPoint);C.loaded!=1&&(N.checkpoint=C.checkpoint,N.loaded=C.loaded,N.videoId=U.VideoId,K._saveCheckoutpoint(N,C.checkpoint))}K.addFileCallback(N)},function(U){try{if((U=JSON.parse(U))&&U.Code=="InvalidParameter"&&U.Message.indexOf("UserId")>0){K._invalidUserId=!0;var C=U.Message+",正确账号ID(userId)请参考:https://help.aliyun.com/knowledge_detail/37196.html"}}catch(ie){}})})}else this.addFileCallback(N)}},{key:"addFileCallback",value:function(s){this._reportLog("20001",s,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess(s)}catch(g){}return!0}},{key:"deleteFile",value:function(s){return!!this.cancelFile(s)&&(this._uploadList.splice(s,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(s){if(this.options,s<0||s>=this._uploadList.length)return!1;var g=this._uploadList[s];if(s==this._curIndex&&g.state==r.UPLOADSTATE.UPLOADING){g.state=r.UPLOADSTATE.CANCELED;var b=this._getCheckoutpoint(g);b&&b.checkpoint&&(b=b.checkpoint),b&&this._ossUpload.cancel(),this._removeCheckoutpoint(g),this.nextUpload()}else g.state!=r.UPLOADSTATE.SUCCESS&&(g.state=r.UPLOADSTATE.CANCELED);return this._reportLog("20008",g),!0}},{key:"resumeFile",value:function(s){if(this.options,s<0||s>=this._uploadList.length)return!1;var g=this._uploadList[s];return g.state==r.UPLOADSTATE.CANCELED&&(g.state=r.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(s){return this._getCheckoutpoint({file:s})}},{key:"startUpload",value:function(s){if(this._retryCount=0,this.options,!(this._state==r.VODSTATE.START||this._state==r.VODSTATE.EXPIRE)){if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=r.VODSTATE.END);var g=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(g),this._state=r.VODSTATE.START}}},{key:"nextUpload",value:function(){var s=this.options;if(this._state==r.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var g=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(g)}else{this._state=r.VODSTATE.END;try{s.onUploadEnd&&s.onUploadEnd(g)}catch(b){}}}},{key:"clear",value:function(s){for(var g=this.options,b=0,P=0;P<this._uploadList.length;P++)g.uploadList[P].state==r.UPLOADSTATE.SUCCESS&&b++,this._uploadList[P].state==s&&(g.uploadList.splice(P,1),P--);g.onClear&&g.onClear(g.uploadList.length,b)}},{key:"stopUpload",value:function(){if((this._state==r.VODSTATE.START||this._state==r.VODSTATE.FAILURE||this._curIndex==-1)&&this._curIndex!=-1){var s=this._uploadList[this._curIndex];this._state=r.VODSTATE.STOP,s.state=r.UPLOADSTATE.STOPED,this._changeState(s,r.UPLOADSTATE.STOPED),this._ossUpload.cancel()}}},{key:"resumeUploadWithAuth",value:function(s){var g=this;if(!s)return!1;var b=JSON.parse(i.default.decode(s));return!!(b.AccessKeyId&&b.AccessKeySecret&&b.SecurityToken&&b.Expiration)&&g.resumeUploadWithToken(b.AccessKeyId,b.AccessKeySecret,b.SecurityToken,b.Expiration)}},{key:"resumeUploadWithToken",value:function(s,g,b,P){if(this.options,!(s&&g&&b&&P)||this._state!=r.VODSTATE.EXPIRE||this._curIndex==-1)return!1;var x="";return this._uploadList.length>this._curIndex&&(x=this._uploadList[this._curIndex]),x&&(this.init(s,g,b,P),this._state=r.VODSTATE.START,this._ossUpload=null,this._uploadCore(x,x.retry),x.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(s,g,b){if(this._curIndex==-1||this._state!=r.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var P=this._uploadList[this._curIndex];P.object?this._refreshSTSTokenUpload(P,s,g,b):this.setSTSToken(P,s,g,b)}}},{key:"setSTSTokenDirectlyUpload",value:function(s,g,b,P,x){if(!(g&&b&&P&&x))return!1;this._ut="oss";var F=s;this.init(g,b,P,x),F.endpoint=F._endpoint,F.bucket=F._bucket,F.object=F._object,this._ossUpload=null,this._uploadCore(F,s.retry),s.retry=!1}},{key:"setSTSToken",value:function(s,g,b,P){if(!g||!b||!P)return!1;this._ut="vod",this._uploadWay="sts";var x=s.videoInfo,F={accessKeyId:g,securityToken:P,accessKeySecret:b,fileName:s.file.name,title:x.Title,requestId:s.ri,region:this.options.region};x.ImageType&&(F.imageType=x.ImageType),x.ImageExt&&(F.imageExt=x.ImageExt),x.FileSize&&(F.fileSize=x.FileSize),x.Description&&(F.description=x.Description),x.CateId&&(F.cateId=x.CateId),x.Tags&&(F.tags=x.Tags),x.TemplateGroupId&&(F.templateGroupId=x.TemplateGroupId),x.StorageLocation&&(F.storageLocation=x.StorageLocation),x.CoverURL&&(F.coverUrl=x.CoverURL),x.TransCodeMode&&(F.transCodeMode=x.TransCodeMode),x.UserData&&(F.userData=x.UserData),x.WorkflowId&&(F.WorkflowId=x.WorkflowId),x.AppId&&(F.AppId=x.AppId);var j=this,N="getUploadAuth";s.videoId?(F.videoId=s.videoId,N="refreshUploadAuth"):s.isImage&&(N="getImageUploadAuth"),S.default[N](F,function(K){s.videoId=K.VideoId?K.VideoId:s.videoId,j.setUploadAuthAndAddress(s,K.UploadAuth,K.UploadAddress),j._state=r.VODSTATE.START},function(K){j._error(s,{name:K.Code,code:K.Code,message:K.Message,requestId:K.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(s,g,b,P){if(!s||!g||!b)return!1;var x=JSON.parse(i.default.decode(g));if(!(x.AccessKeyId&&x.AccessKeySecret&&x.SecurityToken&&x.Expiration))return!1;var F={},j=s;if(b){if(F=JSON.parse(i.default.decode(b)),!F.Endpoint||!F.Bucket||!F.FileName)return!1}else F.Endpoint=j.endpoint,F.Bucket=j.bucket,F.FileName=j.object;this._ut="vod",this._uploadWay="vod",this.options.region=x.Region||this.options.region,this.init(x.AccessKeyId,x.AccessKeySecret,x.SecurityToken,x.Expiration),j.endpoint=j._endpoint?j._endpoint:F.Endpoint,j.bucket=j._bucket?j._bucket:F.Bucket,j.object=j._object?j._object:F.FileName,j.region=this.options.region,P&&(j.videoId=P),this._ossUpload=null,this._uploadCore(j,s.retry),s.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(s,g,b,P){if(!g||!b||!P)return!1;var x={accessKeyId:g,securityToken:P,accessKeySecret:b,videoId:s.object,requestId:s.ri,region:this.options.region},F=this,j="refreshUploadAuth";s.isImage&&(j="getImageUploadAuth"),S.default[j](x,function(N){F.setUploadAuthAndAddress(s,N.UploadAuth,UploadAddress),F._state=r.VODSTATE.START},function(N){F._error(s,{name:N.Code,code:N.Code,message:N.Message,requestId:N.RequestId})})}},{key:"_upload",value:function(s){var g=arguments.length>1&&arguments[1]!==void 0&&arguments[1],b=this.options;if(s.retry=g,b.onUploadstarted&&!g)try{var P=this._getCheckoutpoint(s);P&&P.state!=r.UPLOADSTATE.UPLOADING&&(s.checkpoint=P,s.videoId=P.videoId),b.onUploadstarted(s)}catch(x){}}},{key:"_uploadCore",value:function(s){if(!this._ossCreditor.accessKeyId||!this._ossCreditor.accessKeySecret||!this._ossCreditor.securityToken)throw new Error("AccessKeyId、AccessKeySecret、securityToken should not be null");if(s.state=r.UPLOADSTATE.UPLOADING,!this._ossUpload){s.endpoint=s.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var g=this;this._ossUpload=new u.default({bucket:s.bucket,endpoint:s.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(K,X){g._error.call(g,K,X)},oncomplete:function(K,X){g._complete.call(g,K,X)},onprogress:function(K,X,O){g._progress.call(g,K,X,O)}})}var b=w.default.getFileType(s.file.name),P=this._getCheckoutpoint(s),x="",F="";P&&P.checkpoint&&(F=P.state,x=P.videoId,P=P.checkpoint),P&&x==s.videoId&&F!=r.UPLOADSTATE.UPLOADING&&(P.file=s.file,s.checkpoint=P,P.uploadId);var j=this._adjustPartSize(s);this._reportLog("20002",s,{ft:b,fs:s.file.size,bu:s.bucket,ok:s.object,vid:s.videoId||"",fn:s.file.name,fw:null,fh:null,ps:j});var N={headers:{"x-oss-notification":s.userData?s.userData:"","x-oss-md5":s.fileMd5?s.fileMd5:""},partSize:j,parallel:this.options.parallel};this._ossUpload.upload(s,N)}},{key:"_findUploadIndex",value:function(){for(var s=-1,g=0;g<this._uploadList.length;g++)if(this._uploadList[g].state==r.UPLOADSTATE.INIT){s=g;break}return s}},{key:"_error",value:function(s,g){if(g.name=="cancel")try{this.options.onUploadCanceled(s,g)}catch(P){}else{if(g.message.indexOf("InvalidAccessKeyIdError")>0||g.name=="SignatureDoesNotMatchError"||g.code=="SecurityTokenExpired"||g.code=="InvalidSecurityToken.Expired"||g.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=r.VODSTATE.EXPIRE,s.state=r.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(s,g)}catch(P){}}return}if((g.name=="RequestTimeoutError"||g.name=="ConnectionTimeout"||g.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var b=this;return setTimeout(function(){b._uploadCore(s,!0)},1e3*b._retryDuration),void this._retryCount++}g.name=="NoSuchUploadError"?this._removeCheckoutpoint(s):g.name=="abort"&&(this._removeCheckoutpoint(s),this.options.onUploadFailed(s,"OSSAbort","由于 OSS Abort 上传中止")),this._handleError(s,g)}}},{key:"_handleError",value:function(s,g){var b=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],P=r.UPLOADSTATE.FAIlURE;if(s.state!=r.UPLOADSTATE.CANCELED&&(s.state=r.UPLOADSTATE.FAIlURE,this._state=r.VODSTATE.FAILURE,this.options.onUploadFailed&&g&&g.code&&g.message))try{this.options.onUploadFailed(s,g.code,g.message)}catch(F){}if(b&&this._changeState(s,P),this._reportLog("20006",s,{code:g.name,message:g.message,requestId:g.requestId,fs:s.file.size,bu:s.bucket,ok:s.object,fn:s.file.name}),this._reportLog("20004",s,{requestId:g.requestId,fs:s.file.size,bu:s.bucket,ok:s.object,fn:s.file.name}),s.ri=I.default.create(),this._findUploadIndex()!=-1){var x=this;this._state=r.VODSTATE.START,setTimeout(function(){x.nextUpload()},100)}}},{key:"_complete",value:function(s,g){if(s.state=r.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(s)}catch(x){}var b=0;g&&g.res&&g.res.headers&&(b=g.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(s);var P=this;setTimeout(function(){P.nextUpload()},100),this._retryCount=0,this._reportLog("20003",s,{requestId:b})}},{key:"_progress",value:function(s,g,b){if(this.options.onUploadProgress)try{s.loaded=g.loaded,this.options.onUploadProgress(s,g.total,g.loaded)}catch(X){}var P=g.checkpoint,x=0;P&&!this._onbeforeunload&&(s.checkpoint=P,this._saveCheckoutpoint(s,P,r.UPLOADSTATE.UPLOADING),x=P.uploadId),this._retryCount=0;var F=this._getPortNumber(P),j=0;if(b&&b.headers&&(j=b.headers["x-oss-request-id"]),g.loaded!=0&&this._reportLog("20007",s,{pn:F,requestId:j}),g.loaded!=1&&this._reportLog("20005",s,{UploadId:x,pn:F+1,pr:s.retry?1:0,fs:s.file.size,bu:s.bucket,ok:s.object,fn:s.file.name}),!this._invalidUserId&&!s.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var N={file:s.file,checkpoint:g,userId:this.options.userId,videoId:s.videoId,region:this.options.region,fileHash:s.fileHash};try{var K=this;L.default.upload(N,function(){},function(X){if((X=JSON.parse(X))&&X.Code=="InvalidParameter"&&X.Message.indexOf("UserId")>0){K._invalidUserId=!0;var O=X.Message+",正确账号ID(userId)请参考:https://help.aliyun.com/knowledge_detail/37196.html"}})}catch(X){}}}},{key:"_getPortNumber",value:function(s){if(s){var g=s.doneParts;if(g&&g.length>0)return g[g.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(s){var g=this._getCheckoutpointKey(s);h.default.remove(g)}},{key:"_getCheckoutpoint",value:function(s){var g=this._getCheckoutpointKey(s),b=h.default.get(g);if(b)try{return JSON.parse(b)}catch(P){}return""}},{key:"_saveCheckoutpoint",value:function(s,g,b){if(g){var P=this._getCheckoutpointKey(s),x=s.file,F={fileName:x.name,lastModified:x.lastModified,size:x.size,object:s.object,videoId:s.videoId,bucket:s.bucket,endpoint:s.endpoint,checkpoint:g,loaded:s.loaded,state:b};h.default.set(P,JSON.stringify(F))}}},{key:"_changeState",value:function(s,g){var b=this._getCheckoutpoint(s);b&&((this._onbeforeunload=!0)&&(g=r.UPLOADSTATE.STOPED),this._saveCheckoutpoint(s,b.checkpoint,g))}},{key:"_getCheckoutpointKey",value:function(s){return"upload_"+s.file.lastModified+"_"+s.file.name+"_"+s.file.size}},{key:"_getCheckoutpointFromCloud",value:function(s,g,b){var P={userId:this.options.userId,uploadInfoList:[{FileName:s.file.name,FileSize:s.file.size,FileCreateTime:s.file.lastModified,FileHash:s.fileHash}],region:this.options.region};L.default.get(P,function(x){g(x)},b)}},{key:"_reportLog",value:function(s,g,b){b||(b={}),b.ri=g.ri,this._ut&&(b.ut=this._ut),this._log.log(s,b)}},{key:"_initEvent",value:function(){var s=this;window&&(window.onbeforeunload=function(g){if(s._onbeforeunload=!0,s._curIndex!=-1&&s._uploadList.length>s._curIndex){var b=s._uploadList[s._curIndex];s._changeState(b,r.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var s=0;s<this._uploadList.length;s++){var g=this._uploadList[s];g.state!=r.UPLOADSTATE.FAIlURE&&g.state!=r.UPLOADSTATE.STOPED||(g.state=r.UPLOADSTATE.INIT)}this._state=r.VODSTATE.INIT}},{key:"_adjustPartSize",value:function(s){return s.file.size/this.options.partSize>1e4?s.file.size/9999:this.options.partSize}}]),W}());E.default=q},function(H,E,A){Object.defineProperty(E,"__esModule",{value:!0}),E.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},E.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(H,E,A){function _(o){return o&&o.__esModule?o:{default:o}}function k(o,i){if(!(o instanceof i))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var R=function(){function o(i,a){for(var h=0;h<a.length;h++){var l=a[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(i,l.key,l)}}return function(i,a,h){return a&&o(i.prototype,a),h&&o(i,h),i}}(),r=A(3),c=A(18),d=(_(c),A(1)),u=(_(d),function(){function o(i,a){if(k(this,o),i){this._config=i,this.create(this._config),this._uploadInfo=null,this._callback={};var h=function(){};this._callback.onerror=a.onerror||h,this._callback.oncomplete=a.oncomplete||h,this._callback.onprogress=a.onprogress||h}}return R(o,[{key:"create",value:function(i){if(i.endpoint=i.endpoint||this._config.endpoint,i.bucket=i.bucket||this._config.bucket,!(i.AccessKeyId&&i.AccessKeySecret&&i.endpoint&&i.SecurityToken))throw new Error("AccessKeyId、AccessKeySecret、endpoint should not be null");var a={accessKeyId:i.AccessKeyId,accessKeySecret:i.AccessKeySecret,stsToken:i.SecurityToken,endpoint:i.endpoint||this._config.endpoint,bucket:i.bucket||this._config.bucket,secure:!0,cname:i.cname};i.timeout&&(a.timeout=i.timeout),this.oss=new OSS(a)}},{key:"abort",value:function(i){if(i.checkpoint){var a=i.checkpoint.uploadId;this.oss.abortMultipartUpload(i.object,a)}}},{key:"getVersion",value:function(){}},{key:"cancel",value:function(){this.oss.cancel&&this.oss.cancel()}},{key:"upload",value:function(i,a){this._uploadInfo=i;var h=this,l=function(p,w,B){l=h._progress(p,w,B)},m={parallel:a.parallel||this._config.parallel||r.UPLOADDEFAULT.PARALLEL,partSize:Math.round(a.partSize||this._config.partSize||r.UPLOADDEFAULT.PARTSIZE),progress:l};a.headers&&(m.headers=a.headers),i.checkpoint&&(m.checkpoint=i.checkpoint),i.bucket||(this.oss.options.bucket=i.bucket),i.endpoint||(this.oss.options.endpoint=i.endpoint),this.oss.multipartUpload(i.object,i.file,m).then(function(p,w){h._complete(p)}).catch(function(p){h.oss.cancel&&(h.oss&&h.oss.isCancel()||h.oss.cancel()),h._error(p)})}},{key:"header",value:function(i,a,h){this.oss.get(i.object).then(function(l){a(l)}).catch(function(l){h(l)})}},{key:"_progress",value:function(i,a,h){this._callback.onprogress(this._uploadInfo,{loaded:i,total:this._uploadInfo.file.size,checkpoint:a},h)}},{key:"_error",value:function(i){this._callback.onerror(this._uploadInfo,i)}},{key:"_complete",value:function(i){this._callback.oncomplete(this._uploadInfo,i)}}]),o}());E.default=u},function(H,E,A){function _(r,c){if(!(r instanceof c))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var k=function(){function r(c,d){for(var u=0;u<d.length;u++){var o=d[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}return function(c,d,u){return d&&r(c.prototype,d),u&&r(c,u),c}}(),R=function(){function r(){_(this,r)}return k(r,null,[{key:"format",value:function(c){if(arguments.length<2)return null;for(var d=arguments[1],u=1;u<arguments.length;u++){var o=new RegExp("\\{"+(u-1)+"\\}","gm");d=d.replace(o,arguments[u+1])}return{code:c,message:d}}},{key:"CODE",get:function(){return{SUCCESS:"Successful",EmptyValue:"InvalidParameter.EmptyValue",STSInvalid:"InvalidParameter.TokenInvalid",ReadFileError:"ReadFileError",FILEDUPLICATION:"FileDuplication",UploadALEADRYSTARTED:"UploadAlearyStarted"}}},{key:"MESSAGE",get:function(){return{SUCCESS:"Successful",EmptyValue:"参数 {0} 不能为空。",STSInvalid:"STS参数非法, accessKeyId、accessKeySecret、secretToken、expireTime都不能为空。",ReadFileError:"读取文件{0}{1}失败.",FILEDUPLICATION:"文件重复添加 {0}",UploadALEADRYSTARTED:"重复开始."}}}]),r}();E.default=R},function(H,E,A){(function(_){function k(c,d){if(!(c instanceof d))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var R=function(){function c(d,u){for(var o=0;o<u.length;o++){var i=u[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(d,i.key,i)}}return function(d,u,o){return u&&c(d.prototype,u),o&&c(d,o),d}}(),r=function(){function c(){k(this,c)}return R(c,null,[{key:"encode",value:function(d){return new _(d).toString("base64")}},{key:"decode",value:function(d){return new _(d,"base64").toString()}}]),c}();E.default=r}).call(E,A(20).Buffer)},function(H,E,A){(function(_){function k(){return r.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(e,t){if(k()<t)throw new RangeError("Invalid typed array length");return r.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=r.prototype):(e===null&&(e=new r(t)),e.length=t),e}function r(e,t,n){if(!(r.TYPED_ARRAY_SUPPORT||this instanceof r))return new r(e,t,n);if(typeof e=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return o(this,e)}return c(this,e,t,n)}function c(e,t,n,f){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?h(e,t,n,f):typeof t=="string"?i(e,t,n):l(e,t)}function d(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,n,f){return d(t),t<=0?R(e,t):n!==void 0?typeof f=="string"?R(e,t).fill(n,f):R(e,t).fill(n):R(e,t)}function o(e,t){if(d(t),e=R(e,t<0?0:0|m(t)),!r.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function i(e,t,n){if(typeof n=="string"&&n!==""||(n="utf8"),!r.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var f=0|w(t,n);e=R(e,f);var v=e.write(t,n);return v!==f&&(e=e.slice(0,v)),e}function a(e,t){var n=t.length<0?0:0|m(t.length);e=R(e,n);for(var f=0;f<n;f+=1)e[f]=255&t[f];return e}function h(e,t,n,f){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(f||0))throw new RangeError("'length' is out of bounds");return t=n===void 0&&f===void 0?new Uint8Array(t):f===void 0?new Uint8Array(t,n):new Uint8Array(t,n,f),r.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=r.prototype):e=a(e,t),e}function l(e,t){if(r.isBuffer(t)){var n=0|m(t.length);return e=R(e,n),e.length===0||t.copy(e,0,0,n),e}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||ge(t.length)?R(e,0):a(e,t);if(t.type==="Buffer"&&se(t.data))return a(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return 0|e}function p(e){return+e!=e&&(e=0),r.alloc(+e)}function w(e,t){if(r.isBuffer(e))return e.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;for(var f=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return te(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return ae(e).length;default:if(f)return te(e).length;t=(""+t).toLowerCase(),f=!0}}function B(e,t,n){var f=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,n);case"utf8":case"utf-8":return g(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return x(this,t,n);case"base64":return s(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(f)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),f=!0}}function I(e,t,n){var f=e[t];e[t]=e[n],e[n]=f}function y(e,t,n,f,v){if(e.length===0)return-1;if(typeof n=="string"?(f=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=v?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(v)return-1;n=e.length-1}else if(n<0){if(!v)return-1;n=0}if(typeof t=="string"&&(t=r.from(t,f)),r.isBuffer(t))return t.length===0?-1:S(e,t,n,f,v);if(typeof t=="number")return t&=255,r.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?v?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):S(e,[t],n,f,v);throw new TypeError("val must be string, number or Buffer")}function S(e,t,n,f,v){function T(ce,le){return Y===1?ce[le]:ce.readUInt16BE(le*Y)}var Y=1,J=e.length,Q=t.length;if(f!==void 0&&((f=String(f).toLowerCase())==="ucs2"||f==="ucs-2"||f==="utf16le"||f==="utf-16le")){if(e.length<2||t.length<2)return-1;Y=2,J/=2,Q/=2,n/=2}var G;if(v){var Z=-1;for(G=n;G<J;G++)if(T(e,G)===T(t,Z===-1?0:G-Z)){if(Z===-1&&(Z=G),G-Z+1===Q)return Z*Y}else Z!==-1&&(G-=G-Z),Z=-1}else for(n+Q>J&&(n=J-Q),G=n;G>=0;G--){for(var $=!0,re=0;re<Q;re++)if(T(e,G+re)!==T(t,re)){$=!1;break}if($)return G}return-1}function M(e,t,n,f){n=Number(n)||0;var v=e.length-n;f?(f=Number(f))>v&&(f=v):f=v;var T=t.length;if(T%2!=0)throw new TypeError("Invalid hex string");f>T/2&&(f=T/2);for(var Y=0;Y<f;++Y){var J=parseInt(t.substr(2*Y,2),16);if(isNaN(J))return Y;e[n+Y]=J}return Y}function L(e,t,n,f){return ne(te(t,e.length-n),e,n,f)}function z(e,t,n,f){return ne(he(t),e,n,f)}function V(e,t,n,f){return z(e,t,n,f)}function q(e,t,n,f){return ne(ae(t),e,n,f)}function W(e,t,n,f){return ne(pe(t,e.length-n),e,n,f)}function s(e,t,n){return t===0&&n===e.length?oe.fromByteArray(e):oe.fromByteArray(e.slice(t,n))}function g(e,t,n){n=Math.min(e.length,n);for(var f=[],v=t;v<n;){var T=e[v],Y=null,J=T>239?4:T>223?3:T>191?2:1;if(v+J<=n){var Q,G,Z,$;switch(J){case 1:T<128&&(Y=T);break;case 2:Q=e[v+1],(192&Q)==128&&($=(31&T)<<6|63&Q)>127&&(Y=$);break;case 3:Q=e[v+1],G=e[v+2],(192&Q)==128&&(192&G)==128&&($=(15&T)<<12|(63&Q)<<6|63&G)>2047&&($<55296||$>57343)&&(Y=$);break;case 4:Q=e[v+1],G=e[v+2],Z=e[v+3],(192&Q)==128&&(192&G)==128&&(192&Z)==128&&($=(15&T)<<18|(63&Q)<<12|(63&G)<<6|63&Z)>65535&&$<1114112&&(Y=$)}}Y===null?(Y=65533,J=1):Y>65535&&(Y-=65536,f.push(Y>>>10&1023|55296),Y=56320|1023&Y),f.push(Y),v+=J}return b(f)}function b(e){var t=e.length;if(t<=ue)return String.fromCharCode.apply(String,e);for(var n="",f=0;f<t;)n+=String.fromCharCode.apply(String,e.slice(f,f+=ue));return n}function P(e,t,n){var f="";n=Math.min(e.length,n);for(var v=t;v<n;++v)f+=String.fromCharCode(127&e[v]);return f}function x(e,t,n){var f="";n=Math.min(e.length,n);for(var v=t;v<n;++v)f+=String.fromCharCode(e[v]);return f}function F(e,t,n){var f=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>f)&&(n=f);for(var v="",T=t;T<n;++T)v+=de(e[T]);return v}function j(e,t,n){for(var f=e.slice(t,n),v="",T=0;T<f.length;T+=2)v+=String.fromCharCode(f[T]+256*f[T+1]);return v}function N(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function K(e,t,n,f,v,T){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>v||t<T)throw new RangeError('"value" argument is out of bounds');if(n+f>e.length)throw new RangeError("Index out of range")}function X(e,t,n,f){t<0&&(t=65535+t+1);for(var v=0,T=Math.min(e.length-n,2);v<T;++v)e[n+v]=(t&255<<8*(f?v:1-v))>>>8*(f?v:1-v)}function O(e,t,n,f){t<0&&(t=4294967295+t+1);for(var v=0,T=Math.min(e.length-n,4);v<T;++v)e[n+v]=t>>>8*(f?v:3-v)&255}function D(e,t,n,f,v,T){if(n+f>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,f,v){return v||D(e,t,n,4),ee.write(e,t,n,f,23,4),n+4}function C(e,t,n,f,v){return v||D(e,t,n,8),ee.write(e,t,n,f,52,8),n+8}function ie(e){if(e=fe(e).replace(ye,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function fe(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function de(e){return e<16?"0"+e.toString(16):e.toString(16)}function te(e,t){t=t||1/0;for(var n,f=e.length,v=null,T=[],Y=0;Y<f;++Y){if((n=e.charCodeAt(Y))>55295&&n<57344){if(!v){if(n>56319){(t-=3)>-1&&T.push(239,191,189);continue}if(Y+1===f){(t-=3)>-1&&T.push(239,191,189);continue}v=n;continue}if(n<56320){(t-=3)>-1&&T.push(239,191,189),v=n;continue}n=65536+(v-55296<<10|n-56320)}else v&&(t-=3)>-1&&T.push(239,191,189);if(v=null,n<128){if((t-=1)<0)break;T.push(n)}else if(n<2048){if((t-=2)<0)break;T.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;T.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;T.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return T}function he(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function pe(e,t){for(var n,f,v,T=[],Y=0;Y<e.length&&!((t-=2)<0);++Y)n=e.charCodeAt(Y),f=n>>8,v=n%256,T.push(v),T.push(f);return T}function ae(e){return oe.toByteArray(ie(e))}function ne(e,t,n,f){for(var v=0;v<f&&!(v+n>=t.length||v>=e.length);++v)t[v+n]=e[v];return v}function ge(e){return e!==e}/*!
|
|
2
|
-
* The buffer module from node.js, for the browser.
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/var oe=A(21),ee=A(22),se=A(23);E.Buffer=r,E.SlowBuffer=p,E.INSPECT_MAX_BYTES=50,r.TYPED_ARRAY_SUPPORT=_.TYPED_ARRAY_SUPPORT!==void 0?_.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},e.foo()===42&&typeof e.subarray=="function"&&e.subarray(1,1).byteLength===0}catch(t){return!1}}(),E.kMaxLength=k(),r.poolSize=8192,r._augment=function(e){return e.__proto__=r.prototype,e},r.from=function(e,t,n){return c(null,e,t,n)},r.TYPED_ARRAY_SUPPORT&&(r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0})),r.alloc=function(e,t,n){return u(null,e,t,n)},r.allocUnsafe=function(e){return o(null,e)},r.allocUnsafeSlow=function(e){return o(null,e)},r.isBuffer=function(e){return!(e==null||!e._isBuffer)},r.compare=function(e,t){if(!r.isBuffer(e)||!r.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,f=t.length,v=0,T=Math.min(n,f);v<T;++v)if(e[v]!==t[v]){n=e[v],f=t[v];break}return n<f?-1:f<n?1:0},r.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.concat=function(e,t){if(!se(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return r.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var f=r.allocUnsafe(t),v=0;for(n=0;n<e.length;++n){var T=e[n];if(!r.isBuffer(T))throw new TypeError('"list" argument must be an Array of Buffers');T.copy(f,v),v+=T.length}return f},r.byteLength=w,r.prototype._isBuffer=!0,r.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)I(this,t,t+1);return this},r.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)I(this,t,t+3),I(this,t+1,t+2);return this},r.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)I(this,t,t+7),I(this,t+1,t+6),I(this,t+2,t+5),I(this,t+3,t+4);return this},r.prototype.toString=function(){var e=0|this.length;return e===0?"":arguments.length===0?g(this,0,e):B.apply(this,arguments)},r.prototype.equals=function(e){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||r.compare(this,e)===0},r.prototype.inspect=function(){var e="",t=E.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},r.prototype.compare=function(e,t,n,f,v){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),f===void 0&&(f=0),v===void 0&&(v=this.length),t<0||n>e.length||f<0||v>this.length)throw new RangeError("out of range index");if(f>=v&&t>=n)return 0;if(f>=v)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,f>>>=0,v>>>=0,this===e)return 0;for(var T=v-f,Y=n-t,J=Math.min(T,Y),Q=this.slice(f,v),G=e.slice(t,n),Z=0;Z<J;++Z)if(Q[Z]!==G[Z]){T=Q[Z],Y=G[Z];break}return T<Y?-1:Y<T?1:0},r.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},r.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},r.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},r.prototype.write=function(e,t,n,f){if(t===void 0)f="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")f=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,f===void 0&&(f="utf8")):(f=n,n=void 0)}var v=this.length-t;if((n===void 0||n>v)&&(n=v),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");f||(f="utf8");for(var T=!1;;)switch(f){case"hex":return M(this,e,t,n);case"utf8":case"utf-8":return L(this,e,t,n);case"ascii":return z(this,e,t,n);case"latin1":case"binary":return V(this,e,t,n);case"base64":return q(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,e,t,n);default:if(T)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase(),T=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ue=4096;r.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var f;if(r.TYPED_ARRAY_SUPPORT)f=this.subarray(e,t),f.__proto__=r.prototype;else{var v=t-e;f=new r(v,void 0);for(var T=0;T<v;++T)f[T]=this[T+e]}return f},r.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var f=this[e],v=1,T=0;++T<t&&(v*=256);)f+=this[e+T]*v;return f},r.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var f=this[e+--t],v=1;t>0&&(v*=256);)f+=this[e+--t]*v;return f},r.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var f=this[e],v=1,T=0;++T<t&&(v*=256);)f+=this[e+T]*v;return v*=128,f>=v&&(f-=Math.pow(2,8*t)),f},r.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var f=t,v=1,T=this[e+--f];f>0&&(v*=256);)T+=this[e+--f]*v;return v*=128,T>=v&&(T-=Math.pow(2,8*t)),T},r.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),ee.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),ee.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),ee.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),ee.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,n,f){e=+e,t|=0,n|=0,!f&&K(this,e,t,n,Math.pow(2,8*n)-1,0);var v=1,T=0;for(this[t]=255&e;++T<n&&(v*=256);)this[t+T]=e/v&255;return t+n},r.prototype.writeUIntBE=function(e,t,n,f){e=+e,t|=0,n|=0,!f&&K(this,e,t,n,Math.pow(2,8*n)-1,0);var v=n-1,T=1;for(this[t+v]=255&e;--v>=0&&(T*=256);)this[t+v]=e/T&255;return t+n},r.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||K(this,e,t,1,255,0),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},r.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||K(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):X(this,e,t,!0),t+2},r.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||K(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):X(this,e,t,!1),t+2},r.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||K(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):O(this,e,t,!0),t+4},r.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||K(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},r.prototype.writeIntLE=function(e,t,n,f){if(e=+e,t|=0,!f){var v=Math.pow(2,8*n-1);K(this,e,t,n,v-1,-v)}var T=0,Y=1,J=0;for(this[t]=255&e;++T<n&&(Y*=256);)e<0&&J===0&&this[t+T-1]!==0&&(J=1),this[t+T]=(e/Y>>0)-J&255;return t+n},r.prototype.writeIntBE=function(e,t,n,f){if(e=+e,t|=0,!f){var v=Math.pow(2,8*n-1);K(this,e,t,n,v-1,-v)}var T=n-1,Y=1,J=0;for(this[t+T]=255&e;--T>=0&&(Y*=256);)e<0&&J===0&&this[t+T+1]!==0&&(J=1),this[t+T]=(e/Y>>0)-J&255;return t+n},r.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||K(this,e,t,1,127,-128),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},r.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||K(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):X(this,e,t,!0),t+2},r.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||K(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):X(this,e,t,!1),t+2},r.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||K(this,e,t,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):O(this,e,t,!0),t+4},r.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||K(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},r.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){return C(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){return C(this,e,t,!1,n)},r.prototype.copy=function(e,t,n,f){if(n||(n=0),f||f===0||(f=this.length),t>=e.length&&(t=e.length),t||(t=0),f>0&&f<n&&(f=n),f===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(f<0)throw new RangeError("sourceEnd out of bounds");f>this.length&&(f=this.length),e.length-t<f-n&&(f=e.length-t+n);var v,T=f-n;if(this===e&&n<t&&t<f)for(v=T-1;v>=0;--v)e[v+t]=this[v+n];else if(T<1e3||!r.TYPED_ARRAY_SUPPORT)for(v=0;v<T;++v)e[v+t]=this[v+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+T),t);return T},r.prototype.fill=function(e,t,n,f){if(typeof e=="string"){if(typeof t=="string"?(f=t,t=0,n=this.length):typeof n=="string"&&(f=n,n=this.length),e.length===1){var v=e.charCodeAt(0);v<256&&(e=v)}if(f!==void 0&&typeof f!="string")throw new TypeError("encoding must be a string");if(typeof f=="string"&&!r.isEncoding(f))throw new TypeError("Unknown encoding: "+f)}else typeof e=="number"&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||(e=0);var T;if(typeof e=="number")for(T=t;T<n;++T)this[T]=e;else{var Y=r.isBuffer(e)?e:te(new r(e,f).toString()),J=Y.length;for(T=0;T<n-t;++T)this[T+t]=Y[T%J]}return this};var ye=/[^+\/0-9A-Za-z-_]/g}).call(E,A(4))},function(H,E,A){function _(m){var p=m.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return m[p-2]==="="?2:m[p-1]==="="?1:0}function k(m){return 3*m.length/4-_(m)}function R(m){var p,w,B,I,y,S=m.length;I=_(m),y=new i(3*S/4-I),w=I>0?S-4:S;var M=0;for(p=0;p<w;p+=4)B=o[m.charCodeAt(p)]<<18|o[m.charCodeAt(p+1)]<<12|o[m.charCodeAt(p+2)]<<6|o[m.charCodeAt(p+3)],y[M++]=B>>16&255,y[M++]=B>>8&255,y[M++]=255&B;return I===2?(B=o[m.charCodeAt(p)]<<2|o[m.charCodeAt(p+1)]>>4,y[M++]=255&B):I===1&&(B=o[m.charCodeAt(p)]<<10|o[m.charCodeAt(p+1)]<<4|o[m.charCodeAt(p+2)]>>2,y[M++]=B>>8&255,y[M++]=255&B),y}function r(m){return u[m>>18&63]+u[m>>12&63]+u[m>>6&63]+u[63&m]}function c(m,p,w){for(var B,I=[],y=p;y<w;y+=3)B=(m[y]<<16)+(m[y+1]<<8)+m[y+2],I.push(r(B));return I.join("")}function d(m){for(var p,w=m.length,B=w%3,I="",y=[],S=0,M=w-B;S<M;S+=16383)y.push(c(m,S,S+16383>M?M:S+16383));return B===1?(p=m[w-1],I+=u[p>>2],I+=u[p<<4&63],I+="=="):B===2&&(p=(m[w-2]<<8)+m[w-1],I+=u[p>>10],I+=u[p>>4&63],I+=u[p<<2&63],I+="="),y.push(I),y.join("")}E.byteLength=k,E.toByteArray=R,E.fromByteArray=d;for(var u=[],o=[],i=typeof Uint8Array!="undefined"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,l=a.length;h<l;++h)u[h]=a[h],o[a.charCodeAt(h)]=h;o[45]=62,o[95]=63},function(H,E){E.read=function(A,_,k,R,r){var c,d,u=8*r-R-1,o=(1<<u)-1,i=o>>1,a=-7,h=k?r-1:0,l=k?-1:1,m=A[_+h];for(h+=l,c=m&(1<<-a)-1,m>>=-a,a+=u;a>0;c=256*c+A[_+h],h+=l,a-=8);for(d=c&(1<<-a)-1,c>>=-a,a+=R;a>0;d=256*d+A[_+h],h+=l,a-=8);if(c===0)c=1-i;else{if(c===o)return d?NaN:1/0*(m?-1:1);d+=Math.pow(2,R),c-=i}return(m?-1:1)*d*Math.pow(2,c-R)},E.write=function(A,_,k,R,r,c){var d,u,o,i=8*c-r-1,a=(1<<i)-1,h=a>>1,l=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=R?0:c-1,p=R?1:-1,w=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(u=isNaN(_)?1:0,d=a):(d=Math.floor(Math.log(_)/Math.LN2),_*(o=Math.pow(2,-d))<1&&(d--,o*=2),_+=d+h>=1?l/o:l*Math.pow(2,1-h),_*o>=2&&(d++,o/=2),d+h>=a?(u=0,d=a):d+h>=1?(u=(_*o-1)*Math.pow(2,r),d+=h):(u=_*Math.pow(2,h-1)*Math.pow(2,r),d=0));r>=8;A[k+m]=255&u,m+=p,u/=256,r-=8);for(d=d<<r|u,i+=r;i>0;A[k+m]=255&d,m+=p,d/=256,i-=8);A[k+m-p]|=128*w}},function(H,E){var A={}.toString;H.exports=Array.isArray||function(_){return A.call(_)=="[object Array]"}},function(H,E,A){function _(r,c){if(!(r instanceof c))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var k=function(){function r(c,d){for(var u=0;u<d.length;u++){var o=d[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}return function(c,d,u){return d&&r(c.prototype,d),u&&r(c,u),c}}(),R=function(){function r(){_(this,r)}return k(r,null,[{key:"set",value:function(c,d){try{window.localStorage&&localStorage.setItem(c,d)}catch(u){window[c+"_localStorage"]=d}}},{key:"get",value:function(c){try{if(window.localStorage)return localStorage.getItem(c)}catch(d){return window[c+"_localStorage"]}return""}},{key:"remove",value:function(c){try{window.localStorage&&localStorage.removeItem(c)}catch(d){delete window[c+"_localStorage"]}}}]),r}();E.default=R},function(H,E,A){function _(r,c){if(!(r instanceof c))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var k=function(){function r(c,d){for(var u=0;u<d.length;u++){var o=d[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}return function(c,d,u){return d&&r(c.prototype,d),u&&r(c,u),c}}(),R=function(){function r(){_(this,r)}return k(r,null,[{key:"get",value:function(c){for(var d=c+"",u=document.cookie.split(";"),o=0;o<u.length;o++){var i=u[o].trim();if(i.indexOf(d)==0)return unescape(i.substring(d.length+1,i.length))}return""}},{key:"set",value:function(c,d,u){var o=new Date;o.setTime(o.getTime()+24*u*60*60*1e3);var i="expires="+o.toGMTString();document.cookie=c+"="+escape(d)+"; "+i}}]),r}();E.default=R},function(H,E,A){function _(i){return i&&i.__esModule?i:{default:i}}function k(i,a){if(!(i instanceof a))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var R=function(){function i(a,h){for(var l=0;l<h.length;l++){var m=h[l];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(a,m.key,m)}}return function(a,h,l){return h&&i(a.prototype,h),l&&i(a,l),a}}(),r=A(9),c=_(r),d=A(10),u=_(d),o=function(){function i(){k(this,i)}return R(i,null,[{key:"refreshUploadAuth",value:function(a,h,l){var m=(u.default.randomUUID(),u.default.randomUUID()),p={AccessKeyId:a.accessKeyId,SecurityToken:a.securityToken,Action:"RefreshUploadVideo",VideoId:a.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:m,RequestId:a.requestId},w=u.default.makeUTF8sort(p,"=","&")+"&Signature="+u.default.aliyunEncodeURI(u.default.makeChangeSiga(p,a.accessKeySecret)),B="https://vod."+a.region+".aliyuncs.com/?"+w;c.default.get(B,function(y){var y=JSON.parse(y);h&&h(y)},function(I){if(l){var y=JSON.parse(I);l(y)}})}},{key:"getUploadAuth",value:function(a,h,l){var m=(u.default.randomUUID(),u.default.randomUUID()),p={AccessKeyId:a.accessKeyId,SecurityToken:a.securityToken,Action:"CreateUploadVideo",Title:a.title,FileName:a.fileName,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:m,RequestId:a.requestId};a.fileSize&&(p.FileSize=a.fileSize),a.description&&(p.Description=a.description),a.cateId&&(p.CateId=a.cateId),a.tags&&(p.Tags=a.tags),a.templateGroupId&&(p.TemplateGroupId=a.templateGroupId),a.storageLocation&&(p.StorageLocation=a.storageLocation),a.coverUrl&&(p.CoverURL=a.coverUrl),a.transCodeMode&&(p.TransCodeMode=a.transCodeMode),a.userData&&(p.UserData=JSON.stringify(a.userData)),a.WorkflowId&&(p.WorkflowId=a.WorkflowId),a.AppId&&(p.AppId=a.AppId);var w=u.default.makeUTF8sort(p,"=","&")+"&Signature="+u.default.aliyunEncodeURI(u.default.makeChangeSiga(p,a.accessKeySecret)),B="https://vod."+a.region+".aliyuncs.com/?"+w;c.default.get(B,function(I){try{I=JSON.parse(I)}catch(y){if(l)return void l({Code:"GetUploadAuthFailed",Message:"获取uploadauth失败"})}h&&h(I)},function(I){if(l){var y={Code:"GetUploadAuthFailed",Message:"获取uploadauth失败"};try{y=JSON.parse(I)}catch(S){}l(y)}})}},{key:"getImageUploadAuth",value:function(a,h,l){var m=(u.default.randomUUID(),u.default.randomUUID()),p={AccessKeyId:a.accessKeyId,SecurityToken:a.securityToken,Action:"CreateUploadImage",ImageType:a.imageType?a.imageType:"default",Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:m,RequestId:a.requestId};a.title&&(p.Title=a.title),a.imageExt&&(p.ImageExt=a.imageExt),a.tags&&(p.Tags=a.tags),a.storageLocation&&(p.StorageLocation=a.storageLocation);var w=u.default.makeUTF8sort(p,"=","&")+"&Signature="+u.default.aliyunEncodeURI(u.default.makeChangeSiga(p,a.accessKeySecret)),B="https://vod."+a.region+".aliyuncs.com/?"+w;c.default.get(B,function(I){I=JSON.parse(I),h&&h(I)},function(I){if(l){var y=JSON.parse(I);l(y)}})}}]),i}();E.default=o},function(H,E,A){(function(_,k,R){H.exports=k(A(0),A(29),A(30))})(0,function(_){return _.HmacSHA1})},function(H,E){},function(H,E,A){(function(_,k){H.exports=k(A(0))})(0,function(_){return function(){var k=_,R=k.lib,r=R.WordArray,c=R.Hasher,d=k.algo,u=[],o=d.SHA1=c.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(i,a){for(var h=this._hash.words,l=h[0],m=h[1],p=h[2],w=h[3],B=h[4],I=0;I<80;I++){if(I<16)u[I]=0|i[a+I];else{var y=u[I-3]^u[I-8]^u[I-14]^u[I-16];u[I]=y<<1|y>>>31}var S=(l<<5|l>>>27)+B+u[I];S+=I<20?1518500249+(m&p|~m&w):I<40?1859775393+(m^p^w):I<60?(m&p|m&w|p&w)-1894007588:(m^p^w)-899497514,B=w,w=p,p=m<<30|m>>>2,m=l,l=S}h[0]=h[0]+l|0,h[1]=h[1]+m|0,h[2]=h[2]+p|0,h[3]=h[3]+w|0,h[4]=h[4]+B|0},_doFinalize:function(){var i=this._data,a=i.words,h=8*this._nDataBytes,l=8*i.sigBytes;return a[l>>>5]|=128<<24-l%32,a[14+(l+64>>>9<<4)]=Math.floor(h/4294967296),a[15+(l+64>>>9<<4)]=h,i.sigBytes=4*a.length,this._process(),this._hash},clone:function(){var i=c.clone.call(this);return i._hash=this._hash.clone(),i}});k.SHA1=c._createHelper(o),k.HmacSHA1=c._createHmacHelper(o)}(),_.SHA1})},function(H,E,A){(function(_,k){H.exports=k(A(0))})(0,function(_){(function(){var k=_,R=k.lib,r=R.Base,c=k.enc,d=c.Utf8,u=k.algo;u.HMAC=r.extend({init:function(o,i){o=this._hasher=new o.init,typeof i=="string"&&(i=d.parse(i));var a=o.blockSize,h=4*a;i.sigBytes>h&&(i=o.finalize(i)),i.clamp();for(var l=this._oKey=i.clone(),m=this._iKey=i.clone(),p=l.words,w=m.words,B=0;B<a;B++)p[B]^=1549556828,w[B]^=909522486;l.sigBytes=m.sigBytes=h,this.reset()},reset:function(){var o=this._hasher;o.reset(),o.update(this._iKey)},update:function(o){return this._hasher.update(o),this},finalize:function(o){var i=this._hasher,a=i.finalize(o);return i.reset(),i.finalize(this._oKey.clone().concat(a))}})})()})},function(H,E,A){(function(_,k){H.exports=k(A(0))})(0,function(_){return function(){function k(u,o,i){for(var a=[],h=0,l=0;l<o;l++)if(l%4){var m=i[u.charCodeAt(l-1)]<<l%4*2,p=i[u.charCodeAt(l)]>>>6-l%4*2,w=m|p;a[h>>>2]|=w<<24-h%4*8,h++}return c.create(a,h)}var R=_,r=R.lib,c=r.WordArray,d=R.enc;d.Base64={stringify:function(u){var o=u.words,i=u.sigBytes,a=this._map;u.clamp();for(var h=[],l=0;l<i;l+=3)for(var m=o[l>>>2]>>>24-l%4*8&255,p=o[l+1>>>2]>>>24-(l+1)%4*8&255,w=o[l+2>>>2]>>>24-(l+2)%4*8&255,B=m<<16|p<<8|w,I=0;I<4&&l+.75*I<i;I++)h.push(a.charAt(B>>>6*(3-I)&63));var y=a.charAt(64);if(y)for(;h.length%4;)h.push(y);return h.join("")},parse:function(u){var o=u.length,i=this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var h=0;h<i.length;h++)a[i.charCodeAt(h)]=h}var l=i.charAt(64);if(l){var m=u.indexOf(l);m!==-1&&(o=m)}return k(u,o,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),_.enc.Base64})},function(H,E,A){function _(M){return M&&M.__esModule?M:{default:M}}function k(M,L){if(!(M instanceof L))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var R=function(){function M(L,z){for(var V=0;V<z.length;V++){var q=z[V];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(L,q.key,q)}}return function(L,z,V){return z&&M(L.prototype,z),V&&M(L,V),L}}(),r=A(9),c=_(r),d=A(8),u=_(d),o=A(5),i=_(o),a=A(7),h=_(a),l=A(1),m=_(l),p=A(10),w=_(p),B=A(2),I=A(12),y=A(11),S=function(){function M(){k(this,M)}return R(M,null,[{key:"getAuthInfo",value:function(L,z,V){var q=L+"|f#Ylm&^1TppeRhLg|"+V;return z&&(q=L+"|"+z+"|f#Ylm&^1TppeRhLg|"+V),B(y.parse(q)).toString(I)}},{key:"upload",value:function(L,z,V){var q=m.default.ISODateString(new Date),W=Math.floor(new Date().valueOf()/1e3),s=i.default.getClientId();s=i.default.setClientId(s);var g=M.getAuthInfo(L.userId,s,W),b=w.default.randomUUID(),P={Source:"WebSDK",BusinessType:"UploadVideo",Action:"ReportUploadProgress",TerminalType:"H5",DeviceModel:u.default.browser.name+(u.default.browser.version||""),AppVersion:h.default.version,AuthTimestamp:W,Timestamp:q,AuthInfo:g,FileName:L.file.name,FileSize:L.file.size,FileCreateTime:L.file.lastModified,FileHash:L.fileHash,UploadId:L.checkpoint.checkpoint.uploadId,PartSize:L.checkpoint.checkpoint.partSize,DonePartsCount:L.checkpoint.checkpoint.doneParts.length,UploadPoint:JSON.stringify(L.checkpoint),UploadRatio:L.checkpoint.loaded,UserId:L.userId,VideoId:L.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:b};s&&(P.ClientId=s);var x=w.default.makeUTF8sort(P,"=","&")+"&Signature="+w.default.aliyunEncodeURI(w.default.makeChangeSiga(P,L.accessKeySecret)),F="https://vod."+L.region+".aliyuncs.com/?";c.default.post(F,function(j){z&&z()},function(j){j&&V(j)},x)}},{key:"get",value:function(L,z,V){var q=m.default.ISODateString(new Date),W=Math.floor(new Date().valueOf()/1e3),s=i.default.getClientId(),g=M.getAuthInfo(L.userId,s,W),b=w.default.randomUUID(),P={Source:"WebSDK",BusinessType:"UploadVideo",Action:"GetUploadProgress",TerminalType:"H5",DeviceModel:u.default.browser.name+(u.default.browser.version||""),AppVersion:h.default.version,AuthTimestamp:W,Timestamp:q,AuthInfo:g,UserId:L.userId,UploadInfoList:JSON.stringify(L.uploadInfoList),Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:b};s&&(P.ClientId=s);var x=w.default.makeUTF8sort(P,"=","&")+"&Signature="+w.default.aliyunEncodeURI(w.default.makeChangeSiga(P,L.accessKeySecret)),F="https://vod."+L.region+".aliyuncs.com/?"+x;c.default.get(F,function(j){var N={},K=s;j=j?JSON.parse(j):{},j.UploadProgress&&j.UploadProgress.UploadProgressList&&j.UploadProgress.UploadProgressList.length>0&&(N=j.UploadProgress.UploadProgressList[0],K=N.ClientId),i.default.setClientId(K),z&&z(N)},function(j){j&&V(j)})}}]),M}();E.default=S},function(H,E,A){function _(d,u){if(!(d instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(E,"__esModule",{value:!0});var k=function(){function d(u,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(u,a.key,a)}}return function(u,o,i){return o&&d(u.prototype,o),i&&d(u,i),u}}(),R=A(2),r=A(34),c=(A(12),function(){function d(){_(this,d)}return k(d,null,[{key:"getMd5",value:function(u,o,i){var a=new FileReader;a.onload=function(m){try{var p=m&&m.target.result||a.content,w=R(r.parse(p)),B=w.toString(),I=window.btoa(w.toString(r));o(B,I)}catch(y){}},a.onerror=function(m){errorCallback(m)};var h=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,l=h.call(u,0,1024);a.readAsBinaryString(l)}}]),d}());E.default=c},function(H,E,A){(function(_,k){H.exports=k(A(0))})(0,function(_){return _.enc.Latin1})}]);
|