UNPKG

uppy

Version:

Extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:

2 lines 587 kB
(()=>{var zg=Object.create;var po=Object.defineProperty;var Hg=Object.getOwnPropertyDescriptor;var qg=Object.getOwnPropertyNames;var Vg=Object.getPrototypeOf,$g=Object.prototype.hasOwnProperty;var o=(i,e)=>po(i,"name",{value:e,configurable:!0});var pe=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),ho=(i,e)=>{for(var t in e)po(i,t,{get:e[t],enumerable:!0})},Wg=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of qg(e))!$g.call(i,s)&&s!==t&&po(i,s,{get:()=>e[s],enumerable:!(r=Hg(e,s))||r.enumerable});return i};var ae=(i,e,t)=>(t=i!=null?zg(Vg(i)):{},Wg(e||!i||!i.__esModule?po(t,"default",{value:i,enumerable:!0}):t,i));var er=pe((A5,Sc)=>{"use strict";Sc.exports=o(function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return`${(t?"-":"")+e} B`;let s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/1024**s);let n=r[s];return e>=10||e%1===0?`${(t?"-":"")+e.toFixed(0)} ${n}`:`${(t?"-":"")+e.toFixed(1)} ${n}`},"prettierBytes")});var Pc=pe((U5,_c)=>{"use strict";function xc(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}o(xc,"WildcardMatcher");xc.prototype.match=function(i){var e=!0,t=this.parts,r,s=t.length,n;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)e=!1;else{for(n=(i||"").split(this.separator),r=0;e&&r<s;r++)t[r]!=="*"&&(r<n.length?e=t[r]===n[r]:e=!1);e=e&&n}else if(typeof i.splice=="function")for(e=[],r=i.length;r--;)this.match(i[r])&&(e[e.length]=i[r]);else if(typeof i=="object"){e={};for(var a in i)this.match(a)&&(e[a]=i[a])}return e};_c.exports=function(i,e,t){var r=new xc(i,t||/[\/\.]/);return typeof e<"u"?r.match(e):r}});var Ec=pe((D5,kc)=>{var Sy=Pc(),xy=/[\/\+\.]/;kc.exports=function(i,e){function t(r){var s=Sy(r,i,xy);return s&&s.length>=2}return o(t,"test"),e?t(e.split(";")[0]):t}});var ko=pe((G5,Ac)=>{function ky(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}o(ky,"isObject");Ac.exports=ky});var Uc=pe((X5,Rc)=>{var Ey=typeof global=="object"&&global&&global.Object===Object&&global;Rc.exports=Ey});var sa=pe((Y5,Oc)=>{var Fy=Uc(),Ty=typeof self=="object"&&self&&self.Object===Object&&self,Cy=Fy||Ty||Function("return this")();Oc.exports=Cy});var Ic=pe((J5,Dc)=>{var Ay=sa(),Ry=o(function(){return Ay.Date.now()},"now");Dc.exports=Ry});var Mc=pe((Z5,Nc)=>{var Uy=/\s/;function Oy(i){for(var e=i.length;e--&&Uy.test(i.charAt(e)););return e}o(Oy,"trimmedEndIndex");Nc.exports=Oy});var Bc=pe((t3,Lc)=>{var Dy=Mc(),Iy=/^\s+/;function Ny(i){return i&&i.slice(0,Dy(i)+1).replace(Iy,"")}o(Ny,"baseTrim");Lc.exports=Ny});var oa=pe((r3,jc)=>{var My=sa(),Ly=My.Symbol;jc.exports=Ly});var Vc=pe((s3,qc)=>{var zc=oa(),Hc=Object.prototype,By=Hc.hasOwnProperty,jy=Hc.toString,as=zc?zc.toStringTag:void 0;function zy(i){var e=By.call(i,as),t=i[as];try{i[as]=void 0;var r=!0}catch{}var s=jy.call(i);return r&&(e?i[as]=t:delete i[as]),s}o(zy,"getRawTag");qc.exports=zy});var Wc=pe((n3,$c)=>{var Hy=Object.prototype,qy=Hy.toString;function Vy(i){return qy.call(i)}o(Vy,"objectToString");$c.exports=Vy});var Yc=pe((l3,Xc)=>{var Gc=oa(),$y=Vc(),Wy=Wc(),Gy="[object Null]",Ky="[object Undefined]",Kc=Gc?Gc.toStringTag:void 0;function Xy(i){return i==null?i===void 0?Ky:Gy:Kc&&Kc in Object(i)?$y(i):Wy(i)}o(Xy,"baseGetTag");Xc.exports=Xy});var Qc=pe((c3,Jc)=>{function Yy(i){return i!=null&&typeof i=="object"}o(Yy,"isObjectLike");Jc.exports=Yy});var ep=pe((d3,Zc)=>{var Jy=Yc(),Qy=Qc(),Zy="[object Symbol]";function ev(i){return typeof i=="symbol"||Qy(i)&&Jy(i)==Zy}o(ev,"isSymbol");Zc.exports=ev});var sp=pe((f3,rp)=>{var tv=Bc(),tp=ko(),iv=ep(),ip=NaN,rv=/^[-+]0x[0-9a-f]+$/i,sv=/^0b[01]+$/i,ov=/^0o[0-7]+$/i,nv=parseInt;function av(i){if(typeof i=="number")return i;if(iv(i))return ip;if(tp(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=tp(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=tv(i);var t=sv.test(i);return t||ov.test(i)?nv(i.slice(2),t?2:8):rv.test(i)?ip:+i}o(av,"toNumber");rp.exports=av});var Eo=pe((g3,np)=>{var lv=ko(),na=Ic(),op=sp(),uv="Expected a function",cv=Math.max,pv=Math.min;function dv(i,e,t){var r,s,n,a,u,c,p=0,f=!1,d=!1,v=!0;if(typeof i!="function")throw new TypeError(uv);e=op(e)||0,lv(t)&&(f=!!t.leading,d="maxWait"in t,n=d?cv(op(t.maxWait)||0,e):n,v="trailing"in t?!!t.trailing:v);function P(H){var Q=r,K=s;return r=s=void 0,p=H,a=i.apply(K,Q),a}o(P,"invokeFunc");function k(H){return p=H,u=setTimeout(R,e),f?P(H):a}o(k,"leadingEdge");function A(H){var Q=H-c,K=H-p,Z=e-Q;return d?pv(Z,n-K):Z}o(A,"remainingWait");function C(H){var Q=H-c,K=H-p;return c===void 0||Q>=e||Q<0||d&&K>=n}o(C,"shouldInvoke");function R(){var H=na();if(C(H))return U(H);u=setTimeout(R,A(H))}o(R,"timerExpired");function U(H){return u=void 0,v&&r?P(H):(r=s=void 0,a)}o(U,"trailingEdge");function F(){u!==void 0&&clearTimeout(u),p=0,r=c=s=u=void 0}o(F,"cancel");function Y(){return u===void 0?a:U(na())}o(Y,"flush");function $(){var H=na(),Q=C(H);if(r=arguments,s=this,c=H,Q){if(u===void 0)return k(c);if(d)return clearTimeout(u),u=setTimeout(R,e),P(c)}return u===void 0&&(u=setTimeout(R,e)),a}return o($,"debounced"),$.cancel=F,$.flush=Y,$}o(dv,"debounce");np.exports=dv});var aa=pe((v3,ap)=>{var hv=Eo(),fv=ko(),mv="Expected a function";function gv(i,e,t){var r=!0,s=!0;if(typeof i!="function")throw new TypeError(mv);return fv(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),hv(i,e,{leading:r,maxWait:e,trailing:s})}o(gv,"throttle");ap.exports=gv});var up=pe((w3,lp)=>{lp.exports=o(function(){var e={},t=e._fns={};e.emit=o(function(a,u,c,p,f,d,v){var P=r(a);P.length&&s(a,P,[u,c,p,f,d,v])},"emit"),e.on=o(function(a,u){t[a]||(t[a]=[]),t[a].push(u)},"on"),e.once=o(function(a,u){function c(){u.apply(this,arguments),e.off(a,c)}o(c,"one"),this.on(a,c)},"once"),e.off=o(function(a,u){var c=[];if(a&&u){var p=this._fns[a],f=0,d=p?p.length:0;for(f;f<d;f++)p[f]!==u&&c.push(p[f])}c.length?this._fns[a]=c:delete this._fns[a]},"off");function r(n){var a=t[n]?t[n]:[],u=n.indexOf(":"),c=u===-1?[n]:[n.substring(0,u),n.substring(u+1)],p=Object.keys(t),f=0,d=p.length;for(f;f<d;f++){var v=p[f];if(v==="*"&&(a=a.concat(t[v])),c.length===2&&c[0]===v){a=a.concat(t[v]);break}}return a}o(r,"getListeners");function s(n,a,u){var c=0,p=a.length;for(c;c<p&&a[c];c++)a[c].event=n,a[c].apply(a[c],u)}return o(s,"emitAll"),e},"createNamespaceEmitter")});var gp=pe((X3,mp)=>{function _t(i,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}o(_t,"RetryOperation");mp.exports=_t;_t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};_t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};_t.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var e=new Date().getTime();if(i&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(i),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};_t.prototype.attempt=function(i,e){this._fn=i,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};_t.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)};_t.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)};_t.prototype.start=_t.prototype.try;_t.prototype.errors=function(){return this._errors};_t.prototype.attempts=function(){return this._attempts};_t.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r<this._errors.length;r++){var s=this._errors[r],n=s.message,a=(i[n]||0)+1;i[n]=a,a>=t&&(e=s,t=a)}return e}});var yp=pe(Ti=>{var wv=gp();Ti.operation=function(i){var e=Ti.timeouts(i);return new wv(e,{forever:i&&(i.forever||i.retries===1/0),unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};Ti.timeouts=function(i){if(i instanceof Array)return[].concat(i);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in i)e[t]=i[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s<e.retries;s++)r.push(this.createTimeout(s,e));return i&&i.forever&&!r.length&&r.push(this.createTimeout(s,e)),r.sort(function(n,a){return n-a}),r};Ti.createTimeout=function(i,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,i));return r=Math.min(r,e.maxTimeout),r};Ti.wrap=function(i,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in i)typeof i[r]=="function"&&t.push(r)}for(var s=0;s<t.length;s++){var n=t[s],a=i[n];i[n]=o(function(c){var p=Ti.operation(e),f=Array.prototype.slice.call(arguments,1),d=f.pop();f.push(function(v){p.retry(v)||(v&&(arguments[0]=p.mainError()),d.apply(this,arguments))}),p.attempt(function(){c.apply(i,f)})},"retryWrapper").bind(i,a),i[n].options=e}}});var bp=pe((Z3,vp)=>{vp.exports=yp()});var Ge=pe((Y_,No)=>{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var s="",n=0;n<arguments.length;n++){var a=arguments[n];a&&(s=r(s,t(a)))}return s}o(e,"classNames");function t(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return e.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var n="";for(var a in s)i.call(s,a)&&s[a]&&(n=r(n,a));return n}o(t,"parseValue");function r(s,n){return n?s?s+" "+n:s+n:s}o(r,"appendClass"),typeof No<"u"&&No.exports?(e.default=e,No.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var Dp=pe((HP,wa)=>{"use strict";var t0=Object.prototype.hasOwnProperty,nt="~";function ps(){}o(ps,"Events");Object.create&&(ps.prototype=Object.create(null),new ps().__proto__||(nt=!1));function i0(i,e,t){this.fn=i,this.context=e,this.once=t||!1}o(i0,"EE");function Op(i,e,t,r,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new i0(t,r||i,s),a=nt?nt+e:e;return i._events[a]?i._events[a].fn?i._events[a]=[i._events[a],n]:i._events[a].push(n):(i._events[a]=n,i._eventsCount++),i}o(Op,"addListener");function qo(i,e){--i._eventsCount===0?i._events=new ps:delete i._events[e]}o(qo,"clearEvent");function st(){this._events=new ps,this._eventsCount=0}o(st,"EventEmitter");st.prototype.eventNames=o(function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)t0.call(t,r)&&e.push(nt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},"eventNames");st.prototype.listeners=o(function(e){var t=nt?nt+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=new Array(n);s<n;s++)a[s]=r[s].fn;return a},"listeners");st.prototype.listenerCount=o(function(e){var t=nt?nt+e:e,r=this._events[t];return r?r.fn?1:r.length:0},"listenerCount");st.prototype.emit=o(function(e,t,r,s,n,a){var u=nt?nt+e:e;if(!this._events[u])return!1;var c=this._events[u],p=arguments.length,f,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),p){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,s),!0;case 5:return c.fn.call(c.context,t,r,s,n),!0;case 6:return c.fn.call(c.context,t,r,s,n,a),!0}for(d=1,f=new Array(p-1);d<p;d++)f[d-1]=arguments[d];c.fn.apply(c.context,f)}else{var v=c.length,P;for(d=0;d<v;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),p){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,r);break;case 4:c[d].fn.call(c[d].context,t,r,s);break;default:if(!f)for(P=1,f=new Array(p-1);P<p;P++)f[P-1]=arguments[P];c[d].fn.apply(c[d].context,f)}}return!0},"emit");st.prototype.on=o(function(e,t,r){return Op(this,e,t,r,!1)},"on");st.prototype.once=o(function(e,t,r){return Op(this,e,t,r,!0)},"once");st.prototype.removeListener=o(function(e,t,r,s){var n=nt?nt+e:e;if(!this._events[n])return this;if(!t)return qo(this,n),this;var a=this._events[n];if(a.fn)a.fn===t&&(!s||a.once)&&(!r||a.context===r)&&qo(this,n);else{for(var u=0,c=[],p=a.length;u<p;u++)(a[u].fn!==t||s&&!a[u].once||r&&a[u].context!==r)&&c.push(a[u]);c.length?this._events[n]=c.length===1?c[0]:c:qo(this,n)}return this},"removeListener");st.prototype.removeAllListeners=o(function(e){var t;return e?(t=nt?nt+e:e,this._events[t]&&qo(this,t)):(this._events=new ps,this._eventsCount=0),this},"removeAllListeners");st.prototype.off=st.prototype.removeListener;st.prototype.addListener=st.prototype.on;st.prefixed=nt;st.EventEmitter=st;typeof wa<"u"&&(wa.exports=st)});var hd=pe((La,Ba)=>{(function(i,e){typeof La=="object"&&typeof Ba<"u"?Ba.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=e())})(La,(function(){"use strict";function i(I,T){var O=Object.keys(I);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(I);T&&(L=L.filter(function(X){return Object.getOwnPropertyDescriptor(I,X).enumerable})),O.push.apply(O,L)}return O}o(i,"ownKeys");function e(I){for(var T=1;T<arguments.length;T++){var O=arguments[T]!=null?arguments[T]:{};T%2?i(Object(O),!0).forEach(function(L){n(I,L,O[L])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(O)):i(Object(O)).forEach(function(L){Object.defineProperty(I,L,Object.getOwnPropertyDescriptor(O,L))})}return I}o(e,"_objectSpread2");function t(I,T){if(!(I instanceof T))throw new TypeError("Cannot call a class as a function")}o(t,"_classCallCheck");function r(I,T){for(var O=0;O<T.length;O++){var L=T[O];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(I,c(L.key),L)}}o(r,"_defineProperties");function s(I,T,O){return T&&r(I.prototype,T),O&&r(I,O),Object.defineProperty(I,"prototype",{writable:!1}),I}o(s,"_createClass");function n(I,T,O){return T=c(T),T in I?Object.defineProperty(I,T,{value:O,enumerable:!0,configurable:!0,writable:!0}):I[T]=O,I}o(n,"_defineProperty");function a(){return a=Object.assign?Object.assign.bind():function(I){for(var T=1;T<arguments.length;T++){var O=arguments[T];for(var L in O)Object.prototype.hasOwnProperty.call(O,L)&&(I[L]=O[L])}return I},a.apply(this,arguments)}o(a,"_extends");function u(I,T){if(typeof I!="object"||I===null)return I;var O=I[Symbol.toPrimitive];if(O!==void 0){var L=O.call(I,T||"default");if(typeof L!="object")return L;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(I)}o(u,"_toPrimitive");function c(I){var T=u(I,"string");return typeof T=="symbol"?T:String(T)}o(c,"_toPropertyKey");var p={exports:{}};(function(I){typeof window>"u"||(function(T){var O=T.HTMLCanvasElement&&T.HTMLCanvasElement.prototype,L=T.Blob&&(function(){try{return!!new Blob}catch{return!1}})(),X=L&&T.Uint8Array&&(function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}})(),J=T.BlobBuilder||T.WebKitBlobBuilder||T.MozBlobBuilder||T.MSBlobBuilder,ne=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,ue=(L||J)&&T.atob&&T.ArrayBuffer&&T.Uint8Array&&function(te){var ie,_e,Ee,ot,Ce,ee,et,Oe,jt;if(ie=te.match(ne),!ie)throw new Error("invalid data URI");for(_e=ie[2]?ie[1]:"text/plain"+(ie[3]||";charset=US-ASCII"),Ee=!!ie[4],ot=te.slice(ie[0].length),Ee?Ce=atob(ot):Ce=decodeURIComponent(ot),ee=new ArrayBuffer(Ce.length),et=new Uint8Array(ee),Oe=0;Oe<Ce.length;Oe+=1)et[Oe]=Ce.charCodeAt(Oe);return L?new Blob([X?et:ee],{type:_e}):(jt=new J,jt.append(ee),jt.getBlob(_e))};T.HTMLCanvasElement&&!O.toBlob&&(O.mozGetAsFile?O.toBlob=function(te,ie,_e){var Ee=this;setTimeout(function(){_e&&O.toDataURL&&ue?te(ue(Ee.toDataURL(ie,_e))):te(Ee.mozGetAsFile("blob",ie))})}:O.toDataURL&&ue&&(O.msToBlob?O.toBlob=function(te,ie,_e){var Ee=this;setTimeout(function(){(ie&&ie!=="image/png"||_e)&&O.toDataURL&&ue?te(ue(Ee.toDataURL(ie,_e))):te(Ee.msToBlob(ie))})}:O.toBlob=function(te,ie,_e){var Ee=this;setTimeout(function(){te(ue(Ee.toDataURL(ie,_e)))})})),I.exports?I.exports=ue:T.dataURLtoBlob=ue})(window)})(p);var f=p.exports,d=o(function(T){return typeof Blob>"u"?!1:T instanceof Blob||Object.prototype.toString.call(T)==="[object Blob]"},"isBlob"),v={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},P=typeof window<"u"&&typeof window.document<"u",k=P?window:{},A=o(function(T){return T>0&&T<1/0},"isPositiveNumber"),C=Array.prototype.slice;function R(I){return Array.from?Array.from(I):C.call(I)}o(R,"toArray");var U=/^image\/.+$/;function F(I){return U.test(I)}o(F,"isImageType");function Y(I){var T=F(I)?I.substr(6):"";return T==="jpeg"&&(T="jpg"),".".concat(T)}o(Y,"imageTypeToExtension");var $=String.fromCharCode;function H(I,T,O){var L="",X;for(O+=T,X=T;X<O;X+=1)L+=$(I.getUint8(X));return L}o(H,"getStringFromCharCode");var Q=k.btoa;function K(I,T){for(var O=[],L=8192,X=new Uint8Array(I);X.length>0;)O.push($.apply(null,R(X.subarray(0,L)))),X=X.subarray(L);return"data:".concat(T,";base64,").concat(Q(O.join("")))}o(K,"arrayBufferToDataURL");function Z(I){var T=new DataView(I),O;try{var L,X,J;if(T.getUint8(0)===255&&T.getUint8(1)===216)for(var ne=T.byteLength,ue=2;ue+1<ne;){if(T.getUint8(ue)===255&&T.getUint8(ue+1)===225){X=ue;break}ue+=1}if(X){var te=X+4,ie=X+10;if(H(T,te,4)==="Exif"){var _e=T.getUint16(ie);if(L=_e===18761,(L||_e===19789)&&T.getUint16(ie+2,L)===42){var Ee=T.getUint32(ie+4,L);Ee>=8&&(J=ie+Ee)}}}if(J){var ot=T.getUint16(J,L),Ce,ee;for(ee=0;ee<ot;ee+=1)if(Ce=J+ee*12+2,T.getUint16(Ce,L)===274){Ce+=8,O=T.getUint16(Ce,L),T.setUint16(Ce,1,L);break}}}catch{O=1}return O}o(Z,"resetAndGetOrientation");function ye(I){var T=0,O=1,L=1;switch(I){case 2:O=-1;break;case 3:T=-180;break;case 4:L=-1;break;case 5:T=90,L=-1;break;case 6:T=90;break;case 7:T=90,O=-1;break;case 8:T=-90;break}return{rotate:T,scaleX:O,scaleY:L}}o(ye,"parseOrientation");var se=/\.\d*(?:0|9){12}\d*$/;function be(I){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return se.test(I)?Math.round(I*T)/T:I}o(be,"normalizeDecimalNumber");function me(I){var T=I.aspectRatio,O=I.height,L=I.width,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",J=A(L),ne=A(O);if(J&&ne){var ue=O*T;(X==="contain"||X==="none")&&ue>L||X==="cover"&&ue<L?O=L/T:L=O*T}else J?O=L/T:ne&&(L=O*T);return{width:L,height:O}}o(me,"getAdjustedSizes");function Pe(I){for(var T=R(new Uint8Array(I)),O=T.length,L=[],X=0;X+3<O;){var J=T[X],ne=T[X+1];if(J===255&&ne===218)break;if(J===255&&ne===216)X+=2;else{var ue=T[X+2]*256+T[X+3],te=X+ue+2,ie=T.slice(X,te);L.push(ie),X=te}}return L.reduce(function(_e,Ee){return Ee[0]===255&&Ee[1]===225?_e.concat(Ee):_e},[])}o(Pe,"getExif");function ve(I,T){var O=R(new Uint8Array(I));if(O[2]!==255||O[3]!==224)return I;var L=O[4]*256+O[5],X=[255,216].concat(T,O.slice(4+L));return new Uint8Array(X)}o(ve,"insertExif");var E=k.ArrayBuffer,w=k.FileReader,S=k.URL||k.webkitURL,B=/\.\w+$/,q=k.Compressor,j=(function(){function I(T,O){t(this,I),this.file=T,this.exif=[],this.image=new Image,this.options=e(e({},v),O),this.aborted=!1,this.result=null,this.init()}return o(I,"Compressor"),s(I,[{key:"init",value:o(function(){var O=this,L=this.file,X=this.options;if(!d(L)){this.fail(new Error("The first argument must be a File or Blob object."));return}var J=L.type;if(!F(J)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!S||!w){this.fail(new Error("The current browser does not support image compression."));return}E||(X.checkOrientation=!1,X.retainExif=!1);var ne=J==="image/jpeg",ue=ne&&X.checkOrientation,te=ne&&X.retainExif;if(S&&!ue&&!te)this.load({url:S.createObjectURL(L)});else{var ie=new w;this.reader=ie,ie.onload=function(_e){var Ee=_e.target,ot=Ee.result,Ce={},ee=1;ue&&(ee=Z(ot),ee>1&&a(Ce,ye(ee))),te&&(O.exif=Pe(ot)),ue||te?!S||ee>1?Ce.url=K(ot,J):Ce.url=S.createObjectURL(L):Ce.url=ot,O.load(Ce)},ie.onabort=function(){O.fail(new Error("Aborted to read the image with FileReader."))},ie.onerror=function(){O.fail(new Error("Failed to read the image with FileReader."))},ie.onloadend=function(){O.reader=null},ue||te?ie.readAsArrayBuffer(L):ie.readAsDataURL(L)}},"init")},{key:"load",value:o(function(O){var L=this,X=this.file,J=this.image;J.onload=function(){L.draw(e(e({},O),{},{naturalWidth:J.naturalWidth,naturalHeight:J.naturalHeight}))},J.onabort=function(){L.fail(new Error("Aborted to load the image."))},J.onerror=function(){L.fail(new Error("Failed to load the image."))},k.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(k.navigator.userAgent)&&(J.crossOrigin="anonymous"),J.alt=X.name,J.src=O.url},"load")},{key:"draw",value:o(function(O){var L=this,X=O.naturalWidth,J=O.naturalHeight,ne=O.rotate,ue=ne===void 0?0:ne,te=O.scaleX,ie=te===void 0?1:te,_e=O.scaleY,Ee=_e===void 0?1:_e,ot=this.file,Ce=this.image,ee=this.options,et=document.createElement("canvas"),Oe=et.getContext("2d"),jt=Math.abs(ue)%180===90,zi=(ee.resize==="contain"||ee.resize==="cover")&&A(ee.width)&&A(ee.height),$t=Math.max(ee.maxWidth,0)||1/0,zt=Math.max(ee.maxHeight,0)||1/0,Wt=Math.max(ee.minWidth,0)||0,gi=Math.max(ee.minHeight,0)||0,Gt=X/J,Ve=ee.width,$e=ee.height;if(jt){var Or=[zt,$t];$t=Or[0],zt=Or[1];var Dr=[gi,Wt];Wt=Dr[0],gi=Dr[1];var Ir=[$e,Ve];Ve=Ir[0],$e=Ir[1]}zi&&(Gt=Ve/$e);var oo=me({aspectRatio:Gt,width:$t,height:zt},"contain");$t=oo.width,zt=oo.height;var no=me({aspectRatio:Gt,width:Wt,height:gi},"cover");if(Wt=no.width,gi=no.height,zi){var oe=me({aspectRatio:Gt,width:Ve,height:$e},ee.resize);Ve=oe.width,$e=oe.height}else{var Nr=me({aspectRatio:Gt,width:Ve,height:$e}),Hi=Nr.width;Ve=Hi===void 0?X:Hi;var Ft=Nr.height;$e=Ft===void 0?J:Ft}Ve=Math.floor(be(Math.min(Math.max(Ve,Wt),$t))),$e=Math.floor(be(Math.min(Math.max($e,gi),zt)));var Tn=-Ve/2,Kt=-$e/2,tt=Ve,Cn=$e,qi=[];if(zi){var Fe=0,we=0,Mr=X,Tt=J,ao=me({aspectRatio:Gt,width:X,height:J},{contain:"cover",cover:"contain"}[ee.resize]);Mr=ao.width,Tt=ao.height,Fe=(X-Mr)/2,we=(J-Tt)/2,qi.push(Fe,we,Mr,Tt)}if(qi.push(Tn,Kt,tt,Cn),jt){var Pt=[$e,Ve];Ve=Pt[0],$e=Pt[1]}et.width=Ve,et.height=$e,F(ee.mimeType)||(ee.mimeType=ot.type);var lo="transparent";ot.size>ee.convertSize&&ee.convertTypes.indexOf(ee.mimeType)>=0&&(ee.mimeType="image/jpeg");var Ae=ee.mimeType==="image/jpeg";if(Ae&&(lo="#fff"),Oe.fillStyle=lo,Oe.fillRect(0,0,Ve,$e),ee.beforeDraw&&ee.beforeDraw.call(this,Oe,et),!this.aborted&&(Oe.save(),Oe.translate(Ve/2,$e/2),Oe.rotate(ue*Math.PI/180),Oe.scale(ie,Ee),Oe.drawImage.apply(Oe,[Ce].concat(qi)),Oe.restore(),ee.drew&&ee.drew.call(this,Oe,et),!this.aborted)){var dt=o(function(vi){if(!L.aborted){var Vi=o(function(Xt){return L.done({naturalWidth:X,naturalHeight:J,result:Xt})},"done");if(vi&&Ae&&ee.retainExif&&L.exif&&L.exif.length>0){var $i=o(function(Xt){return Vi(f(K(ve(Xt,L.exif),ee.mimeType)))},"next");if(vi.arrayBuffer)vi.arrayBuffer().then($i).catch(function(){L.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var vt=new w;L.reader=vt,vt.onload=function(Lr){var Xt=Lr.target;$i(Xt.result)},vt.onabort=function(){L.fail(new Error("Aborted to read the compressed image with FileReader."))},vt.onerror=function(){L.fail(new Error("Failed to read the compressed image with FileReader."))},vt.onloadend=function(){L.reader=null},vt.readAsArrayBuffer(vi)}}else Vi(vi)}},"callback");et.toBlob?et.toBlob(dt,ee.mimeType,ee.quality):dt(f(et.toDataURL(ee.mimeType,ee.quality)))}},"draw")},{key:"done",value:o(function(O){var L=O.naturalWidth,X=O.naturalHeight,J=O.result,ne=this.file,ue=this.image,te=this.options;if(S&&ue.src.indexOf("blob:")===0&&S.revokeObjectURL(ue.src),J)if(te.strict&&!te.retainExif&&J.size>ne.size&&te.mimeType===ne.type&&!(te.width>L||te.height>X||te.minWidth>L||te.minHeight>X||te.maxWidth<L||te.maxHeight<X))J=ne;else{var ie=new Date;J.lastModified=ie.getTime(),J.lastModifiedDate=ie,J.name=ne.name,J.name&&J.type!==ne.type&&(J.name=J.name.replace(B,Y(J.type)))}else J=ne;this.result=J,te.success&&te.success.call(this,J)},"done")},{key:"fail",value:o(function(O){var L=this.options;if(L.error)L.error.call(this,O);else throw O},"fail")},{key:"abort",value:o(function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))},"abort")}],[{key:"noConflict",value:o(function(){return window.Compressor=q,I},"noConflict")},{key:"setDefaults",value:o(function(O){a(v,O)},"setDefaults")}]),I})();return j}))});var Kh=pe((Pl,kl)=>{(function(i,e){typeof Pl=="object"&&typeof kl<"u"?kl.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Cropper=e())})(Pl,(function(){"use strict";function i(y,h){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(y);h&&(m=m.filter(function(_){return Object.getOwnPropertyDescriptor(y,_).enumerable})),g.push.apply(g,m)}return g}o(i,"ownKeys");function e(y){for(var h=1;h<arguments.length;h++){var g=arguments[h]!=null?arguments[h]:{};h%2?i(Object(g),!0).forEach(function(m){c(y,m,g[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):i(Object(g)).forEach(function(m){Object.defineProperty(y,m,Object.getOwnPropertyDescriptor(g,m))})}return y}o(e,"_objectSpread2");function t(y,h){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var m=g.call(y,h||"default");if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(y)}o(t,"_toPrimitive");function r(y){var h=t(y,"string");return typeof h=="symbol"?h:h+""}o(r,"_toPropertyKey");function s(y){"@babel/helpers - typeof";return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},s(y)}o(s,"_typeof");function n(y,h){if(!(y instanceof h))throw new TypeError("Cannot call a class as a function")}o(n,"_classCallCheck");function a(y,h){for(var g=0;g<h.length;g++){var m=h[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,r(m.key),m)}}o(a,"_defineProperties");function u(y,h,g){return h&&a(y.prototype,h),g&&a(y,g),Object.defineProperty(y,"prototype",{writable:!1}),y}o(u,"_createClass");function c(y,h,g){return h=r(h),h in y?Object.defineProperty(y,h,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[h]=g,y}o(c,"_defineProperty");function p(y){return f(y)||d(y)||v(y)||k()}o(p,"_toConsumableArray");function f(y){if(Array.isArray(y))return P(y)}o(f,"_arrayWithoutHoles");function d(y){if(typeof Symbol<"u"&&y[Symbol.iterator]!=null||y["@@iterator"]!=null)return Array.from(y)}o(d,"_iterableToArray");function v(y,h){if(y){if(typeof y=="string")return P(y,h);var g=Object.prototype.toString.call(y).slice(8,-1);if(g==="Object"&&y.constructor&&(g=y.constructor.name),g==="Map"||g==="Set")return Array.from(y);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return P(y,h)}}o(v,"_unsupportedIterableToArray");function P(y,h){(h==null||h>y.length)&&(h=y.length);for(var g=0,m=new Array(h);g<h;g++)m[g]=y[g];return m}o(P,"_arrayLikeToArray");function k(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}o(k,"_nonIterableSpread");var A=typeof window<"u"&&typeof window.document<"u",C=A?window:{},R=A&&C.document.documentElement?"ontouchstart"in C.document.documentElement:!1,U=A?"PointerEvent"in C:!1,F="cropper",Y="all",$="crop",H="move",Q="zoom",K="e",Z="w",ye="s",se="n",be="ne",me="nw",Pe="se",ve="sw",E="".concat(F,"-crop"),w="".concat(F,"-disabled"),S="".concat(F,"-hidden"),B="".concat(F,"-hide"),q="".concat(F,"-invisible"),j="".concat(F,"-modal"),I="".concat(F,"-move"),T="".concat(F,"Action"),O="".concat(F,"Preview"),L="crop",X="move",J="none",ne="crop",ue="cropend",te="cropmove",ie="cropstart",_e="dblclick",Ee=R?"touchstart":"mousedown",ot=R?"touchmove":"mousemove",Ce=R?"touchend touchcancel":"mouseup",ee=U?"pointerdown":Ee,et=U?"pointermove":ot,Oe=U?"pointerup pointercancel":Ce,jt="ready",zi="resize",$t="wheel",zt="zoom",Wt="image/jpeg",gi=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Gt=/^data:/,Ve=/^data:image\/jpeg;base64,/,$e=/^img|canvas$/i,Or=200,Dr=100,Ir={viewMode:0,dragMode:L,initialAspectRatio:NaN,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:Or,minContainerHeight:Dr,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},oo='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',no=Number.isNaN||C.isNaN;function oe(y){return typeof y=="number"&&!no(y)}o(oe,"isNumber");var Nr=o(function(h){return h>0&&h<1/0},"isPositiveNumber");function Hi(y){return typeof y>"u"}o(Hi,"isUndefined");function Ft(y){return s(y)==="object"&&y!==null}o(Ft,"isObject");var Tn=Object.prototype.hasOwnProperty;function Kt(y){if(!Ft(y))return!1;try{var h=y.constructor,g=h.prototype;return h&&g&&Tn.call(g,"isPrototypeOf")}catch{return!1}}o(Kt,"isPlainObject");function tt(y){return typeof y=="function"}o(tt,"isFunction");var Cn=Array.prototype.slice;function qi(y){return Array.from?Array.from(y):Cn.call(y)}o(qi,"toArray");function Fe(y,h){return y&&tt(h)&&(Array.isArray(y)||oe(y.length)?qi(y).forEach(function(g,m){h.call(y,g,m,y)}):Ft(y)&&Object.keys(y).forEach(function(g){h.call(y,y[g],g,y)})),y}o(Fe,"forEach");var we=Object.assign||o(function(h){for(var g=arguments.length,m=new Array(g>1?g-1:0),_=1;_<g;_++)m[_-1]=arguments[_];return Ft(h)&&m.length>0&&m.forEach(function(b){Ft(b)&&Object.keys(b).forEach(function(x){h[x]=b[x]})}),h},"assign"),Mr=/\.\d*(?:0|9){12}\d*$/;function Tt(y){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Mr.test(y)?Math.round(y*h)/h:y}o(Tt,"normalizeDecimalNumber");var ao=/^width|height|left|top|marginLeft|marginTop$/;function Pt(y,h){var g=y.style;Fe(h,function(m,_){ao.test(_)&&oe(m)&&(m="".concat(m,"px")),g[_]=m})}o(Pt,"setStyle");function lo(y,h){return y.classList?y.classList.contains(h):y.className.indexOf(h)>-1}o(lo,"hasClass");function Ae(y,h){if(h){if(oe(y.length)){Fe(y,function(m){Ae(m,h)});return}if(y.classList){y.classList.add(h);return}var g=y.className.trim();g?g.indexOf(h)<0&&(y.className="".concat(g," ").concat(h)):y.className=h}}o(Ae,"addClass");function dt(y,h){if(h){if(oe(y.length)){Fe(y,function(g){dt(g,h)});return}if(y.classList){y.classList.remove(h);return}y.className.indexOf(h)>=0&&(y.className=y.className.replace(h,""))}}o(dt,"removeClass");function yi(y,h,g){if(h){if(oe(y.length)){Fe(y,function(m){yi(m,h,g)});return}g?Ae(y,h):dt(y,h)}}o(yi,"toggleClass");var vi=/([a-z\d])([A-Z])/g;function Vi(y){return y.replace(vi,"$1-$2").toLowerCase()}o(Vi,"toParamCase");function $i(y,h){return Ft(y[h])?y[h]:y.dataset?y.dataset[h]:y.getAttribute("data-".concat(Vi(h)))}o($i,"getData");function vt(y,h,g){Ft(g)?y[h]=g:y.dataset?y.dataset[h]=g:y.setAttribute("data-".concat(Vi(h)),g)}o(vt,"setData");function Lr(y,h){if(Ft(y[h]))try{delete y[h]}catch{y[h]=void 0}else if(y.dataset)try{delete y.dataset[h]}catch{y.dataset[h]=void 0}else y.removeAttribute("data-".concat(Vi(h)))}o(Lr,"removeData");var Xt=/\s\s*/,Ru=(function(){var y=!1;if(A){var h=!1,g=o(function(){},"listener"),m=Object.defineProperty({},"once",{get:o(function(){return y=!0,h},"get"),set:o(function(b){h=b},"set")});C.addEventListener("test",g,m),C.removeEventListener("test",g,m)}return y})();function kt(y,h,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},_=g;h.trim().split(Xt).forEach(function(b){if(!Ru){var x=y.listeners;x&&x[b]&&x[b][g]&&(_=x[b][g],delete x[b][g],Object.keys(x[b]).length===0&&delete x[b],Object.keys(x).length===0&&delete y.listeners)}y.removeEventListener(b,_,m)})}o(kt,"removeListener");function bt(y,h,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},_=g;h.trim().split(Xt).forEach(function(b){if(m.once&&!Ru){var x=y.listeners,D=x===void 0?{}:x;_=o(function(){delete D[b][g],y.removeEventListener(b,_,m);for(var z=arguments.length,N=new Array(z),M=0;M<z;M++)N[M]=arguments[M];g.apply(y,N)},"handler"),D[b]||(D[b]={}),D[b][g]&&y.removeEventListener(b,D[b][g],m),D[b][g]=_,y.listeners=D}y.addEventListener(b,_,m)})}o(bt,"addListener");function Wi(y,h,g){var m;return tt(Event)&&tt(CustomEvent)?m=new CustomEvent(h,{detail:g,bubbles:!0,cancelable:!0}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(h,!0,!0,g)),y.dispatchEvent(m)}o(Wi,"dispatchEvent");function Uu(y){var h=y.getBoundingClientRect();return{left:h.left+(window.pageXOffset-document.documentElement.clientLeft),top:h.top+(window.pageYOffset-document.documentElement.clientTop)}}o(Uu,"getOffset");var An=C.location,Sg=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Ou(y){var h=y.match(Sg);return h!==null&&(h[1]!==An.protocol||h[2]!==An.hostname||h[3]!==An.port)}o(Ou,"isCrossOriginURL");function Du(y){var h="timestamp=".concat(new Date().getTime());return y+(y.indexOf("?")===-1?"?":"&")+h}o(Du,"addTimestamp");function Br(y){var h=y.rotate,g=y.scaleX,m=y.scaleY,_=y.translateX,b=y.translateY,x=[];oe(_)&&_!==0&&x.push("translateX(".concat(_,"px)")),oe(b)&&b!==0&&x.push("translateY(".concat(b,"px)")),oe(h)&&h!==0&&x.push("rotate(".concat(h,"deg)")),oe(g)&&g!==1&&x.push("scaleX(".concat(g,")")),oe(m)&&m!==1&&x.push("scaleY(".concat(m,")"));var D=x.length?x.join(" "):"none";return{WebkitTransform:D,msTransform:D,transform:D}}o(Br,"getTransforms");function xg(y){var h=e({},y),g=0;return Fe(y,function(m,_){delete h[_],Fe(h,function(b){var x=Math.abs(m.startX-b.startX),D=Math.abs(m.startY-b.startY),W=Math.abs(m.endX-b.endX),z=Math.abs(m.endY-b.endY),N=Math.sqrt(x*x+D*D),M=Math.sqrt(W*W+z*z),V=(M-N)/N;Math.abs(V)>Math.abs(g)&&(g=V)})}),g}o(xg,"getMaxZoomRatio");function uo(y,h){var g=y.pageX,m=y.pageY,_={endX:g,endY:m};return h?_:e({startX:g,startY:m},_)}o(uo,"getPointer");function _g(y){var h=0,g=0,m=0;return Fe(y,function(_){var b=_.startX,x=_.startY;h+=b,g+=x,m+=1}),h/=m,g/=m,{pageX:h,pageY:g}}o(_g,"getPointersCenter");function Yt(y){var h=y.aspectRatio,g=y.height,m=y.width,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",b=Nr(m),x=Nr(g);if(b&&x){var D=g*h;_==="contain"&&D>m||_==="cover"&&D<m?g=m/h:m=g*h}else b?g=m/h:x&&(m=g*h);return{width:m,height:g}}o(Yt,"getAdjustedSizes");function Pg(y){var h=y.width,g=y.height,m=y.degree;if(m=Math.abs(m)%180,m===90)return{width:g,height:h};var _=m%90*Math.PI/180,b=Math.sin(_),x=Math.cos(_),D=h*x+g*b,W=h*b+g*x;return m>90?{width:W,height:D}:{width:D,height:W}}o(Pg,"getRotatedSizes");function kg(y,h,g,m){var _=h.aspectRatio,b=h.naturalWidth,x=h.naturalHeight,D=h.rotate,W=D===void 0?0:D,z=h.scaleX,N=z===void 0?1:z,M=h.scaleY,V=M===void 0?1:M,ce=g.aspectRatio,le=g.naturalWidth,ke=g.naturalHeight,de=m.fillColor,Le=de===void 0?"transparent":de,We=m.imageSmoothingEnabled,De=We===void 0?!0:We,Ht=m.imageSmoothingQuality,ht=Ht===void 0?"low":Ht,G=m.maxWidth,he=G===void 0?1/0:G,Be=m.maxHeight,wt=Be===void 0?1/0:Be,qt=m.minWidth,bi=qt===void 0?0:qt,wi=m.minHeight,Jt=wi===void 0?0:wi,Ct=document.createElement("canvas"),lt=Ct.getContext("2d"),Si=Yt({aspectRatio:ce,width:he,height:wt}),co=Yt({aspectRatio:ce,width:bi,height:Jt},"cover"),Rn=Math.min(Si.width,Math.max(co.width,le)),Un=Math.min(Si.height,Math.max(co.height,ke)),Mu=Yt({aspectRatio:_,width:he,height:wt}),Lu=Yt({aspectRatio:_,width:bi,height:Jt},"cover"),Bu=Math.min(Mu.width,Math.max(Lu.width,b)),ju=Math.min(Mu.height,Math.max(Lu.height,x)),Bg=[-Bu/2,-ju/2,Bu,ju];return Ct.width=Tt(Rn),Ct.height=Tt(Un),lt.fillStyle=Le,lt.fillRect(0,0,Rn,Un),lt.save(),lt.translate(Rn/2,Un/2),lt.rotate(W*Math.PI/180),lt.scale(N,V),lt.imageSmoothingEnabled=De,lt.imageSmoothingQuality=ht,lt.drawImage.apply(lt,[y].concat(p(Bg.map(function(jg){return Math.floor(Tt(jg))})))),lt.restore(),Ct}o(kg,"getSourceCanvas");var Iu=String.fromCharCode;function Eg(y,h,g){var m="";g+=h;for(var _=h;_<g;_+=1)m+=Iu(y.getUint8(_));return m}o(Eg,"getStringFromCharCode");var Fg=/^data:.*,/;function Tg(y){var h=y.replace(Fg,""),g=atob(h),m=new ArrayBuffer(g.length),_=new Uint8Array(m);return Fe(_,function(b,x){_[x]=g.charCodeAt(x)}),m}o(Tg,"dataURLToArrayBuffer");function Cg(y,h){for(var g=[],m=8192,_=new Uint8Array(y);_.length>0;)g.push(Iu.apply(null,qi(_.subarray(0,m)))),_=_.subarray(m);return"data:".concat(h,";base64,").concat(btoa(g.join("")))}o(Cg,"arrayBufferToDataURL");function Ag(y){var h=new DataView(y),g;try{var m,_,b;if(h.getUint8(0)===255&&h.getUint8(1)===216)for(var x=h.byteLength,D=2;D+1<x;){if(h.getUint8(D)===255&&h.getUint8(D+1)===225){_=D;break}D+=1}if(_){var W=_+4,z=_+10;if(Eg(h,W,4)==="Exif"){var N=h.getUint16(z);if(m=N===18761,(m||N===19789)&&h.getUint16(z+2,m)===42){var M=h.getUint32(z+4,m);M>=8&&(b=z+M)}}}if(b){var V=h.getUint16(b,m),ce,le;for(le=0;le<V;le+=1)if(ce=b+le*12+2,h.getUint16(ce,m)===274){ce+=8,g=h.getUint16(ce,m),h.setUint16(ce,1,m);break}}}catch{g=1}return g}o(Ag,"resetAndGetOrientation");function Rg(y){var h=0,g=1,m=1;switch(y){case 2:g=-1;break;case 3:h=-180;break;case 4:m=-1;break;case 5:h=90,m=-1;break;case 6:h=90;break;case 7:h=90,g=-1;break;case 8:h=-90;break}return{rotate:h,scaleX:g,scaleY:m}}o(Rg,"parseOrientation");var Ug={render:o(function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},"render"),initContainer:o(function(){var h=this.element,g=this.options,m=this.container,_=this.cropper,b=Number(g.minContainerWidth),x=Number(g.minContainerHeight);Ae(_,S),dt(h,S);var D={width:Math.max(m.offsetWidth,b>=0?b:Or),height:Math.max(m.offsetHeight,x>=0?x:Dr)};this.containerData=D,Pt(_,{width:D.width,height:D.height}),Ae(h,S),dt(_,S)},"initContainer"),initCanvas:o(function(){var h=this.containerData,g=this.imageData,m=this.options.viewMode,_=Math.abs(g.rotate)%180===90,b=_?g.naturalHeight:g.naturalWidth,x=_?g.naturalWidth:g.naturalHeight,D=b/x,W=h.width,z=h.height;h.height*D>h.width?m===3?W=h.height*D:z=h.width/D:m===3?z=h.width/D:W=h.height*D;var N={aspectRatio:D,naturalWidth:b,naturalHeight:x,width:W,height:z};this.canvasData=N,this.limited=m===1||m===2,this.limitCanvas(!0,!0),N.width=Math.min(Math.max(N.width,N.minWidth),N.maxWidth),N.height=Math.min(Math.max(N.height,N.minHeight),N.maxHeight),N.left=(h.width-N.width)/2,N.top=(h.height-N.height)/2,N.oldLeft=N.left,N.oldTop=N.top,this.initialCanvasData=we({},N)},"initCanvas"),limitCanvas:o(function(h,g){var m=this.options,_=this.containerData,b=this.canvasData,x=this.cropBoxData,D=m.viewMode,W=b.aspectRatio,z=this.cropped&&x;if(h){var N=Number(m.minCanvasWidth)||0,M=Number(m.minCanvasHeight)||0;D>1?(N=Math.max(N,_.width),M=Math.max(M,_.height),D===3&&(M*W>N?N=M*W:M=N/W)):D>0&&(N?N=Math.max(N,z?x.width:0):M?M=Math.max(M,z?x.height:0):z&&(N=x.width,M=x.height,M*W>N?N=M*W:M=N/W));var V=Yt({aspectRatio:W,width:N,height:M});N=V.width,M=V.height,b.minWidth=N,b.minHeight=M,b.maxWidth=1/0,b.maxHeight=1/0}if(g)if(D>(z?0:1)){var ce=_.width-b.width,le=_.height-b.height;b.minLeft=Math.min(0,ce),b.minTop=Math.min(0,le),b.maxLeft=Math.max(0,ce),b.maxTop=Math.max(0,le),z&&this.limited&&(b.minLeft=Math.min(x.left,x.left+(x.width-b.width)),b.minTop=Math.min(x.top,x.top+(x.height-b.height)),b.maxLeft=x.left,b.maxTop=x.top,D===2&&(b.width>=_.width&&(b.minLeft=Math.min(0,ce),b.maxLeft=Math.max(0,ce)),b.height>=_.height&&(b.minTop=Math.min(0,le),b.maxTop=Math.max(0,le))))}else b.minLeft=-b.width,b.minTop=-b.height,b.maxLeft=_.width,b.maxTop=_.height},"limitCanvas"),renderCanvas:o(function(h,g){var m=this.canvasData,_=this.imageData;if(g){var b=Pg({width:_.naturalWidth*Math.abs(_.scaleX||1),height:_.naturalHeight*Math.abs(_.scaleY||1),degree:_.rotate||0}),x=b.width,D=b.height,W=m.width*(x/m.naturalWidth),z=m.height*(D/m.naturalHeight);m.left-=(W-m.width)/2,m.top-=(z-m.height)/2,m.width=W,m.height=z,m.aspectRatio=x/D,m.naturalWidth=x,m.naturalHeight=D,this.limitCanvas(!0,!1)}(m.width>m.maxWidth||m.width<m.minWidth)&&(m.left=m.oldLeft),(m.height>m.maxHeight||m.height<m.minHeight)&&(m.top=m.oldTop),m.width=Math.min(Math.max(m.width,m.minWidth),m.maxWidth),m.height=Math.min(Math.max(m.height,m.minHeight),m.maxHeight),this.limitCanvas(!1,!0),m.left=Math.min(Math.max(m.left,m.minLeft),m.maxLeft),m.top=Math.min(Math.max(m.top,m.minTop),m.maxTop),m.oldLeft=m.left,m.oldTop=m.top,Pt(this.canvas,we({width:m.width,height:m.height},Br({translateX:m.left,translateY:m.top}))),this.renderImage(h),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},"renderCanvas"),renderImage:o(function(h){var g=this.canvasData,m=this.imageData,_=m.naturalWidth*(g.width/g.naturalWidth),b=m.naturalHeight*(g.height/g.naturalHeight);we(m,{width:_,height:b,left:(g.width-_)/2,top:(g.height-b)/2}),Pt(this.image,we({width:m.width,height:m.height},Br(we({translateX:m.left,translateY:m.top},m)))),h&&this.output()},"renderImage"),initCropBox:o(function(){var h=this.options,g=this.canvasData,m=h.aspectRatio||h.initialAspectRatio,_=Number(h.autoCropArea)||.8,b={width:g.width,height:g.height};m&&(g.height*m>g.width?b.height=b.width/m:b.width=b.height*m),this.cropBoxData=b,this.limitCropBox(!0,!0),b.width=Math.min(Math.max(b.width,b.minWidth),b.maxWidth),b.height=Math.min(Math.max(b.height,b.minHeight),b.maxHeight),b.width=Math.max(b.minWidth,b.width*_),b.height=Math.max(b.minHeight,b.height*_),b.left=g.left+(g.width-b.width)/2,b.top=g.top+(g.height-b.height)/2,b.oldLeft=b.left,b.oldTop=b.top,this.initialCropBoxData=we({},b)},"initCropBox"),limitCropBox:o(function(h,g){var m=this.options,_=this.containerData,b=this.canvasData,x=this.cropBoxData,D=this.limited,W=m.aspectRatio;if(h){var z=Number(m.minCropBoxWidth)||0,N=Number(m.minCropBoxHeight)||0,M=D?Math.min(_.width,b.width,b.width+b.left,_.width-b.left):_.width,V=D?Math.min(_.height,b.height,b.height+b.top,_.height-b.top):_.height;z=Math.min(z,_.width),N=Math.min(N,_.height),W&&(z&&N?N*W>z?N=z/W:z=N*W:z?N=z/W:N&&(z=N*W),V*W>M?V=M/W:M=V*W),x.minWidth=Math.min(z,M),x.minHeight=Math.min(N,V),x.maxWidth=M,x.maxHeight=V}g&&(D?(x.minLeft=Math.max(0,b.left),x.minTop=Math.max(0,b.top),x.maxLeft=Math.min(_.width,b.left+b.width)-x.width,x.maxTop=Math.min(_.height,b.top+b.height)-x.height):(x.minLeft=0,x.minTop=0,x.maxLeft=_.width-x.width,x.maxTop=_.height-x.height))},"limitCropBox"),renderCropBox:o(function(){var h=this.options,g=this.containerData,m=this.cropBoxData;(m.width>m.maxWidth||m.width<m.minWidth)&&(m.left=m.oldLeft),(m.height>m.maxHeight||m.height<m.minHeight)&&(m.top=m.oldTop),m.width=Math.min(Math.max(m.width,m.minWidth),m.maxWidth),m.height=Math.min(Math.max(m.height,m.minHeight),m.maxHeight),this.limitCropBox(!1,!0),m.left=Math.min(Math.max(m.left,m.minLeft),m.maxLeft),m.top=Math.min(Math.max(m.top,m.minTop),m.maxTop),m.oldLeft=m.left,m.oldTop=m.top,h.movable&&h.cropBoxMovable&&vt(this.face,T,m.width>=g.width&&m.height>=g.height?H:Y),Pt(this.cropBox,we({width:m.width,height:m.height},Br({translateX:m.left,translateY:m.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},"renderCropBox"),output:o(function(){this.preview(),Wi(this.element,ne,this.getData())},"output")},Og={initPreview:o(function(){var h=this.element,g=this.crossOrigin,m=this.options.preview,_=g?this.crossOriginUrl:this.url,b=h.alt||"The image to preview",x=document.createElement("img");if(g&&(x.crossOrigin=g),x.src=_,x.alt=b,this.viewBox.appendChild(x),this.viewBoxImage=x,!!m){var D=m;typeof m=="string"?D=h.ownerDocument.querySelectorAll(m):m.querySelector&&(D=[m]),this.previews=D,Fe(D,function(W){var z=document.createElement("img");vt(W,O,{width:W.offsetWidth,height:W.offsetHeight,html:W.innerHTML}),g&&(z.crossOrigin=g),z.src=_,z.alt=b,z.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;"',W.innerHTML="",W.appendChild(z)})}},"initPreview"),resetPreview:o(function(){Fe(this.previews,function(h){var g=$i(h,O);Pt(h,{width:g.width,height:g.height}),h.innerHTML=g.html,Lr(h,O)})},"resetPreview"),preview:o(function(){var h=this.imageData,g=this.canvasData,m=this.cropBoxData,_=m.width,b=m.height,x=h.width,D=h.height,W=m.left-g.left-h.left,z=m.top-g.top-h.top;!this.cropped||this.disabled||(Pt(this.viewBoxImage,we({width:x,height:D},Br(we({translateX:-W,translateY:-z},h)))),Fe(this.previews,function(N){var M=$i(N,O),V=M.width,ce=M.height,le=V,ke=ce,de=1;_&&(de=V/_,ke=b*de),b&&ke>ce&&(de=ce/b,le=_*de,ke=ce),Pt(N,{width:le,height:ke}),Pt(N.getElementsByTagName("img")[0],we({width:x*de,height:D*de},Br(we({translateX:-W*de,translateY:-z*de},h))))}))},"preview")},Dg={bind:o(function(){var h=this.element,g=this.options,m=this.cropper;tt(g.cropstart)&&bt(h,ie,g.cropstart),tt(g.cropmove)&&bt(h,te,g.cropmove),tt(g.cropend)&&bt(h,ue,g.cropend),tt(g.crop)&&bt(h,ne,g.crop),tt(g.zoom)&&bt(h,zt,g.zoom),bt(m,ee,this.onCropStart=this.cropStart.bind(this)),g.zoomable&&g.zoomOnWheel&&bt(m,$t,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&bt(m,_e,this.onDblclick=this.dblclick.bind(this)),bt(h.ownerDocument,et,this.onCropMove=this.cropMove.bind(this)),bt(h.ownerDocument,Oe,this.onCropEnd=this.cropEnd.bind(this)),g.responsive&&bt(window,zi,this.onResize=this.resize.bind(this))},"bind"),unbind:o(function(){var h=this.element,g=this.options,m=this.cropper;tt(g.cropstart)&&kt(h,ie,g.cropstart),tt(g.cropmove)&&kt(h,te,g.cropmove),tt(g.cropend)&&kt(h,ue,g.cropend),tt(g.crop)&&kt(h,ne,g.crop),tt(g.zoom)&&kt(h,zt,g.zoom),kt(m,ee,this.onCropStart),g.zoomable&&g.zoomOnWheel&&kt(m,$t,this.onWheel,{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&kt(m,_e,this.onDblclick),kt(h.ownerDocument,et,this.onCropMove),kt(h.ownerDocument,Oe,this.onCropEnd),g.responsive&&kt(window,zi,this.onResize)},"unbind")},Ig={resize:o(function(){if(!this.disabled){var h=this.options,g=this.container,m=this.containerData,_=g.offsetWidth/m.width,b=g.offsetHeight/m.height,x=Math.abs(_-1)>Math.abs(b-1)?_:b;if(x!==1){var D,W;h.restore&&(D=this.getCanvasData(),W=this.getCropBoxData()),this.render(),h.restore&&(this.setCanvasData(Fe(D,function(z,N){D[N]=z*x})),this.setCropBoxData(Fe(W,function(z,N){W[N]=z*x})))}}},"resize"),dblclick:o(function(){this.disabled||this.options.dragMode===J||this.setDragMode(lo(this.dragBox,E)?X:L)},"dblclick"),wheel:o(function(h){var g=this,m=Number(this.options.wheelZoomRatio)||.1,_=1;this.disabled||(h.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){g.wheeling=!1},50),h.deltaY?_=h.deltaY>0?1:-1:h.wheelDelta?_=-h.wheelDelta/120:h.detail&&(_=h.detail>0?1:-1),this.zoom(-_*m,h)))},"wheel"),cropStart:o(function(h){var g=h.buttons,m=h.button;if(!(this.disabled||(h.type==="mousedown"||h.type==="pointerdown"&&h.pointerType==="mouse")&&(oe(g)&&g!==1||oe(m)&&m!==0||h.ctrlKey))){var _=this.options,b=this.pointers,x;h.changedTouches?Fe(h.changedTouches,function(D){b[D.identifier]=uo(D)}):b[h.pointerId||0]=uo(h),Object.keys(b).length>1&&_.zoomable&&_.zoomOnTouch?x=Q:x=$i(h.target,T),