10 lines
35 KiB
JavaScript
10 lines
35 KiB
JavaScript
|
/*!
|
||
|
* Cropper v4.0.0
|
||
|
* https://github.com/fengyuanchen/cropper
|
||
|
*
|
||
|
* Copyright (c) 2014-2018 Chen Fengyuan
|
||
|
* Released under the MIT license
|
||
|
*
|
||
|
* Date: 2018-04-01T06:27:27.267Z
|
||
|
*/
|
||
|
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],i):i(t.jQuery)}(this,function(d){"use strict";d=d&&d.hasOwnProperty("default")?d.default:d;var n="undefined"!=typeof window,r=n?window:{},l="cropper",k="all",T="crop",W="move",E="zoom",H="e",N="w",L="s",O="n",z="ne",Y="nw",X="se",R="sw",h=l+"-crop",t=l+"-disabled",S=l+"-hidden",p=l+"-hide",o=l+"-modal",m=l+"-move",u="action",g="preview",s="crop",c="move",f="none",a="crop",v="cropend",w="cropmove",b="cropstart",x="dblclick",y="load",M=r.PointerEvent?"pointerdown":"touchstart mousedown",C=r.PointerEvent?"pointermove":"touchmove mousemove",D=r.PointerEvent?"pointerup pointercancel":"touchend touchcancel mouseup",B="ready",A="resize",I="wheel mousewheel DOMMouseScroll",j="zoom",U=/^(?:e|w|s|n|se|sw|ne|nw|all|crop|move|zoom)$/,P=/^data:/,q=/^data:image\/jpeg;base64,/,$=/^(?:img|canvas)$/i,Q={viewMode:0,dragMode:s,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F=function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")},Z=function(){function a(t,i){for(var e=0;e<i.length;e++){var a=i[e];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,i,e){return i&&a(t.prototype,i),e&&a(t,e),t}}(),bt=function(t){if(Array.isArray(t)){for(var i=0,e=Array(t.length);i<t.length;i++)e[i]=t[i];return e}return Array.from(t)},e=Number.isNaN||r.isNaN;function K(t){return"number"==typeof t&&!e(t)}function V(t){return void 0===t}function G(t){return"object"===(void 0===t?"undefined":i(t))&&null!==t}var J=Object.prototype.hasOwnProperty;function _(t){if(!G(t))return!1;try{var i=t.constructor,e=i.prototype;return i&&e&&J.call(e,"isPrototypeOf")}catch(t){return!1}}function tt(t){return"function"==typeof t}function it(i,e){if(i&&tt(e))if(Array.isArray(i)||K(i.length)){var t=i.length,a=void 0;for(a=0;a<t&&!1!==e.call(i,i[a],a,i);a+=1);}else G(i)&&Object.keys(i).forEach(function(t){e.call(i,i[t],t,i)});return i}var et=Object.assign||function(e){for(var t=arguments.length,i=Array(1<t?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];return G(e)&&0<i.length&&i.forEach(function(i){G(i)&&Object.keys(i).forEach(function(t){e[t]=i[t]})}),e},at=/\.\d*(?:0|9){12}\d*$/i;function xt(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1e11;return at.test(t)?Math.round(t*i)/i:t}var nt=/^(?:width|height|left|top|marginLeft|marginTop)$/;function ot(t,i){var e=t.style;it(i,function(t,i){nt.test(i)&&K(t)&&(t+="px"),e[i]=t})}function ht(t,i){if(i)if(K(t.length))it(t,function(t){ht(t,i)});else if(t.classList)t.classList.add(i);else{var e=t.className.trim();e?e.indexOf(i)<0&&(t.className=e+" "+i):t.className=i}}function rt(t,i){i&&(K(t.length)?it(t,function(t){rt(t,i)}):t.classList?t.classList.remove(i):0<=t.className.indexOf(i)&&(t.className=t.className.replace(i,"")))}function st(t,i,e){i&&(K(t.length)?it(t,function(t){st(t,i,e)}):e?ht(t,i):rt(t,i))}var ct=/([a-z\d])([A-Z])/g;function dt(t){return t.replace(ct,"$1-$2").toLowerCase()}function lt(t,i){return G(t[i])?t[i]:t.dataset?t.dataset[i]:t.getAttribute("data-"+dt(i))}function pt(t,i,e){G(e)?t[i]=e:t.dataset?t.dataset[i]=e:t.setAttribute("data-"+dt(i),e)}function mt(i,e){if(G(i[e]))try{delete i[e]}catch(t){i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch(t){i.dataset[e]=void
|