!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 o};var o={},r=Object.prototype,i=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},a=n.iterator||"@@iterator",s=n.asyncIterator||"@@asyncIterator",c=n.toStringTag||"@@toStringTag";function h(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(O){h=function(e,t,o){return e[t]=o}}function p(e,t,o,r){var i=t&&t.prototype instanceof d?t:d,n=Object.create(i.prototype),a=new _(r||[]);return n._invoke=function(e,t,o){var r="suspendedStart";return function(i,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw n;return S()}for(o.method=i,o.arg=n;;){var a=o.delegate;if(a){var s=A(a,o);if(s){if(s===u)continue;return s}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===r)throw r="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r="executing";var c=l(e,t,o);if("normal"===c.type){if(r=o.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:o.done}}"throw"===c.type&&(r="completed",o.method="throw",o.arg=c.arg)}}}(e,o,a),n}function l(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(O){return{type:"throw",arg:O}}}o.wrap=p;var u={};function d(){}function f(){}function g(){}var v={};h(v,a,(function(){return this}));var m=Object.getPrototypeOf,w=m&&m(m(M([])));w&&w!==r&&i.call(w,a)&&(v=w);var x=g.prototype=d.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function y(t,o){function r(n,a,s,c){var h=l(t[n],t,a);if("throw"!==h.type){var p=h.arg,u=p.value;return u&&"object"==e(u)&&i.call(u,"__await")?o.resolve(u.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):o.resolve(u).then((function(e){p.value=e,s(p)}),(function(e){return r("throw",e,s,c)}))}c(h.arg)}var n;this._invoke=function(e,t){function i(){return new o((function(o,i){r(e,t,o,i)}))}return n=n?n.then(i,i):i()}}function A(e,t){var o=e.iterator[t.method];if(void 0===o){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,A(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(o,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function C(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 L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function M(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function t(){for(;++o=0;--r){var n=this.tryEntries[r],a=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var s=i.call(n,"catchLoc"),c=i.call(n,"finallyLoc");if(s&&c){if(this.prev=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),L(o),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var r=o.completion;if("throw"===r.type){var i=r.arg;L(o)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:M(e),resultName:t,nextLoc:o},"next"===this.method&&(this.arg=void 0),u}},o}function o(e,t,o,r,i,n,a){try{var s=e[n](a),c=s.value}catch(h){return void o(h)}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var a=e.apply(t,r);function s(e){o(a,i,n,s,c,"next",e)}function c(e){o(a,i,n,s,c,"throw",e)}s(void 0)}))}}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var r,i,n=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==o.return||o.return()}finally{if(s)throw i}}return n}(e,t)||n(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 n(e,t){if(e){if("string"==typeof e)return a(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);ospan{display:block;color:#212121;font-size:16px;padding-bottom:15px}._operation_cslsh_44{font-size:24px;display:flex;align-items:center;margin-top:20px}._operation_cslsh_44>i{margin-left:12px;cursor:pointer}._operation_cslsh_44 ._icon-rate_cslsh_54{display:inline-block;width:20px;height:20px;background:url(./images/icon_rate.png) no-repeat center;background-size:contain}._vue-cropper_cslsh_61{border-radius:5px;overflow:hidden}:deep(._el-dialog_cslsh_65){margin-bottom:10vh}:deep(._el-dialog_cslsh_65) ._el-dialog__header_cslsh_68{background:#fff;padding:15px 20px}:deep(._el-dialog_cslsh_65) ._el-dialog__header_cslsh_68 ._el-dialog__title_cslsh_72{color:#212121}:deep(._el-dialog_cslsh_65) ._el-dialog__header_cslsh_68 ._el-dialog__headerbtn_cslsh_75 ._el-dialog__close_cslsh_75{color:#212121}:deep(._el-dialog_cslsh_65) ._el-dialog__body_cslsh_78{padding-top:0}.vue-cropper[data-v-be5e5ddc]{position:relative;width:100%;height:100%;box-sizing:border-box;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;direction:ltr;touch-action:none;text-align:left;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-box[data-v-be5e5ddc],.cropper-box-canvas[data-v-be5e5ddc],.cropper-drag-box[data-v-be5e5ddc],.cropper-crop-box[data-v-be5e5ddc],.cropper-face[data-v-be5e5ddc]{position:absolute;top:0;right:0;bottom:0;left:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-box-canvas img[data-v-be5e5ddc]{position:relative;text-align:left;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transform:none;max-width:none;max-height:none}.cropper-box[data-v-be5e5ddc]{overflow:hidden}.cropper-move[data-v-be5e5ddc]{cursor:move}.cropper-crop[data-v-be5e5ddc]{cursor:crosshair}.cropper-modal[data-v-be5e5ddc]{background:rgba(0,0,0,.5)}.cropper-view-box[data-v-be5e5ddc]{display:block;overflow:hidden;width:100%;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-view-box img[data-v-be5e5ddc]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:left;max-width:none;max-height:none}.cropper-face[data-v-be5e5ddc]{top:0;left:0;background-color:#fff;opacity:.1}.crop-info[data-v-be5e5ddc]{position:absolute;left:0px;min-width:65px;text-align:center;color:#fff;line-height:20px;background-color:rgba(0,0,0,.8);font-size:12px}.crop-line[data-v-be5e5ddc]{position:absolute;display:block;width:100%;height:100%;opacity:.1}.line-w[data-v-be5e5ddc]{top:-3px;left:0;height:5px;cursor:n-resize}.line-a[data-v-be5e5ddc]{top:0;left:-3px;width:5px;cursor:w-resize}.line-s[data-v-be5e5ddc]{bottom:-3px;left:0;height:5px;cursor:s-resize}.line-d[data-v-be5e5ddc]{top:0;right:-3px;width:5px;cursor:e-resize}.crop-point[data-v-be5e5ddc]{position:absolute;width:8px;height:8px;opacity:.75;background-color:#39f;border-radius:100%}.point1[data-v-be5e5ddc]{top:-4px;left:-4px;cursor:nw-resize}.point2[data-v-be5e5ddc]{top:-5px;left:50%;margin-left:-3px;cursor:n-resize}.point3[data-v-be5e5ddc]{top:-4px;right:-4px;cursor:ne-resize}.point4[data-v-be5e5ddc]{top:50%;left:-4px;margin-top:-3px;cursor:w-resize}.point5[data-v-be5e5ddc]{top:50%;right:-4px;margin-top:-3px;cursor:e-resize}.point6[data-v-be5e5ddc]{bottom:-5px;left:-4px;cursor:sw-resize}.point7[data-v-be5e5ddc]{bottom:-5px;left:50%;margin-left:-3px;cursor:s-resize}.point8[data-v-be5e5ddc]{bottom:-5px;right:-4px;cursor:se-resize}@media screen and (max-width: 500px){.crop-point[data-v-be5e5ddc]{position:absolute;width:20px;height:20px;opacity:.45;background-color:#39f;border-radius:100%}.point1[data-v-be5e5ddc]{top:-10px;left:-10px}.point2[data-v-be5e5ddc],.point4[data-v-be5e5ddc],.point5[data-v-be5e5ddc],.point7[data-v-be5e5ddc]{display:none}.point3[data-v-be5e5ddc]{top:-10px;right:-10px}.point4[data-v-be5e5ddc]{top:0;left:0}.point6[data-v-be5e5ddc]{bottom:-10px;left:-10px}.point8[data-v-be5e5ddc]{bottom:-10px;right:-10px}}\n",document.head.appendChild(s),System.register(["./icon_upload-legacy.2ac077e3.js","./index-legacy.9707ed2d.js"],(function(e){"use strict";var o,a,s,c,h,p,l,u,d,f,g,v,m,w,x,b,y,A,C,L,_,M,S,O,k;return{setters:[function(e){o=e.E,a=e.i},function(e){s=e.d,c=e.v,h=e.x,p=e.a0,l=e.a1,u=e.y,d=e.J,f=e.I,g=e.A,v=e.a2,m=e.b,w=e.bX,x=e.b5,b=e.c,y=e.aS,A=e.b7,C=e.b8,L=e.H,_=e.bY,M=e.bZ,S=e.a,O=e.bB,k=e.aO}],execute:function(){var I={uploadSection:"_uploadSection_cslsh_1",uploadClass:"_uploadClass_cslsh_11","avatar-upload-preview_range":"_avatar-upload-preview_range_cslsh_19","avatar-upload-preview":"_avatar-upload-preview_cslsh_19",previewImg:"_previewImg_cslsh_34",operation:"_operation_cslsh_44","icon-rate":"_icon-rate_cslsh_54","vue-cropper":"_vue-cropper_cslsh_61","el-dialog":"_el-dialog_cslsh_65","el-dialog__header":"_el-dialog__header_cslsh_68","el-dialog__title":"_el-dialog__title_cslsh_72","el-dialog__headerbtn":"_el-dialog__headerbtn_cslsh_75","el-dialog__close":"_el-dialog__close_cslsh_75","el-dialog__body":"_el-dialog__body_cslsh_78"},E={};E.getData=function(e){return new Promise((function(t,o){var r={};(function(e){var t=null;return new Promise((function(o,r){if(e.src)if(/^data\:/i.test(e.src))t=function(e){e=e.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var t=atob(e),o=t.length,r=new ArrayBuffer(o),i=new Uint8Array(r),n=0;n=8&&(s=o+r));if(s)for(l=p.getUint16(s,i),h=0;h=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==o.return||o.return()}finally{if(c)throw a}}}}(t);try{for(a.s();!(o=a.n()).done;){var s=i(o.value,2),c=s[0],h=s[1];r[c]=h}}catch(p){a.e(p)}finally{a.f()}return r},Y=s({data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:function(){return[1,1]}},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:function(){return 10}}},computed:{cropInfo:function(){var e={};if(e.top=this.cropOffsertY>21?"-21px":"0px",e.width=this.cropW>0?this.cropW:0,e.height=this.cropH>0?this.cropH:0,this.infoTrue){var t=1;this.high&&!this.full&&(t=window.devicePixelRatio),1!==this.enlarge&!this.full&&(t=Math.abs(Number(this.enlarge))),e.width=e.width*t,e.height=e.height*t,this.full&&(e.width=e.width/this.scale,e.height=e.height/this.scale)}return e.width=e.width.toFixed(0),e.height=e.height.toFixed(0),e},isIE:function(){var e=!!window.ActiveXObject||"ActiveXObject"in window;return e},passive:function(){return this.isIE?null:{passive:!1}}},watch:{img:function(){this.checkedImg()},imgs:function(e){""!==e&&this.reload()},cropW:function(){this.showPreview()},cropH:function(){this.showPreview()},cropOffsertX:function(){this.showPreview()},cropOffsertY:function(){this.showPreview()},scale:function(e,t){this.showPreview()},x:function(){this.showPreview()},y:function(){this.showPreview()},autoCrop:function(e){e&&this.goAutoCrop()},autoCropWidth:function(){this.autoCrop&&this.goAutoCrop()},autoCropHeight:function(){this.autoCrop&&this.goAutoCrop()},mode:function(){this.checkedImg()},rotate:function(){this.showPreview(),(this.autoCrop||this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion:function(e){for(var t=navigator.userAgent.split(" "),o="",r=new RegExp(e,"i"),i=0;i=81)t=-1;else if(this.getVersion("safari")[0]>=605){var n=this.getVersion("version");n[0]>13&&n[1]>1&&(t=-1)}else{var a=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(a){var s=a[1];((s=s.split("_"))[0]>13||s[0]>=13&&s[1]>=4)&&(t=-1)}}var c=document.createElement("canvas"),h=c.getContext("2d");switch(h.save(),t){case 2:c.width=o,c.height=r,h.translate(o,0),h.scale(-1,1);break;case 3:c.width=o,c.height=r,h.translate(o/2,r/2),h.rotate(180*Math.PI/180),h.translate(-o/2,-r/2);break;case 4:c.width=o,c.height=r,h.translate(0,r),h.scale(1,-1);break;case 5:c.height=o,c.width=r,h.rotate(.5*Math.PI),h.scale(1,-1);break;case 6:c.width=r,c.height=o,h.translate(r/2,o/2),h.rotate(90*Math.PI/180),h.translate(-o/2,-r/2);break;case 7:c.height=o,c.width=r,h.rotate(.5*Math.PI),h.translate(o,-r),h.scale(-1,1);break;case 8:c.height=o,c.width=r,h.translate(r/2,o/2),h.rotate(-90*Math.PI/180),h.translate(-o/2,-r/2);break;default:c.width=o,c.height=r}h.drawImage(e,0,0,o,r),h.restore(),c.toBlob((function(e){var t=URL.createObjectURL(e);URL.revokeObjectURL(i.imgs),i.imgs=t}),"image/"+this.outputType,1)},checkedImg:function(){var e=this;if(null===this.img||""===this.img)return this.imgs="",void this.clearCrop();this.loading=!0,this.scale=1,this.rotate=0,this.clearCrop();var t=new Image;if(t.onload=function(){if(""===e.img)return e.$emit("img-load","error"),!1;var o=t.width,r=t.height;E.getData(t).then((function(i){e.orientation=i.orientation||1;var n=Number(e.maxImgSize);!e.orientation&&on&&(r=r/o*n,o=n),r>n&&(o=o/r*n,r=n),e.checkOrientationImage(t,e.orientation,o,r))}))},t.onerror=function(){e.$emit("img-load","error")},"data"!==this.img.substr(0,4)&&(t.crossOrigin=""),this.isIE){var o=new XMLHttpRequest;o.onload=function(){var e=URL.createObjectURL(this.response);t.src=e},o.open("GET",this.img,!0),o.responseType="blob",o.send()}else t.src=this.img},startMove:function(e){if(e.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in e?e.clientX:e.touches[0].clientX)-this.x,this.moveY=("clientY"in e?e.clientY:e.touches[0].clientY)-this.y,e.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),2==e.touches.length&&(this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("imgMoving",{moving:!0,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=e.offsetX?e.offsetX:e.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=e.offsetY?e.offsetY:e.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale:function(e){var t=this;e.preventDefault();var o=this.scale,r=this.touches[0].clientX,i=this.touches[0].clientY,n=e.touches[0].clientX,a=e.touches[0].clientY,s=this.touches[1].clientX,c=this.touches[1].clientY,h=e.touches[1].clientX,p=e.touches[1].clientY,l=Math.sqrt(Math.pow(r-s,2)+Math.pow(i-c,2)),u=Math.sqrt(Math.pow(n-h,2)+Math.pow(a-p,2))-l,d=1,f=(d=(d=d/this.trueWidth>d/this.trueHeight?d/this.trueHeight:d/this.trueWidth)>.1?.1:d)*u;if(!this.touchNow){if(this.touchNow=!0,u>0?o+=Math.abs(f):u<0&&o>Math.abs(f)&&(o-=Math.abs(f)),this.touches=e.touches,setTimeout((function(){t.touchNow=!1}),8),!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o}},cancelTouchScale:function(e){window.removeEventListener("touchmove",this.touchScale)},moveImg:function(e){var t=this;if(e.preventDefault(),e.touches&&2===e.touches.length)return this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;var o,r,i="clientX"in e?e.clientX:e.touches[0].clientX,n="clientY"in e?e.clientY:e.touches[0].clientY;o=i-this.moveX,r=n-this.moveY,this.$nextTick((function(){if(t.centerBox){var e,i,n,a,s=t.getImgAxis(o,r,t.scale),c=t.getCropAxis(),h=t.trueHeight*t.scale,p=t.trueWidth*t.scale;switch(t.rotate){case 1:case-1:case 3:case-3:e=t.cropOffsertX-t.trueWidth*(1-t.scale)/2+(h-p)/2,i=t.cropOffsertY-t.trueHeight*(1-t.scale)/2+(p-h)/2,n=e-h+t.cropW,a=i-p+t.cropH;break;default:e=t.cropOffsertX-t.trueWidth*(1-t.scale)/2,i=t.cropOffsertY-t.trueHeight*(1-t.scale)/2,n=e-p+t.cropW,a=i-h+t.cropH}s.x1>=c.x1&&(o=e),s.y1>=c.y1&&(r=i),s.x2<=c.x2&&(o=n),s.y2<=c.y2&&(r=a)}t.x=o,t.y=r,t.$emit("imgMoving",{moving:!0,axis:t.getImgAxis()}),t.$emit("img-moving",{moving:!0,axis:t.getImgAxis()})}))},leaveImg:function(e){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("imgMoving",{moving:!1,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg:function(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale:function(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize:function(e){var t=this;e.preventDefault();var o=this.scale,r=e.deltaY||e.wheelDelta;r=navigator.userAgent.indexOf("Firefox")>0?30*r:r,this.isIE&&(r=-r);var i=this.coe,n=(i=i/this.trueWidth>i/this.trueHeight?i/this.trueHeight:i/this.trueWidth)*r;n<0?o+=Math.abs(n):o>Math.abs(n)&&(o-=Math.abs(n));var a=n<0?"add":"reduce";if(a!==this.coeStatus&&(this.coeStatus=a,this.coe=.2),this.scaling||(this.scalingSet=setTimeout((function(){t.scaling=!1,t.coe=t.coe+=.01}),50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o},changeScale:function(e){var t=this.scale;e=e||1;var o=20;if((e*=o=o/this.trueWidth>o/this.trueHeight?o/this.trueHeight:o/this.trueWidth)>0?t+=Math.abs(e):t>Math.abs(e)&&(t-=Math.abs(e)),!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t},createCrop:function(e){var t=this;e.preventDefault();var o="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,r="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;this.$nextTick((function(){var e=o-t.cropX,i=r-t.cropY;if(e>0?(t.cropW=e+t.cropChangeX>t.w?t.w-t.cropChangeX:e,t.cropOffsertX=t.cropChangeX):(t.cropW=t.w-t.cropChangeX+Math.abs(e)>t.w?t.cropChangeX:Math.abs(e),t.cropOffsertX=t.cropChangeX+e>0?t.cropChangeX+e:0),t.fixed){var n=t.cropW/t.fixedNumber[0]*t.fixedNumber[1];n+t.cropOffsertY>t.h?(t.cropH=t.h-t.cropOffsertY,t.cropW=t.cropH/t.fixedNumber[1]*t.fixedNumber[0],t.cropOffsertX=e>0?t.cropChangeX:t.cropChangeX-t.cropW):t.cropH=n,t.cropOffsertY=t.cropOffsertY}else i>0?(t.cropH=i+t.cropChangeY>t.h?t.h-t.cropChangeY:i,t.cropOffsertY=t.cropChangeY):(t.cropH=t.h-t.cropChangeY+Math.abs(i)>t.h?t.cropChangeY:Math.abs(i),t.cropOffsertY=t.cropChangeY+i>0?t.cropChangeY+i:0)}))},changeCropSize:function(e,t,o,r,i){e.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=t,this.canChangeY=o,this.changeCropTypeX=r,this.changeCropTypeY=i,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow:function(e){var t=this;e.preventDefault();var o="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,r="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0,i=this.w,n=this.h,a=0,s=0;if(this.centerBox){var c=this.getImgAxis(),h=c.x2,p=c.y2;a=c.x1>0?c.x1:0,s=c.y1>0?c.y1:0,i>h&&(i=h),n>p&&(n=p)}this.$nextTick((function(){var e=o-t.cropX,c=r-t.cropY;if(t.canChangeX&&(1===t.changeCropTypeX?t.cropOldW-e>0?(t.cropW=i-t.cropChangeX-e<=i-a?t.cropOldW-e:t.cropOldW+t.cropChangeX-a,t.cropOffsertX=i-t.cropChangeX-e<=i-a?t.cropChangeX+e:a):(t.cropW=Math.abs(e)+t.cropChangeX<=i?Math.abs(e)-t.cropOldW:i-t.cropOldW-t.cropChangeX,t.cropOffsertX=t.cropChangeX+t.cropOldW):2===t.changeCropTypeX&&(t.cropOldW+e>0?(t.cropW=t.cropOldW+e+t.cropOffsertX<=i?t.cropOldW+e:i-t.cropOffsertX,t.cropOffsertX=t.cropChangeX):(t.cropW=i-t.cropChangeX+Math.abs(e+t.cropOldW)<=i-a?Math.abs(e+t.cropOldW):t.cropChangeX-a,t.cropOffsertX=i-t.cropChangeX+Math.abs(e+t.cropOldW)<=i-a?t.cropChangeX-Math.abs(e+t.cropOldW):a))),t.canChangeY&&(1===t.changeCropTypeY?t.cropOldH-c>0?(t.cropH=n-t.cropChangeY-c<=n-s?t.cropOldH-c:t.cropOldH+t.cropChangeY-s,t.cropOffsertY=n-t.cropChangeY-c<=n-s?t.cropChangeY+c:s):(t.cropH=Math.abs(c)+t.cropChangeY<=n?Math.abs(c)-t.cropOldH:n-t.cropOldH-t.cropChangeY,t.cropOffsertY=t.cropChangeY+t.cropOldH):2===t.changeCropTypeY&&(t.cropOldH+c>0?(t.cropH=t.cropOldH+c+t.cropOffsertY<=n?t.cropOldH+c:n-t.cropOffsertY,t.cropOffsertY=t.cropChangeY):(t.cropH=n-t.cropChangeY+Math.abs(c+t.cropOldH)<=n-s?Math.abs(c+t.cropOldH):t.cropChangeY-s,t.cropOffsertY=n-t.cropChangeY+Math.abs(c+t.cropOldH)<=n-s?t.cropChangeY-Math.abs(c+t.cropOldH):s))),t.canChangeX&&t.fixed){var h=t.cropW/t.fixedNumber[0]*t.fixedNumber[1];h+t.cropOffsertY>n?(t.cropH=n-t.cropOffsertY,t.cropW=t.cropH/t.fixedNumber[1]*t.fixedNumber[0]):t.cropH=h}if(t.canChangeY&&t.fixed){var p=t.cropH/t.fixedNumber[1]*t.fixedNumber[0];p+t.cropOffsertX>i?(t.cropW=i-t.cropOffsertX,t.cropH=t.cropW/t.fixedNumber[0]*t.fixedNumber[1]):t.cropW=p}}))},checkCropLimitSize:function(){this.cropW,this.cropH;var e=this.limitMinSize,t=new Array;return t=Array.isArray[e]?e:[e,e],[parseFloat(t[0]),parseFloat(t[1])]},changeCropEnd:function(e){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},endCrop:function(){0===this.cropW&&0===this.cropH&&(this.cropping=!1),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop:function(){this.crop=!0},stopCrop:function(){this.crop=!1},clearCrop:function(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove:function(e){if(e.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(e),!1;if(e.touches&&2===e.touches.length)return this.crop=!1,this.startMove(e),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);var t,o,r="clientX"in e?e.clientX:e.touches[0].clientX,i="clientY"in e?e.clientY:e.touches[0].clientY;t=r-this.cropOffsertX,o=i-this.cropOffsertY,this.cropX=t,this.cropY=o,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop:function(e,t){var o=this,r=0,i=0;e&&(e.preventDefault(),r="clientX"in e?e.clientX:e.touches[0].clientX,i="clientY"in e?e.clientY:e.touches[0].clientY),this.$nextTick((function(){var e,n,a=r-o.cropX,s=i-o.cropY;if(t&&(a=o.cropOffsertX,s=o.cropOffsertY),e=a<=0?0:a+o.cropW>o.w?o.w-o.cropW:a,n=s<=0?0:s+o.cropH>o.h?o.h-o.cropH:s,o.centerBox){var c=o.getImgAxis();e<=c.x1&&(e=c.x1),e+o.cropW>c.x2&&(e=c.x2-o.cropW),n<=c.y1&&(n=c.y1),n+o.cropH>c.y2&&(n=c.y2-o.cropH)}o.cropOffsertX=e,o.cropOffsertY=n,o.$emit("cropMoving",{moving:!0,axis:o.getCropAxis()}),o.$emit("crop-moving",{moving:!0,axis:o.getCropAxis()})}))},getImgAxis:function(e,t,o){e=e||this.x,t=t||this.y,o=o||this.scale;var r={x1:0,x2:0,y1:0,y2:0},i=this.trueWidth*o,n=this.trueHeight*o;switch(this.rotate){case 0:r.x1=e+this.trueWidth*(1-o)/2,r.x2=r.x1+this.trueWidth*o,r.y1=t+this.trueHeight*(1-o)/2,r.y2=r.y1+this.trueHeight*o;break;case 1:case-1:case 3:case-3:r.x1=e+this.trueWidth*(1-o)/2+(i-n)/2,r.x2=r.x1+this.trueHeight*o,r.y1=t+this.trueHeight*(1-o)/2+(n-i)/2,r.y2=r.y1+this.trueWidth*o;break;default:r.x1=e+this.trueWidth*(1-o)/2,r.x2=r.x1+this.trueWidth*o,r.y1=t+this.trueHeight*(1-o)/2,r.y2=r.y1+this.trueHeight*o}return r},getCropAxis:function(){var e={x1:0,x2:0,y1:0,y2:0};return e.x1=this.cropOffsertX,e.x2=e.x1+this.cropW,e.y1=this.cropOffsertY,e.y2=e.y1+this.cropH,e},leaveCrop:function(e){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("cropMoving",{moving:!1,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked:function(e){var t=this,o=document.createElement("canvas"),r=new Image,i=this.rotate,n=this.trueWidth,a=this.trueHeight,s=this.cropOffsertX,c=this.cropOffsertY;function h(e,t){o.width=Math.round(e),o.height=Math.round(t)}r.onload=function(){if(0!==t.cropW){var p=o.getContext("2d"),l=1;t.high&!t.full&&(l=window.devicePixelRatio),1!==t.enlarge&!t.full&&(l=Math.abs(Number(t.enlarge)));var u=t.cropW*l,d=t.cropH*l,f=n*t.scale*l,g=a*t.scale*l,v=(t.x-s+t.trueWidth*(1-t.scale)/2)*l,m=(t.y-c+t.trueHeight*(1-t.scale)/2)*l;switch(h(u,d),p.save(),i){case 0:t.full?(h(u/t.scale,d/t.scale),p.drawImage(r,v/t.scale,m/t.scale,f/t.scale,g/t.scale)):p.drawImage(r,v,m,f,g);break;case 1:case-3:t.full?(h(u/t.scale,d/t.scale),v=v/t.scale+(f/t.scale-g/t.scale)/2,m=m/t.scale+(g/t.scale-f/t.scale)/2,p.rotate(90*i*Math.PI/180),p.drawImage(r,m,-v-g/t.scale,f/t.scale,g/t.scale)):(v+=(f-g)/2,m+=(g-f)/2,p.rotate(90*i*Math.PI/180),p.drawImage(r,m,-v-g,f,g));break;case 2:case-2:t.full?(h(u/t.scale,d/t.scale),p.rotate(90*i*Math.PI/180),v/=t.scale,m/=t.scale,p.drawImage(r,-v-f/t.scale,-m-g/t.scale,f/t.scale,g/t.scale)):(p.rotate(90*i*Math.PI/180),p.drawImage(r,-v-f,-m-g,f,g));break;case 3:case-1:t.full?(h(u/t.scale,d/t.scale),v=v/t.scale+(f/t.scale-g/t.scale)/2,m=m/t.scale+(g/t.scale-f/t.scale)/2,p.rotate(90*i*Math.PI/180),p.drawImage(r,-m-f/t.scale,v,f/t.scale,g/t.scale)):(v+=(f-g)/2,m+=(g-f)/2,p.rotate(90*i*Math.PI/180),p.drawImage(r,-m-f,v,f,g));break;default:t.full?(h(u/t.scale,d/t.scale),p.drawImage(r,v/t.scale,m/t.scale,f/t.scale,g/t.scale)):p.drawImage(r,v,m,f,g)}p.restore()}else{var w=n*t.scale,x=a*t.scale,b=o.getContext("2d");switch(b.save(),i){case 0:h(w,x),b.drawImage(r,0,0,w,x);break;case 1:case-3:h(x,w),b.rotate(90*i*Math.PI/180),b.drawImage(r,0,-x,w,x);break;case 2:case-2:h(w,x),b.rotate(90*i*Math.PI/180),b.drawImage(r,-w,-x,w,x);break;case 3:case-1:h(x,w),b.rotate(90*i*Math.PI/180),b.drawImage(r,-w,0,w,x);break;default:h(w,x),b.drawImage(r,0,0,w,x)}b.restore()}e(o)},"data"!==this.img.substr(0,4)&&(r.crossOrigin="Anonymous"),r.src=this.imgs},getCropData:function(e){var t=this;this.getCropChecked((function(o){e(o.toDataURL("image/"+t.outputType,t.outputSize))}))},getCropBlob:function(e){var t=this;this.getCropChecked((function(o){o.toBlob((function(t){return e(t)}),"image/"+t.outputType,t.outputSize)}))},showPreview:function(){var e=this;if(!this.isCanShow)return!1;this.isCanShow=!1,setTimeout((function(){e.isCanShow=!0}),16);var t=this.cropW,o=this.cropH,r=this.scale,i={};i.div={width:"".concat(t,"px"),height:"".concat(o,"px")};var n=(this.x-this.cropOffsertX)/r,a=(this.y-this.cropOffsertY)/r;i.w=t,i.h=o,i.url=this.imgs,i.img={width:"".concat(this.trueWidth,"px"),height:"".concat(this.trueHeight,"px"),transform:"scale(".concat(r,")translate3d(").concat(n,"px, ").concat(a,"px, ").concat(0,"px)rotateZ(").concat(90*this.rotate,"deg)")},i.html='\n
\n
\n \n
\n
'),this.$emit("realTime",i),this.$emit("real-time",i)},reload:function(){var e=this,t=new Image;t.onload=function(){e.w=parseFloat(window.getComputedStyle(e.$refs.cropper).width),e.h=parseFloat(window.getComputedStyle(e.$refs.cropper).height),e.trueWidth=t.width,e.trueHeight=t.height,e.original?e.scale=1:e.scale=e.checkedMode(),e.$nextTick((function(){e.x=-(e.trueWidth-e.trueWidth*e.scale)/2+(e.w-e.trueWidth*e.scale)/2,e.y=-(e.trueHeight-e.trueHeight*e.scale)/2+(e.h-e.trueHeight*e.scale)/2,e.loading=!1,e.autoCrop&&e.goAutoCrop(),e.$emit("img-load","success"),e.$emit("imgLoad","success"),setTimeout((function(){e.showPreview()}),20)}))},t.onerror=function(){e.$emit("imgLoad","error"),e.$emit("img-load","error")},t.src=this.imgs},checkedMode:function(){var e=1,t=(this.trueWidth,this.trueHeight),o=this.mode.split(" ");switch(o[0]){case"contain":this.trueWidth>this.w&&(e=this.w/this.trueWidth),this.trueHeight*e>this.h&&(e=this.h/this.trueHeight);break;case"cover":(t*=e=this.w/this.trueWidth)0,n=(i?this.trueHeight:this.trueWidth)*this.scale,a=(i?this.trueWidth:this.trueHeight)*this.scale;o=no?o:s,c=c>r?r:c,this.fixed&&(c=s/this.fixedNumber[0]*this.fixedNumber[1]),c>this.h&&(s=(c=this.h)/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(s,c)}},changeCrop:function(e,t){var o=this;if(this.centerBox){var r=this.getImgAxis();e>r.x2-r.x1&&(t=(e=r.x2-r.x1)/this.fixedNumber[0]*this.fixedNumber[1]),t>r.y2-r.y1&&(e=(t=r.y2-r.y1)/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=e,this.cropH=t,this.checkCropLimitSize(),this.$nextTick((function(){o.cropOffsertX=(o.w-o.cropW)/2,o.cropOffsertY=(o.h-o.cropH)/2,o.centerBox&&o.moveCrop(null,!0)}))},refresh:function(){var e=this;this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.clearCrop(),this.$nextTick((function(){e.checkedImg()}))},rotateLeft:function(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight:function(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear:function(){this.rotate=0},checkoutImgAxis:function(e,t,o){e=e||this.x,t=t||this.y,o=o||this.scale;var r=!0;if(this.centerBox){var i=this.getImgAxis(e,t,o),n=this.getCropAxis();i.x1>=n.x1&&(r=!1),i.x2<=n.x2&&(r=!1),i.y1>=n.y1&&(r=!1),i.y2<=n.y2&&(r=!1)}return r}},mounted:function(){this.support="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";var e=this,t=navigator.userAgent;this.isIOS=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(t,o,r){for(var i=atob(this.toDataURL(o,r).split(",")[1]),n=i.length,a=new Uint8Array(n),s=0;s