chunk-653dfb0c.74012596.js 12 KB

123456
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-653dfb0c","chunk-0985238c","chunk-17c7e2d1","chunk-2d0e2c67","chunk-2d21b316"],{"0e19":function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return c}));var n=r("320c"),o=r.n(n),i=r("7fac"),s=r("fbb8");class c{constructor(t={}){Object(s["assertOptions"])(t),this.opts=o()({region:"oss-cn-hangzhou",internal:!1,cname:!1,secure:!1,timeout:6e4},t);const{bucket:e,region:r,endpoint:n,internal:i}=this.opts;if(this.host="",n)this.host=n;else{let t=e;i&&(t+="-internal"),t+=`.${r}.aliyuncs.com`,this.host=t}}put(t,e){return new Promise((r,n)=>{const{accessKeyId:o,accessKeySecret:c,stsToken:u,bucket:a}=this.opts,f="PUT",h=e.type,d={"Content-Type":h,"x-oss-date":(new Date).toGMTString()};u&&(d["x-oss-security-token"]=u);const p=Object(s["getSignature"])({verb:f,headers:d,bucket:a,objectName:t,accessKeyId:o,accessKeySecret:c});d.Authorization=`OSS ${o}:${p}`;const y=this.opts.secure?"https":"http",l=`${y}://${this.host}/${t}`;return Object(i["default"])(l,{method:f,headers:d,data:e,timeout:this.opts.timeout}).then(r).catch(n)})}signatureUrl(t,e={}){const{expires:r=1800,method:n,process:o,response:i}=e,{accessKeyId:c,accessKeySecret:u,stsToken:a,bucket:f}=this.opts,h={},d={};if(o){const t="x-oss-process";d[t]=o}i&&Object.keys(i).forEach(t=>{const e="response-"+t.toLowerCase();d[e]=i[t]}),Object.keys(e).forEach(t=>{const r=t.toLowerCase(),n=e[t];0===r.indexOf("x-oss-")?h[r]=n:0===r.indexOf("content-type")?h[t]=n:"expires"!==r&&"response"!==r&&"process"!==r&&"method"!==r&&(d[r]=n)});const p=e["security-token"]||a;p&&(d["security-token"]=p);const y=Object(s["unix"])()+r,l=Object(s["getSignature"])({type:"url",verb:n||"GET",accessKeyId:c,accessKeySecret:u,bucket:f,objectName:t,headers:h,subResource:d,expires:y}),b=this.opts.secure?"https":"http";let g=`${b}://${this.host}/${t}`;return g+="?OSSAccessKeyId="+c,g+="&Expires="+y,g+="&Signature="+encodeURIComponent(l),Object.keys(d).forEach(t=>{g+=`&${t}=${encodeURIComponent(d[t])}`}),g}}},"1fb5":function(t,e,r){"use strict";e.byteLength=f,e.toByteArray=d,e.fromByteArray=l;for(var n=[],o=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,u=s.length;c<u;++c)n[c]=s[c],o[s.charCodeAt(c)]=c;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function f(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n}function h(t,e,r){return 3*(e+r)/4-r}function d(t){var e,r,n=a(t),s=n[0],c=n[1],u=new i(h(t,s,c)),f=0,d=c>0?s-4:s;for(r=0;r<d;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===c&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===c&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u}function p(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function y(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(p(n));return o.join("")}function l(t){for(var e,r=t.length,o=r%3,i=[],s=16383,c=0,u=r-o;c<u;c+=s)i.push(y(t,c,c+s>u?u:c+s));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},"320c":function(t,e,r){"use strict";
  2. /*
  3. object-assign
  4. (c) Sindre Sorhus
  5. @license MIT
  6. */var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function s(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function c(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map((function(t){return e[t]}));if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(t){o[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(i){return!1}}t.exports=c()?Object.assign:function(t,e){for(var r,c,u=s(t),a=1;a<arguments.length;a++){for(var f in r=Object(arguments[a]),r)o.call(r,f)&&(u[f]=r[f]);if(n){c=n(r);for(var h=0;h<c.length;h++)i.call(r,c[h])&&(u[c[h]]=r[c[h]])}}return u}},"7fac":function(t,e,r){"use strict";function n(t,e={}){return new Promise((r,n)=>{const{async:o=!0,data:i=null,headers:s={},method:c="get",timeout:u=0}=e,a=new XMLHttpRequest;let f;a.open(c,t,o),u&&(f=setTimeout(()=>{n(new Error(`the request timeout ${u}ms`))},u)),a.onerror=()=>{n(new Error("unknown error"))},a.onreadystatechange=()=>{if(4===a.readyState)if(u&&clearTimeout(f),a.status>=200&&a.status<300)r(a.response,a);else{const t=new Error("the request is error");n(t)}},Object.keys(s).forEach(t=>{a.setRequestHeader(t,s[t])});try{a.send(i)}catch(h){n(h)}})}r.r(e),r.d(e,"default",(function(){return n}))},b4c7:function(t,e,r){t.exports=r("0e19").default},bf73:function(t,e,r){"use strict";function n(){}r.r(e),ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(t,e){var r,n=new Uint8Array(this);void 0===e&&(e=n.length);var o=new ArrayBuffer(e-t),i=new Uint8Array(o);for(r=0;r<i.length;r++)i[r]=n[r+t];return o}),n.prototype.processBlock=function(t){var e,r,n=this.current[0],o=this.current[1],i=this.current[2],s=this.current[3],c=this.current[4],u=[t[0]<<24|t[1]<<16|t[2]<<8|t[3],t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[8]<<24|t[9]<<16|t[10]<<8|t[11],t[12]<<24|t[13]<<16|t[14]<<8|t[15],t[16]<<24|t[17]<<16|t[18]<<8|t[19],t[20]<<24|t[21]<<16|t[22]<<8|t[23],t[24]<<24|t[25]<<16|t[26]<<8|t[27],t[28]<<24|t[29]<<16|t[30]<<8|t[31],t[32]<<24|t[33]<<16|t[34]<<8|t[35],t[36]<<24|t[37]<<16|t[38]<<8|t[39],t[40]<<24|t[41]<<16|t[42]<<8|t[43],t[44]<<24|t[45]<<16|t[46]<<8|t[47],t[48]<<24|t[49]<<16|t[50]<<8|t[51],t[52]<<24|t[53]<<16|t[54]<<8|t[55],t[56]<<24|t[57]<<16|t[58]<<8|t[59],t[60]<<24|t[61]<<16|t[62]<<8|t[63]];for(r=16;r<80;r++)u.push((u[r-3]^u[r-8]^u[r-14]^u[r-16])<<1|(u[r-3]^u[r-8]^u[r-14]^u[r-16])>>>31);for(r=0;r<80;r++)e=(n<<5|n>>>27)+c+u[r],e+=r<20?1518500249+(o&i|~o&s)|0:r<40?1859775393+(o^i^s)|0:r<60?2400959708+(o&i|o&s|i&s)|0:3395469782+(o^i^s)|0,c=s,s=i,i=o<<30|o>>>2,o=n,n=e;this.current[0]+=n,this.current[1]+=o,this.current[2]+=i,this.current[3]+=s,this.current[4]+=c,this.currentLen+=64},n.prototype.doPadding=function(){var t=8*(this.inLen+this.currentLen),e=0,r=4294967295&t,n=this.inLen<=55?55-this.inLen:119-this.inLen,o=new Uint8Array(new ArrayBuffer(n+1+8));return o[0]=128,o[o.length-1]=255&r,o[o.length-2]=r>>>8&255,o[o.length-3]=r>>>16&255,o[o.length-4]=r>>>24&255,o[o.length-5]=255&e,o[o.length-6]=e>>>8&255,o[o.length-7]=e>>>16&255,o[o.length-8]=e>>>24&255,o},n.prototype.getDigest=function(){var t=new Uint8Array(new ArrayBuffer(20));return t[3]=255&this.current[0],t[2]=this.current[0]>>>8&255,t[1]=this.current[0]>>>16&255,t[0]=this.current[0]>>>24&255,t[7]=255&this.current[1],t[6]=this.current[1]>>>8&255,t[5]=this.current[1]>>>16&255,t[4]=this.current[1]>>>24&255,t[11]=255&this.current[2],t[10]=this.current[2]>>>8&255,t[9]=this.current[2]>>>16&255,t[8]=this.current[2]>>>24&255,t[15]=255&this.current[3],t[14]=this.current[3]>>>8&255,t[13]=this.current[3]>>>16&255,t[12]=this.current[3]>>>24&255,t[19]=255&this.current[4],t[18]=this.current[4]>>>8&255,t[17]=this.current[4]>>>16&255,t[16]=this.current[4]>>>24&255,t.buffer},n.prototype.reset=function(){this.currentLen=0,this.inLen=0,this.current=new Uint32Array(new ArrayBuffer(20)),this.current[0]=1732584193,this.current[1]=4023233417,this.current[2]=2562383102,this.current[3]=271733878,this.current[4]=3285377520},n.prototype.blockLen=64,n.prototype.digestLen=20;var o=function(t){var e,r=new ArrayBuffer(t.length),n=new Uint8Array(r);for(e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},i=function(t){var e=new ArrayBuffer(1),r=new Uint8Array(e);return r[0]=t,r},s=function(t){if(t.constructor===Uint8Array)return t;if(t.constructor===ArrayBuffer)return new Uint8Array(t);if(t.constructor===String)return o(t);if(t.constructor===Number){if(t>255)throw"For more than one byte, use an array buffer";if(t<0)throw"Input value must be positive";return i(t)}throw"Unsupported type"},c=function(t){var e=function(t){var e=t.length,r=0;while(e>0){var n=this.blockLen-this.inLen;n>e&&(n=e);var o=t.subarray(r,r+n);this.inbuf.set(o,this.inLen),r+=n,e-=n,this.inLen+=n,this.inLen===this.blockLen&&(this.processBlock(this.inbuf),this.inLen=0)}},r=function(){var t=this.doPadding();this.update(t);var e=this.getDigest();return this.reset(),e},n=function(){if(!t)throw"Unsupported algorithm: "+t.toString();t.prototype.update=e,t.prototype.finalize=r;var n=new t;return n.inbuf=new Uint8Array(new ArrayBuffer(n.blockLen)),n.reset(),n}();return{update:function(t){n.update(s(t))},finalize:function(){return n.finalize()},digest:function(t){return n.update(s(t)),n.finalize()},reset:function(){n.reset()},digestLength:function(){return n.digestLen}}},u=function(t){var e,r,n,o=!1,i=function(){var i,s;if(!o){if(void 0===e)throw"MAC key is not defined";for(s=e.byteLength>64?new Uint8Array(t.digest(e)):new Uint8Array(e),r=new Uint8Array(new ArrayBuffer(64)),i=0;i<s.length;i++)r[i]=54^s[i];for(i=s.length;i<64;i++)r[i]=54;for(n=new Uint8Array(new ArrayBuffer(64)),i=0;i<s.length;i++)n[i]=92^s[i];for(i=s.length;i<64;i++)n[i]=92;o=!0,t.update(r.buffer)}},c=function(){o=!1,e=void 0,r=void 0,n=void 0,t.reset()},u=function(){var e=t.finalize();return t.reset(),t.update(n.buffer),t.update(e),e=t.finalize(),c(),e},a=function(t){e=t};return{setKey:function(t){a(s(t)),i()},update:function(e){t.update(e)},finalize:function(){return u()},mac:function(t){return this.update(t),this.finalize()},reset:function(){c()},hmacLength:function(){return t.digestLength()}}},a={SHA1:function(){return c(n)},HMAC_SHA1:function(){return u(c(n))}};e["default"]=a},fbb8:function(t,e,r){"use strict";r.r(e),r.d(e,"unix",(function(){return u})),r.d(e,"blobToBuffer",(function(){return a})),r.d(e,"assertOptions",(function(){return f})),r.d(e,"getCanonicalizedOSSHeaders",(function(){return h})),r.d(e,"getCanonicalizedResource",(function(){return d})),r.d(e,"getSignature",(function(){return p}));var n=r("1fb5"),o=r.n(n),i=r("bf73"),s=r("1d2a");function c(t){return t&&"[object Date]"===Object.prototype.toString.call(t)&&"Invalid Date"!==t.toString}function u(t){let e;return t&&(e=new Date(t)),c(e)||(e=new Date),Math.round(e.getTime()/1e3)}function a(t){return new Promise((e,r)=>{const n=new FileReader;n.onload=()=>{const t=new Uint8Array(n.result);e(t)},n.onerror=()=>{r(n.error)},n.readAsArrayBuffer(t)})}function f(t){const{accessKeyId:e,accessKeySecret:r,bucket:n,endpoint:o}=t;if(!e)throw new Error("need accessKeyId");if(!r)throw new Error("need accessKeySecret");if(!n&&!o)throw new Error("need bucket or endpoint")}function h(t){let e="",r=Object.keys(t);return r=r.map(t=>t.toLowerCase()),r.sort(),r.forEach(r=>{0===r.indexOf("x-oss-")&&(e+=`${r}:${t[r]}\n`)}),e}function d(t="",e="",r){let n="";t&&(n+="/"+t),e&&("/"!==e.charAt(0)&&(n+="/"),n+=e);let o=""+n,i="?";if(r){const t=(t,e)=>t[0]>e[0]?1:t[0]<e[0]?-1:0,e=t=>{o+=i+t,r[t]&&(o+="="+r[t]),i="&"};Object.keys(r).sort(t).forEach(e)}return o}function p(t={}){const{type:e="header",verb:r="",contentMd5:n="",expires:c=u()+3600,bucket:a,objectName:f,accessKeySecret:p,headers:y={},subResource:l}=t,b=y["x-oss-date"]||"",g=y["Content-Type"]||"",w=[r,n,g];"header"===e?w.push(b):w.push(c);const A=h(y),v=d(a,f,l);w.push(`${A}${v}`);const m=w.join("\n");s["a"].debug("text",m,p);const k=new i["default"].HMAC_SHA1;k.setKey(p),k.update(m);const O=new Uint8Array(k.finalize()),j=o.a.fromByteArray(O);return j}}}]);