!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},e(t)}function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return r};var r={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(z){s=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),u=new V(n||[]);return a(i,"_invoke",{value:S(e,r,u)}),i}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(z){return{type:"throw",arg:z}}}r.wrap=d;var f={};function h(){}function v(){}function m(){}var y={};s(y,u,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(L([])));b&&b!==n&&o.call(b,u)&&(y=b);var w=m.prototype=h.prototype=Object.create(y);function A(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(t,r){function n(a,i,u,l){var c=p(t[a],t,i);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==e(d)&&o.call(d,"__await")?r.resolve(d.__await).then((function(e){n("next",e,u,l)}),(function(e){n("throw",e,u,l)})):r.resolve(d).then((function(e){s.value=e,u(s)}),(function(e){return n("throw",e,u,l)}))}l(c.arg)}var i;a(this,"_invoke",{value:function(e,t){function o(){return new r((function(r,o){n(e,t,r,o)}))}return i=i?i.then(o,o):o()}})}function S(e,t,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return F()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=k(i,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function k(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=p(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function G(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function L(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r=0;--n){var a=this.tryEntries[n],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),G(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;G(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},r}function r(e,t,r,n,o,a,i){try{var u=e[a](i),l=u.value}catch(c){return void r(c)}u.done?t(l):Promise.resolve(l).then(n,o)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var i=e.apply(t,n);function u(e){r(i,o,a,u,l,"next",e)}function l(e){r(i,o,a,u,l,"throw",e)}u(void 0)}))}}function o(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);l=!0);}catch(s){c=!0,o=s}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?(e.$emit("update:modelValue",[].concat(o(e.modelValue),[t.fileUrl])),e.$emit("uploadChange",[].concat(o(e.modelValue),[t.fileUrl]))):(e.$emit("update:modelValue",[t.fileUrl]),e.$emit("uploadChange",[t.fileUrl]))}))}},beforeRead:function(e){return console.log(e,"beforeRead"),!!(e.size/1024/1024-1&&(r.splice(n,1),this.$emit("update:modelValue",r),this.$emit("uploadChange")),e.stopPropagation()},getFile:function(e){var r=this;return n(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r.uploadFile(e);case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),n,null,[[0,5]])})))()},uploadFile:function(e){var r=this;return n(t().mark((function n(){var a,i,u,l,c,s,d,p;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,"/api-web/getUploadSign",a=e.name||"",i=r.path+"/"+(a&&a.replace(/ /gi,"_")),u=(new Date).getTime()+i,console.log(e),t.next=8,x.post("/api-web/getUploadSign",{data:{filename:i,bucketName:r.bucket,postData:{filename:i,acl:"public-read",key:u,unknowValueField:[]}}});case 8:for(d in l=t.sent,S({message:"加载中...",forbidClick:!0,loadingType:"spinner",duration:0}),c={policy:l.data.policy,signature:l.data.signature,key:u,KSSAccessKeyId:l.data.kssAccessKeyId,acl:"public-read",name:i},s=new FormData,c)s.append(d,c[d]);return s.append("file",e,i),t.next=16,k(E(r.bucket),{method:"POST",data:s});case 16:console.log(E(r.bucket)+u),p=E(r.bucket)+u,A(),r.maxCount>1?(r.$emit("update:modelValue",[].concat(o(r.modelValue),[p])),r.$emit("uploadChange",[].concat(o(r.modelValue),[p]))):(r.$emit("update:modelValue",[p]),r.$emit("uploadChange",[p])),t.next=25;break;case 22:t.prev=22,t.t0=t.catch(0),console.log(t.t0,"uploadFile");case 25:case"end":return t.stop()}}),n,null,[[0,22]])})))()}},render:function(){var e=this;return d((function(){return e.modelValue})),p(V,null,[this.modelValue.length>0&&this.maxCount>1&&this.modelValue.map((function(t){return p("div",{class:["van-uploader",C.uploader,C[e.size]]},[e.deletable&&!e.disabled&&p(G,{name:"cross",onClick:function(r){return e.onClose(r,t)},class:C["img-close"]},null),p("div",{class:["van-uploader__upload"]},["IMAGE"===e.uploadType?p(M,{src:t,class:C.previewImg,fit:"cover"},null):p("video",{ref:"videoUpload",style:{backgroundColor:"#F8F8F8"},class:C.previewImg,src:t+"#t=1,4"},null)])])})),this.native?this.maxCount>1?this.modelValue.length0?p("div",{class:["van-uploader__upload"]},[this.modelValue.map((function(t){return p(V,null,[e.deletable&&!e.disabled&&p(G,{name:"cross",onClick:function(r){return e.onClose(r,t)},class:[C["img-close"],C.singleImgClose]},null),"IMAGE"===e.uploadType?p(M,{fit:"cover",position:"center",class:C.uploadImg,src:t},null):p("video",{ref:"videoUpload",class:C.uploadImg,style:{backgroundColor:"#F8F8F8"},src:t+"#t=1,4"},null)])}))]):p(G,{name:this.uploadIcon,class:["van-uploader__upload"],size:"32"},null)]):this.maxCount>1?this.modelValue.length0?p("div",{class:["van-uploader__upload"]},[e.modelValue.map((function(t){return p(V,null,[e.deletable&&!e.disabled&&p(G,{name:"cross",onClick:function(r){return e.onClose(r,t)},class:[C["img-close"],C.singleImgClose]},null),"IMAGE"===e.uploadType?p(M,{fit:"cover",position:"center",class:C.uploadImg,src:t},null):p("video",{ref:"videoUpload",class:C.uploadImg,style:{backgroundColor:"#F8F8F8"},src:t+"#t=1,4"},null)])}))]):p(G,{name:e.uploadIcon,class:["van-uploader__upload"],size:"32"},null)]}}),this.$slots.default&&this.$slots.default()])}})),r("d",(function(t){if(null===t)return null;var r=Object.assign({},t);return Object.keys(r).forEach((function(n){return r[n]="object"===e(t[n])?J(t[n]):t[n]})),Array.isArray(t)?(r.length=t.length,Array.from(r)):r})))}}}))}();