diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a51cd74..9e80f4b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,13 @@ Types of changes: ------------- +## 3.12.1 - 2020-10-09 +### Fixed +- Removing hot loader build paths from the complied library files. + +### Improved +- Decreasing the library size a bit. + ## 3.12.0 - 2020-10-07 ### Fixed - Watermark or added images quality is not destroyed and it would be relative to the edited image. diff --git a/README.md b/README.md index 46f28629..8cd14ad1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ > Repository includes React version and Vanilla JS adapter for standalone usage -[![Release](https://img.shields.io/badge/release-v3.12.0-blue.svg)](https://github.com/scaleflex/filerobot-image-editor/releases) +[![Release](https://img.shields.io/badge/release-v3.12.1-blue.svg)](https://github.com/scaleflex/filerobot-image-editor/releases) [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)](#contributing) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Scaleflex team](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-the%20Scaleflex%20team-6986fa.svg)](https://www.scaleflex.it/en/home) @@ -140,7 +140,7 @@ or use your custom color scheme Use the latest CDNized plugin version: ```html - + ``` ### Quick start diff --git a/build/3.12.0/filerobot-image-editor.min.js b/build/3.12.0/filerobot-image-editor.min.js deleted file mode 100644 index a400b20d..00000000 --- a/build/3.12.0/filerobot-image-editor.min.js +++ /dev/null @@ -1,88 +0,0 @@ -/*! - * - * filerobot-image-editor v3.12.0 - * https://github.com/scaleflex/filerobot-image-editor - * - * Copyright (c) 2019 scaleflex - * Released under the MIT license - * - * Date: 2020-10-07T11:41:04.162Z - * - */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="https://cdn.scaleflex.it/plugins/filerobot-image-editor/3.12.0/",n(n.s=71)}([function(e,t,n){"use strict";e.exports=n(24)},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Ve}));var r=n(7),o=n.n(r),i=n(14),a=n.n(i),l=n(0),c=n.n(l),s=n(15),u=n(8),f=n(9),p=(n(28),n(21)),d=n(22),h=function(e,t){for(var n=[e[0]],r=0,o=t.length;r1?r-1:0),i=1;i0?" Additional arguments: "+o.join(", "):"")));return _(a)}return v(t,e),t}(Error),A=/^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm,D=function(e){var t=""+(e||""),n=[];return t.replace(A,(function(e,t,r){return n.push({componentId:t,matchIndex:r}),e})),n.map((function(e,r){var o=e.componentId,i=e.matchIndex,a=n[r+1];return{componentId:o,cssFromDOM:a?t.slice(i,a.matchIndex):t.slice(i)}}))},P=/^\s*\/\/.*$/gm,L=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!1,compress:!1,semicolon:!0}),M=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!1}),I=[],F=function(e){if(-2===e){var t=I;return I=[],t}},z=a()((function(e){I.push(e)})),H=void 0,B=void 0,N=void 0,U=function(e,t,n){return t>0&&-1!==n.slice(0,t).indexOf(B)&&n.slice(t-B.length,t)!==B?"."+H:e};M.use([function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(B)>0&&(n[0]=n[0].replace(N,U))},z,F]),L.use([z,F]);var W=function(e){return L("",e)};function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&",o=e.join("").replace(P,""),i=t&&n?n+" "+t+" { "+o+" }":o;return H=r,B=t,N=new RegExp("\\"+B+"\\b","g"),M(n||!t?"":t,i)}var V=function(){return n.nc},X=function(e,t,n){n&&((e[t]||(e[t]=Object.create(null)))[n]=!0)},q=function(e,t){e[t]=Object.create(null)},K=function(e){return function(t,n){return void 0!==e[t]&&e[t][n]}},Q=function(e){var t="";for(var n in e)t+=Object.keys(e[n]).join(" ")+" ";return t.trim()},$=function(e){if(e.sheet)return e.sheet;for(var t=e.ownerDocument.styleSheets.length,n=0;n"+e()+""}},te=function(e,t){return function(){var n,r=((n={})[k]=Q(t),n["data-styled-version"]="4.4.1",n),o=V();return o&&(r.nonce=o),c.a.createElement("style",y({},r,{dangerouslySetInnerHTML:{__html:e()}}))}},ne=function(e){return function(){return Object.keys(e)}},re=function(e,t){return e.createTextNode(Z(t))},oe=function e(t,n){var r=void 0===t?Object.create(null):t,o=void 0===n?Object.create(null):n,i=function(e){var t=o[e];return void 0!==t?t:o[e]=[""]},a=function(){var e="";for(var t in o){var n=o[t][0];n&&(e+=Z(t)+n)}return e};return{clone:function(){var t=function(e){var t=Object.create(null);for(var n in e)t[n]=y({},e[n]);return t}(r),n=Object.create(null);for(var i in o)n[i]=[o[i][0]];return e(t,n)},css:a,getIds:ne(o),hasNameForId:K(r),insertMarker:i,insertRules:function(e,t,n){i(e)[0]+=t.join(" "),X(r,e,n)},removeRules:function(e){var t=o[e];void 0!==t&&(t[0]="",q(r,e))},sealed:!1,styleTag:null,toElement:te(a,r),toHTML:ee(a,r)}},ie=function(e,t,n,r,o){if(T&&!n){var i=function(e,t,n){var r=document;e?r=e.ownerDocument:t&&(r=t.ownerDocument);var o=r.createElement("style");o.setAttribute(k,""),o.setAttribute("data-styled-version","4.4.1");var i=V();if(i&&o.setAttribute("nonce",i),o.appendChild(r.createTextNode("")),e&&!t)e.appendChild(o);else{if(!t||!e||!t.parentNode)throw new R(6);t.parentNode.insertBefore(o,n?t:t.nextSibling)}return o}(e,t,r);return j?function(e,t){var n=Object.create(null),r=Object.create(null),o=void 0!==t,i=!1,a=function(t){var o=r[t];return void 0!==o?o:(r[t]=re(e.ownerDocument,t),e.appendChild(r[t]),n[t]=Object.create(null),r[t])},l=function(){var e="";for(var t in r)e+=r[t].data;return e};return{clone:function(){throw new R(5)},css:l,getIds:ne(r),hasNameForId:K(n),insertMarker:a,insertRules:function(e,r,l){for(var c=a(e),s=[],u=r.length,f=0;f0&&(i=!0,t().insertRules(e+"-import",s))},removeRules:function(a){var l=r[a];if(void 0!==l){var c=re(e.ownerDocument,a);e.replaceChild(c,l),r[a]=c,q(n,a),o&&i&&t().removeRules(a+"-import")}},sealed:!1,styleTag:e,toElement:te(l,n),toHTML:ee(l,n)}}(i,o):function(e,t){var n=Object.create(null),r=Object.create(null),o=[],i=void 0!==t,a=!1,l=function(e){var t=r[e];return void 0!==t?t:(r[e]=o.length,o.push(0),q(n,e),r[e])},c=function(){var t=$(e).cssRules,n="";for(var i in r){n+=Z(i);for(var a=r[i],l=J(o,a),c=l-o[a];c0&&(a=!0,t().insertRules(r+"-import",h)),o[u]+=d,X(n,r,s)},removeRules:function(l){var c=r[l];if(void 0!==c&&!1!==e.isConnected){var s=o[c];!function(e,t,n){for(var r=t-n,o=t;o>r;o-=1)e.deleteRule(o)}($(e),J(o,c)-1,s),o[c]=0,q(n,l),i&&a&&t().removeRules(l+"-import")}},sealed:!1,styleTag:e,toElement:te(c,n),toHTML:ee(c,n)}}(i,o)}return oe()},ae=/\s+/,le=void 0;le=T?j?40:1e3:-1;var ce=0,se=void 0,ue=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T?document.head:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g(this,e),this.getImportRuleTag=function(){var e=t.importRuleTag;if(void 0!==e)return e;var n=t.tags[0];return t.importRuleTag=ie(t.target,n?n.styleTag:null,t.forceServer,!0)},ce+=1,this.id=ce,this.forceServer=r,this.target=r?null:n,this.tagMap={},this.deferred={},this.rehydratedNames={},this.ignoreRehydratedNames={},this.tags=[],this.capacity=1,this.clones=[]}return e.prototype.rehydrate=function(){if(!T||this.forceServer)return this;var e=[],t=[],n=!1,r=document.querySelectorAll("style["+k+'][data-styled-version="4.4.1"]'),o=r.length;if(!o)return this;for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];se=new e(void 0,t).rehydrate()},e.prototype.clone=function(){var t=new e(this.target,this.forceServer);return this.clones.push(t),t.tags=this.tags.map((function(e){for(var n=e.getIds(),r=e.clone(),o=0;o1?t-1:0),r=1;r=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return((r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16))^r>>>15)>>>0}var _e=function(e){return String.fromCharCode(e+(e>25?39:97))};function we(e){var t="",n=void 0;for(n=e;n>52;n=Math.floor(n/52))t=_e(n%52)+t;return _e(n%52)+t}function xe(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:E,r=!!n&&e.theme===n.theme,o=e.theme&&!r?e.theme:t||n.theme;return o},ke=/[[\].#*$><+~=|^:(),"'`-]+/g,Te=/(^-|-$)/g;function je(e){return e.replace(ke,"-").replace(Te,"")}function Re(e){return"string"==typeof e&&!0}var Ae={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},De={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Pe=((Ee={})[u.ForwardRef]={$$typeof:!0,render:!0},Ee),Le=Object.defineProperty,Me=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols,Fe=void 0===Ie?function(){return[]}:Ie,ze=Object.getOwnPropertyDescriptor,He=Object.getPrototypeOf,Be=Object.prototype,Ne=Array.prototype;function Ue(e,t,n){if("string"!=typeof t){var r=He(t);r&&r!==Be&&Ue(e,r,n);for(var o=Ne.concat(Me(t),Fe(t)),i=Pe[e.$$typeof]||Ae,a=Pe[t.$$typeof]||Ae,l=o.length,c=void 0,s=void 0;l--;)if(s=o[l],!(De[s]||n&&n[s]||a&&a[s]||i&&i[s])&&(c=ze(t,s)))try{Le(e,s,c)}catch(e){}return e}return e}var We=Object(l.createContext)(),Ye=We.Consumer,Ve=function(e){function t(n){g(this,t);var r=_(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext.bind(r)),r.renderInner=r.renderInner.bind(r),r}return v(t,e),t.prototype.render=function(){return this.props.children?c.a.createElement(We.Consumer,null,this.renderInner):null},t.prototype.renderInner=function(e){var t=this.getContext(this.props.theme,e);return c.a.createElement(We.Provider,{value:t},this.props.children)},t.prototype.getTheme=function(e,t){if(C(e))return e(t);if(null===e||Array.isArray(e)||"object"!==(void 0===e?"undefined":m(e)))throw new R(8);return y({},t,e)},t.prototype.getContext=function(e,t){return this.getTheme(e,t)},t}(l.Component),Xe=(function(){function e(){g(this,e),this.masterSheet=ue.master,this.instance=this.masterSheet.clone(),this.sealed=!1}e.prototype.seal=function(){if(!this.sealed){var e=this.masterSheet.clones.indexOf(this.instance);this.masterSheet.clones.splice(e,1),this.sealed=!0}},e.prototype.collectStyles=function(e){if(this.sealed)throw new R(2);return c.a.createElement(Ke,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.seal(),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.seal(),this.instance.toReactElements()},e.prototype.interleaveWithNodeStream=function(e){throw new R(3)}}(),Object(l.createContext)()),qe=Xe.Consumer,Ke=function(e){function t(n){g(this,t);var r=_(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext),r}return v(t,e),t.prototype.getContext=function(e,t){if(e)return e;if(t)return new ue(t);throw new R(4)},t.prototype.render=function(){var e=this.props,t=e.children,n=e.sheet,r=e.target;return c.a.createElement(Xe.Provider,{value:this.getContext(n,r)},t)},t}(l.Component),Qe={};var $e=function(e){function t(){g(this,t);var n=_(this,e.call(this));return n.attrs={},n.renderOuter=n.renderOuter.bind(n),n.renderInner=n.renderInner.bind(n),n}return v(t,e),t.prototype.render=function(){return c.a.createElement(qe,null,this.renderOuter)},t.prototype.renderOuter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue.master;return this.styleSheet=e,this.props.forwardedComponent.componentStyle.isStatic?this.renderInner():c.a.createElement(Ye,null,this.renderInner)},t.prototype.renderInner=function(e){var t=this.props.forwardedComponent,n=t.componentStyle,r=t.defaultProps,o=(t.displayName,t.foldedComponentIds),i=t.styledComponentId,a=t.target,c=void 0;c=n.isStatic?this.generateAndInjectStyles(E,this.props):this.generateAndInjectStyles(Se(this.props,e,r)||E,this.props);var s=this.props.as||this.attrs.as||a,u=Re(s),f={},d=y({},this.props,this.attrs),h=void 0;for(h in d)"forwardedComponent"!==h&&"as"!==h&&("forwardedRef"===h?f.ref=d[h]:"forwardedAs"===h?f.as=d[h]:u&&!Object(p.a)(h)||(f[h]=d[h]));return this.props.style&&this.attrs.style&&(f.style=y({},this.attrs.style,this.props.style)),f.className=Array.prototype.concat(o,i,c!==i?c:null,this.props.className,this.attrs.className).filter(Boolean).join(" "),Object(l.createElement)(s,f)},t.prototype.buildExecutionContext=function(e,t,n){var r=this,o=y({},t,{theme:e});return n.length?(this.attrs={},n.forEach((function(e){var t,n=e,i=!1,a=void 0,l=void 0;for(l in C(n)&&(n=n(o),i=!0),n)a=n[l],i||!C(a)||(t=a)&&t.prototype&&t.prototype.isReactComponent||S(a)||(a=a(o)),r.attrs[l]=a,o[l]=a})),o):o},t.prototype.generateAndInjectStyles=function(e,t){var n=t.forwardedComponent,r=n.attrs,o=n.componentStyle;n.warnTooManyClasses;return o.isStatic&&!r.length?o.generateAndInjectStyles(E,this.styleSheet):o.generateAndInjectStyles(this.buildExecutionContext(e,t,r),this.styleSheet)},t}(l.Component);function Ge(e,t,n){var r=S(e),o=!Re(e),i=t.displayName,a=void 0===i?function(e){return Re(e)?"styled."+e:"Styled("+O(e)+")"}(e):i,l=t.componentId,s=void 0===l?function(e,t,n){var r="string"!=typeof t?"sc":je(t),o=(Qe[r]||0)+1;Qe[r]=o;var i=r+"-"+e.generateName(r+o);return n?n+"-"+i:i}(Oe,t.displayName,t.parentComponentId):l,u=t.ParentComponent,f=void 0===u?$e:u,p=t.attrs,h=void 0===p?x:p,m=t.displayName&&t.componentId?je(t.displayName)+"-"+t.componentId:t.componentId||s,g=r&&e.attrs?Array.prototype.concat(e.attrs,h).filter(Boolean):h,b=new Oe(r?e.componentStyle.rules.concat(n):n,g,m),v=void 0,_=function(e,t){return c.a.createElement(f,y({},e,{forwardedComponent:v,forwardedRef:t}))};return _.displayName=a,(v=c.a.forwardRef(_)).displayName=a,v.attrs=g,v.componentStyle=b,v.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):x,v.styledComponentId=m,v.target=r?e.target:e,v.withComponent=function(e){var r=t.componentId,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["componentId"]),i=r&&r+"-"+(Re(e)?e:je(O(e)));return Ge(e,y({},o,{attrs:g,componentId:i,ParentComponent:f}),n)},Object.defineProperty(v,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Object(d.a)(e.defaultProps,t):t}}),v.toString=function(){return"."+v.styledComponentId},o&&Ue(v,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,styledComponentId:!0,target:!0,withComponent:!0}),v}var Ze=function(e){return function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;if(!Object(u.isValidElementType)(n))throw new R(1,String(n));var o=function(){return t(n,r,ye.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,y({},r,o))},o.attrs=function(o){return e(t,n,y({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(Ge,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Ze[e]=Ze(e)}));!function(){function e(t,n){g(this,e),this.rules=t,this.componentId=n,this.isStatic=xe(t,x),ue.master.hasId(n)||ue.master.deferredInject(n,[])}e.prototype.createStyles=function(e,t){var n=Y(be(this.rules,e,t),"");t.inject(this.componentId,n)},e.prototype.removeStyles=function(e){var t=this.componentId;e.hasId(t)&&e.remove(t)},e.prototype.renderStyles=function(e,t){this.removeStyles(t),this.createStyles(e,t)}}();T&&(window.scCGSHMRCache={});t.b=Ze}).call(this,n(12))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n1?n-1:0),o=1;o255?255:e}},{key:"copyAttributes",value:function(e,t,n){return null==n&&(n={}),function(){for(var r=[],o=0,i=Array.from(e.attributes);oe?d():!0!==t&&(o=setTimeout(r?h:d,void 0===r?e-p:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),c.cancel=function(){l(),i=!0},c}e.debounce=function(e,n,r){return void 0===r?t(e,n,!1):t(e,r,!1!==n)},e.throttle=t,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(23)},function(e,t,n){"use strict";function r(e,t){for(var n=0;n])/g,y=/([[}=:>])\s+/g,v=/(\{[^{]+?);(?=\})/g,_=/\s{2,}/g,w=/([^\(])(:+) */g,x=/[svh]\w+-[tblr]{2}/,E=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,O=/-self|flex-/g,S=/[^]*?(:[rp][el]a[\w-]+)[^]*/,k=/stretch|:\s*\w+\-(?:conte|avail)/,T=/([^-])(image-set\()/,j="-webkit-",R="-moz-",A="-ms-",D=59,P=125,L=123,M=40,I=41,F=10,z=13,H=32,B=45,N=42,U=44,W=58,Y=47,V=1,X=1,q=0,K=1,Q=1,$=1,G=0,Z=0,J=0,ee=[],te=[],ne=0,re=null,oe=0,ie=1,ae="",le="",ce="";function se(e,t,o,i,a){for(var l,c,u=0,f=0,p=0,d=0,b=0,y=0,v=0,_=0,x=0,C=0,O=0,S=0,k=0,T=0,R=0,A=0,G=0,te=0,re=0,fe=o.length,be=fe-1,ye="",ve="",_e="",we="",xe="",Ee="";R0&&(ve=ve.replace(r,"")),ve.trim().length>0)){switch(v){case H:case 9:case D:case z:case F:break;default:ve+=o.charAt(R)}v=D}if(1===G)switch(v){case L:case P:case D:case 34:case 39:case M:case I:case U:G=0;case 9:case z:case F:case H:break;default:for(G=0,re=R,b=v,R--,v=D;re0&&(++R,v=b);case L:re=fe}}switch(v){case L:for(b=(ve=ve.trim()).charCodeAt(0),O=1,re=++R;R0&&(ve=ve.replace(r,"")),y=ve.charCodeAt(1)){case 100:case 109:case 115:case B:l=t;break;default:l=ee}if(re=(_e=se(t,l,_e,y,a+1)).length,J>0&&0===re&&(re=ve.length),ne>0&&(c=me(3,_e,l=ue(ee,ve,te),t,X,V,re,y,a,i),ve=l.join(""),void 0!==c&&0===(re=(_e=c.trim()).length)&&(y=0,_e="")),re>0)switch(y){case 115:ve=ve.replace(E,he);case 100:case 109:case B:_e=ve+"{"+_e+"}";break;case 107:_e=(ve=ve.replace(h,"$1 $2"+(ie>0?ae:"")))+"{"+_e+"}",_e=1===Q||2===Q&&de("@"+_e,3)?"@"+j+_e+"@"+_e:"@"+_e;break;default:_e=ve+_e,112===i&&(we+=_e,_e="")}else _e="";break;default:_e=se(t,ue(t,ve,te),_e,i,a+1)}xe+=_e,S=0,G=0,T=0,A=0,te=0,k=0,ve="",_e="",v=o.charCodeAt(++R);break;case P:case D:if((re=(ve=(A>0?ve.replace(r,""):ve).trim()).length)>1)switch(0===T&&((b=ve.charCodeAt(0))===B||b>96&&b<123)&&(re=(ve=ve.replace(" ",":")).length),ne>0&&void 0!==(c=me(1,ve,t,e,X,V,we.length,i,a,i))&&0===(re=(ve=c.trim()).length)&&(ve="\0\0"),b=ve.charCodeAt(0),y=ve.charCodeAt(1),b){case 0:break;case 64:if(105===y||99===y){Ee+=ve+o.charAt(R);break}default:if(ve.charCodeAt(re-1)===W)break;we+=pe(ve,b,y,ve.charCodeAt(2))}S=0,G=0,T=0,A=0,te=0,ve="",v=o.charCodeAt(++R)}}switch(v){case z:case F:if(f+d+p+u+Z===0)switch(C){case I:case 39:case 34:case 64:case 126:case 62:case N:case 43:case Y:case B:case W:case U:case D:case L:case P:break;default:T>0&&(G=1)}f===Y?f=0:K+S===0&&107!==i&&ve.length>0&&(A=1,ve+="\0"),ne*oe>0&&me(0,ve,t,e,X,V,we.length,i,a,i),V=1,X++;break;case D:case P:if(f+d+p+u===0){V++;break}default:switch(V++,ye=o.charAt(R),v){case 9:case H:if(d+u+f===0)switch(_){case U:case W:case 9:case H:ye="";break;default:v!==H&&(ye=" ")}break;case 0:ye="\\0";break;case 12:ye="\\f";break;case 11:ye="\\v";break;case 38:d+f+u===0&&K>0&&(te=1,A=1,ye="\f"+ye);break;case 108:if(d+f+u+q===0&&T>0)switch(R-T){case 2:112===_&&o.charCodeAt(R-3)===W&&(q=_);case 8:111===x&&(q=x)}break;case W:d+f+u===0&&(T=R);break;case U:f+p+d+u===0&&(A=1,ye+="\r");break;case 34:case 39:0===f&&(d=d===v?0:0===d?v:d);break;case 91:d+f+p===0&&u++;break;case 93:d+f+p===0&&u--;break;case I:d+f+u===0&&p--;break;case M:if(d+f+u===0){if(0===S)switch(2*_+3*x){case 533:break;default:O=0,S=1}p++}break;case 64:f+p+d+u+T+k===0&&(k=1);break;case N:case Y:if(d+u+p>0)break;switch(f){case 0:switch(2*v+3*o.charCodeAt(R+1)){case 235:f=Y;break;case 220:re=R,f=N}break;case N:v===Y&&_===N&&re+2!==R&&(33===o.charCodeAt(re+2)&&(we+=o.substring(re,R+1)),ye="",f=0)}}if(0===f){if(K+d+u+k===0&&107!==i&&v!==D)switch(v){case U:case 126:case 62:case 43:case I:case M:if(0===S){switch(_){case 9:case H:case F:case z:ye+="\0";break;default:ye="\0"+ye+(v===U?"":"\0")}A=1}else switch(v){case M:T+7===R&&108===_&&(T=0),S=++O;break;case I:0==(S=--O)&&(A=1,ye+="\0")}break;case 9:case H:switch(_){case 0:case L:case P:case D:case U:case 12:case 9:case H:case F:case z:break;default:0===S&&(A=1,ye+="\0")}}ve+=ye,v!==H&&9!==v&&(C=v)}}x=_,_=v,R++}if(re=we.length,J>0&&0===re&&0===xe.length&&0===t[0].length==0&&(109!==i||1===t.length&&(K>0?le:ce)===t[0])&&(re=t.join(",").length+2),re>0){if(l=0===K&&107!==i?function(e){for(var t,n,o=0,i=e.length,a=Array(i);o1)){if(p=c.charCodeAt(c.length-1),d=n.charCodeAt(0),t="",0!==u)switch(p){case N:case 126:case 62:case 43:case H:case M:break;default:t=" "}switch(d){case 38:n=t+le;case 126:case 62:case 43:case H:case I:case M:break;case 91:n=t+n+le;break;case W:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if($>0){n=t+n.substring(8,f-1);break}default:(u<1||l[u-1].length<1)&&(n=t+le+n)}break;case U:t="";default:n=f>1&&n.indexOf(":")>0?t+n.replace(w,"$1"+le+"$2"):t+n+le}c+=n}a[o]=c.replace(r,"").trim()}return a}(t):t,ne>0&&void 0!==(c=me(2,we,l,e,X,V,re,i,a,i))&&0===(we=c).length)return Ee+we+xe;if(we=l.join(",")+"{"+we+"}",Q*q!=0){switch(2!==Q||de(we,2)||(q=0),q){case 111:we=we.replace(g,":-moz-$1")+we;break;case 112:we=we.replace(m,"::"+j+"input-$1")+we.replace(m,"::-moz-$1")+we.replace(m,":-ms-input-$1")+we}q=0}}return Ee+we+xe}function ue(e,t,n){var r=t.trim().split(u),o=r,i=r.length,a=e.length;switch(a){case 0:case 1:for(var l=0,c=0===a?"":e[0]+" ";l0&&K>0)return o.replace(p,"$1").replace(f,"$1"+ce);break;default:return e.trim()+o.replace(f,"$1"+e.trim())}default:if(n*K>0&&o.indexOf("\f")>0)return o.replace(f,(e.charCodeAt(0)===W?"":"$1")+e.trim())}return e+o}function pe(e,t,n,r){var s,u=0,f=e+";",p=2*t+3*n+4*r;if(944===p)return function(e){var t=e.length,n=e.indexOf(":",9)+1,r=e.substring(0,n).trim(),o=e.substring(n,t-1).trim();switch(e.charCodeAt(9)*ie){case 0:break;case B:if(110!==e.charCodeAt(10))break;default:var i=o.split((o="",l)),a=0;for(n=0,t=i.length;a64&&f<90||f>96&&f<123||95===f||f===B&&s.charCodeAt(1)!==B))switch(isNaN(parseFloat(s))+(-1!==s.indexOf("("))){case 1:switch(s){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:s+=ae}}u[n++]=s}o+=(0===a?"":",")+u.join(" ")}}return o=r+o+";",1===Q||2===Q&&de(o,1)?j+o+o:o}(f);if(0===Q||2===Q&&!de(f,1))return f;switch(p){case 1015:return 97===f.charCodeAt(10)?j+f+f:f;case 951:return 116===f.charCodeAt(3)?j+f+f:f;case 963:return 110===f.charCodeAt(5)?j+f+f:f;case 1009:if(100!==f.charCodeAt(4))break;case 969:case 942:return j+f+f;case 978:return j+f+R+f+f;case 1019:case 983:return j+f+R+f+A+f+f;case 883:return f.charCodeAt(8)===B?j+f+f:f.indexOf("image-set(",11)>0?f.replace(T,"$1"+j+"$2")+f:f;case 932:if(f.charCodeAt(4)===B)switch(f.charCodeAt(5)){case 103:return j+"box-"+f.replace("-grow","")+j+f+A+f.replace("grow","positive")+f;case 115:return j+f+A+f.replace("shrink","negative")+f;case 98:return j+f+A+f.replace("basis","preferred-size")+f}return j+f+A+f+f;case 964:return j+f+A+"flex-"+f+f;case 1023:if(99!==f.charCodeAt(8))break;return s=f.substring(f.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),j+"box-pack"+s+j+f+A+"flex-pack"+s+f;case 1005:return i.test(f)?f.replace(o,":"+j)+f.replace(o,":"+R)+f:f;case 1e3:switch(u=(s=f.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(u)){case 226:s=f.replace(x,"tb");break;case 232:s=f.replace(x,"tb-rl");break;case 220:s=f.replace(x,"lr");break;default:return f}return j+f+A+s+f;case 1017:if(-1===f.indexOf("sticky",9))return f;case 975:switch(u=(f=e).length-10,p=(s=(33===f.charCodeAt(u)?f.substring(0,u):f).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(s.charCodeAt(8)<111)break;case 115:f=f.replace(s,j+s)+";"+f;break;case 207:case 102:f=f.replace(s,j+(p>102?"inline-":"")+"box")+";"+f.replace(s,j+s)+";"+f.replace(s,A+s+"box")+";"+f}return f+";";case 938:if(f.charCodeAt(5)===B)switch(f.charCodeAt(6)){case 105:return s=f.replace("-items",""),j+f+j+"box-"+s+A+"flex-"+s+f;case 115:return j+f+A+"flex-item-"+f.replace(O,"")+f;default:return j+f+A+"flex-line-pack"+f.replace("align-content","").replace(O,"")+f}break;case 973:case 989:if(f.charCodeAt(3)!==B||122===f.charCodeAt(4))break;case 931:case 953:if(!0===k.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?pe(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):f.replace(s,j+s)+f.replace(s,R+s.replace("fill-",""))+f;break;case 962:if(f=j+f+(102===f.charCodeAt(5)?A+f:"")+f,n+r===211&&105===f.charCodeAt(13)&&f.indexOf("transform",10)>0)return f.substring(0,f.indexOf(";",27)+1).replace(a,"$1"+j+"$2")+f}return f}function de(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10),o=e.substring(n+1,e.length-1);return re(2!==t?r:r.replace(S,"$1"),o,t)}function he(e,t){var n=pe(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(C," or ($1)").substring(4):"("+t+")"}function me(e,t,n,r,o,i,a,l,c,s){for(var u,f=0,p=t;f0&&(ae=o.replace(d,91===i?"":"-")),i=1,1===K?ce=o:le=o;var a,l=[ce];ne>0&&void 0!==(a=me(-1,n,l,l,X,V,0,0,0,0))&&"string"==typeof a&&(n=a);var c=se(ee,l,n,0,0);return ne>0&&void 0!==(a=me(-2,c,l,l,X,V,c.length,0,0,0))&&"string"!=typeof(c=a)&&(i=0),ae="",ce="",le="",q=0,X=1,V=1,G*i==0?c:c.replace(r,"").replace(b,"").replace(y,"$1").replace(v,"$1").replace(_," ")}return ye.use=function e(t){switch(t){case void 0:case null:ne=te.length=0;break;default:if("function"==typeof t)te[ne++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n1)for(var n=1;n>2]|=e[o]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(a[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.block=a[16],this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha1.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha1.prototype.hash=function(){var e,t,n=this.h0,r=this.h1,o=this.h2,i=this.h3,a=this.h4,l=this.blocks;for(e=16;e<80;++e)t=l[e-3]^l[e-8]^l[e-14]^l[e-16],l[e]=t<<1|t>>>31;for(e=0;e<20;e+=5)n=(t=(r=(t=(o=(t=(i=(t=(a=(t=n<<5|n>>>27)+(r&o|~r&i)+a+1518500249+l[e]<<0)<<5|a>>>27)+(n&(r=r<<30|r>>>2)|~n&o)+i+1518500249+l[e+1]<<0)<<5|i>>>27)+(a&(n=n<<30|n>>>2)|~a&r)+o+1518500249+l[e+2]<<0)<<5|o>>>27)+(i&(a=a<<30|a>>>2)|~i&n)+r+1518500249+l[e+3]<<0)<<5|r>>>27)+(o&(i=i<<30|i>>>2)|~o&a)+n+1518500249+l[e+4]<<0,o=o<<30|o>>>2;for(;e<40;e+=5)n=(t=(r=(t=(o=(t=(i=(t=(a=(t=n<<5|n>>>27)+(r^o^i)+a+1859775393+l[e]<<0)<<5|a>>>27)+(n^(r=r<<30|r>>>2)^o)+i+1859775393+l[e+1]<<0)<<5|i>>>27)+(a^(n=n<<30|n>>>2)^r)+o+1859775393+l[e+2]<<0)<<5|o>>>27)+(i^(a=a<<30|a>>>2)^n)+r+1859775393+l[e+3]<<0)<<5|r>>>27)+(o^(i=i<<30|i>>>2)^a)+n+1859775393+l[e+4]<<0,o=o<<30|o>>>2;for(;e<60;e+=5)n=(t=(r=(t=(o=(t=(i=(t=(a=(t=n<<5|n>>>27)+(r&o|r&i|o&i)+a-1894007588+l[e]<<0)<<5|a>>>27)+(n&(r=r<<30|r>>>2)|n&o|r&o)+i-1894007588+l[e+1]<<0)<<5|i>>>27)+(a&(n=n<<30|n>>>2)|a&r|n&r)+o-1894007588+l[e+2]<<0)<<5|o>>>27)+(i&(a=a<<30|a>>>2)|i&n|a&n)+r-1894007588+l[e+3]<<0)<<5|r>>>27)+(o&(i=i<<30|i>>>2)|o&a|i&a)+n-1894007588+l[e+4]<<0,o=o<<30|o>>>2;for(;e<80;e+=5)n=(t=(r=(t=(o=(t=(i=(t=(a=(t=n<<5|n>>>27)+(r^o^i)+a-899497514+l[e]<<0)<<5|a>>>27)+(n^(r=r<<30|r>>>2)^o)+i-899497514+l[e+1]<<0)<<5|i>>>27)+(a^(n=n<<30|n>>>2)^r)+o-899497514+l[e+2]<<0)<<5|o>>>27)+(i^(a=a<<30|a>>>2)^n)+r-899497514+l[e+3]<<0)<<5|r>>>27)+(o^(i=i<<30|i>>>2)^a)+n-899497514+l[e+4]<<0,o=o<<30|o>>>2;this.h0=this.h0+n<<0,this.h1=this.h1+r<<0,this.h2=this.h2+o<<0,this.h3=this.h3+i<<0,this.h4=this.h4+a<<0},Sha1.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,o=this.h4;return HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,o=this.h4;return[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24&255,n>>16&255,n>>8&255,255&n,r>>24&255,r>>16&255,r>>8&255,255&r,o>>24&255,o>>16&255,o>>8&255,255&o]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};var exports=createMethod();COMMON_JS?module.exports=exports:(root.sha1=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(12),__webpack_require__(13))},function(e,t,n){ -/*! - * Cropper.js v1.5.7 - * https://fengyuanchen.github.io/cropperjs - * - * Copyright 2015-present Chen Fengyuan - * Released under the MIT license - * - * Date: 2020-05-23T05:23:00.081Z - */ -e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e<1/0};function M(e){return void 0===e}function I(t){return"object"===e(t)&&null!==t}var F=Object.prototype.hasOwnProperty;function z(e){if(!I(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&F.call(n,"isPrototypeOf")}catch(e){return!1}}function H(e){return"function"==typeof e}var B=Array.prototype.slice;function N(e){return Array.from?Array.from(e):B.call(e)}function U(e,t){return e&&H(t)&&(Array.isArray(e)||P(e.length)?N(e).forEach((function(n,r){t.call(e,n,r,e)})):I(e)&&Object.keys(e).forEach((function(n){t.call(e,e[n],n,e)}))),e}var W=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&n.forEach((function(t){I(t)&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e},Y=/\.\d*(?:0|9){12}\d*$/;function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return Y.test(e)?Math.round(e*t)/t:e}var X=/^width|height|left|top|marginLeft|marginTop$/;function q(e,t){var n=e.style;U(t,(function(e,t){X.test(t)&&P(e)&&(e="".concat(e,"px")),n[t]=e}))}function K(e,t){if(t)if(P(e.length))U(e,(function(e){K(e,t)}));else if(e.classList)e.classList.add(t);else{var n=e.className.trim();n?n.indexOf(t)<0&&(e.className="".concat(n," ").concat(t)):e.className=t}}function Q(e,t){t&&(P(e.length)?U(e,(function(e){Q(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function $(e,t,n){t&&(P(e.length)?U(e,(function(e){$(e,t,n)})):n?K(e,t):Q(e,t))}var G=/([a-z\d])([A-Z])/g;function Z(e){return e.replace(G,"$1-$2").toLowerCase()}function J(e,t){return I(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Z(t)))}function ee(e,t,n){I(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(Z(t)),n)}var te=/\s\s*/,ne=function(){var e=!1;if(c){var t=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});s.addEventListener("test",n,r),s.removeEventListener("test",n,r)}return e}();function re(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n;t.trim().split(te).forEach((function(t){if(!ne){var i=e.listeners;i&&i[t]&&i[t][n]&&(o=i[t][n],delete i[t][n],0===Object.keys(i[t]).length&&delete i[t],0===Object.keys(i).length&&delete e.listeners)}e.removeEventListener(t,o,r)}))}function oe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n;t.trim().split(te).forEach((function(t){if(r.once&&!ne){var i=e.listeners,a=void 0===i?{}:i;o=function(){delete a[t][n],e.removeEventListener(t,o,r);for(var i=arguments.length,l=new Array(i),c=0;c1&&void 0!==arguments[1]?arguments[1]:"contain",i=L(r),a=L(n);if(i&&a){var l=n*t;"contain"===o&&l>r||"cover"===o&&l=8&&(i=c+u)}}}if(i){var f,p,d=n.getUint16(i,r);for(p=0;pe.width?3===n?l=e.height*a:c=e.width/a:3===n?c=e.width/a:l=e.height*a;var s={aspectRatio:a,naturalWidth:o,naturalHeight:i,width:l,height:c};s.left=(e.width-l)/2,s.top=(e.height-c)/2,s.oldLeft=s.left,s.oldTop=s.top,this.canvasData=s,this.limited=1===n||2===n,this.limitCanvas(!0,!0),this.initialImageData=W({},t),this.initialCanvasData=W({},s)},limitCanvas:function(e,t){var n=this.options,r=this.containerData,o=this.canvasData,i=this.cropBoxData,a=n.viewMode,l=o.aspectRatio,c=this.cropped&&i;if(e){var s=Number(n.minCanvasWidth)||0,u=Number(n.minCanvasHeight)||0;a>1?(s=Math.max(s,r.width),u=Math.max(u,r.height),3===a&&(u*l>s?s=u*l:u=s/l)):a>0&&(s?s=Math.max(s,c?i.width:0):u?u=Math.max(u,c?i.height:0):c&&(s=i.width,(u=i.height)*l>s?s=u*l:u=s/l));var f=de({aspectRatio:l,width:s,height:u});s=f.width,u=f.height,o.minWidth=s,o.minHeight=u,o.maxWidth=1/0,o.maxHeight=1/0}if(t)if(a>(c?0:1)){var p=r.width-o.width,d=r.height-o.height;o.minLeft=Math.min(0,p),o.minTop=Math.min(0,d),o.maxLeft=Math.max(0,p),o.maxTop=Math.max(0,d),c&&this.limited&&(o.minLeft=Math.min(i.left,i.left+(i.width-o.width)),o.minTop=Math.min(i.top,i.top+(i.height-o.height)),o.maxLeft=i.left,o.maxTop=i.top,2===a&&(o.width>=r.width&&(o.minLeft=Math.min(0,p),o.maxLeft=Math.max(0,p)),o.height>=r.height&&(o.minTop=Math.min(0,d),o.maxTop=Math.max(0,d))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=r.width,o.maxTop=r.height},renderCanvas:function(e,t){var n=this.canvasData,r=this.imageData;if(t){var o=function(e){var t=e.width,n=e.height,r=e.degree;if(90==(r=Math.abs(r)%180))return{width:n,height:t};var o=r%90*Math.PI/180,i=Math.sin(o),a=Math.cos(o),l=t*a+n*i,c=t*i+n*a;return r>90?{width:c,height:l}:{width:l,height:c}}({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),i=o.width,a=o.height,l=n.width*(i/n.naturalWidth),c=n.height*(a/n.naturalHeight);n.left-=(l-n.width)/2,n.top-=(c-n.height)/2,n.width=l,n.height=c,n.aspectRatio=i/a,n.naturalWidth=i,n.naturalHeight=a,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.widthn.maxHeight||n.heightt.width?o.height=o.width/n:o.width=o.height*n),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*r),o.height=Math.max(o.minHeight,o.height*r),o.left=t.left+(t.width-o.width)/2,o.top=t.top+(t.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=W({},o)},limitCropBox:function(e,t){var n=this.options,r=this.containerData,o=this.canvasData,i=this.cropBoxData,a=this.limited,l=n.aspectRatio;if(e){var c=Number(n.minCropBoxWidth)||0,s=Number(n.minCropBoxHeight)||0,u=a?Math.min(r.width,o.width,o.width+o.left,r.width-o.left):r.width,f=a?Math.min(r.height,o.height,o.height+o.top,r.height-o.top):r.height;c=Math.min(c,r.width),s=Math.min(s,r.height),l&&(c&&s?s*l>c?s=c/l:c=s*l:c?s=c/l:s&&(c=s*l),f*l>u?f=u/l:u=f*l),i.minWidth=Math.min(c,u),i.minHeight=Math.min(s,f),i.maxWidth=u,i.maxHeight=f}t&&(a?(i.minLeft=Math.max(0,o.left),i.minTop=Math.max(0,o.top),i.maxLeft=Math.min(r.width,o.left+o.width)-i.width,i.maxTop=Math.min(r.height,o.top+o.height)-i.height):(i.minLeft=0,i.minTop=0,i.maxLeft=r.width-i.width,i.maxTop=r.height-i.height))},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.widthn.maxHeight||n.height=t.width&&n.height>=t.height?"move":"all"),q(this.cropBox,W({width:n.width,height:n.height},fe({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ie(this.element,"crop",this.getData())}},ve={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,r=t?this.crossOriginUrl:this.url,o=e.alt||"The image to preview",i=document.createElement("img");if(t&&(i.crossOrigin=t),i.src=r,i.alt=o,this.viewBox.appendChild(i),this.viewBoxImage=i,n){var a=n;"string"==typeof n?a=e.ownerDocument.querySelectorAll(n):n.querySelector&&(a=[n]),this.previews=a,U(a,(function(e){var n=document.createElement("img");ee(e,_,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(n.crossOrigin=t),n.src=r,n.alt=o,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(n)}))}},resetPreview:function(){U(this.previews,(function(e){var t=J(e,_);q(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(I(e[t]))try{delete e[t]}catch(n){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(n){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(Z(t)))}(e,_)}))},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,r=n.width,o=n.height,i=e.width,a=e.height,l=n.left-t.left-e.left,c=n.top-t.top-e.top;this.cropped&&!this.disabled&&(q(this.viewBoxImage,W({width:i,height:a},fe(W({translateX:-l,translateY:-c},e)))),U(this.previews,(function(t){var n=J(t,_),s=n.width,u=n.height,f=s,p=u,d=1;r&&(p=o*(d=s/r)),o&&p>u&&(f=r*(d=u/o),p=u),q(t,{width:f,height:p}),q(t.getElementsByTagName("img")[0],W({width:i*d,height:a*d},fe(W({translateX:-l*d,translateY:-c*d},e))))})))}},_e={bind:function(){var e=this.element,t=this.options,n=this.cropper;H(t.cropstart)&&oe(e,"cropstart",t.cropstart),H(t.cropmove)&&oe(e,"cropmove",t.cropmove),H(t.cropend)&&oe(e,"cropend",t.cropend),H(t.crop)&&oe(e,"crop",t.crop),H(t.zoom)&&oe(e,"zoom",t.zoom),oe(n,C,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&oe(n,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&oe(n,"dblclick",this.onDblclick=this.dblclick.bind(this)),oe(e.ownerDocument,O,this.onCropMove=this.cropMove.bind(this)),oe(e.ownerDocument,S,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&oe(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,n=this.cropper;H(t.cropstart)&&re(e,"cropstart",t.cropstart),H(t.cropmove)&&re(e,"cropmove",t.cropmove),H(t.cropend)&&re(e,"cropend",t.cropend),H(t.crop)&&re(e,"crop",t.crop),H(t.zoom)&&re(e,"zoom",t.zoom),re(n,C,this.onCropStart),t.zoomable&&t.zoomOnWheel&&re(n,"wheel",this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&re(n,"dblclick",this.onDblclick),re(e.ownerDocument,O,this.onCropMove),re(e.ownerDocument,S,this.onCropEnd),t.responsive&&re(window,"resize",this.onResize)}},we={resize:function(){if(!this.disabled){var e,t,n=this.options,r=this.container,o=this.containerData,i=r.offsetWidth/o.width;1===i&&r.offsetHeight===o.height||(n.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(U(e,(function(t,n){e[n]=t*i}))),this.setCropBoxData(U(t,(function(e,n){t[n]=e*i})))))}},dblclick:function(){var e,t;this.disabled||"none"===this.options.dragMode||this.setDragMode((e=this.dragBox,t=p,(e.classList?e.classList.contains(t):e.className.indexOf(t)>-1)?"move":"crop"))},wheel:function(e){var t=this,n=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,e)))},cropStart:function(e){var t=e.buttons,n=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(P(t)&&1!==t||P(n)&&0!==n||e.ctrlKey))){var r,o=this.options,i=this.pointers;e.changedTouches?U(e.changedTouches,(function(e){i[e.identifier]=pe(e)})):i[e.pointerId||0]=pe(e),r=Object.keys(i).length>1&&o.zoomable&&o.zoomOnTouch?"zoom":J(e.target,v),k.test(r)&&!1!==ie(this.element,"cropstart",{originalEvent:e,action:r})&&(e.preventDefault(),this.action=r,this.cropping=!1,"crop"===r&&(this.cropping=!0,K(this.dragBox,b)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var n=this.pointers;e.preventDefault(),!1!==ie(this.element,"cropmove",{originalEvent:e,action:t})&&(e.changedTouches?U(e.changedTouches,(function(e){W(n[e.identifier]||{},pe(e,!0))})):W(n[e.pointerId||0]||{},pe(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers;e.changedTouches?U(e.changedTouches,(function(e){delete n[e.identifier]})):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,$(this.dragBox,b,this.cropped&&this.options.modal)),ie(this.element,"cropend",{originalEvent:e,action:t}))}}},xe={change:function(e){var t,n=this.options,r=this.canvasData,o=this.containerData,a=this.cropBoxData,l=this.pointers,c=this.action,s=n.aspectRatio,u=a.left,f=a.top,p=a.width,d=a.height,m=u+p,g=f+d,b=0,y=0,v=o.width,_=o.height,w=!0;!s&&e.shiftKey&&(s=p&&d?p/d:1),this.limited&&(b=a.minLeft,y=a.minTop,v=b+Math.min(o.width,r.width,r.left+r.width),_=y+Math.min(o.height,r.height,r.top+r.height));var x=l[Object.keys(l)[0]],E={x:x.endX-x.startX,y:x.endY-x.startY},C=function(e){switch(e){case"e":m+E.x>v&&(E.x=v-m);break;case"w":u+E.x_&&(E.y=_-g)}};switch(c){case"all":u+=E.x,f+=E.y;break;case"e":if(E.x>=0&&(m>=v||s&&(f<=y||g>=_))){w=!1;break}C("e"),(p+=E.x)<0&&(c="w",u-=p=-p),s&&(d=p/s,f+=(a.height-d)/2);break;case"n":if(E.y<=0&&(f<=y||s&&(u<=b||m>=v))){w=!1;break}C("n"),d-=E.y,f+=E.y,d<0&&(c="s",f-=d=-d),s&&(p=d*s,u+=(a.width-p)/2);break;case"w":if(E.x<=0&&(u<=b||s&&(f<=y||g>=_))){w=!1;break}C("w"),p-=E.x,u+=E.x,p<0&&(c="e",u-=p=-p),s&&(d=p/s,f+=(a.height-d)/2);break;case"s":if(E.y>=0&&(g>=_||s&&(u<=b||m>=v))){w=!1;break}C("s"),(d+=E.y)<0&&(c="n",f-=d=-d),s&&(p=d*s,u+=(a.width-p)/2);break;case"ne":if(s){if(E.y<=0&&(f<=y||m>=v)){w=!1;break}C("n"),d-=E.y,f+=E.y,p=d*s}else C("n"),C("e"),E.x>=0?my&&(d-=E.y,f+=E.y):(d-=E.y,f+=E.y);p<0&&d<0?(c="sw",f-=d=-d,u-=p=-p):p<0?(c="nw",u-=p=-p):d<0&&(c="se",f-=d=-d);break;case"nw":if(s){if(E.y<=0&&(f<=y||u<=b)){w=!1;break}C("n"),d-=E.y,f+=E.y,p=d*s,u+=a.width-p}else C("n"),C("w"),E.x<=0?u>b?(p-=E.x,u+=E.x):E.y<=0&&f<=y&&(w=!1):(p-=E.x,u+=E.x),E.y<=0?f>y&&(d-=E.y,f+=E.y):(d-=E.y,f+=E.y);p<0&&d<0?(c="se",f-=d=-d,u-=p=-p):p<0?(c="ne",u-=p=-p):d<0&&(c="sw",f-=d=-d);break;case"sw":if(s){if(E.x<=0&&(u<=b||g>=_)){w=!1;break}C("w"),p-=E.x,u+=E.x,d=p/s}else C("s"),C("w"),E.x<=0?u>b?(p-=E.x,u+=E.x):E.y>=0&&g>=_&&(w=!1):(p-=E.x,u+=E.x),E.y>=0?g<_&&(d+=E.y):d+=E.y;p<0&&d<0?(c="ne",f-=d=-d,u-=p=-p):p<0?(c="se",u-=p=-p):d<0&&(c="nw",f-=d=-d);break;case"se":if(s){if(E.x>=0&&(m>=v||g>=_)){w=!1;break}C("e"),d=(p+=E.x)/s}else C("s"),C("e"),E.x>=0?m=0&&g>=_&&(w=!1):p+=E.x,E.y>=0?g<_&&(d+=E.y):d+=E.y;p<0&&d<0?(c="nw",f-=d=-d,u-=p=-p):p<0?(c="sw",u-=p=-p):d<0&&(c="ne",f-=d=-d);break;case"move":this.move(E.x,E.y),w=!1;break;case"zoom":this.zoom(function(e){var t=i({},e),n=[];return U(e,(function(e,r){delete t[r],U(t,(function(t){var r=Math.abs(e.startX-t.startX),o=Math.abs(e.startY-t.startY),i=Math.abs(e.endX-t.endX),a=Math.abs(e.endY-t.endY),l=Math.sqrt(r*r+o*o),c=(Math.sqrt(i*i+a*a)-l)/l;n.push(c)}))})),n.sort((function(e,t){return Math.abs(e)0?c=E.y>0?"se":"ne":E.x<0&&(u-=p,c=E.y>0?"sw":"nw"),E.y<0&&(f-=d),this.cropped||(Q(this.cropBox,h),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}w&&(a.width=p,a.height=d,a.left=u,a.top=f,this.action=c,this.renderCropBox()),U(l,(function(e){e.startX=e.endX,e.startY=e.endY}))}},Ee={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&K(this.dragBox,b),Q(this.cropBox,h),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=W({},this.initialImageData),this.canvasData=W({},this.initialCanvasData),this.cropBoxData=W({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(W(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Q(this.dragBox,b),K(this.cropBox,h)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,U(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Q(this.cropper,d)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,K(this.cropper,d)),this},destroy:function(){var e=this.element;return e.cropper?(e.cropper=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,r=n.left,o=n.top;return this.moveTo(M(e)?e:r+Number(e),M(t)?t:o+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(P(e)&&(n.left=e,r=!0),P(t)&&(n.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var r=this.options,o=this.canvasData,i=o.width,a=o.height,l=o.naturalWidth,c=o.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&r.zoomable){var s=l*e,u=c*e;if(!1===ie(this.element,"zoom",{ratio:e,oldRatio:i/l,originalEvent:n}))return this;if(n){var f=this.pointers,p=ae(this.cropper),d=f&&Object.keys(f).length?function(e){var t=0,n=0,r=0;return U(e,(function(e){var o=e.startX,i=e.startY;t+=o,n+=i,r+=1})),{pageX:t/=r,pageY:n/=r}}(f):{pageX:n.pageX,pageY:n.pageY};o.left-=(s-i)*((d.pageX-p.left-o.left)/i),o.top-=(u-a)*((d.pageY-p.top-o.top)/a)}else z(t)&&P(t.x)&&P(t.y)?(o.left-=(s-i)*((t.x-o.left)/i),o.top-=(u-a)*((t.y-o.top)/a)):(o.left-=(s-i)/2,o.top-=(u-a)/2);o.width=s,o.height=u,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return P(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,P(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(P(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(P(e)&&(n.scaleX=e,r=!0),P(t)&&(n.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,r=this.imageData,o=this.canvasData,i=this.cropBoxData;if(this.ready&&this.cropped){e={x:i.left-o.left,y:i.top-o.top,width:i.width,height:i.height};var a=r.width/r.naturalWidth;if(U(e,(function(t,n){e[n]=t/a})),t){var l=Math.round(e.y+e.height),c=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=c-e.x,e.height=l-e.y}}else e={x:0,y:0,width:0,height:0};return n.rotatable&&(e.rotate=r.rotate||0),n.scalable&&(e.scaleX=r.scaleX||1,e.scaleY=r.scaleY||1),e},setData:function(e){var t=this.options,n=this.imageData,r=this.canvasData,o={};if(this.ready&&!this.disabled&&z(e)){var i=!1;t.rotatable&&P(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,i=!0),t.scalable&&(P(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,i=!0),P(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,i=!0)),i&&this.renderCanvas(!0,!0);var a=n.width/n.naturalWidth;P(e.x)&&(o.left=e.x*a+r.left),P(e.y)&&(o.top=e.y*a+r.top),P(e.width)&&(o.width=e.width*a),P(e.height)&&(o.height=e.height*a),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?W({},this.containerData):{}},getImageData:function(){return this.sized?W({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&U(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){t[n]=e[n]})),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio;return this.ready&&!this.disabled&&z(e)&&(P(e.left)&&(t.left=e.left),P(e.top)&&(t.top=e.top),P(e.width)?(t.width=e.width,t.height=e.width/n):P(e.height)&&(t.height=e.height,t.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,n,r=this.cropBoxData,o=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&z(e)&&(P(e.left)&&(r.left=e.left),P(e.top)&&(r.top=e.top),P(e.width)&&e.width!==r.width&&(t=!0,r.width=e.width),P(e.height)&&e.height!==r.height&&(n=!0,r.height=e.height),o&&(t?r.height=r.width/o:n&&(r.width=r.height*o)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,n=he(this.image,this.imageData,t,e);if(!this.cropped)return n;var r=this.getData(),o=r.x,i=r.y,l=r.width,c=r.height,s=n.width/Math.floor(t.naturalWidth);1!==s&&(o*=s,i*=s,l*=s,c*=s);var u=l/c,f=de({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=de({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),d=de({aspectRatio:u,width:e.width||(1!==s?n.width:l),height:e.height||(1!==s?n.height:c)}),h=d.width,m=d.height;h=Math.min(f.width,Math.max(p.width,h)),m=Math.min(f.height,Math.max(p.height,m));var g=document.createElement("canvas"),b=g.getContext("2d");g.width=V(h),g.height=V(m),b.fillStyle=e.fillColor||"transparent",b.fillRect(0,0,h,m);var y=e.imageSmoothingEnabled,v=void 0===y||y,_=e.imageSmoothingQuality;b.imageSmoothingEnabled=v,_&&(b.imageSmoothingQuality=_);var w,x,E,C,O,S,k=n.width,T=n.height,j=o,R=i;j<=-l||j>k?(j=0,w=0,E=0,O=0):j<=0?(E=-j,j=0,O=w=Math.min(k,l+j)):j<=k&&(E=0,O=w=Math.min(l,k-j)),w<=0||R<=-c||R>T?(R=0,x=0,C=0,S=0):R<=0?(C=-R,R=0,S=x=Math.min(T,c+R)):R<=T&&(C=0,S=x=Math.min(c,T-R));var A=[j,R,w,x];if(O>0&&S>0){var D=h/l;A.push(E*D,C*D,O*D,S*D)}return b.drawImage.apply(b,[n].concat(a(A.map((function(e){return Math.floor(V(e))}))))),g},setAspectRatio:function(e){var t=this.options;return this.disabled||M(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var o="crop"===e,i=t.movable&&"move"===e;e=o||i?e:"none",t.dragMode=e,ee(n,v,e),$(n,p,o),$(n,y,i),t.cropBoxMovable||(ee(r,v,e),$(r,p,o),$(r,y,i))}return this}},Ce=s.Cropper,Oe=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,e),!n||!R.test(n.tagName))throw new Error("The first argument is required and must be an or element.");this.element=n,this.options=W({},A,z(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var r,o,i;return r=e,i=[{key:"noConflict",value:function(){return window.Cropper=Ce,e}},{key:"setDefaults",value:function(e){W(A,z(e)&&e)}}],(o=[{key:"init",value:function(){var e,t=this.element,n=t.tagName.toLowerCase();if(!t.cropper){if(t.cropper=this,"img"===n){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===n&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var n=this.element,r=this.options;if(r.rotatable||r.scalable||(r.checkOrientation=!1),r.checkOrientation&&window.ArrayBuffer)if(T.test(e))j.test(e)?this.read((o=e.replace(ge,""),i=atob(o),a=new ArrayBuffer(i.length),U(l=new Uint8Array(a),(function(e,t){l[t]=i.charCodeAt(t)})),a)):this.clone();else{var o,i,a,l,c=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=c,c.onabort=s,c.onerror=s,c.ontimeout=s,c.onprogress=function(){"image/jpeg"!==c.getResponseHeader("content-type")&&c.abort()},c.onload=function(){t.read(c.response)},c.onloadend=function(){t.reloading=!1,t.xhr=null},r.checkCrossOrigin&&se(e)&&n.crossOrigin&&(e=ue(e)),c.open("GET",e),c.responseType="arraybuffer",c.withCredentials="use-credentials"===n.crossOrigin,c.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,n=this.imageData,r=be(e),o=0,i=1,a=1;if(r>1){this.url=function(e,t){for(var n=[],r=new Uint8Array(e);r.length>0;)n.push(me.apply(null,N(r.subarray(0,8192)))),r=r.subarray(8192);return"data:".concat(t,";base64,").concat(btoa(n.join("")))}(e,"image/jpeg");var l=function(e){var t=0,n=1,r=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:r=-1;break;case 5:t=90,r=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90}return{rotate:t,scaleX:n,scaleY:r}}(r);o=l.rotate,i=l.scaleX,a=l.scaleY}t.rotatable&&(n.rotate=o),t.scalable&&(n.scaleX=i,n.scaleY=a),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,n=e.crossOrigin,r=t;this.options.checkCrossOrigin&&se(t)&&(n||(n="anonymous"),r=ue(t)),this.crossOrigin=n,this.crossOriginUrl=r;var o=document.createElement("img");n&&(o.crossOrigin=n),o.src=r||t,o.alt=e.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),K(o,m),e.parentNode.insertBefore(o,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var n=s.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(s.navigator.userAgent),r=function(t,n){W(e.imageData,{naturalWidth:t,naturalHeight:n,aspectRatio:t/n}),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||n){var o=document.createElement("img"),i=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){r(o.width,o.height),n||i.removeChild(o)},o.src=t.src,n||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",i.appendChild(o))}else r(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,n=this.image,r=e.parentNode,o=document.createElement("div");o.innerHTML='
';var i=o.querySelector(".".concat("cropper","-container")),a=i.querySelector(".".concat("cropper","-canvas")),l=i.querySelector(".".concat("cropper","-drag-box")),c=i.querySelector(".".concat("cropper","-crop-box")),s=c.querySelector(".".concat("cropper","-face"));this.container=r,this.cropper=i,this.canvas=a,this.dragBox=l,this.cropBox=c,this.viewBox=i.querySelector(".".concat("cropper","-view-box")),this.face=s,a.appendChild(n),K(e,h),r.insertBefore(i,e.nextSibling),this.isImg||Q(n,m),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,K(c,h),t.guides||K(c.getElementsByClassName("".concat("cropper","-dashed")),h),t.center||K(c.getElementsByClassName("".concat("cropper","-center")),h),t.background&&K(i,"".concat("cropper","-bg")),t.highlight||K(s,g),t.cropBoxMovable&&(K(s,y),ee(s,v,"all")),t.cropBoxResizable||(K(c.getElementsByClassName("".concat("cropper","-line")),h),K(c.getElementsByClassName("".concat("cropper","-point")),h)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),H(t.ready)&&oe(e,"ready",t.ready,{once:!0}),ie(e,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Q(this.element,h))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&n(r.prototype,o),i&&n(r,i),e}();return W(Oe.prototype,ye,ve,_e,we,xe,Ee),Oe}()},function(e,t,n){"use strict";const r=n(34),o=new Set(["jpg","png","gif","webp","flif","cr2","tif","bmp","jxr","psd","ico","bpg","jp2","jpm","jpx","heic","cur","dcm"]),i=e=>{const t=r(e);return o.has(t&&t.ext)?t:null};e.exports=i,e.exports.default=i,Object.defineProperty(i,"minimumBytes",{value:r.minimumBytes})},function(e,t,n){"use strict";function r(e,t){for(var n=0;nl;c?a++:a--){var s=a*o,u=s+(a===e.Blocks-1?i:o);if(Caman.NodeJS){var f=Fiber((function(){return t.call(n,a,s,u)})).run();r.push(n.blockFinished(f))}else r.push(setTimeout(function(e,r,o){return function(){return t.call(n,e,r,o)}}(a,s,u),0))}return r}()}},{key:"executeFilter",value:function(){return Caman.Event.trigger(this.c,"processStart",this.currentJob),this.currentJob.type===Caman.Filter.Type.Single?this.eachBlock(this.renderBlock):this.eachBlock(this.renderKernel)}},{key:"executePlugin",value:function(){return o.a.debug("Executing plugin ".concat(this.currentJob.plugin)),Caman.Plugin.execute(this.c,this.currentJob.plugin,this.currentJob.args),o.a.debug("Plugin ".concat(this.currentJob.plugin," finished!")),this.processNext()}},{key:"renderBlock",value:function(t,n,i){o.a.debug("Block #".concat(t," - Filter: ").concat(this.currentJob.name,", Start: ").concat(n,", End: ").concat(i)),Caman.Event.trigger(this.c,"blockStarted",{blockNum:t,totalBlocks:e.Blocks,startPixel:n,endPixel:i});var a=new Caman.Pixel;a.setContext(this.c);for(var l=n,c=i;l=b;y?g++:g--)for(var v=f,_=-f,w=f<=_;w?v<=_:v>=_;w?v++:v--){var x=p.getPixelRelative(g,v);u[3*m]=x.r,u[3*m+1]=x.g,u[3*m+2]=x.b,m++}var E=this.processKernel(c,u,a,i);this.modPixelData[d]=r.b.clampRGB(E.r),this.modPixelData[d+1]=r.b.clampRGB(E.g),this.modPixelData[d+2]=r.b.clampRGB(E.b),this.modPixelData[d+3]=this.c.pixelData[d+3]}return this.blockFinished(e)}},{key:"blockFinished",value:function(t){if(t>=0&&o.a.debug("Block #".concat(t," finished! Filter: ").concat(this.currentJob.name)),this.blocksDone++,Caman.Event.trigger(this.c,"blockFinished",{blockNum:t,blocksFinished:this.blocksDone,totalBlocks:e.Blocks}),this.blocksDone===e.Blocks){if(this.currentJob.type===Caman.Filter.Type.Kernel)for(var n=0,r=this.c.pixelData.length,i=0<=r;i?nr;i?n++:n--)this.c.pixelData[n]=this.modPixelData[n];return t>=0&&o.a.debug("Filter ".concat(this.currentJob.name," finished!")),Caman.Event.trigger(this.c,"processComplete",this.currentJob),this.processNext()}}},{key:"processKernel",value:function(e,t,n,r){for(var o={r:0,g:0,b:0},i=0,a=e.length,l=0<=a;l?ia;l?i++:i--)o.r+=e[i]*t[3*i],o.g+=e[i]*t[3*i+1],o.b+=e[i]*t[3*i+2];return o.r=o.r/n+r,o.g=o.g/n+r,o.b=o.b/n+r,o}},{key:"loadOverlay",value:function(e,t){var n=this,r=new Image;r.onload=function(){return e.context.drawImage(r,0,0,n.c.dimensions.width,n.c.dimensions.height),e.imageData=e.context.getImageData(0,0,n.c.dimensions.width,n.c.dimensions.height),e.pixelData=e.imageData.data,n.c.pixelData=e.pixelData,n.processNext()};var o=Caman.IO.remoteCheck(t);return r.src=null!=o?o:t}},{key:"loadLayerMask",value:function(e,t){var n=this,r=new Image;r.onload=function(){var t=document.createElement("canvas");t.width=n.c.dimensions.width,t.height=n.c.dimensions.height;var o=t.getContext("2d");o.drawImage(r,0,0,n.c.dimensions.width,n.c.dimensions.height);var i=o.getImageData(0,0,n.c.dimensions.width,n.c.dimensions.height);return e.maskData=i.data,n.processNext()};var o=Caman.IO.remoteCheck(t);return r.src=null!=o?o:t}}]),e}();l.initClass();var c=l;t.a=c;"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(l,"Renderer","/mnt/w/ScaleFlex/projects/filerobot-image-editor/projects/react/lib/caman/core/renderer.js"),__REACT_HOT_LOADER__.register(c,"default","/mnt/w/ScaleFlex/projects/filerobot-image-editor/projects/react/lib/caman/core/renderer.js"))},function(e,t,n){"use strict";var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.a=o},function(e,t,n){"use strict";function r(e){return Object.prototype.toString.call(e).slice(8,-1)}function o(e){return"Object"===r(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function i(e){return"Array"===r(e)}function a(e){return"Symbol"===r(e)} -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -function l(){for(var e=0,t=0,n=arguments.length;t