v-avatar-crop
Version:
A Vue.js avatar crop component for mobile Vue手机端头像裁剪
1 lines • 57.2 kB
JavaScript
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("Vue"));else if("function"==typeof define&&define.amd)define(["Vue"],e);else{var n="object"==typeof exports?e(require("Vue")):e(t.Vue);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}("undefined"!=typeof self?self:this,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=60)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(28)("wks"),o=n(19),i=n(0).Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},function(t,e){var n=t.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(4),o=n(38),i=n(25),a=Object.defineProperty;e.f=n(5)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(7);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(17)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(3),o=n(18);t.exports=n(5)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(0),o=n(2),i=n(15),a=n(6),s=n(8),c=function(t,e,n){var u,f,l,p=t&c.F,h=t&c.G,d=t&c.S,v=t&c.P,A=t&c.B,g=t&c.W,m=h?o:o[e]||(o[e]={}),y=m.prototype,b=h?r:d?r[e]:(r[e]||{}).prototype;for(u in h&&(n=e),n)(f=!p&&b&&void 0!==b[u])&&s(m,u)||(l=f?b[u]:n[u],m[u]=h&&"function"!=typeof b[u]?n[u]:A&&f?i(l,r):g&&b[u]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):v&&"function"==typeof l?i(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[u]=l,t&c.R&&y&&!y[u]&&a(y,u,l)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){var r=n(69),o=n(23);t.exports=function(t){return r(o(t))}},function(t,e){t.exports=!0},function(t,e){t.exports={}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t,e,n,r,o,i){var a,s=t=t||{},c=typeof t.default;"object"!==c&&"function"!==c||(a=t,s=t.default);var u,f="function"==typeof s?s.options:s;if(e&&(f.render=e.render,f.staticRenderFns=e.staticRenderFns,f._compiled=!0),n&&(f.functional=!0),o&&(f._scopeId=o),i?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},f._ssrRegister=u):r&&(u=r),u){var l=f.functional,p=l?f.render:f.beforeCreate;l?(f._injectStyles=u,f.render=function(t,e){return u.call(e),p(t,e)}):f.beforeCreate=p?[].concat(p,u):[u]}return{esModule:a,exports:s,options:f}}},function(t,e,n){var r=n(16);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){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)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(3).f,o=n(8),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){"use strict";n.d(e,"a",function(){return a}),e.d=function(){},e.b=function(t){var e=new Blob(["("+t.toString()+")(null)"],{type:"application/javascript"});return URL.createObjectURL(e)},n.d(e,"c",function(){return s});var r,o,i,a=(r=navigator.userAgent,o=/OS (\d)_.* like Mac OS X/g.exec(r),i=/Android (\d.*?);/g.exec(r)||/Android\/(\d.*?) /g.exec(r),{oldIOS:!!o&&+o.pop()<8.3,oldAndroid:!!i&&+i.pop().substr(0,3)<4.5,ios:/\(i[^;]+;( U;)? CPU.+Mac OS X/.test(r),android:/Android/g.test(r),mQQBrowser:/MQQBrowser/g.test(r)});var s=function(t){var e={top:document.documentElement.scrollTop||document.body.scrollTop,left:document.documentElement.scrollLeft||document.body.scrollLeft},n=function(t){return t.getBoundingClientRect()}(t);return{top:e.top+n.top,left:e.left+n.left}}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(7),o=n(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(7);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(41),o=n(29);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(28)("keys"),o=n(19);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(2),o=n(0),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(11)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){"use strict";var r=n(16);t.exports.f=function(t){return new function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)}(t)}},function(t,e,n){e.f=n(1)},function(t,e,n){var r=n(0),o=n(2),i=n(11),a=n(31),s=n(3).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";var r=n(62),o=n(63),i=n(54),a=n(21),s={100:"浏览器不支持",101:"图片文件太大",102:"图片读取失败",103:"图片数量超出限制"};e.a={name:"avatar-input",props:{size:{type:Number,default:4},accept:{type:String,default:"image/*"}},data:function(){return{isCancel:!1}},methods:{$_fileChange:function(t){var e=this,n=t.target.files,o=1024*+this.size*1024,a=void 0,s=0;(i.a.$emit("show",!0),this.isCancel=!1,window.Worker)?((a=this.$_openWebWorker(r.a)).postMessage({files:n,size:o,isWebWorker:!0}),a.onmessage=function(t){e.$_onReaderComplete(t.data),++s===n.length&&e.$_closeWebWorker(a)}):Object(r.a)(window)({files:n,size:o,isWebWorker:!1,complete:this.$_onReaderComplete})},$_openWebWorker:function(t){return new Worker(Object(a.b)(t))},$_onReaderComplete:function(t){var e=this,n=t.errorCode,r=(t.file,t.dataUrl);0===n?Object(o.a)({dataUrl:r,width:2e3,height:2e3,quality:.8}).then(function(t){var n=t.dataUrl,r=t.blob,o=t.width,a=t.height;!e.isCancel&&i.a.$emit("imagePickerInit",{dataUrl:n,blob:r,width:o,height:a})}).catch(function(t){e.$emit("error",t)}):this.$emit("error",s[n])},$_closeWebWorker:function(t){t.terminate()}},mounted:function(){var t=this;i.a.$on("cancel",function(e){t.isCancel=!0,t.$el.value=""}),i.a.$on("success",function(e){t.$emit("success",e)})}}},function(t,e){},function(t,e,n){"use strict";var r=n(66)(!0);n(37)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r=n(11),o=n(9),i=n(39),a=n(6),s=n(12),c=n(67),u=n(20),f=n(72),l=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,d,v,A,g){c(n,e,d);var m,y,b,w=function(t){if(!p&&t in _)return _[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",C="values"==v,E=!1,_=t.prototype,S=_[l]||_["@@iterator"]||v&&_[v],k=S||w(v),O=v?C?w("entries"):k:void 0,P="Array"==e&&_.entries||S;if(P&&(b=f(P.call(new t)))!==Object.prototype&&b.next&&(u(b,x,!0),r||"function"==typeof b[l]||a(b,l,h)),C&&S&&"values"!==S.name&&(E=!0,k=function(){return S.call(this)}),r&&!g||!p&&!E&&_[l]||a(_,l,k),s[e]=k,s[x]=h,v)if(m={values:C?k:w("values"),keys:A?k:w("keys"),entries:O},g)for(y in m)y in _||i(_,y,m[y]);else o(o.P+o.F*(p||E),e,m);return m}},function(t,e,n){t.exports=!n(5)&&!n(17)(function(){return 7!=Object.defineProperty(n(24)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){t.exports=n(6)},function(t,e,n){var r=n(4),o=n(68),i=n(29),a=n(27)("IE_PROTO"),s=function(){},c=function(){var t,e=n(24)("iframe"),r=i.length;for(e.style.display="none",n(43).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[i[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[a]=t):n=c(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(8),o=n(10),i=n(70)(!1),a=n(27)("IE_PROTO");t.exports=function(t,e){var n,s=o(t),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;e.length>c;)r(s,n=e[c++])&&(~i(u,n)||u.push(n));return u}},function(t,e,n){var r=n(22),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(23);t.exports=function(t){return Object(r(t))}},function(t,e,n){n(73);for(var r=n(0),o=n(6),i=n(12),a=n(1)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c<s.length;c++){var u=s[c],f=r[u],l=f&&f.prototype;l&&!l[a]&&o(l,a,u),i[u]=i.Array}},function(t,e,n){var r=n(13),o=n(1)("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:i?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var r=n(4),o=n(16),i=n(1)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[i])?e:o(n)}},function(t,e,n){var r,o,i,a=n(15),s=n(82),c=n(43),u=n(24),f=n(0),l=f.process,p=f.setImmediate,h=f.clearImmediate,d=f.MessageChannel,v=f.Dispatch,A=0,g={},m=function(){var t=+this;if(g.hasOwnProperty(t)){var e=g[t];delete g[t],e()}},y=function(t){m.call(t.data)};p&&h||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return g[++A]=function(){s("function"==typeof t?t:Function(t),e)},r(A),A},h=function(t){delete g[t]},"process"==n(13)(l)?r=function(t){l.nextTick(a(m,t,1))}:v&&v.now?r=function(t){v.now(a(m,t,1))}:d?(i=(o=new d).port2,o.port1.onmessage=y,r=a(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",y,!1)):r="onreadystatechange"in u("script")?function(t){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),m.call(t)}}:function(t){setTimeout(a(m,t,1),0)}),t.exports={set:p,clear:h}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(4),o=n(7),i=n(30);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){"use strict";e.a=function(t){t=t.replace(/^data:([^;]+);base64,/gim,"").replace(/\s/g,"");for(var e=atob(t),n=e.length,r=new ArrayBuffer(n),o=new Uint8Array(r),i=0;i<n;i++)o[i]=e.charCodeAt(i);return r},e.b=function(t){var e=void 0;e=t.split(",")[0].indexOf("base64")>=0?atob(t.split(",")[1]):unescape(t.split(",")[1]);for(var n=t.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(e.length),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return new Blob([r.buffer],{type:n})}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(41),o=n(29).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){"use strict";var r=n(106),o=n.n(r);e.a=new o.a},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(i).concat([o]).join("\n")}var a;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var a=t[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){var r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o=n(114),i={},a=r&&(document.head||document.getElementsByTagName("head")[0]),s=null,c=0,u=!1,f=function(){},l=null,p="data-vue-ssr-id",h="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function d(t){for(var e=0;e<t.length;e++){var n=t[e],r=i[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(A(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(o=0;o<n.parts.length;o++)a.push(A(n.parts[o]));i[n.id]={id:n.id,refs:1,parts:a}}}}function v(){var t=document.createElement("style");return t.type="text/css",a.appendChild(t),t}function A(t){var e,n,r=document.querySelector("style["+p+'~="'+t.id+'"]');if(r){if(u)return f;r.parentNode.removeChild(r)}if(h){var o=c++;r=s||(s=v()),e=y.bind(null,r,o,!1),n=y.bind(null,r,o,!0)}else r=v(),e=function(t,e){var n=e.css,r=e.media,o=e.sourceMap;r&&t.setAttribute("media",r);l.ssrId&&t.setAttribute(p,e.id);o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}t.exports=function(t,e,n,r){u=n,l=r||{};var a=o(t,e);return d(a),function(e){for(var n=[],r=0;r<a.length;r++){var s=a[r];(c=i[s.id]).refs--,n.push(c)}e?d(a=o(t,e)):a=[];for(r=0;r<n.length;r++){var c;if(0===(c=n[r]).refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete i[c.id]}}}};var g,m=(g=[],function(t,e){return g[t]=e,g.filter(Boolean).join("\n")});function y(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=m(e,o);else{var i=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}},function(t,e,n){"use strict";var r,o=n(115),i=n.n(o),a=n(119),s=n(123),c=n(51),u=n(54),f=n(21);e.a={name:"avatar-crop",props:{width:Number,height:Number},data:function(){return{cWidth:0,cHeight:0,avatarTop:0,avatarLeft:0,dataUrl:"",pickerWidth:0,pickerHeight:0,visible:!1}},methods:{$_createAvatar:function(){var t=document.createElement("canvas"),e=t.getContext("2d");t.width=this.width,t.height=this.height;var n=this.$refs.imagePicker.$el,r=parseInt(n.style.left)-this.avatarLeft,o=parseInt(n.style.top)-this.avatarTop;e.drawImage(n,r,o,parseInt(n.style.width),parseInt(n.style.height));var i=void 0;if(f.a.oldIOS||f.a.oldAndroid||f.a.mQQBrowser||!navigator.userAgent){var a=new JPEGEncoder,s=e.getImageData(0,0,t.width,t.height);i=a.encode(s,100)}else i=t.toDataURL("image/jpeg",1);u.a.$emit("success",{dataUrl:i,blob:Object(c.b)(i)}),this.$_cancel(),this.dataUrl="",this.pickerWidth=0},$_cancel:function(){this.visible=!1,u.a.$emit("cancel"),this.dataUrl="",this.pickerWidth=0}},mounted:function(){var t=this;u.a.$on("imagePickerInit",function(e){var n=e.dataUrl,r=(e.blob,e.width),o=e.height;t.dataUrl=n,t.$nextTick(function(e){t.cWidth=t.$el.clientWidth,t.cHeight=t.$el.clientHeight,t.avatarLeft=(t.cWidth-t.width)/2,t.avatarTop=(t.cHeight-t.height)/2;var n=o*t.cWidth/r;t.pickerWidth=t.cWidth,t.pickerHeight=n})}),u.a.$on("show",function(e){t.visible=e})},components:(r={},i()(r,s.a.name,s.a),i()(r,"loading",a.a),r)}},function(t,e,n){"use strict";e.a={name:"loading",computed:{spinnerColor:function(){return this.color||this.$parent.color||"#ccc"}},props:{size:Number,color:String},data:function(){return{spinnerSize:"40px"}}}},function(t,e,n){"use strict";var r=n(21),o=document.querySelector("html"),i=document.querySelector("body");e.a={name:"image-picker",props:{src:String,maxTop:null,maxLeft:null,width:Number,height:Number,avatarWidth:Number,avatarHeight:Number},data:function(){return{drag:!1,touchType:1,startPos:{touchX:0,touchY:0,top:0,left:0,w:0,h:0},startZoom:0}},methods:{move:function(t){if(this.drag)if((r.a.ios||r.a.mQQBrowser||r.a.oldIOS)&&t.preventDefault(),t.stopPropagation(),1===this.touchType){var e=t.touches[0],n=e.clientX,o=e.clientY,i=this.startPos.left+n-this.startPos.touchX,a=this.startPos.top+o-this.startPos.touchY,s=(this.limitElement.clientWidth-this.avatarWidth)/2+this.avatarWidth-this.startPos.w,c=(this.limitElement.clientHeight-this.avatarHeight)/2+this.avatarHeight-this.startPos.h;i=i<=this.maxLeft?i:this.maxLeft,a=a<=this.maxTop?a:this.maxTop,i=i>=s?i:s,a=a>=c?a:c,this.$el.style.left=i+"px",this.$el.style.top=a+"px"}else if(2===this.touchType){var u=t.touches[0],f=t.touches[1],l=Math.floor(Math.sqrt(Math.pow(u.clientX-f.clientX,2)+Math.pow(u.clientY-f.clientY,2)))-this.startZoom,p=this.startPos.w+l;p>2*this.width?(l=0,p=2*this.width):p<this.avatarWidth&&(l=0,p=this.avatarWidth),this.$el.style.width=p+"px",this.$el.style.height=this.startPos.h*p/this.startPos.w+"px",this.$el.style.left=this.startPos.left-(p-this.startPos.w)/2+"px",this.$el.style.top=this.startPos.top-(this.startPos.h*p/this.startPos.w-this.startPos.h)/2+"px"}},up:function(t){if(o.style.overflow=o.getAttribute("old_overflow")||"",i.style.overflow=i.getAttribute("old_overflow")||"",2===this.touchType){var e=parseInt(this.$el.style.left),n=parseInt(this.$el.style.top),r=parseInt(this.$el.style.width),a=parseInt(this.$el.style.height),s=(this.limitElement.clientWidth-this.avatarWidth)/2+this.avatarWidth-r,c=(this.limitElement.clientHeight-this.avatarHeight)/2+this.avatarHeight-a;e=e<=this.maxLeft?e:this.maxLeft,n=n<=this.maxTop?n:this.maxTop,e=e>=s?e:s,n=n>=c?n:c,this.$el.style.webkitTransition="all .3s",this.$el.style.left=e+"px",this.$el.style.top=n+"px"}},start:function(t){if(t.target.hasAttribute("image-dragble")){this.drag=!0,this.touchType=t.touches.length,o.style.overflow="hidden",i.style.overflow="hidden",this.$el.style.webkitTransition="none",this.startPos.w=this.$el.clientWidth,this.startPos.h=this.$el.clientHeight;var e=Object(r.c)(this.limitElement),n=Object(r.c)(this.$el);if(this.startPos.top=n.top-e.top,this.startPos.left=n.left-e.left,1===this.touchType){var a=t.touches[0];this.startPos.touchX=a.clientX,this.startPos.touchY=a.clientY}else if(2===this.touchType){var s=t.touches[0],c=t.touches[1];this.startZoom=Math.floor(Math.sqrt(Math.pow(s.clientX-c.clientX,2)+Math.pow(s.clientY-c.clientY,2)))}}else this.drag=!1},getLimitElement:function(t){var e=t.parentNode,n=e.style.position;return"absolute"===n||"relative"===n||"fixed"===n||"BODY"===e.nodeName?e:this.getLimitElement(e)}},mounted:function(){var t=this,e=this.$el;this.limitElement=this.getLimitElement(e),document.documentElement.addEventListener("touchmove",this.move,{passive:!1}),document.documentElement.addEventListener("touchend",this.up),document.documentElement.addEventListener("touchcancel",this.up),document.documentElement.addEventListener("touchstart",this.start),i.setAttribute("old_overflow",o.style.overflow),i.setAttribute("old_overflow",i.style.overflow),this.$nextTick(function(n){e.style.height=t.height+"px",e.style.width=t.width+"px",e.style.left=0,e.style.top=(t.limitElement.clientHeight-t.height)/2+"px"})},beforeDestroy:function(){document.documentElement.removeEventListener("touchmove",this.move),document.documentElement.removeEventListener("touchend",this.up),document.documentElement.removeEventListener("touchcancel",this.up),document.documentElement.removeEventListener("touchstart",this.start)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(61),o=n(108);n.d(e,"avatarInput",function(){return r.a}),n.d(e,"avatarCrop",function(){return o.a})},function(t,e,n){"use strict";var r=n(34),o=n(107),i=n(14)(r.a,o.a,!1,null,null,null);i.options.__file="src/components/avatar-crop/avatar-input.vue",e.a=i.exports},function(t,e,n){"use strict";e.a=function(t){function e(t){t.files&&(this.files=t.files,this.index=0,this.size=t.size||0,!t.isWebWorker&&t.complete&&(this.callback=t.complete),this.readImage(t.files[this.index]))}e.prototype.readImage=function(t){var e=this,n=this.files&&this.index<this.files.length-1?function(){e.index+=1,e.readImage(e.files[e.index])}:null,r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.callback?e.callback(t):postMessage(t),n&&n()};if(!this.size||t.size<=this.size){var o=new FileReader;o.onload=function(e){var n=e.target.result;r({errorCode:0,file:t,dataUrl:n})},o.onerror=function(){r({errorCode:102})},o.readAsDataURL(t)}else r({errorCode:101})};var n=function(t){return new e(t.data)};if(t)return function(t){return n({data:t})};onmessage=n}},function(t,e,n){"use strict";var r=n(64),o=n.n(r),i=n(51),a=n(21);function s(t,e,n,r,o){var i=function(t,e,n,r){var o={width:t.width,height:t.height};if("5678".indexOf(e)>-1&&(o.width=t.height,o.height=t.width),o.width<n||o.height<r)return o;var i=o.width/o.height;return n&&r?i>=n/r?o.width>n&&(o.width=n,o.height=Math.ceil(n/i)):o.height>r&&(o.height=r,o.width=Math.ceil(r*i)):n?n<o.width&&(o.width=n,o.height=Math.ceil(n/i)):r<o.height&&(o.width=Math.ceil(r*i),o.height=r),(o.width>=3264||o.height>=2448)&&(o.width*=.8,o.height*=.8),o}(t,e,n,r),s=i.width,c=i.height,u=document.createElement("canvas"),f=u.getContext("2d");u.width=s,u.height=c,f.drawImage(t,0,0,s,c);var l=null;switch(e){case 3:f.rotate(180*Math.PI/180),f.drawImage(t,-s,-c,s,c);break;case 6:f.rotate(90*Math.PI/180),f.drawImage(t,0,-s,c,s);break;case 8:f.rotate(270*Math.PI/180),f.drawImage(t,-c,0,c,s);break;case 2:f.translate(s,0),f.scale(-1,1),f.drawImage(t,0,0,s,c);break;case 4:f.translate(s,0),f.scale(-1,1),f.rotate(180*Math.PI/180),f.drawImage(t,-s,-c,s,c);break;case 5:f.translate(s,0),f.scale(-1,1),f.rotate(90*Math.PI/180),f.drawImage(t,0,-s,c,s);break;case 7:f.translate(s,0),f.scale(-1,1),f.rotate(270*Math.PI/180),f.drawImage(t,-c,0,c,s);break;default:f.drawImage(t,0,0,s,c)}if(a.a.oldIOS||a.a.oldAndroid||a.a.mQQBrowser||!navigator.userAgent){var p=new JPEGEncoder,h=f.getImageData(0,0,u.width,u.height);l=p.encode(h,100*o)}else l=u.toDataURL("image/jpeg",o);return{base64:l,width:s,height:c}}(a.a.oldIOS||a.a.oldAndroid||a.a.mQQBrowser||!navigator.userAgent)&&n(90),e.a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.d;return new o.a(function(n,r){var o=t.dataUrl,a=t.width,c=t.height,u=t.quality,f=function(t){var e=Object(i.a)(t),n=new DataView(e);if(65496!==n.getUint16(0,!1))return-2;for(var r=n.byteLength,o=2;o<r;){var a=n.getUint16(o,!1);if(o+=2,65505===a){if(1165519206!==n.getUint32(o+=2,!1))return-1;var s=18761===n.getUint16(o+=6,!1);o+=n.getUint32(o+4,s);var c=n.getUint16(o,s);o+=2;for(var u=0;u<c;u++)if(274===n.getUint16(o+12*u,s))return n.getUint16(o+12*u+8,s)}else{if(65280!=(65280&a))break;o+=n.getUint16(o,!1)}}return-1}(o),l=Object(i.b)(o);if(f>1||u<1||a||c){var p=new Image;p.src=o,p.onload=function(){var t=s(p,f,a,c,u),r=Object(i.b)(t.base64);e(t.base64,r,t.width,t,c),n({dataUrl:t.base64,blob:r,width:t.width,height:t.height})},p.onerror=function(){e(null),r(new Error("image load error"))}}else e(o,l),n({dataUrl:o,blob:l,width:a,height:c})})}},function(t,e,n){t.exports={default:n(65),__esModule:!0}},function(t,e,n){n(35),n(36),n(45),n(76),n(88),n(89),t.exports=n(2).Promise},function(t,e,n){var r=n(22),o=n(23);t.exports=function(t){return function(e,n){var i,a,s=String(o(e)),c=r(n),u=s.length;return c<0||c>=u?t?"":void 0:(i=s.charCodeAt(c))<55296||i>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):i:t?s.slice(c,c+2):a-56320+(i-55296<<10)+65536}}},function(t,e,n){"use strict";var r=n(40),o=n(18),i=n(20),a={};n(6)(a,n(1)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(3),o=n(4),i=n(26);t.exports=n(5)?Object.defineProperties:function(t,e){o(t);for(var n,a=i(e),s=a.length,c=0;s>c;)r.f(t,n=a[c++],e[n]);return t}},function(t,e,n){var r=n(13);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(10),o=n(42),i=n(71);t.exports=function(t){return function(e,n,a){var s,c=r(e),u=o(c.length),f=i(a,u);if(t&&n!=n){for(;u>f;)if((s=c[f++])!=s)return!0}else for(;u>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(22),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},function(t,e,n){var r=n(8),o=n(44),i=n(27)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,n){"use strict";var r=n(74),o=n(75),i=n(12),a=n(10);t.exports=n(37)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var r,o,i,a,s=n(11),c=n(0),u=n(15),f=n(46),l=n(9),p=n(7),h=n(16),d=n(77),v=n(78),A=n(47),g=n(48).set,m=n(83)(),y=n(30),b=n(49),w=n(84),x=n(50),C=c.TypeError,E=c.process,_=E&&E.versions,S=_&&_.v8||"",k=c.Promise,O="process"==f(E),P=function(){},j=o=y.f,M=!!function(){try{var t=k.resolve(1),e=(t.constructor={})[n(1)("species")]=function(t){t(P,P)};return(O||"function"==typeof PromiseRejectionEvent)&&t.then(P)instanceof e&&0!==S.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(t){}}(),B=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},L=function(t,e){if(!t._n){t._n=!0;var n=t._c;m(function(){for(var r=t._v,o=1==t._s,i=0,a=function(e){var n,i,a,s=o?e.ok:e.fail,c=e.resolve,u=e.reject,f=e.domain;try{s?(o||(2==t._h&&I(t),t._h=1),!0===s?n=r:(f&&f.enter(),n=s(r),f&&(f.exit(),a=!0)),n===e.promise?u(C("Promise-chain cycle")):(i=B(n))?i.call(n,c,u):c(n)):u(r)}catch(t){f&&!a&&f.exit(),u(t)}};n.length>i;)a(n[i++]);t._c=[],t._n=!1,e&&!t._h&&T(t)})}},T=function(t){g.call(c,function(){var e,n,r,o=t._v,i=U(t);if(i&&(e=b(function(){O?E.emit("unhandledRejection",o,t):(n=c.onunhandledrejection)?n({promise:t,reason:o}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=O||U(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},U=function(t){return 1!==t._h&&0===(t._a||t._c).length},I=function(t){g.call(c,function(){var e;O?E.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})})},R=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),L(e,!0))},W=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw C("Promise can't be resolved itself");(e=B(t))?m(function(){var r={_w:n,_d:!1};try{e.call(t,u(W,r,1),u(R,r,1))}catch(t){R.call(r,t)}}):(n._v=t,n._s=1,L(n,!1))}catch(t){R.call({_w:n,_d:!1},t)}}};M||(k=function(t){d(this,k,"Promise","_h"),h(t),r.call(this);try{t(u(W,this,1),u(R,this,1))}catch(t){R.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(85)(k.prototype,{then:function(t,e){var n=j(A(this,k));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=O?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&L(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=u(W,t,1),this.reject=u(R,t,1)},y.f=j=function(t){return t===k||t===a?new i(t):o(t)}),l(l.G+l.W+l.F*!M,{Promise:k}),n(20)(k,"Promise"),n(86)("Promise"),a=n(2).Promise,l(l.S+l.F*!M,"Promise",{reject:function(t){var e=j(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(s||!M),"Promise",{resolve:function(t){return x(s&&this===a?k:this,t)}}),l(l.S+l.F*!(M&&n(87)(function(t){k.all(t).catch(P)})),"Promise",{all:function(t){var e=this,n=j(e),r=n.resolve,o=n.reject,i=b(function(){var n=[],i=0,a=1;v(t,!1,function(t){var s=i++,c=!1;n.push(void 0),a++,e.resolve(t).then(function(t){c||(c=!0,n[s]=t,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=j(e),r=n.reject,o=b(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(15),o=n(79),i=n(80),a=n(4),s=n(42),c=n(81),u={},f={};(e=t.exports=function(t,e,n,l,p){var h,d,v,A,g=p?function(){return t}:c(t),m=r(n,l,e?2:1),y=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(i(g)){for(h=s(t.length);h>y;y++)if((A=e?m(a(d=t[y])[0],d[1]):m(t[y]))===u||A===f)return A}else for(v=g.call(t);!(d=v.next()).done;)if((A=o(v,m,d.value,e))===u||A===f)return A}).BREAK=u,e.RETURN=f},function(t,e,n){var r=n(4);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},function(t,e,n){var r=n(12),o=n(1)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},function(t,e,n){var r=n(46),o=n(1)("iterator"),i=n(12);t.exports=n(2).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(0),o=n(48).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n(13)(a);t.exports=function(){var t,e,n,u=function(){var r,o;for(c&&(r=a.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(u)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var f=s.resolve(void 0);n=function(){f.then(u)}}else n=function(){o.call(r,u)};else{var l=!0,p=document.createTextNode("");new i(u).observe(p,{characterData:!0}),n=function(){p.data=l=!l}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},function(t,e,n){var r=n(0).navigator;t.exports=r&&r.userAgent||""},function(t,e,n){var r=n(6);t.exports=function(t,e,n){for(var o in e)n&&t[o]?t[o]=e[o]:r(t,o,e[o]);return t}},function(t,e,n){"use strict";var r=n(0),o=n(2),i=n(3),a=n(5),s=n(1)("species");t.exports=function(t){var e="function"==typeof o[t]?o[t]:r[t];a&&e&&!e[s]&&i.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(1)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},t(i)}catch(t){}return n}},function(t,e,n){"use strict";var r=n(9),o=n(2),i=n(0),a=n(47),s=n(50);r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,o.Promise||i.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then(function(){return n})}:t,n?function(n){return s(e,t()).then(function(){throw n})}:t)}})},function(t,e,n){"use strict";var r=n(9),o=n(30),i=n(49);r(r.S,"Promise",{try:function(t){var e=o.f(this),n=i(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){var e,r,o=n(92),i=n.n(o);e=window,r=function(){return function(t){Math.round;var e,n,r,o,i,a=Math.floor,s=new Array(64),c=new Array(64),u=new Array(64),f=new Array(64),l=new Array(65535),p=new Array(65535),h=new Array(64),d=new Array(64),v=[],A=0,g=7,m=new Array(64),y=new Array(64),b=new Array(64),w=new Array(256),x=new Array(2048),C=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],E=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],_=[0,1,2,3,4,5,6,7,8,9,10,11],S=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],k=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],O=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],P=[0,1,2,3,4,5,6,7,8,9,10,11],j=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],M=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function B(t,e){for(var n=0,r=0,o=new Array,i=1;i<=16;i++){for(var a=1;a<=t[i];a++)o[e[r]]=[],o[e[r]][0]=n,o[e[r]][1]=i,r++,n++;n*=2}return o}function L(t){for(var e=t[0],n=t[1]-1;n>=0;)e&1<<n&&(A|=1<<g),n--,--g<0&&(255==A?(T(255),T(0)):T(A),g=7,A=0)}function T(t){v.push(w[t])}function U(t){T(t>>8&255),T(255&t)}function I(t,e,n,r,o){for(var i,a=o[0],s=o[240],c=function(t,e){var n,r,o,i,a,s,c,u,f,l,p=0;for(f=0;f<8;++f){n=t[p],r=t[p+1],o=t[p+2],i=t[p+3],a=t[p+4],s=t[p+5],c=t[p+6];var d=n+(u=t[p+7]),v=n-u,A=r+c,g=r-c,m=o+s,y=o-s,b=i+a,w=i-a,x=d+b,C=d-b,E=A+m,_=A-m;t[p]=x+E,t[p+4]=x-E;var S=.707106781*(_+C);t[p+2]=C+S,t[p+6]=C-S;var k=.382683433*((x=w+y)-(_=g+v)),O=.5411961*x+k,P=1.306562965*_+k,j=.707106781*(E=y+g),M=v+j,B=v-j;t[p+5]=B+O,t[p+3]=B-O,t[p+1]=M+P,t[p+7]=M-P,p+=8}for(p=0,f=0;f<8;++f){n=t[p],r=t[p+8],o=t[p+16],i=t[p+24],a=t[p+32],s=t[p+40],c=t[p+48];var L=n+(u=t[p+56]),T=n-u,U=r+c,I=r-c,R=o+s,W=o-s,D=i+a,$=i-a,F=L+D,Q=L-D,N=U+R,Y=U-R;t[p]=F+N,t[p+32]=F-N;var H=.707106781*(Y+Q);t[p+16]=Q+H,t[p+48]=Q-H;var q=.382683433*((F=$+W)-(Y=I+T)),z=.5411961*F+q,V=1.306562965*Y+q,G=.707106781*(N=W+I),X=T+G,J=T-G;t[p+40]=J+z,t[p+24]=J-z,t[p+8]=X+V,t[p+56]=X-V,p++}for(f=0;f<64;++f)l=t[f]*e[f],h[f]=l>0?l+.5|0:l-.5|0;return h}(t,e),u=0;u<64;++u)d[C[u]]=c[u];var f=d[0]-n;n=d[0],0==f?L(r[0]):(L(r[p[i=32767+f]]),L(l[i]));for(var v=63;v>0&&0==d[v];v--);if(0==v)return L(a),n;for(var A,g=1;g<=v;){for(var m=g;0==d[g]&&g<=v;++g);var y=g-m;if(y>=16){A=y>>4;for(var b=1;b<=A;++b)L(s);y&=15}i=32767+d[g],L(o[(y<<4)+p[i]]),L(l[i]),g++}return 63!=v&&L(a),n}function R(t){t<=0&&(t=1),t>100&&(t=100),i!=t&&(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=a((e[n]*t+50)/100);r<1?r=1:r>255&&(r=255),s[C[n]]=r}for(var o=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],i=0;i<64;i++){var l=a((o[i]*t+50)/100);l<1?l=1:l>255&&(l=255),c[C[i]]=l}for(var p=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],h=0,d=0;d<8;d++)for(var v=0;v<8;v++)u[h]=1/(s[C[h]]*p[d]*p[v]*8),f[h]=1/(c[C[h]]*p[d]*p[v]*8),h++}(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),i=t)}this.encode=function(t,i,a){(new Date).getTime();i&&R(i),v=new Array,A=0,g=7,U(65496),U(65504),U(16),T(74),T(70),T(73),T(70),T(0),T(1),T(1),T(0),U(1),U(1),T(0),T(0),function(){U(65499),U(132),T(0);for(var t=0;t<64;t++)T(s[t]);T(1);for(var e=0;e<64;e++)T(c[e])}(),function(t,e){U(65472),U(17),T(8),U(e),U(t),T(3),T(1),T(17),T(0),T(2),T(17),T(1),T(3),T(17),T(1)}(t.width,t.height),function(){U(65476),U(418),T(0);for(var t=0;t<16;t++)T(E[t+1]);for(var e=0;e<=11;e++)T(_[e]);T(16);for(var n=0;n<16;n++)T(S[n+1]);for(var r=0;r<=161;r++)T(k[r]);T(1);for(var o=0;o<16;o++)T(O[o+1]);for(var i=0;i<=11;i++)T(P[i]);T(17);for(var a=0;a<16;a++)T(j[a+1]);for(var s=0;s<=161;s++)T(M[s])}(),U(65498),U(12),T(3),T(1),T(0),T(2),T(17),T(3),T(17),T(0),T(63),T(0);var l=0,p=0,h=0;A=0,g=7,this.encode.displayName="_encode_";for(var d,w,C,B,W,D,$,F,Q,N=t.data,Y=t.width,H=t.height,q=4*Y,z=0;z<H;){for(d=0;d<q;){for(D=W=q*z+d,$=-1,F=0,Q=0;Q<64;Q++)D=W+(F=Q>>3)*q+($=4*(7&Q)),z+F>=H&&(D-=q*(z+1+F-H)),d+$>=q&&(D-=d+$-q+4),w=N[D++],C=N[D++],B=N[D++],m[Q]=(x[w]+x[C+256>>0]+x[B+512>>0]>>16)-128,y[Q]=(x[w+768>>0]+x[C+1024>>0]+x[B+1280>>0]>>16)-128,b[Q]=(x[w+1280>>0]+x[C+1536>>0]+x[B+1792>>0]>>16)-128;l=I(m,u,l,e,r),p=I(y,f,p,n,o),h=I(b,f,h,n,o),d+=32}z+=8}if(g>=0){var V=[];V[1]=g+1,V[0]=(1<<g+1)-1,L(V)}if(U(65497),a){for(var G=v.length,X=new Uint8Array(G),J=0;J<G;J++)X[J]=v[J].charCodeAt();return v=[],(new Date).getTime(),X}var Z="data:image/jpeg;base64,"+btoa(v.join(""));return v=[],(new Date).getTime(),Z},(new Date).getTime(),t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)w[e]=t(e)}(),e=B(E,_),n=B(O,P),r=B(S,k),o=B(j,M),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)p[32767+r]=n,l[32767+r]=[],l[32767+r][1]=n,l[32767+r][0]=r;for(var o=-(e-1);o<=-t;o++)p[32767+o]=n,l[32767+o]=[],l[32767+o][1]=n,l[32767+o][0]=e-1+o;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)x[t]=19595*t,x[t+256>>0]=38470*t,x[t+512>>0]=7471*t+32768,x[t+768>>0]=-11059*t,x[t+1024>>0]=-21709*t,x[t+1280>>0]=32768*t+8421375,x[t+1536>>0]=-27439*t,x[t+1792>>0]=-5329*t}(),R(t),(new Date).getTime()}},"function"==typeof define&&n(105)?define(function(){return e.JPEGEncoder=r()}):"object"===i()(t)&&t.exports?t.exports=r():e.JPEGEncoder=r()}.call(e,n(91)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,n){"use strict";e.__esModule=!0;var r=a(n(93)),o=a(n(95)),i="function"==typeof o.default&&"symbol"==typeof r.default?function(t){return typeof t}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default&&t!==o.default.prototype?"symbol":typeof t};function a(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof o.default&&"symbol"===i(r.default)?function(t){return void 0===t?"undefined":i(t)}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default&&t!==o.default.prototype?"symbol":void 0===t?"undefined":i(t)}},function(t,e,n){t.exports={default:n(94),__esModule:!0}},function(t,e,n){n(36),n(45),t.exports=n(31).f("iterator")},function(t,e,n){t.exports={default:n(96),__esModule:!0}},function(t,e,n){n(97),n(35),n(103),n(104),t.exports=n(2).Symbol},function(t,e,n){"use strict";var r=n(0),o=n(8),i=n(5),a=n(9),s=n(39),c=n(98).KEY,u=n(17),f=n(28),l=n(20),p=n(19),h=n(1),d=n(31),v=n(32),A=n(99),g=n(100),m=n(4),y=n(7),b=n(44),w=n(10),x=n(25),C=n(18),E=n(40),_=n(101),S=n(102),k=n(52),O=n(3),P=n(26),j=S.f,M=O.f,B=_.f,L=r.Symbol,T=r.JSON,U=T&&T.stringify,I=h("_hidden"),R=h("toPrimitive"),W={}.propertyIsEnumerable,D=f("symbol-registry"),$=f("symbols"),F=f("op-symbols"),Q=Object.prototype,N="function"==typeof L&&!!k.f,Y=r.QObject,H=!Y||!Y.prototype||!Y.prototype.findChild,q=i&&u(function(){return 7!=E(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=j(Q,e);r&&delete Q[e],M(t,e,n),r&&t!==Q&&M(Q,e,r)}:M,z=function(t){var e=$[t]=E(L.prototype);return e._k=t,e},V=N&&"symbol"==typeof L.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof L},G=function(t,e,n){return t===Q&&G(F,e,n),m(t),e=x(e,!0),m(n),o($,e)?(n.enumerable?(o(t,I)&&t[I][e]&&(t[I][e]=!1),n=E(n,{enumerable:C(0,!1)})):(o(t,I)||M(t,I,C(1,{})),t[I][e]=!0),q(t,e,n)):M(t,e,n)},X=function(t,e){m(t);for(var n,r=A(e=w(e)),o=0,i=r.length;i>o;)G(t,n=r[o++],e[n]);return t},J=function(t){var e=W.call(this,t=x(t,!0));return!(this===Q&&o($,t)&&!o(F,t))&&(!(e||!o(this,t)||!o($,t)||o(this,I)&&this[I][t])||e)},Z=function(t,e){if(t=w(t),e=x(e,!0),t!==Q||!o($,e)||o(F,e)){var n=j(t,e);return!n||!o($,e)||o(t,I)&&t[I][e]||(n.enumerable=!0),n}},K=function(t){for(var e,n=B(w(t)),r=[],i=0;n.length>i;)o($,e=n[i++])||e==I||e==c||r.push(e);return r},tt=function(t){for(var e,n=t===Q,r=B(n?F:w(t)),i=[],a=0;r.length>a;)!o($,e=r[a++])||n&&!o(Q,e)||i.push($[e]);return i};N||(s((L=function(){if(this instanceof L)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===Q&&e.call(F,n),o(this,I)&&o(this[I],t)&&(this[I][t]=!1),q(this,t,C(1,n))};return i&&H&&q(Q,t,{configurable:!0,set:e}),z(t)}).prototype,"toString",function(){return this._k}),S.f=Z,O.f=G,n(53).f=_.f=K,n(33).f=J,k.f=tt,i&&!n(11)&&s(Q,"propertyIsEnumerable",J,!0),d.f=function(t){return z(h(t))}),a(a.G+a.W+a.F*!N,{Symbol:L});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)h(et[nt++]);for(var rt=P(h.store),ot=0;rt.length>ot;)v(rt[ot++]);a(a.S+a.F*!N,"Symbol",{for:function(t){return o(D,t+="")?D[t]:D[t]=L(t)},keyFor:function(t){if(!V(t))throw TypeError(t+" is not a symbol!");for(var e in D)if(D[e]===t)return e},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!N,"Object",{create:function(t,e){return void 0===e?E(t):X(E(t),e)},defineProperty:G,defineProperties:X,getOwnPropertyDescriptor:Z,getOwnPropertyNames:K,getOwnPropertySymbols:tt});var it=u(function(){k.f(1)});a(a.S+a.F*it,"Object",{getOwnPropertySymbols:function(t){return k.f(b(t))}}),T&&a(a.S+a.F*(!N||u(function(){var t=L();return"[null]"!=U([t])||"{}"!=U({a:t})||"{}"!=U(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(y(e)||void 0!==t)&&!V(t))return g(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!V(e))return e}),r[1]=e,U.apply(T,r)}}),L.prototype[R]||n(6)(L.prototype,R,L.prototype.valueOf),l(L,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(19)("meta"),o=n(7),i=n(8),a=n(3).f,s=0,c=Object.isExtensible||function(){return!0},u=!n(17)(function(){return c(Object.preventExtensions({}))}),f=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!c(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!i(t,r)){if(!c(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return u&&l.NEED&&c(t)&&!i(t,r)&&f(t),t}}},function(t,e,n){var r=n(26),o=n(52),i=n(33);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var a,s=n(t),c=i.f,u=0;s.length>u;)c.call(t,a=s[u++])&&e.push(a);return e}},function(t,e,n){var r=n(13);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(10),o=n(53).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return a.slice()}}(t):o(r(t))}},function(t,e,n){var r=n(33),o=n(18),i=n(10),a=n(25),s=n(8),c=n(38),u=Object.getOwnPropertyDescriptor;e.f=n(5)?u:function(t,e){if(t=i(t),e=a(e,!0),c)try{return u(t,e)}catch(t){}if(s(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e,n){n(32)("asyncIterator")},function(t,e,n){n(32)("observable")},function(t,e){(function(e){t.exports=e}).call(e,{})},function(e,n){e.exports=t},function(t,e,n){"use strict";var r=function(){var t=this.$createElement;return(this._self._c||t)("input",{attrs:{type:"file",accept:this.accept,ca:""},on:{change:this.$_fileChange}})};r._withStripped=!0;var o={render:r,staticRenderFns:[]};e.a=o},function(t,e,n){"use strict";var r=n(57),o=n(125),i=!1;var a=function(t){i||n(109)},s=n(14)(r.a,o.a,!1,a,"data-v-2150e119",null);s.options.__file="src/components/avatar-crop/avatar-crop.vue",e.a=s.exports},function(t,e,n){var r=n(110);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);n(56)("efba95e2",r,!1,{})},function(t,e,n){var r=n(111);(t.exports=n(55)(!0)).push([t.i,"\n.avatar-crop[data-v-2150e119] {\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n width: 100%;\n height: 100%;\n background: fixed;\n background-color: rgba(0, 0, 0, 0.8);\n}\n.avatar-crop .avatar-shutter[data-v-2150e119] {\n position: absolute;\n outline: 500px solid rgba(0, 0, 0, 0.6);\n pointer-events: none;\n}\n.avatar-crop .image-picker[data-v-2150e119] {\n position: absolute;\n}\n.avatar-crop .icon[data-v-2150e119] {\n width: 30px;\n height: 30px;\n display: inline-block;\n background-size: cover;\n position: absolute;\n top: 20px;\n}\n.avatar-crop .icon.icon-close[data-v-2150e119] {\n left: 20px;\n background-image: url("+r(n(112))+");\n}\n.avatar-crop .icon.icon-check[data-v-2150e119] {\n right: 20px;\n background-image: url("+r(n(113))+");\n}\n","",{version:3,sources:["E:/github/vue-avatar-crop/src/components/avatar-crop/avatar-crop.vue"],names:[],mappings:";AAAA;EACE,mBAAmB;EACnB,OAAO;EACP,QAAQ;EACR,iBAAiB;EACjB,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,qCAAqC;CACtC;AACD;EACE,mBAAmB;EACnB,wCAAwC;EACxC,qBAAqB;CACtB;AACD;EACE,mBAAmB;CACpB;AACD;EACE,YAAY;EACZ,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,mBAAmB;EACnB,UAAU;CACX;AACD;EACE,WAAW;EACX,gDAAgD;CACjD;AACD;EACE,YAAY;EACZ,gDAAgD;CACjD",file:"avatar-crop.vue",sourcesContent:[".avatar-crop {\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n width: 100%;\n height: 100%;\n background: fixed;\n background-color: rgba(0, 0, 0, 0.8);\n}\n.avatar-crop .avatar-shutter {\n position: absolute;\n outline: 500px solid rgba(0, 0, 0, 0.6);\n pointer-events: none;\n}\n.avatar-crop .image-picker {\n position: absolute;\n}\n.avatar-crop .icon {\n width: 30px;\n height: 30px;\n display: inline-block;\n background-size: cover;\n position: absolute;\n top: 20px;\n}\n.avatar-crop .icon.icon-close {\n left: 20px;\n background-image: url('../../assets/close.png');\n}\n.avatar-crop .icon.icon-check {\n right: 20px;\n background-image: url('../../assets/check.png');\n}\n"],sourceRoot:""}])},function(t,e){t.exports=function(t){return"string"!=typeof t?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),/["'() \t\n]/.test(t)?'"'+t.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':t)}},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACe0lEQVRoQ+2YS4oUQRCGv19F8QS6FhE9ic5CxffgC5EZ8Ah6AvECgqIivhCf+FiIFxFFxJ1zhFGUkJDsISep6squyqaqsWozi86J+P8/IjIiUiz4pwXHz0ig7wiOERgj0FGBMYU6Ctj53/+fCJjZQeAGsBW4LulJZ/kiA2Z2DrgG/AKuSvqYYz8rAma2BfgE7AtGDViRdC/HSdMZM7sM3I3OfQYOSHI/U79cAn7uK7AnFg24IOlxk5Npvwfwd2DT