1 line
29 KiB
JavaScript
1 line
29 KiB
JavaScript
|
|
"use strict";(self["webpackChunkaida"]=self["webpackChunkaida"]||[]).push([[87],{2323:function(t,e,i){i.d(e,{AK:function(){return C}});var s=i(6252),h=i(3577),o=i(9963);const r={};function a(t){let e=null;return new Promise(((i,s)=>{if(t.src)if(/^data\:/i.test(t.src))e=n(t.src),i(e);else if(/^blob\:/i.test(t.src)){var h=new FileReader;h.onload=function(t){e=t.target.result,i(e)},c(t.src,(function(t){h.readAsArrayBuffer(t)}))}else{var o=new XMLHttpRequest;o.onload=function(){if(200!=this.status&&0!==this.status)throw"Could not load image";e=o.response,i(e),o=null},o.open("GET",t.src,!0),o.responseType="arraybuffer",o.send(null)}else s("img error")}))}function c(t,e){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="blob",i.onload=function(t){200!=this.status&&0!==this.status||e(this.response)},i.send()}function n(t){t=t.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var e=atob(t),i=e.length,s=new ArrayBuffer(i),h=new Uint8Array(s),o=0;o<i;o++)h[o]=e.charCodeAt(o);return s}function p(t,e,i){var s,h="";for(s=e,i+=e;s<i;s++)h+=String.fromCharCode(t.getUint8(s));return h}function l(t){var e,i,s,h,o,r,a,c,n,l,u=new DataView(t),g=u.byteLength;if(255===u.getUint8(0)&&216===u.getUint8(1)){n=2;while(n<g){if(255===u.getUint8(n)&&225===u.getUint8(n+1)){a=n;break}n++}}if(a&&(i=a+4,s=a+10,"Exif"===p(u,i,4)&&(r=u.getUint16(s),o=18761===r,(o||19789===r)&&42===u.getUint16(s+2,o)&&(h=u.getUint32(s+4,o),h>=8&&(c=s+h)))),c)for(g=u.getUint16(c,o),l=0;l<g;l++)if(n=c+12*l+2,274===u.getUint16(n,o)){n+=8,e=u.getUint16(n,o);break}return e}r.getData=t=>new Promise(((e,i)=>{let s={};a(t).then((t=>{s.arrayBuffer=t,s.orientation=l(t),e(s)})).catch((t=>{i(t)}))}));var u=(t,e)=>{const i=t.__vccOpts||t;for(const[s,h]of e)i[s]=h;return i};const g=(0,s.aZ)({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:()=>[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:()=>10}},computed:{cropInfo(){let t={};if(t.top=this.cropOffsertY>21?"-21px":"0px",t.width=this.cropW>0?this.cropW:0,t.height=this.cropH>0?this.cropH:0,this.infoTrue){let e=1;this.high&&!this.full&&(e=window.devicePixelRatio),1!==this.enlarge&!this.full&&(e=Math.abs(Number(this.enlarge))),t.width=t.width*e,t.height=t.height*e,this.full&&(t.width=t.width/this.scale,t.height=t.height/this.scale)}return t.width=t.width.toFixed(0),t.height=t.height.toFixed(0),t},isIE(){const t=!!window.ActiveXObject||"ActiveXObject"in window;return t},passive(){return this.isIE?null:{passive:!1}}},watch:{img(){this.checkedImg()},imgs(t){""!==t&&this.reload()},cropW(){this.showPreview()},cropH(){this.showPreview()},cropOffsertX(){this.showPreview()},cropOffsertY(){this.showPreview()},scale(t,e){this.showPreview()},x(){this.showPreview()},y(){this.showPreview()},autoCrop(t){t&&this.goAutoCrop()},autoCropWidth(){this.autoCrop&&this.goAutoCrop()},autoCropHeight(){this.autoCrop&&this.goAutoCrop()},mode(){this.checkedImg()}
|