tim-upload-plugin
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).TIMUploadPlugin=e()}(this,(function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=function(t){return t&&t.Math==Math&&t},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")(),o=function(t){try{return!!t()}catch(e){return!0}},i=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,c={f:a&&!u.call({1:2},1)?function(t){var e=a(this,t);return!!e&&e.enumerable}:u},f=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},l={}.toString,s=function(t){return l.call(t).slice(8,-1)},p="".split,d=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==s(t)?p.call(t,""):Object(t)}:Object,y=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},h=function(t){return d(y(t))},g=function(t){return"object"==typeof t?null!==t:"function"==typeof t},v=function(t,e){if(!g(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!g(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},m={}.hasOwnProperty,b=function(t,e){return m.call(t,e)},S=r.document,x=g(S)&&g(S.createElement),O=!i&&!o((function(){return 7!=Object.defineProperty((t="div",x?S.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),w=Object.getOwnPropertyDescriptor,E={f:i?w:function(t,e){if(t=h(t),e=v(e,!0),O)try{return w(t,e)}catch(n){}if(b(t,e))return f(!c.f.call(t,e),t[e])}},j=function(t){if(!g(t))throw TypeError(String(t)+" is not an object");return t},P=Object.defineProperty,R={f:i?P:function(t,e,n){if(j(t),e=v(e,!0),j(n),O)try{return P(t,e,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},T=i?function(t,e,n){return R.f(t,e,f(1,n))}:function(t,e,n){return t[e]=n,t},C=function(t,e){try{T(r,t,e)}catch(n){r[t]=e}return e},I=r["__core-js_shared__"]||C("__core-js_shared__",{}),L=Function.toString;"function"!=typeof I.inspectSource&&(I.inspectSource=function(t){return L.call(t)});var A,_,k,M=I.inspectSource,D=r.WeakMap,U="function"==typeof D&&/native code/.test(M(D)),q=e((function(t){(t.exports=function(t,e){return I[t]||(I[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.8.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),N=0,F=Math.random(),B=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++N+F).toString(36)},G=q("keys"),V=function(t){return G[t]||(G[t]=B(t))},$={},H=r.WeakMap;if(U){var K=I.state||(I.state=new H),z=K.get,Y=K.has,W=K.set;A=function(t,e){return e.facade=t,W.call(K,t,e),e},_=function(t){return z.call(K,t)||{}},k=function(t){return Y.call(K,t)}}else{var X=V("state");$[X]=!0,A=function(t,e){return e.facade=t,T(t,X,e),e},_=function(t){return b(t,X)?t[X]:{}},k=function(t){return b(t,X)}}var J={set:A,get:_,has:k,enforce:function(t){return k(t)?_(t):A(t,{})},getterFor:function(t){return function(e){var n;if(!g(e)||(n=_(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},Q=e((function(t){var e=J.get,n=J.enforce,o=String(String).split("String");(t.exports=function(t,e,i,u){var a,c=!!u&&!!u.unsafe,f=!!u&&!!u.enumerable,l=!!u&&!!u.noTargetGet;"function"==typeof i&&("string"!=typeof e||b(i,"name")||T(i,"name",e),(a=n(i)).source||(a.source=o.join("string"==typeof e?e:""))),t!==r?(c?!l&&t[e]&&(f=!0):delete t[e],f?t[e]=i:T(t,e,i)):f?t[e]=i:C(e,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||M(this)}))})),Z=r,et=function(t){return"function"==typeof t?t:void 0},nt=function(t,e){return arguments.length<2?et(Z[t])||et(r[t]):Z[t]&&Z[t][e]||r[t]&&r[t][e]},rt=Math.ceil,ot=Math.floor,it=function(t){return isNaN(t=+t)?0:(t>0?ot:rt)(t)},ut=Math.min,at=function(t){return t>0?ut(it(t),9007199254740991):0},ct=Math.max,ft=Math.min,lt=function(t){return function(e,n,r){var o,i=h(e),u=at(i.length),a=function(t,e){var n=it(t);return n<0?ct(n+e,0):ft(n,e)}(r,u);if(t&&n!=n){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((t||a in i)&&i[a]===n)return t||a||0;return!t&&-1}},st={includes:lt(!0),indexOf:lt(!1)},pt=st.indexOf,dt=function(t,e){var n,r=h(t),o=0,i=[];for(n in r)!b($,n)&&b(r,n)&&i.push(n);for(;e.length>o;)b(r,n=e[o++])&&(~pt(i,n)||i.push(n));return i},yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ht=yt.concat("length","prototype"),gt={f:Object.getOwnPropertyNames||function(t){return dt(t,ht)}},vt={f:Object.getOwnPropertySymbols},mt=nt("Reflect","ownKeys")||function(t){var e=gt.f(j(t)),n=vt.f;return n?e.concat(n(t)):e},bt=function(t,e){for(var n=mt(e),r=R.f,o=E.f,i=0;i<n.length;i++){var u=n[i];b(t,u)||r(t,u,o(e,u))}},St=/#|\.prototype\./,xt=function(t,e){var n=wt[Ot(t)];return n==jt||n!=Et&&("function"==typeof e?o(e):!!e)},Ot=xt.normalize=function(t){return String(t).replace(St,".").toLowerCase()},wt=xt.data={},Et=xt.NATIVE="N",jt=xt.POLYFILL="P",Pt=xt,Rt=E.f,Tt=function(t,e){var n,o,i,u,a,c=t.target,f=t.global,l=t.stat;if(n=f?r:l?r[c]||C(c,{}):(r[c]||{}).prototype)for(o in e){if(u=e[o],i=t.noTargetGet?(a=Rt(n,o))&&a.value:n[o],!Pt(f?o:c+(l?".":"#")+o,t.forced)&&void 0!==i){if(typeof u==typeof i)continue;bt(u,i)}(t.sham||i&&i.sham)&&T(u,"sham",!0),Q(n,o,u,t)}};Tt({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}});var Ct=Date.prototype,It=Ct.toString,Lt=Ct.getTime;function At(t){return(At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Mt(t,e,n){return e&&kt(t.prototype,e),n&&kt(t,n),t}function Dt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ut(Object(n),!0).forEach((function(e){Dt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Nt(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}new Date(NaN)+""!="Invalid Date"&&Q(Ct,"toString",(function(){var t=Lt.call(this);return t==t?It.call(this):"Invalid Date"}));var Ft,Bt,Gt="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync,Vt="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync,$t="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync,Ht="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync,Kt="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync,zt=Gt||Vt||$t||Ht||Kt,Yt=Vt?qq:$t?tt:Ht?swan:Kt?my:Gt?wx:{},Wt=Array.isArray||function(t){return"Array"==s(t)},Xt=function(t){return Object(y(t))},Jt=function(t,e,n){var r=v(e);r in t?R.f(t,r,f(0,n)):t[r]=n},Qt=!!Object.getOwnPropertySymbols&&!o((function(){return!String(Symbol())})),Zt=Qt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,te=q("wks"),ee=r.Symbol,ne=Zt?ee:ee&&ee.withoutSetter||B,re=function(t){return b(te,t)||(Qt&&b(ee,t)?te[t]=ee[t]:te[t]=ne("Symbol."+t)),te[t]},oe=re("species"),ie=function(t,e){var n;return Wt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Wt(n.prototype)?g(n)&&null===(n=n[oe])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},ue=nt("navigator","userAgent")||"",ae=r.process,ce=ae&&ae.versions,fe=ce&&ce.v8;fe?Bt=(Ft=fe.split("."))[0]+Ft[1]:ue&&(!(Ft=ue.match(/Edge\/(\d+)/))||Ft[1]>=74)&&(Ft=ue.match(/Chrome\/(\d+)/))&&(Bt=Ft[1]);var le=Bt&&+Bt,se=re("species"),pe=function(t){return le>=51||!o((function(){var e=[];return(e.constructor={})[se]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},de=re("isConcatSpreadable"),ye=le>=51||!o((function(){var t=[];return t[de]=!1,t.concat()[0]!==t})),he=pe("concat"),ge=function(t){if(!g(t))return!1;var e=t[de];return void 0!==e?!!e:Wt(t)};Tt({target:"Array",proto:!0,forced:!ye||!he},{concat:function(t){var e,n,r,o,i,u=Xt(this),a=ie(u,0),c=0;for(e=-1,r=arguments.length;e<r;e++)if(ge(i=-1===e?u:arguments[e])){if(c+(o=at(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,c++)n in i&&Jt(a,c,i[n])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Jt(a,c++,i)}return a.length=c,a}});var ve=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},me=[].push,be=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,u=7==t,a=5==t||i;return function(c,f,l,s){for(var p,y,h=Xt(c),g=d(h),v=function(t,e,n){if(ve(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}(f,l,3),m=at(g.length),b=0,S=s||ie,x=e?S(c,m):n||u?S(c,0):void 0;m>b;b++)if((a||b in g)&&(y=v(p=g[b],b,h),t))if(e)x[b]=y;else if(y)switch(t){case 3:return!0;case 5:return p;case 6:return b;case 2:me.call(x,p)}else switch(t){case 4:return!1;case 7:me.call(x,p)}return i?-1:r||o?o:x}},Se={forEach:be(0),map:be(1),filter:be(2),some:be(3),every:be(4),find:be(5),findIndex:be(6),filterOut:be(7)},xe=function(t,e){var n=[][t];return!!n&&o((function(){n.call(null,e||function(){throw 1},1)}))},Oe=Object.defineProperty,we={},Ee=function(t){throw t},je=function(t,e){if(b(we,t))return we[t];e||(e={});var n=[][t],r=!!b(e,"ACCESSORS")&&e.ACCESSORS,u=b(e,0)?e[0]:Ee,a=b(e,1)?e[1]:void 0;return we[t]=!!n&&!o((function(){if(r&&!i)return!0;var t={length:-1};r?Oe(t,1,{enumerable:!0,get:Ee}):t[1]=1,n.call(t,u,a)}))},Pe=Se.forEach,Re=xe("forEach"),Te=je("forEach"),Ce=Re&&Te?[].forEach:function(t){return Pe(this,t,arguments.length>1?arguments[1]:void 0)};Tt({target:"Array",proto:!0,forced:[].forEach!=Ce},{forEach:Ce});var Ie=st.indexOf,Le=[].indexOf,Ae=!!Le&&1/[1].indexOf(1,-0)<0,_e=xe("indexOf"),ke=je("indexOf",{ACCESSORS:!0,1:0});Tt({target:"Array",proto:!0,forced:Ae||!_e||!ke},{indexOf:function(t){return Ae?Le.apply(this,arguments)||0:Ie(this,t,arguments.length>1?arguments[1]:void 0)}});var Me=function(){var t=j(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e};function De(t,e){return RegExp(t,e)}var Ue,qe,Ne={UNSUPPORTED_Y:o((function(){var t=De("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:o((function(){var t=De("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},Fe=RegExp.prototype.exec,Be=String.prototype.replace,Ge=Fe,Ve=(Ue=/a/,qe=/b*/g,Fe.call(Ue,"a"),Fe.call(qe,"a"),0!==Ue.lastIndex||0!==qe.lastIndex),$e=Ne.UNSUPPORTED_Y||Ne.BROKEN_CARET,He=void 0!==/()??/.exec("")[1];(Ve||He||$e)&&(Ge=function(t){var e,n,r,o,i=this,u=$e&&i.sticky,a=Me.call(i),c=i.source,f=0,l=t;return u&&(-1===(a=a.replace("y","")).indexOf("g")&&(a+="g"),l=String(t).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==t[i.lastIndex-1])&&(c="(?: "+c+")",l=" "+l,f++),n=new RegExp("^(?:"+c+")",a)),He&&(n=new RegExp("^"+c+"$(?!\\s)",a)),Ve&&(e=i.lastIndex),r=Fe.call(u?n:i,l),u?r?(r.input=r.input.slice(f),r[0]=r[0].slice(f),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:Ve&&r&&(i.lastIndex=i.global?r.index+r[0].length:e),He&&r&&r.length>1&&Be.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r});var Ke=Ge;Tt({target:"RegExp",proto:!0,forced:/./.exec!==Ke},{exec:Ke});var ze=re("species"),Ye=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),We="$0"==="a".replace(/./,"$0"),Xe=re("replace"),Je=!!/./[Xe]&&""===/./[Xe]("a","$0"),Qe=!o((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Ze=function(t,e,n,r){var i=re(t),u=!o((function(){var e={};return e[i]=function(){return 7},7!=""[t](e)})),a=u&&!o((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[ze]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return e=!0,null},n[i](""),!e}));if(!u||!a||"replace"===t&&(!Ye||!We||Je)||"split"===t&&!Qe){var c=/./[i],f=n(i,""[t],(function(t,e,n,r,o){return e.exec===Ke?u&&!o?{done:!0,value:c.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),{REPLACE_KEEPS_$0:We,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Je}),l=f[0],s=f[1];Q(String.prototype,t,l),Q(RegExp.prototype,i,2==e?function(t,e){return s.call(t,this,e)}:function(t){return s.call(t,this)})}r&&T(RegExp.prototype[i],"sham",!0)},tn=re("match"),en=re("species"),nn=function(t){return function(e,n){var r,o,i=String(y(e)),u=it(n),a=i.length;return u<0||u>=a?t?"":void 0:(r=i.charCodeAt(u))<55296||r>56319||u+1===a||(o=i.charCodeAt(u+1))<56320||o>57343?t?i.charAt(u):r:t?i.slice(u,u+2):o-56320+(r-55296<<10)+65536}},rn={codeAt:nn(!1),charAt:nn(!0)}.charAt,on=function(t,e,n){return e+(n?rn(t,e).length:1)},un=function(t,e){var n=t.exec;if("function"==typeof n){var r=n.call(t,e);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==s(t))throw TypeError("RegExp#exec called on incompatible receiver");return Ke.call(t,e)},an=[].push,cn=Math.min,fn=!o((function(){return!RegExp(4294967295,"y")}));Ze("split",2,(function(t,e,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var r,o,i=String(y(this)),u=void 0===n?4294967295:n>>>0;if(0===u)return[];if(void 0===t)return[i];if(!g(r=t)||!(void 0!==(o=r[tn])?o:"RegExp"==s(r)))return e.call(i,t,u);for(var a,c,f,l=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),d=0,h=new RegExp(t.source,p+"g");(a=Ke.call(h,i))&&!((c=h.lastIndex)>d&&(l.push(i.slice(d,a.index)),a.length>1&&a.index<i.length&&an.apply(l,a.slice(1)),f=a[0].length,d=c,l.length>=u));)h.lastIndex===a.index&&h.lastIndex++;return d===i.length?!f&&h.test("")||l.push(""):l.push(i.slice(d)),l.length>u?l.slice(0,u):l}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var o=y(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,o,n):r.call(String(o),e,n)},function(t,o){var i=n(r,t,this,o,r!==e);if(i.done)return i.value;var u=j(t),a=String(this),c=function(t,e){var n,r=j(t).constructor;return void 0===r||null==(n=j(r)[en])?e:ve(n)}(u,RegExp),f=u.unicode,l=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(fn?"y":"g"),s=new c(fn?u:"^(?:"+u.source+")",l),p=void 0===o?4294967295:o>>>0;if(0===p)return[];if(0===a.length)return null===un(s,a)?[a]:[];for(var d=0,y=0,h=[];y<a.length;){s.lastIndex=fn?y:0;var g,v=un(s,fn?a:a.slice(y));if(null===v||(g=cn(at(s.lastIndex+(fn?0:y)),a.length))===d)y=on(a,y,f);else{if(h.push(a.slice(d,y)),h.length===p)return h;for(var m=1;m<=v.length-1;m++)if(h.push(v[m]),h.length===p)return h;y=d=g}}return h.push(a.slice(d)),h}]}),!fn);var ln,sn="\t\n\v\f\r \u2028\u2029\ufeff",pn="["+sn+"]",dn=RegExp("^"+pn+pn+"*"),yn=RegExp(pn+pn+"*$"),hn=function(t){return function(e){var n=String(y(e));return 1&t&&(n=n.replace(dn,"")),2&t&&(n=n.replace(yn,"")),n}},gn={start:hn(1),end:hn(2),trim:hn(3)},vn=gn.trim;Tt({target:"String",proto:!0,forced:(ln="trim",o((function(){return!!sn[ln]()||" "!=" "[ln]()||sn[ln].name!==ln})))},{trim:function(){return vn(this)}});for(var mn in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var bn=r[mn],Sn=bn&&bn.prototype;if(Sn&&Sn.forEach!==Ce)try{T(Sn,"forEach",Ce)}catch($n){Sn.forEach=Ce}}var xn=Se.filter,On=pe("filter"),wn=je("filter");Tt({target:"Array",proto:!0,forced:!On||!wn},{filter:function(t){return xn(this,t,arguments.length>1?arguments[1]:void 0)}}),Tt({target:"Array",stat:!0},{isArray:Wt});var En=[].join,jn=d!=Object,Pn=xe("join",",");Tt({target:"Array",proto:!0,forced:jn||!Pn},{join:function(t){return En.call(h(this),void 0===t?",":t)}});var Rn=Se.map,Tn=pe("map"),Cn=je("map");Tt({target:"Array",proto:!0,forced:!Tn||!Cn},{map:function(t){return Rn(this,t,arguments.length>1?arguments[1]:void 0)}});var In=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ln=V("IE_PROTO"),An=Object.prototype,_n=In?Object.getPrototypeOf:function(t){return t=Xt(t),b(t,Ln)?t[Ln]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?An:null};Tt({target:"Object",stat:!0,forced:o((function(){_n(1)})),sham:!In},{getPrototypeOf:function(t){return _n(Xt(t))}});var kn=Object.keys||function(t){return dt(t,yt)};Tt({target:"Object",stat:!0,forced:o((function(){kn(1)}))},{keys:function(t){return kn(Xt(t))}});var Mn=function(t){if("object"!==At(t)||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n};function Dn(t){if(null==t)return!0;if("boolean"==typeof t)return!1;if("number"==typeof t)return 0===t;if("string"==typeof t)return 0===t.length;if("function"==typeof t)return 0===t.length;if(Array.isArray(t))return 0===t.length;if(t instanceof Error)return""===t.message;if(Mn(t)){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}return!1}var Un=function(){function t(){_t(this,t),this.downloadUrl=""}return Mt(t,[{key:"request",value:function(t,e){var n=this;this.downloadUrl=t.downloadUrl||"";var r=(t.method||"PUT").toUpperCase(),o=t.url;if(t.qs){var i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"=";return Dn(t)?"":Mn(t)?Object.keys(t).map((function(r){var o=encodeURIComponent(r)+n;return Array.isArray(t[r])?t[r].map((function(t){return o+encodeURIComponent(t)})).join(e):o+encodeURIComponent(t[r])})).filter(Boolean).join(e):void 0}(t.qs);i&&(o+="".concat(-1===o.indexOf("?")?"?":"&").concat(i))}var u=new XMLHttpRequest;u.open(r,o,!0),u.responseType=t.dataType||"text";var a=t.headers||{};if(!Dn(a))for(var c in a)a.hasOwnProperty(c)&&"content-length"!==c.toLowerCase()&&"user-agent"!==c.toLowerCase()&&"origin"!==c.toLowerCase()&&"host"!==c.toLowerCase()&&u.setRequestHeader(c,a[c]);return u.onload=function(){e(null,n._xhrRes(u,n._xhrBody(u)))},u.onerror=function(t){var r=n._xhrBody(u);if(r)e(t,n._xhrRes(u,r));else{var o=u.statusText;o||0!==u.status||(o="CORS blocked or network error"),e(o,n._xhrRes(u,r))}},t.onProgress&&u.upload&&(u.upload.onprogress=function(e){var n=e.total,r=e.loaded,o=Math.floor(100*r/n);t.onProgress({total:n,loaded:r,percent:(o>=100?100:o)/100})}),u.send(t.resources),u}},{key:"_xhrRes",value:function(t,e){var n={};return t.getAllResponseHeaders().trim().split("\n").forEach((function(t){if(t){var e=t.indexOf(":"),r=t.substr(0,e).trim().toLowerCase(),o=t.substr(e+1).trim();n[r]=o}})),{statusCode:t.status,statusMessage:t.statusText,headers:n,data:e}}},{key:"_xhrBody",value:function(t){return 200===t.status&&t.responseURL&&this.downloadUrl?{location:this.downloadUrl}:{response:t.responseText}}}]),t}(),qn=R.f,Nn=Function.prototype,Fn=Nn.toString,Bn=/^\s*function ([^ (]*)/;i&&!("name"in Nn)&&qn(Nn,"name",{configurable:!0,get:function(){try{return Fn.call(this).match(Bn)[1]}catch($n){return""}}}),Ze("match",1,(function(t,e,n){return[function(e){var n=y(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var o=j(t),i=String(this);if(!o.global)return un(o,i);var u=o.unicode;o.lastIndex=0;for(var a,c=[],f=0;null!==(a=un(o,i));){var l=String(a[0]);c[f]=l,""===l&&(o.lastIndex=on(i,at(o.lastIndex),u)),f++}return 0===f?null:c}]}));var Gn=["unknown","image","video","audio","log"],Vn=function(){function t(){_t(this,t),this.downloadUrl=""}return Mt(t,[{key:"request",value:function(t,e){var n=this,r=t.resources,o=void 0===r?"":r,i=t.headers,u=void 0===i?{}:i,a=t.url,c=t.downloadUrl,f=void 0===c?"":c;this.downloadUrl=f;var l=null,s="",p=f.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/);s=(s=decodeURIComponent(p[3])).indexOf("?")>-1?s.split("?")[0]:s,u["Content-Type"]="multipart/form-data";var d={url:a,header:u,name:"file",filePath:o,formData:{key:s,success_action_status:200,"Content-Type":""},timeout:t.timeout||3e5};if(Kt){var y=d;y.name;d=qt(qt({},Nt(y,["name"])),{},{fileName:"file",fileType:Gn[t.fileType]})}return(l=Yt.uploadFile(qt(qt({},d),{},{success:function(t){n._handleResponse(t,e)},fail:function(t){n._handleResponse(t,e)}}))).onProgressUpdate((function(e){t.onProgress&&t.onProgress({total:e.totalBytesExpectedToSend,loaded:e.totalBytesSent,percent:Math.floor(e.progress)/100})})),l}},{key:"_handleResponse",value:function(t,e){var n=t.header,r={};if(n)for(var o in n)n.hasOwnProperty(o)&&(r[o.toLowerCase()]=n[o]);var i=+t.statusCode;200===i?e(null,{statusCode:i,headers:r,data:qt(qt({},t.data),{},{location:this.downloadUrl})}):e(t,{statusCode:i,headers:r,data:void 0})}}]),t}();return function(){function t(){_t(this,t),this.retry=1,this.tryCount=0,this.systemClockOffset=0,this.httpRequest=zt?new Vn:new Un}return Mt(t,[{key:"uploadFile",value:function(t,e){var n=this;return this.httpRequest.request(t,(function(r,o){r&&n.tryCount<n.retry&&n.allowRetry(r)?(n.tryCount++,n.uploadFile(t,e)):(n.tryCount=0,e(r,o))}))}},{key:"allowRetry",value:function(t){var e=!1,n=!1;if(t){var r=t.headers&&(t.headers.date||t.headers.Date)||t.error&&t.error.ServerTime;try{var o=t.error&&t.error.Code,i=t.error&&t.error.Message;("RequestTimeTooSkewed"===o||"AccessDenied"===o&&"Request has expired"===i)&&(n=!0)}catch(c){}if(n&&r){var u=Date.now(),a=Date.parse(r);Math.abs(u+this.systemClockOffset-a)>=3e4&&(this.systemClockOffset=a-u,e=!0)}else 5===Math.floor(t.statusCode/100)&&(e=!0)}return e}}]),t}()})); | ||
var global,factory;global=this,factory=function(){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function o(e,t,o){return t&&r(e.prototype,t),o&&r(e,o),e}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var u="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync,f="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync,l="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync,c="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync,y="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync,d=u||f||l||c||y,p=f?qq:l?tt:c?swan:y?my:u?wx:{},h=function(t){if("object"!==e(t)||null===t)return!1;var r=Object.getPrototypeOf(t);if(null===r)return!0;for(var o=r;null!==Object.getPrototypeOf(o);)o=Object.getPrototypeOf(o);return r===o};function v(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(h(e)){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1}var m=function(){function e(){t(this,e),this.downloadUrl=""}return o(e,[{key:"request",value:function(e,t){var r=this;this.downloadUrl=e.downloadUrl||"";var o=(e.method||"PUT").toUpperCase(),n=e.url;if(e.qs){var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"=";return v(e)?"":h(e)?Object.keys(e).map((function(o){var n=encodeURIComponent(o)+r;return Array.isArray(e[o])?e[o].map((function(e){return n+encodeURIComponent(e)})).join(t):n+encodeURIComponent(e[o])})).filter(Boolean).join(t):void 0}(e.qs);a&&(n+="".concat(-1===n.indexOf("?")?"?":"&").concat(a))}var s=new XMLHttpRequest;s.open(o,n,!0),s.responseType=e.dataType||"text";var i=e.headers||{};if(!v(i))for(var u in i)i.hasOwnProperty(u)&&"content-length"!==u.toLowerCase()&&"user-agent"!==u.toLowerCase()&&"origin"!==u.toLowerCase()&&"host"!==u.toLowerCase()&&s.setRequestHeader(u,i[u]);return s.onload=function(){t(null,r._xhrRes(s,r._xhrBody(s)))},s.onerror=function(e){var o=r._xhrBody(s);if(o)t(e,r._xhrRes(s,o));else{var n=s.statusText;n||0!==s.status||(n="CORS blocked or network error"),t(n,r._xhrRes(s,o))}},e.onProgress&&s.upload&&(s.upload.onprogress=function(t){var r=t.total,o=t.loaded,n=Math.floor(100*o/r);e.onProgress({total:r,loaded:o,percent:(n>=100?100:n)/100})}),s.send(e.resources),s}},{key:"_xhrRes",value:function(e,t){var r={};return e.getAllResponseHeaders().trim().split("\n").forEach((function(e){if(e){var t=e.indexOf(":"),o=e.substr(0,t).trim().toLowerCase(),n=e.substr(t+1).trim();r[o]=n}})),{statusCode:e.status,statusMessage:e.statusText,headers:r,data:t}}},{key:"_xhrBody",value:function(e){return 200===e.status&&e.responseURL&&this.downloadUrl?{location:this.downloadUrl}:{response:e.responseText}}}]),e}(),b=["unknown","image","video","audio","log"],g=function(){function e(){t(this,e),this.downloadUrl=""}return o(e,[{key:"request",value:function(e,t){var r=this,o=e.resources,n=void 0===o?"":o,a=e.headers,u=void 0===a?{}:a,f=e.url,l=e.downloadUrl,c=void 0===l?"":l;this.downloadUrl=c;var d=null,h="",v=c.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/);h=(h=decodeURIComponent(v[3])).indexOf("?")>-1?h.split("?")[0]:h,u["Content-Type"]="multipart/form-data";var m={url:f,header:u,name:"file",filePath:n,formData:{key:h,success_action_status:200,"Content-Type":""},timeout:e.timeout||3e5};if(y){var g=m;g.name,m=s(s({},i(g,["name"])),{},{fileName:"file",fileType:b[e.fileType]})}return(d=p.uploadFile(s(s({},m),{},{success:function(e){r._handleResponse(e,t)},fail:function(e){r._handleResponse(e,t)}}))).onProgressUpdate((function(t){e.onProgress&&e.onProgress({total:t.totalBytesExpectedToSend,loaded:t.totalBytesSent,percent:Math.floor(t.progress)/100})})),d}},{key:"_handleResponse",value:function(e,t){var r=e.header,o={};if(r)for(var n in r)r.hasOwnProperty(n)&&(o[n.toLowerCase()]=r[n]);var a=+e.statusCode;200===a?t(null,{statusCode:a,headers:o,data:s(s({},e.data),{},{location:this.downloadUrl})}):t(e,{statusCode:a,headers:o,data:void 0})}}]),e}();return function(){function e(){t(this,e),this.retry=1,this.tryCount=0,this.systemClockOffset=0,this.httpRequest=d?new g:new m}return o(e,[{key:"uploadFile",value:function(e,t){var r=this;return this.httpRequest.request(e,(function(o,n){o&&r.tryCount<r.retry&&r.allowRetry(o)?(r.tryCount++,r.uploadFile(e,t)):(r.tryCount=0,t(o,n))}))}},{key:"allowRetry",value:function(e){var t=!1,r=!1;if(e){var o=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var n=e.error&&e.error.Code,a=e.error&&e.error.Message;("RequestTimeTooSkewed"===n||"AccessDenied"===n&&"Request has expired"===a)&&(r=!0)}catch(u){}if(r&&o){var s=Date.now(),i=Date.parse(o);Math.abs(s+this.systemClockOffset-i)>=3e4&&(this.systemClockOffset=i-s,t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0)}return t}}]),e}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):(global=global||self).TIMUploadPlugin=factory(); |
{ | ||
"name": "tim-upload-plugin", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Tencent Cloud Upload To COS SDK for IM", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -19,3 +19,3 @@ ### 简介 | ||
- 使用前请将 [tim-js-sdk](https://www.npmjs.com/package/tim-js-sdk) 或 [tim-wx-sdk](https://www.npmjs.com/package/tim-wx-sdk) 升级到v2.9.2或更高版本 | ||
- 小程序端使用 tim-upload-plugin,在小程序管理后台增加 uploadFile 域名配置 `https://cos.ap-shanghai.myqcloud.com`,增加 downloadFile 域名配置 `https://coscdn.tim.qq.com` | ||
- 小程序端使用 tim-upload-plugin,在小程序管理后台增加 uploadFile 域名配置 `https://cos.ap-shanghai.myqcloud.com`,增加 downloadFile 域名配置 `https://cos.ap-shanghai.myqcloud.com` | ||
@@ -22,0 +22,0 @@ |
9741
26