UNPKG

h-richedit

Version:
2 lines 43.3 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Hricheditor",[],t):"object"==typeof exports?exports.Hricheditor=t():e.Hricheditor=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=6)}([function(e,t){function n(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var o=r(i);return[n].concat(i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"})).concat([o]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){function r(e){for(var t=0;t<e.length;t++){var n=e[t],r=l[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(o(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var a=[],i=0;i<n.parts.length;i++)a.push(o(n.parts[i]));l[n.id]={id:n.id,refs:1,parts:a}}}}function i(){var e=document.createElement("style");return e.type="text/css",d.appendChild(e),e}function o(e){var t,n,r=document.querySelector("style["+v+'~="'+e.id+'"]');if(r){if(p)return g;r.parentNode.removeChild(r)}if(w){var o=h++;r=f||(f=i()),t=a.bind(null,r,o,!1),n=a.bind(null,r,o,!0)}else r=i(),t=s.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}function a(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=y(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function s(e,t){var n=t.css,r=t.media,i=t.sourceMap;if(r&&e.setAttribute("media",r),m.ssrId&&e.setAttribute(v,t.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var c="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!c)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 u=n(11),l={},d=c&&(document.head||document.getElementsByTagName("head")[0]),f=null,h=0,p=!1,g=function(){},m=null,v="data-vue-ssr-id",w="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,i){p=n,m=i||{};var o=u(e,t);return r(o),function(t){for(var n=[],i=0;i<o.length;i++){var a=o[i],s=l[a.id];s.refs--,n.push(s)}t?(o=u(e,t),r(o)):o=[];for(var i=0;i<n.length;i++){var s=n[i];if(0===s.refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete l[s.id]}}}};var y=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e,t,n,r,i,o){var a,s=e=e||{},c=typeof e.default;"object"!==c&&"function"!==c||(a=e,s=e.default);var u="function"==typeof s?s.options:s;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),i&&(u._scopeId=i);var l;if(o?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=l):r&&(l=r),l){var d=u.functional,f=d?u.render:u.beforeCreate;d?(u._injectStyles=l,u.render=function(e,t){return l.call(t),f(e,t)}):u.beforeCreate=f?[].concat(f,l):[l]}return{esModule:a,exports:s,options:u}}},function(e,t,n){"use strict";var r=n(12),i=n(5),o=n.n(i);t.a={name:"richEditor",data:function(){return{strTitle:this.oldTitle||"",strContent:this.oldContent||""}},props:{placeholder:String,contentplaceholder:String,oldContent:String,width:Number,oldTitle:String,hasTitle:{type:Boolean,default:function(){return!1}},description:String,title:String},components:{editable:r.a},mounted:function(){},methods:{getFile:function(e){var t=this,n=e.target.files[0];o()(n).then(function(e){t.$refs.editor.addImg(e.base64)})},addimg:function(e){this.strContent=this.strContent+'<br><img class="rich-img" src="'+e+'" style="max-width:80%"><br>'}},watch:{strContent:function(e){this.$emit("update:description",this.strContent)},strTitle:function(e){this.$emit("update:title",this.strTitle)},title:function(e){this.strTitle=e},description:function(e){this.strContent=e}}}},function(e,t,n){"use strict";var r=n(5),i=n.n(r);t.a={name:"richEditor",data:function(){return{hasfocus:!1,n:!0}},props:["content","contentplaceholder"],mounted:function(){var e=this;this.content&&(this.$el.innerHTML=this.content),this.$refs.editor.addEventListener("paste",function(t){for(var n=0;n<t.clipboardData.items.length;n++){if("file"===t.clipboardData.items[n].kind&&/image\//.test(t.clipboardData.items[n].type)){var r=t.clipboardData.items[n].getAsFile();e.uploadImg(r),t.preventDefault();break}"string"===t.clipboardData.items[n].kind&&t.clipboardData.items[n].getAsString(function(e){})}}),this.$refs.editor.addEventListener("focus",function(t){e.hasfocus=!0}),this.$refs.editor.addEventListener("blur",function(t){e.hasfocus=!1})},computed:{},methods:{update:function(e){this.$emit("update",e.target.innerHTML)},addImg:function(e){var t=document.createElement("img");t.setAttribute("src",e),t.style="max-width:80%";var n=document.createElement("br");this.$refs.editor.appendChild(n),this.$refs.editor.appendChild(t),this.$emit("addimg",e)},setText:function(e){this.$el.innerHTML=e},uploadImg:function(e){var t=this;if(!e)return!1;i()(e).then(function(e){t.addImg(e.base64)})}},watch:{content:function(e){if(this.n){this.n=!1,this.$el.innerHTML=e;var t=null;window.getSelection?(this.$el.focus(),t=window.getSelection(),t.selectAllChildren(this.$el),t.collapseToEnd()):document.selection&&(t=document.selection.createRange(),t.moveToElementText(this.$el),t.collapse(!1),t.select())}}}}},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){n(6),n(7),e.exports=n(8)},function(e,t,n){(function(t){!function(n){function r(e,t){return function(){e.apply(t,arguments)}}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,r(a,this),r(s,this))}function o(e){var t=this;return null===this._state?void this._deferreds.push(e):void d(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(t){return void e.reject(t)}e.resolve(r)})}function a(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(a,this),r(s,this))}this._state=!0,this._value=e,c.call(this)}catch(e){s.call(this,e)}}function s(e){this._state=!1,this._value=e,c.call(this)}function c(){for(var e=0,t=this._deferreds.length;t>e;e++)o.call(this,this._deferreds[e]);this._deferreds=null}function u(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(e){if(r)return;r=!0,n(e)}}var d="function"==typeof t&&t||function(e){setTimeout(e,1)},f=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=this;return new i(function(r,i){o.call(n,new u(e,t,r,i))})},i.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&f(arguments[0])?arguments[0]:arguments);return new i(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0==--i&&t(e)}catch(e){n(e)}}if(0===e.length)return t([]);for(var i=e.length,o=0;o<e.length;o++)r(o,e[o])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(e){return new i(function(t,n){n(e)})},i.race=function(e){return new i(function(t,n){for(var r=0,i=e.length;i>r;r++)e[r].then(t,n)})},i._setImmediateFn=function(e){d=e},i.prototype.always=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(t,n(2).setImmediate)},function(e,t,n){(function(e,r){function i(e,t){this._id=e,this._clearFn=t}var o=n(3).nextTick,a=Function.prototype.apply,s=Array.prototype.slice,c={},u=0;t.setTimeout=function(){return new i(a.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=u++,r=!(arguments.length<2)&&s.call(arguments,1);return c[n]=!0,o(function(){c[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete c[e]}}).call(t,n(2).setImmediate,n(2).clearImmediate)},function(e,t){function n(){u=!1,a.length?c=a.concat(c):l=-1,c.length&&r()}function r(){if(!u){var e=setTimeout(n);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,u=!1,clearTimeout(e)}}function i(e,t){this.fun=e,this.array=t}function o(){}var a,s=e.exports={},c=[],u=!1,l=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new i(e,t)),1!==c.length||u||setTimeout(r,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=o,s.addListener=o,s.once=o,s.off=o,s.removeListener=o,s.removeAllListeners=o,s.emit=o,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t){var n=function(){try{return new Blob,!0}catch(e){return!1}}()?window.Blob:function(e,t){var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MSBlobBuilder||window.MozBlobBuilder);return e.forEach(function(e){n.append(e)}),n.getBlob(t?t.type:void 0)},r=function(){function e(){var e=this,r=[],i=Array(21).join("-")+(+new Date*(1e16*Math.random())).toString(36),o=XMLHttpRequest.prototype.send;this.getParts=function(){return r.toString()},this.append=function(e,t,n){r.push("--"+i+'\r\nContent-Disposition: form-data; name="'+e+'"'),t instanceof Blob?(r.push('; filename="'+(n||"blob")+'"\r\nContent-Type: '+t.type+"\r\n\r\n"),r.push(t)):r.push("\r\n\r\n"+t),r.push("\r\n")},t++,XMLHttpRequest.prototype.send=function(a){var s,c,u=this;a===e?(r.push("--"+i+"--\r\n"),c=new n(r),s=new FileReader,s.onload=function(){o.call(u,s.result)},s.onerror=function(e){throw e},s.readAsArrayBuffer(c),this.setRequestHeader("Content-Type","multipart/form-data; boundary="+i),0==--t&&(XMLHttpRequest.prototype.send=o)):o.call(this,a)}}var t=0;return e.prototype=Object.create(FormData.prototype),e}();e.exports={Blob:n,FormData:function(){return~navigator.userAgent.indexOf("Android")&&~navigator.vendor.indexOf("Google")&&!~navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.match(/AppleWebKit\/(\d+)/).pop()<=534||/MQQBrowser/g.test(navigator.userAgent)}()?r:FormData}},function(e,t,n){var r,i;(function(){function n(e){return!!e.exifdata}function o(e,t){t=t||e.match(/^data\:([^\;]+)\;base64,/im)[1]||"",e=e.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var n=atob(e),r=n.length,i=new ArrayBuffer(r),o=new Uint8Array(i),a=0;r>a;a++)o[a]=n.charCodeAt(a);return i}function a(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){(200==this.status||0===this.status)&&t(this.response)},n.send()}function s(e,t){function n(n){var r=c(n),i=u(n);e.exifdata=r||{},e.iptcdata=i||{},t&&t.call(e)}if(e.src)if(/^data\:/i.test(e.src)){var r=o(e.src);n(r)}else if(/^blob\:/i.test(e.src)){var i=new FileReader;i.onload=function(e){n(e.target.result)},a(e.src,function(e){i.readAsArrayBuffer(e)})}else{var s=new XMLHttpRequest;s.onload=function(){200==this.status||0===this.status?n(s.response):t(new Error("Could not load image")),s=null},s.open("GET",e.src,!0),s.responseType="arraybuffer",s.send(null)}else if(window.FileReader&&(e instanceof window.Blob||e instanceof window.File)){var i=new FileReader;i.onload=function(e){g&&console.log("Got file of length "+e.target.result.byteLength),n(e.target.result)},i.readAsArrayBuffer(e)}}function c(e){var t=new DataView(e);if(g&&console.log("Got file of length "+e.byteLength),255!=t.getUint8(0)||216!=t.getUint8(1))return g&&console.log("Not a valid JPEG"),!1;for(var n,r=2,i=e.byteLength;i>r;){if(255!=t.getUint8(r))return g&&console.log("Not a valid marker at offset "+r+", found: "+t.getUint8(r)),!1;if(n=t.getUint8(r+1),g&&console.log(n),225==n)return g&&console.log("Found 0xFFE1 marker"),p(t,r+4,t.getUint16(r+2));r+=2+t.getUint16(r+2)}}function u(e){var t=new DataView(e);if(g&&console.log("Got file of length "+e.byteLength),255!=t.getUint8(0)||216!=t.getUint8(1))return g&&console.log("Not a valid JPEG"),!1;for(var n=2,r=e.byteLength;r>n;){if(function(e,t){return 56===e.getUint8(t)&&66===e.getUint8(t+1)&&73===e.getUint8(t+2)&&77===e.getUint8(t+3)&&4===e.getUint8(t+4)&&4===e.getUint8(t+5)}(t,n)){var i=t.getUint8(n+7);i%2!=0&&(i+=1),0===i&&(i=4);return l(e,n+8+i,t.getUint16(n+6+i))}n++}}function l(e,t,n){for(var r,i,o,a,s=new DataView(e),c={},u=t;t+n>u;)28===s.getUint8(u)&&2===s.getUint8(u+1)&&(a=s.getUint8(u+2))in x&&(o=s.getInt16(u+3),o+5,i=x[a],r=h(s,u+5,o),c.hasOwnProperty(i)?c[i]instanceof Array?c[i].push(r):c[i]=[c[i],r]:c[i]=r),u++;return c}function d(e,t,n,r,i){var o,a,s,c=e.getUint16(n,!i),u={};for(s=0;c>s;s++)o=n+12*s+2,a=r[e.getUint16(o,!i)],!a&&g&&console.log("Unknown tag: "+e.getUint16(o,!i)),u[a]=f(e,o,t,n,i);return u}function f(e,t,n,r,i){var o,a,s,c,u,l,d=e.getUint16(t+2,!i),f=e.getUint32(t+4,!i),p=e.getUint32(t+8,!i)+n;switch(d){case 1:case 7:if(1==f)return e.getUint8(t+8,!i);for(o=f>4?p:t+8,a=[],c=0;f>c;c++)a[c]=e.getUint8(o+c);return a;case 2:return o=f>4?p:t+8,h(e,o,f-1);case 3:if(1==f)return e.getUint16(t+8,!i);for(o=f>2?p:t+8,a=[],c=0;f>c;c++)a[c]=e.getUint16(o+2*c,!i);return a;case 4:if(1==f)return e.getUint32(t+8,!i);for(a=[],c=0;f>c;c++)a[c]=e.getUint32(p+4*c,!i);return a;case 5:if(1==f)return u=e.getUint32(p,!i),l=e.getUint32(p+4,!i),s=new Number(u/l),s.numerator=u,s.denominator=l,s;for(a=[],c=0;f>c;c++)u=e.getUint32(p+8*c,!i),l=e.getUint32(p+4+8*c,!i),a[c]=new Number(u/l),a[c].numerator=u,a[c].denominator=l;return a;case 9:if(1==f)return e.getInt32(t+8,!i);for(a=[],c=0;f>c;c++)a[c]=e.getInt32(p+4*c,!i);return a;case 10:if(1==f)return e.getInt32(p,!i)/e.getInt32(p+4,!i);for(a=[],c=0;f>c;c++)a[c]=e.getInt32(p+8*c,!i)/e.getInt32(p+4+8*c,!i);return a}}function h(e,t,n){var r,i="";for(r=t;t+n>r;r++)i+=String.fromCharCode(e.getUint8(r));return i}function p(e,t){if("Exif"!=h(e,t,4))return g&&console.log("Not valid EXIF data! "+h(e,t,4)),!1;var n,r,i,o,a,s=t+6;if(18761==e.getUint16(s))n=!1;else{if(19789!=e.getUint16(s))return g&&console.log("Not valid TIFF data! (no 0x4949 or 0x4D4D)"),!1;n=!0}if(42!=e.getUint16(s+2,!n))return g&&console.log("Not valid TIFF data! (no 0x002A)"),!1;var c=e.getUint32(s+4,!n);if(8>c)return g&&console.log("Not valid TIFF data! (First offset less than 8)",e.getUint32(s+4,!n)),!1;if(r=d(e,s,s+c,w,n),r.ExifIFDPointer){o=d(e,s,s+r.ExifIFDPointer,v,n);for(i in o){switch(i){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":o[i]=b[i][o[i]];break;case"ExifVersion":case"FlashpixVersion":o[i]=String.fromCharCode(o[i][0],o[i][1],o[i][2],o[i][3]);break;case"ComponentsConfiguration":o[i]=b.Components[o[i][0]]+b.Components[o[i][1]]+b.Components[o[i][2]]+b.Components[o[i][3]]}r[i]=o[i]}}if(r.GPSInfoIFDPointer){a=d(e,s,s+r.GPSInfoIFDPointer,y,n);for(i in a){switch(i){case"GPSVersionID":a[i]=a[i][0]+"."+a[i][1]+"."+a[i][2]+"."+a[i][3]}r[i]=a[i]}}return r}var g=!1,m=function(e){return e instanceof m?e:this instanceof m?void(this.EXIFwrapped=e):new m(e)};void 0!==e&&e.exports&&(t=e.exports=m),t.EXIF=m;var v=m.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},w=m.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},y=m.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},b=m.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}},x={120:"caption",110:"credit",25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",122:"captionWriter",105:"headline",116:"copyright",15:"category"};m.getData=function(e,t){return!((e instanceof Image||e instanceof HTMLImageElement)&&!e.complete)&&(n(e)?t&&t.call(e):s(e,t),!0)},m.getTag=function(e,t){return n(e)?e.exifdata[t]:void 0},m.getAllTags=function(e){if(!n(e))return{};var t,r=e.exifdata,i={};for(t in r)r.hasOwnProperty(t)&&(i[t]=r[t]);return i},m.pretty=function(e){if(!n(e))return"";var t,r=e.exifdata,i="";for(t in r)r.hasOwnProperty(t)&&(i+="object"==typeof r[t]?r[t]instanceof Number?t+" : "+r[t]+" ["+r[t].numerator+"/"+r[t].denominator+"]\r\n":t+" : ["+r[t].length+" values]\r\n":t+" : "+r[t]+"\r\n");return i},m.readFromBinaryFile=function(e){return c(e)},r=[],void 0!==(i=function(){return m}.apply(t,r))&&(e.exports=i)}).call(this)},function(e,t,n){var r,i;!function(){function n(e){var t=e.naturalWidth;if(t*e.naturalHeight>1048576){var n=document.createElement("canvas");n.width=n.height=1;var r=n.getContext("2d");return r.drawImage(e,1-t,0),0===r.getImageData(0,0,1,1).data[3]}return!1}function o(e,t,n){var r=document.createElement("canvas");r.width=1,r.height=n;var i=r.getContext("2d");i.drawImage(e,0,0);for(var o=i.getImageData(0,0,1,n).data,a=0,s=n,c=n;c>a;){0===o[4*(c-1)+3]?s=c:a=c,c=s+a>>1}var u=c/n;return 0===u?1:u}function a(e,t,n){var r=document.createElement("canvas");return s(e,r,t,n),r.toDataURL("image/jpeg",t.quality||.8)}function s(e,t,r,i){var a=e.naturalWidth,s=e.naturalHeight,u=r.width,l=r.height,d=t.getContext("2d");d.save(),c(t,d,u,l,r.orientation),n(e)&&(a/=2,s/=2);var f=1024,h=document.createElement("canvas");h.width=h.height=f;for(var p=h.getContext("2d"),g=i?o(e,a,s):1,m=Math.ceil(f*u/a),v=Math.ceil(f*l/s/g),w=0,y=0;s>w;){for(var b=0,x=0;a>b;)p.clearRect(0,0,f,f),p.drawImage(e,-b,-w),d.drawImage(h,0,0,f,f,x,y,m,v),b+=f,x+=m;w+=f,y+=v}d.restore(),h=p=null}function c(e,t,n,r,i){switch(i){case 5:case 6:case 7:case 8:e.width=r,e.height=n;break;default:e.width=n,e.height=r}switch(i){case 2:t.translate(n,0),t.scale(-1,1);break;case 3:t.translate(n,r),t.rotate(Math.PI);break;case 4:t.translate(0,r),t.scale(1,-1);break;case 5:t.rotate(.5*Math.PI),t.scale(1,-1);break;case 6:t.rotate(.5*Math.PI),t.translate(0,-r);break;case 7:t.rotate(.5*Math.PI),t.translate(n,-r),t.scale(-1,1);break;case 8:t.rotate(-.5*Math.PI),t.translate(-n,0)}}function u(e){if(window.Blob&&e instanceof Blob){var t=new Image,n=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;if(!n)throw Error("No createObjectURL function found to create blob url");t.src=n.createObjectURL(e),this.blob=e,e=t}if(!e.naturalWidth&&!e.naturalHeight){var r=this;e.onload=function(){var e=r.imageLoadListeners;if(e){r.imageLoadListeners=null;for(var t=0,n=e.length;n>t;t++)e[t]()}},this.imageLoadListeners=[]}this.srcImage=e}u.prototype.render=function(e,t,n){if(this.imageLoadListeners){var r=this;return void this.imageLoadListeners.push(function(){r.render(e,t,n)})}t=t||{};var i=this.srcImage,o=i.src,c=o.length,u=i.naturalWidth,l=i.naturalHeight,d=t.width,f=t.height,h=t.maxWidth,p=t.maxHeight,g=this.blob&&"image/jpeg"===this.blob.type||0===o.indexOf("data:image/jpeg")||o.indexOf(".jpg")===c-4||o.indexOf(".jpeg")===c-5;d&&!f?f=l*d/u<<0:f&&!d?d=u*f/l<<0:(d=u,f=l),h&&d>h&&(d=h,f=l*d/u<<0),p&&f>p&&(f=p,d=u*f/l<<0);var m={width:d,height:f};for(var v in t)m[v]=t[v];var w=e.tagName.toLowerCase();"img"===w?e.src=a(this.srcImage,m,g):"canvas"===w&&s(this.srcImage,e,m,g),"function"==typeof this.onrender&&this.onrender(e),n&&n()},r=[],void 0!==(i=function(){return u}.apply(t,r))&&(e.exports=i)}()},function(e,t){function n(e){function t(e){for(var t=[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;64>n;n++){var r=C((t[n]*e+50)/100);1>r?r=1:r>255&&(r=255),I[B[n]]=r}for(var i=[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],o=0;64>o;o++){var a=C((i[o]*e+50)/100);1>a?a=1:a>255&&(a=255),P[B[o]]=a}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],c=0,u=0;8>u;u++)for(var l=0;8>l;l++)T[c]=1/(I[B[c]]*s[u]*s[l]*8),F[c]=1/(P[B[c]]*s[u]*s[l]*8),c++}function n(e,t){for(var n=0,r=0,i=new Array,o=1;16>=o;o++){for(var a=1;a<=e[o];a++)i[t[r]]=[],i[t[r]][0]=n,i[t[r]][1]=o,r++,n++;n*=2}return i}function r(){w=n(N,H),y=n(W,V),b=n($,z),x=n(q,X)}function i(){for(var e=1,t=2,n=1;15>=n;n++){for(var r=e;t>r;r++)U[32767+r]=n,D[32767+r]=[],D[32767+r][1]=n,D[32767+r][0]=r;for(var i=-(t-1);-e>=i;i++)U[32767+i]=n,D[32767+i]=[],D[32767+i][1]=n,D[32767+i][0]=t-1+i;e<<=1,t<<=1}}function o(){for(var e=0;256>e;e++)k[e]=19595*e,k[e+256>>0]=38470*e,k[e+512>>0]=7471*e+32768,k[e+768>>0]=-11059*e,k[e+1024>>0]=-21709*e,k[e+1280>>0]=32768*e+8421375,k[e+1536>>0]=-27439*e,k[e+1792>>0]=-5329*e}function a(e){for(var t=e[0],n=e[1]-1;n>=0;)t&1<<n&&(_|=1<<M),n--,0>--M&&(255==_?(s(255),s(0)):s(_),M=7,_=0)}function s(e){A.push(G[e])}function c(e){s(e>>8&255),s(255&e)}function u(e,t){var n,r,i,o,a,s,c,u,l,d=0;for(l=0;8>l;++l){n=e[d],r=e[d+1],i=e[d+2],o=e[d+3],a=e[d+4],s=e[d+5],c=e[d+6],u=e[d+7];var f=n+u,h=n-u,p=r+c,g=r-c,m=i+s,v=i-s,w=o+a,y=o-a,b=f+w,x=f-w,S=p+m,C=p-m;e[d]=b+S,e[d+4]=b-S;var I=.707106781*(C+x);e[d+2]=x+I,e[d+6]=x-I,b=y+v,S=v+g,C=g+h;var P=.382683433*(b-C),T=.5411961*b+P,F=1.306562965*C+P,D=.707106781*S,U=h+D,L=h-D;e[d+5]=L+T,e[d+3]=L-T,e[d+1]=U+F,e[d+7]=U-F,d+=8}for(d=0,l=0;8>l;++l){n=e[d],r=e[d+8],i=e[d+16],o=e[d+24],a=e[d+32],s=e[d+40],c=e[d+48],u=e[d+56];var A=n+u,_=n-u,M=r+c,E=r-c,O=i+s,j=i-s,G=o+a,k=o-a,B=A+G,N=A-G,H=M+O,$=M-O;e[d]=B+H,e[d+32]=B-H;var z=.707106781*($+N);e[d+16]=N+z,e[d+48]=N-z,B=k+j,H=j+E,$=E+_;var W=.382683433*(B-$),V=.5411961*B+W,q=1.306562965*$+W,X=.707106781*H,Q=_+X,Y=_-X;e[d+40]=Y+V,e[d+24]=Y-V,e[d+8]=Q+q,e[d+56]=Q-q,d++}var J;for(l=0;64>l;++l)J=e[l]*t[l],R[l]=J>0?J+.5|0:J-.5|0;return R}function l(){c(65504),c(16),s(74),s(70),s(73),s(70),s(0),s(1),s(1),s(0),c(1),c(1),s(0),s(0)}function d(e,t){c(65472),c(17),s(8),c(t),c(e),s(3),s(1),s(17),s(0),s(2),s(17),s(1),s(3),s(17),s(1)}function f(){c(65499),c(132),s(0);for(var e=0;64>e;e++)s(I[e]);s(1);for(var t=0;64>t;t++)s(P[t])}function h(){c(65476),c(418),s(0);for(var e=0;16>e;e++)s(N[e+1]);for(var t=0;11>=t;t++)s(H[t]);s(16);for(var n=0;16>n;n++)s($[n+1]);for(var r=0;161>=r;r++)s(z[r]);s(1);for(var i=0;16>i;i++)s(W[i+1]);for(var o=0;11>=o;o++)s(V[o]);s(17);for(var a=0;16>a;a++)s(q[a+1]);for(var u=0;161>=u;u++)s(X[u])}function p(){c(65498),c(12),s(3),s(1),s(0),s(2),s(17),s(3),s(17),s(0),s(63),s(0)}function g(e,t,n,r,i){var o,s=i[0],c=i[240];for(var l=u(e,t),d=0;64>d;++d)L[B[d]]=l[d];var f=L[0]-n;n=L[0],0==f?a(r[0]):(o=32767+f,a(r[U[o]]),a(D[o]));for(var h=63;h>0&&0==L[h];h--);if(0==h)return a(s),n;for(var p,g=1;h>=g;){for(var m=g;0==L[g]&&h>=g;++g);var v=g-m;if(v>=16){p=v>>4;for(var w=1;p>=w;++w)a(c);v&=15}o=32767+L[g],a(i[(v<<4)+U[o]]),a(D[o]),g++}return 63!=h&&a(s),n}function m(){for(var e=String.fromCharCode,t=0;256>t;t++)G[t]=e(t)}function v(e){if(0>=e&&(e=1),e>100&&(e=100),S!=e){var n=0;n=50>e?Math.floor(5e3/e):Math.floor(200-2*e),t(n),S=e}}var w,y,b,x,S,C=(Math.round,Math.floor),I=new Array(64),P=new Array(64),T=new Array(64),F=new Array(64),D=new Array(65535),U=new Array(65535),R=new Array(64),L=new Array(64),A=[],_=0,M=7,E=new Array(64),O=new Array(64),j=new Array(64),G=new Array(256),k=new Array(2048),B=[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],N=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],H=[0,1,2,3,4,5,6,7,8,9,10,11],$=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],z=[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],W=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],V=[0,1,2,3,4,5,6,7,8,9,10,11],q=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],X=[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];this.encode=function(e,t,n){(new Date).getTime();t&&v(t),A=new Array,_=0,M=7,c(65496),l(),f(),d(e.width,e.height),h(),p();var r=0,i=0,o=0;_=0,M=7,this.encode.displayName="_encode_";for(var s,u,m,S,C,I,P,D,U,R=e.data,L=e.width,G=e.height,B=4*L,N=0;G>N;){for(s=0;B>s;){for(C=B*N+s,I=C,P=-1,D=0,U=0;64>U;U++)D=U>>3,P=4*(7&U),I=C+D*B+P,N+D>=G&&(I-=B*(N+1+D-G)),s+P>=B&&(I-=s+P-B+4),u=R[I++],m=R[I++],S=R[I++],E[U]=(k[u]+k[m+256>>0]+k[S+512>>0]>>16)-128,O[U]=(k[u+768>>0]+k[m+1024>>0]+k[S+1280>>0]>>16)-128,j[U]=(k[u+1280>>0]+k[m+1536>>0]+k[S+1792>>0]>>16)-128;r=g(E,T,r,w,b),i=g(O,F,i,y,x),o=g(j,F,o,y,x),s+=32}N+=8}if(M>=0){var H=[];H[1]=M+1,H[0]=(1<<M+1)-1,a(H)}if(c(65497),n){for(var $=A.length,z=new Uint8Array($),W=0;$>W;W++)z[W]=A[W].charCodeAt();return A=[],(new Date).getTime(),z}var V="data:image/jpeg;base64,"+btoa(A.join(""));return A=[],(new Date).getTime(),V},function(){(new Date).getTime();e||(e=50),m(),r(),i(),o(),v(e),(new Date).getTime()}()}e.exports=n},function(e,t,n){function r(e,t){var n=this;if(!e)throw new Error("没有收到图片,可能的解决方案:https://github.com/think2011/localResizeIMG/issues/7");t=t||{},n.defaults={width:null,height:null,fieldName:"file",quality:.7},n.file=e;for(var r in t)t.hasOwnProperty(r)&&(n.defaults[r]=t[r]);return this.init()}function i(e){var t;t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):unescape(e.split(",")[1]);for(var n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length),i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return new a.Blob([r.buffer],{type:n})}n.p=function(e){var t=null;return t=e?[].filter.call(document.scripts,function(t){return-1!==t.src.indexOf(e)})[0]:document.scripts[document.scripts.length-1],t?t.src.substr(0,t.src.lastIndexOf("/")):null}("lrz")+"/",window.URL=window.URL||window.webkitURL;var o=n(1),a=n(4),s=n(5),c=function(e){var t=/OS (\d)_.* like Mac OS X/g.exec(e),n=/Android (\d.*?);/g.exec(e)||/Android\/(\d.*?) /g.exec(e);return{oldIOS:!!t&&+t.pop()<8,oldAndroid:!!n&&+n.pop().substr(0,3)<4.5,iOS:/\(i[^;]+;( U;)? CPU.+Mac OS X/.test(e),android:/Android/g.test(e),mQQBrowser:/MQQBrowser/g.test(e)}}(navigator.userAgent);r.prototype.init=function(){var e=this,t=e.file,n="string"==typeof t,r=/^data:/.test(t),s=new Image,c=document.createElement("canvas"),u=n?t:URL.createObjectURL(t);if(e.img=s,e.blob=u,e.canvas=c,e.fileName=n?r?"base64.jpg":t.split("/").pop():t.name,!document.createElement("canvas").getContext)throw new Error("浏览器不支持canvas");return new o(function(n,o){s.onerror=function(){var e=new Error("加载图片文件失败");throw o(e),e},s.onload=function(){e._getBase64().then(function(e){if(e.length<10){var t=new Error("生成base64失败");throw o(t),t}return e}).then(function(r){var o=null;"object"==typeof e.file&&r.length>e.file.size?(o=new FormData,t=e.file):(o=new a.FormData,t=i(r)),o.append(e.defaults.fieldName,t,e.fileName.replace(/\..+/g,".jpg")),n({formData:o,fileLen:+t.size,base64:r,base64Len:r.length,origin:e.file,file:t});for(var s in e)e.hasOwnProperty(s)&&(e[s]=null);URL.revokeObjectURL(e.blob)})},!r&&(s.crossOrigin="*"),s.src=u})},r.prototype._getBase64=function(){var e=this,t=e.img,n=e.file,r=e.canvas;return new o(function(i){try{s.getData("object"==typeof n?n:t,function(){e.orientation=s.getTag(this,"Orientation"),e.resize=e._getResize(),e.ctx=r.getContext("2d"),r.width=e.resize.width,r.height=e.resize.height,e.ctx.fillStyle="#fff",e.ctx.fillRect(0,0,r.width,r.height),c.oldIOS?e._createBase64ForOldIOS().then(i):e._createBase64().then(i)})}catch(e){throw new Error(e)}})},r.prototype._createBase64ForOldIOS=function(){var e=this,t=e.img,r=e.canvas,i=e.defaults,a=e.orientation;return new o(function(e){!function(){var o=[n(6)];(function(n){var o=new n(t);"5678".indexOf(a)>-1?o.render(r,{width:r.height,height:r.width,orientation:a}):o.render(r,{width:r.width,height:r.height,orientation:a}),e(r.toDataURL("image/jpeg",i.quality))}).apply(null,o)}()})},r.prototype._createBase64=function(){var e=this,t=e.resize,r=e.img,i=e.canvas,a=e.ctx,s=e.defaults;switch(e.orientation){case 3:a.rotate(180*Math.PI/180),a.drawImage(r,-t.width,-t.height,t.width,t.height);break;case 6:a.rotate(90*Math.PI/180),a.drawImage(r,0,-t.width,t.height,t.width);break;case 8:a.rotate(270*Math.PI/180),a.drawImage(r,-t.height,0,t.height,t.width);break;case 2:a.translate(t.width,0),a.scale(-1,1),a.drawImage(r,0,0,t.width,t.height);break;case 4:a.translate(t.width,0),a.scale(-1,1),a.rotate(180*Math.PI/180),a.drawImage(r,-t.width,-t.height,t.width,t.height);break;case 5:a.translate(t.width,0),a.scale(-1,1),a.rotate(90*Math.PI/180),a.drawImage(r,0,-t.width,t.height,t.width);break;case 7:a.translate(t.width,0),a.scale(-1,1),a.rotate(270*Math.PI/180),a.drawImage(r,-t.height,0,t.height,t.width);break;default:a.drawImage(r,0,0,t.width,t.height)}return new o(function(e){c.oldAndroid||c.mQQBrowser||!navigator.userAgent?function(){var t=[n(7)];(function(t){var n=new t,r=a.getImageData(0,0,i.width,i.height);e(n.encode(r,100*s.quality))}).apply(null,t)}():e(i.toDataURL("image/jpeg",s.quality))})},r.prototype._getResize=function(){var e=this,t=e.img,n=e.defaults,r=n.width,i=n.height,o=e.orientation,a={width:t.width,height:t.height};if("5678".indexOf(o)>-1&&(a.width=t.height,a.height=t.width),a.width<r||a.height<i)return a;var s=a.width/a.height;for(r&&i?s>=r/i?a.width>r&&(a.width=r,a.height=Math.ceil(r/s)):a.height>i&&(a.height=i,a.width=Math.ceil(i*s)):r?r<a.width&&(a.width=r,a.height=Math.ceil(r/s)):i&&i<a.height&&(a.width=Math.ceil(i*s),a.height=i);a.width>=3264||a.height>=2448;)a.width*=.8,a.height*=.8;return a},window.lrz=function(e,t){return new r(e,t)},window.lrz.version="4.9.40",e.exports=window.lrz}])})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i={};i.install=function(e,t){e.component("richEditor",r.a)},t.default=i},function(e,t,n){"use strict";var r=n(8);t.a=r.a},function(e,t,n){"use strict";function r(e){n(9)}var i=n(3),o=n(16),a=n(2),s=r,c=a(i.a,o.a,!1,s,"data-v-0dd59d11",null);t.a=c.exports},function(e,t,n){var r=n(10);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(1)("2f0c3dab",r,!0,{})},function(e,t,n){t=e.exports=n(0)(!1),t.push([e.i,".editable[data-v-0dd59d11]{height:200px;width:100%;user-select:text;overflow-y:auto;outline:none;cursor:text}.content[data-v-0dd59d11]{position:relative;overflow:hidden;padding:16px}.title-input[data-v-0dd59d11]{width:100%;border-style:none;background-color:transparent;line-height:20px;padding:8px 0;max-height:32px;outline:none;-webkit-appearance:none}.title-input[data-v-0dd59d11]:before{background-position:bottom;background-size:3px 1px;background-repeat:repeat-x;height:1px;background-color:rgba(0,0,0,.87)}.input[data-v-0dd59d11]{position:absolute;right:0;bottom:0;width:24px;opacity:0}.rich-editor[data-v-0dd59d11]{background-color:#cfd8dc!important;border-color:#cfd8dc!important;border-radius:2px;min-width:0;position:relative;text-decoration:none;-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12)}",""])},function(e,t){e.exports=function(e,t){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i],a=o[0],s=o[1],c=o[2],u=o[3],l={id:e+":"+i,css:s,media:c,sourceMap:u};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}},function(e,t,n){"use strict";function r(e){n(13)}var i=n(4),o=n(15),a=n(2),s=r,c=a(i.a,o.a,!1,s,"data-v-0cd526b8",null);t.a=c.exports},function(e,t,n){var r=n(14);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(1)("e2c1380e",r,!0,{})},function(e,t,n){t=e.exports=n(0)(!1),t.push([e.i,".editor[data-v-0cd526b8]:empty:before{color:#969da0;content:attr(placeholder)}",""])},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{ref:"editor",staticClass:"editor v-html",attrs:{contenteditable:"true",placeholder:e.contentplaceholder||"请输入文字"},on:{input:e.update}})},i=[],o={render:r,staticRenderFns:i};t.a=o},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"100%"}},[n("div",{staticClass:"rich-editor"},[n("div",{staticClass:"content"},[n("svg",{staticClass:"icon",staticStyle:{position:"absolute",right:"0px",bottom:"0px"},attrs:{t:"1533975745402",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2587","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"24",height:"24"}},[n("path",{attrs:{d:"M629.76 814.08l-404.48-5.12c-51.2 0-92.16-40.96-92.16-94.72V396.8c0-51.2 40.96-94.72 94.72-94.72h563.2c51.2 0 94.72 40.96 94.72 94.72v335.36h-51.2V396.8c0-23.04-17.92-43.52-43.52-43.52h-563.2c-23.04 0-43.52 17.92-43.52 43.52v317.44c0 23.04 17.92 43.52 43.52 43.52l404.48 5.12-2.56 51.2z",fill:"#333333","p-id":"2588"}}),e._v(" "),n("path",{attrs:{d:"M718.2848 503.5264l155.4688 196.9152-40.192 31.744-155.4688-196.9408zM591.36 796.16L330.24 496.64l-153.6 161.28-35.84-35.84 192-199.68 296.96 340.48z",fill:"#333333","p-id":"2589"}}),e._v(" "),n("path",{attrs:{d:"M697.9072 517.1456l28.8256 42.3168-190.4128 129.7408-28.8256-42.3168z",fill:"#333333","p-id":"2590"}})]),e._v(" "),e.hasTitle?n("input",{directives:[{name:"model",rawName:"v-model",value:e.strTitle,expression:"strTitle"}],staticClass:"title-input",attrs:{placeholder:e.placeholder||"标题"},domProps:{value:e.strTitle},on:{input:function(t){t.target.composing||(e.strTitle=t.target.value)}}}):e._e(),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.strContent,expression:"strContent"}],attrs:{type:"hidden",id:"target"},domProps:{value:e.strContent},on:{input:function(t){t.target.composing||(e.strContent=t.target.value)}}}),e._v(" "),n("editable",{ref:"editor",staticClass:"editable",attrs:{content:e.strContent,contentplaceholder:e.contentplaceholder},on:{addimg:function(t){e.addimg(t)},update:function(t){e.strContent=t}}}),e._v(" "),n("input",{staticClass:"input",attrs:{id:"imageUpload",type:"file",name:"fileInput",accept:"image/*"},on:{change:e.getFile}})],1)])])},i=[],o={render:r,staticRenderFns:i};t.a=o}])}); //# sourceMappingURL=h-richeditor.js.map