!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Uppy=e()}}((function(){return function e(t,i,r){function s(o,a){if(!i[o]){if(!t[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(n)return n(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var p=i[o]={exports:{}};t[o][0].call(p.exports,(function(e){return s(t[o][1][e]||e)}),p,p.exports,e,t,i,r)}return i[o].exports}for(var n="function"==typeof require&&require,o=0;o=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+s:(t?"-":"")+e.toFixed(1)+" "+s}},{}],2:[function(e,t,i){function r(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}t.exports=r,r.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),i=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-i:e+i}return 0|Math.min(e,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(e){this.ms=e},r.prototype.setMax=function(e){this.max=e},r.prototype.setJitter=function(e){this.jitter=e}},{}],3:[function(e,t,i){!function(e){"use strict";i.encode=function(t){var i,r=new Uint8Array(t),s=r.length,n="";for(i=0;i>2],n+=e[(3&r[i])<<4|r[i+1]>>4],n+=e[(15&r[i+1])<<2|r[i+2]>>6],n+=e[63&r[i+2]];return s%3==2?n=n.substring(0,n.length-1)+"=":s%3==1&&(n=n.substring(0,n.length-2)+"=="),n},i.decode=function(t){var i,r,s,n,o,a=.75*t.length,l=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var p=new ArrayBuffer(a),c=new Uint8Array(p);for(i=0;i>4,c[u++]=(15&s)<<4|n>>2,c[u++]=(3&n)<<6|63&o;return p}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],4:[function(e,t,i){"use strict";i.byteLength=function(e){var t=u(e),i=t[0],r=t[1];return 3*(i+r)/4-r},i.toByteArray=function(e){var t,i,r=u(e),o=r[0],a=r[1],l=new n(function(e,t,i){return 3*(t+i)/4-i}(0,o,a)),p=0,c=a>0?o-4:o;for(i=0;i>16&255,l[p++]=t>>8&255,l[p++]=255&t;2===a&&(t=s[e.charCodeAt(i)]<<2|s[e.charCodeAt(i+1)]>>4,l[p++]=255&t);1===a&&(t=s[e.charCodeAt(i)]<<10|s[e.charCodeAt(i+1)]<<4|s[e.charCodeAt(i+2)]>>2,l[p++]=t>>8&255,l[p++]=255&t);return l},i.fromByteArray=function(e){for(var t,i=e.length,s=i%3,n=[],o=16383,a=0,l=i-s;al?l:a+o));1===s?(t=e[i-1],n.push(r[t>>2]+r[t<<4&63]+"==")):2===s&&(t=(e[i-2]<<8)+e[i-1],n.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return n.join("")};for(var r=[],s=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function p(e,t,i){for(var s,n,o=[],a=t;a>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return o.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],5:[function(e,t,i){(function(t){(function(){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ "use strict";var t=e("base64-js"),r=e("ieee754");i.Buffer=o,i.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},i.INSPECT_MAX_BYTES=50;var s=2147483647;function n(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,i)}function a(e,t,i){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var i=0|h(e,t),r=n(i),s=r.write(e,t);s!==i&&(r=r.slice(0,s));return r}(e,t);if(ArrayBuffer.isView(e))return p(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return function(e,t,i){if(t<0||e.byteLength=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return M(e).length;default:if(s)return r?-1:B(e).length;t=(""+t).toLowerCase(),s=!0}}function d(e,t,i){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return _(this,t,i);case"utf8":case"utf-8":return x(this,t,i);case"ascii":return E(this,t,i);case"latin1":case"binary":return F(this,t,i);case"base64":return k(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function m(e,t,i,r,s){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),z(i=+i)&&(i=s?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(s)return-1;i=e.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:g(e,t,i,r,s);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):g(e,[t],i,r,s);throw new TypeError("val must be string, number or Buffer")}function g(e,t,i,r,s){var n,o=1,a=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,i/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(s){var p=-1;for(n=i;na&&(i=a-l),n=i;n>=0;n--){for(var c=!0,h=0;hs&&(r=s):r=s;var n=t.length;r>n/2&&(r=n/2);for(var o=0;o>8,s=i%256,n.push(s),n.push(r);return n}(t,e.length-i),e,i,r)}function k(e,i,r){return 0===i&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(i,r))}function x(e,t,i){i=Math.min(e.length,i);for(var r=[],s=t;s239?4:u>223?3:u>191?2:1;if(s+c<=i)switch(c){case 1:u<128&&(p=u);break;case 2:128==(192&(n=e[s+1]))&&(l=(31&u)<<6|63&n)>127&&(p=l);break;case 3:n=e[s+1],o=e[s+2],128==(192&n)&&128==(192&o)&&(l=(15&u)<<12|(63&n)<<6|63&o)>2047&&(l<55296||l>57343)&&(p=l);break;case 4:n=e[s+1],o=e[s+2],a=e[s+3],128==(192&n)&&128==(192&o)&&128==(192&a)&&(l=(15&u)<<18|(63&n)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(p=l)}null===p?(p=65533,c=1):p>65535&&(p-=65536,r.push(p>>>10&1023|55296),p=56320|1023&p),r.push(p),s+=c}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);var i="",r=0;for(;rt&&(e+=" ... "),""},o.prototype.compare=function(e,t,i,r,s){if(j(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),t<0||i>e.length||r<0||s>this.length)throw new RangeError("out of range index");if(r>=s&&t>=i)return 0;if(r>=s)return-1;if(t>=i)return 1;if(this===e)return 0;for(var n=(s>>>=0)-(r>>>=0),a=(i>>>=0)-(t>>>=0),l=Math.min(n,a),u=this.slice(r,s),p=e.slice(t,i),c=0;c>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var s=this.length-t;if((void 0===i||i>s)&&(i=s),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var n=!1;;)switch(r){case"hex":return y(this,e,t,i);case"utf8":case"utf-8":return v(this,e,t,i);case"ascii":return b(this,e,t,i);case"latin1":case"binary":return w(this,e,t,i);case"base64":return S(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,i);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),n=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function E(e,t,i){var r="";i=Math.min(e.length,i);for(var s=t;sr)&&(i=r);for(var s="",n=t;ni)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,i,r,s,n){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||te.length)throw new RangeError("Index out of range")}function T(e,t,i,r,s,n){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function U(e,t,i,s,n){return t=+t,i>>>=0,n||T(e,0,i,4),r.write(e,t,i,s,23,4),i+4}function D(e,t,i,s,n){return t=+t,i>>>=0,n||T(e,0,i,8),r.write(e,t,i,s,52,8),i+8}o.prototype.slice=function(e,t){var i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t>>=0,t>>>=0,i||A(e,t,this.length);for(var r=this[e],s=1,n=0;++n>>=0,t>>>=0,i||A(e,t,this.length);for(var r=this[e+--t],s=1;t>0&&(s*=256);)r+=this[e+--t]*s;return r},o.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||A(e,t,this.length);for(var r=this[e],s=1,n=0;++n=(s*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||A(e,t,this.length);for(var r=t,s=1,n=this[e+--r];r>0&&(s*=256);)n+=this[e+--r]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),r.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),r.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),r.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),r.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,i,r){(e=+e,t>>>=0,i>>>=0,r)||R(this,e,t,i,Math.pow(2,8*i)-1,0);var s=1,n=0;for(this[t]=255&e;++n>>=0,i>>>=0,r)||R(this,e,t,i,Math.pow(2,8*i)-1,0);var s=i-1,n=1;for(this[t+s]=255&e;--s>=0&&(n*=256);)this[t+s]=e/n&255;return t+i},o.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t>>>=0,!r){var s=Math.pow(2,8*i-1);R(this,e,t,i,s-1,-s)}var n=0,o=1,a=0;for(this[t]=255&e;++n>0)-a&255;return t+i},o.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t>>>=0,!r){var s=Math.pow(2,8*i-1);R(this,e,t,i,s-1,-s)}var n=i-1,o=1,a=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/o>>0)-a&255;return t+i},o.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,i){return U(this,e,t,!0,i)},o.prototype.writeFloatBE=function(e,t,i){return U(this,e,t,!1,i)},o.prototype.writeDoubleLE=function(e,t,i){return D(this,e,t,!0,i)},o.prototype.writeDoubleBE=function(e,t,i){return D(this,e,t,!1,i)},o.prototype.copy=function(e,t,i,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,r),t);return s},o.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var s=e.charCodeAt(0);("utf8"===r&&s<128||"latin1"===r)&&(e=s)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(n=t;n55295&&i<57344){if(!s){if(i>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&n.push(239,191,189);continue}s=i;continue}if(i<56320){(t-=3)>-1&&n.push(239,191,189),s=i;continue}i=65536+(s-55296<<10|i-56320)}else s&&(t-=3)>-1&&n.push(239,191,189);if(s=null,i<128){if((t-=1)<0)break;n.push(i)}else if(i<2048){if((t-=2)<0)break;n.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;n.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return n}function M(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function L(e,t,i,r){for(var s=0;s=t.length||s>=e.length);++s)t[s+i]=e[s];return s}function j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":4,buffer:5,ieee754:30}],6:[function(e,t,i){ /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(){"use strict";var e={}.hasOwnProperty;function i(){for(var t=[],r=0;re.length)&&(t=e.length);for(var i=0,r=new Array(t);i0&&e<1/0};function se(e){return void 0===e}function ne(t){return"object"===e(t)&&null!==t}var oe=Object.prototype.hasOwnProperty;function ae(e){if(!ne(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&oe.call(i,"isPrototypeOf")}catch(e){return!1}}function le(e){return"function"==typeof e}var ue=Array.prototype.slice;function pe(e){return Array.from?Array.from(e):ue.call(e)}function ce(e,t){return e&&le(t)&&(Array.isArray(e)||ie(e.length)?pe(e).forEach((function(i,r){t.call(e,i,r,e)})):ne(e)&&Object.keys(e).forEach((function(i){t.call(e,e[i],i,e)}))),e}var he=Object.assign||function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r0&&i.forEach((function(t){ne(t)&&Object.keys(t).forEach((function(i){e[i]=t[i]}))})),e},de=/\.\d*(?:0|9){12}\d*$/;function fe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return de.test(e)?Math.round(e*t)/t:e}var me=/^width|height|left|top|marginLeft|marginTop$/;function ge(e,t){var i=e.style;ce(t,(function(e,t){me.test(t)&&ie(e)&&(e="".concat(e,"px")),i[t]=e}))}function ye(e,t){if(t)if(ie(e.length))ce(e,(function(e){ye(e,t)}));else if(e.classList)e.classList.add(t);else{var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function ve(e,t){t&&(ie(e.length)?ce(e,(function(e){ve(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function be(e,t,i){t&&(ie(e.length)?ce(e,(function(e){be(e,t,i)})):i?ye(e,t):ve(e,t))}var we=/([a-z\d])([A-Z])/g;function Se(e){return e.replace(we,"$1-$2").toLowerCase()}function Pe(e,t){return ne(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Se(t)))}function ke(e,t,i){ne(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(Se(t)),i)}var xe=/\s\s*/,Ce=function(){var e=!1;if(l){var t=!1,i=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});u.addEventListener("test",i,r),u.removeEventListener("test",i,r)}return e}();function Ee(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=i;t.trim().split(xe).forEach((function(t){if(!Ce){var n=e.listeners;n&&n[t]&&n[t][i]&&(s=n[t][i],delete n[t][i],0===Object.keys(n[t]).length&&delete n[t],0===Object.keys(n).length&&delete e.listeners)}e.removeEventListener(t,s,r)}))}function Fe(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=i;t.trim().split(xe).forEach((function(t){if(r.once&&!Ce){var n=e.listeners,o=void 0===n?{}:n;s=function(){delete o[t][i],e.removeEventListener(t,s,r);for(var n=arguments.length,a=new Array(n),l=0;l1&&void 0!==arguments[1]?arguments[1]:"contain",n=re(r),o=re(i);if(n&&o){var a=i*t;"contain"===s&&a>r||"cover"===s&&a=8&&(n=l+p)}}}if(n){var c,h,d=i.getUint16(n,r);for(h=0;he.width?3===i?a=e.height*o:l=e.width/o:3===i?l=e.width/o:a=e.height*o;var u={aspectRatio:o,naturalWidth:s,naturalHeight:n,width:a,height:l};u.left=(e.width-a)/2,u.top=(e.height-l)/2,u.oldLeft=u.left,u.oldTop=u.top,this.canvasData=u,this.limited=1===i||2===i,this.limitCanvas(!0,!0),this.initialImageData=he({},t),this.initialCanvasData=he({},u)},limitCanvas:function(e,t){var i=this.options,r=this.containerData,s=this.canvasData,n=this.cropBoxData,o=i.viewMode,a=s.aspectRatio,l=this.cropped&&n;if(e){var u=Number(i.minCanvasWidth)||0,p=Number(i.minCanvasHeight)||0;o>1?(u=Math.max(u,r.width),p=Math.max(p,r.height),3===o&&(p*a>u?u=p*a:p=u/a)):o>0&&(u?u=Math.max(u,l?n.width:0):p?p=Math.max(p,l?n.height:0):l&&(u=n.width,(p=n.height)*a>u?u=p*a:p=u/a));var c=Ne({aspectRatio:a,width:u,height:p});u=c.width,p=c.height,s.minWidth=u,s.minHeight=p,s.maxWidth=1/0,s.maxHeight=1/0}if(t)if(o>(l?0:1)){var h=r.width-s.width,d=r.height-s.height;s.minLeft=Math.min(0,h),s.minTop=Math.min(0,d),s.maxLeft=Math.max(0,h),s.maxTop=Math.max(0,d),l&&this.limited&&(s.minLeft=Math.min(n.left,n.left+(n.width-s.width)),s.minTop=Math.min(n.top,n.top+(n.height-s.height)),s.maxLeft=n.left,s.maxTop=n.top,2===o&&(s.width>=r.width&&(s.minLeft=Math.min(0,h),s.maxLeft=Math.max(0,h)),s.height>=r.height&&(s.minTop=Math.min(0,d),s.maxTop=Math.max(0,d))))}else s.minLeft=-s.width,s.minTop=-s.height,s.maxLeft=r.width,s.maxTop=r.height},renderCanvas:function(e,t){var i=this.canvasData,r=this.imageData;if(t){var s=function(e){var t=e.width,i=e.height,r=e.degree;if(90==(r=Math.abs(r)%180))return{width:i,height:t};var s=r%90*Math.PI/180,n=Math.sin(s),o=Math.cos(s),a=t*o+i*n,l=t*n+i*o;return r>90?{width:l,height:a}:{width:a,height:l}}({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),n=s.width,o=s.height,a=i.width*(n/i.naturalWidth),l=i.height*(o/i.naturalHeight);i.left-=(a-i.width)/2,i.top-=(l-i.height)/2,i.width=a,i.height=l,i.aspectRatio=n/o,i.naturalWidth=n,i.naturalHeight=o,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.widthi.maxHeight||i.heightt.width?s.height=s.width/i:s.width=s.height*i),this.cropBoxData=s,this.limitCropBox(!0,!0),s.width=Math.min(Math.max(s.width,s.minWidth),s.maxWidth),s.height=Math.min(Math.max(s.height,s.minHeight),s.maxHeight),s.width=Math.max(s.minWidth,s.width*r),s.height=Math.max(s.minHeight,s.height*r),s.left=t.left+(t.width-s.width)/2,s.top=t.top+(t.height-s.height)/2,s.oldLeft=s.left,s.oldTop=s.top,this.initialCropBoxData=he({},s)},limitCropBox:function(e,t){var i=this.options,r=this.containerData,s=this.canvasData,n=this.cropBoxData,o=this.limited,a=i.aspectRatio;if(e){var l=Number(i.minCropBoxWidth)||0,u=Number(i.minCropBoxHeight)||0,p=o?Math.min(r.width,s.width,s.width+s.left,r.width-s.left):r.width,c=o?Math.min(r.height,s.height,s.height+s.top,r.height-s.top):r.height;l=Math.min(l,r.width),u=Math.min(u,r.height),a&&(l&&u?u*a>l?u=l/a:l=u*a:l?u=l/a:u&&(l=u*a),c*a>p?c=p/a:p=c*a),n.minWidth=Math.min(l,p),n.minHeight=Math.min(u,c),n.maxWidth=p,n.maxHeight=c}t&&(o?(n.minLeft=Math.max(0,s.left),n.minTop=Math.max(0,s.top),n.maxLeft=Math.min(r.width,s.left+s.width)-n.width,n.maxTop=Math.min(r.height,s.top+s.height)-n.height):(n.minLeft=0,n.minTop=0,n.maxLeft=r.width-n.width,n.maxTop=r.height-n.height))},renderCropBox:function(){var e=this.options,t=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.widthi.maxHeight||i.height=t.width&&i.height>=t.height?m:d),ge(this.cropBox,he({width:i.width,height:i.height},De({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),_e(this.element,B,this.getData())}},He={initPreview:function(){var e=this.element,t=this.crossOrigin,i=this.options.preview,r=t?this.crossOriginUrl:this.url,s=e.alt||"The image to preview",n=document.createElement("img");if(t&&(n.crossOrigin=t),n.src=r,n.alt=s,this.viewBox.appendChild(n),this.viewBoxImage=n,i){var o=i;"string"==typeof i?o=e.ownerDocument.querySelectorAll(i):i.querySelector&&(o=[i]),this.previews=o,ce(o,(function(e){var i=document.createElement("img");ke(e,U,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(i.crossOrigin=t),i.src=r,i.alt=s,i.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(i)}))}},resetPreview:function(){ce(this.previews,(function(e){var t=Pe(e,U);ge(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(ne(e[t]))try{delete e[t]}catch(i){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(i){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(Se(t)))}(e,U)}))},preview:function(){var e=this.imageData,t=this.canvasData,i=this.cropBoxData,r=i.width,s=i.height,n=e.width,o=e.height,a=i.left-t.left-e.left,l=i.top-t.top-e.top;this.cropped&&!this.disabled&&(ge(this.viewBoxImage,he({width:n,height:o},De(he({translateX:-a,translateY:-l},e)))),ce(this.previews,(function(t){var i=Pe(t,U),u=i.width,p=i.height,c=u,h=p,d=1;r&&(h=s*(d=u/r)),s&&h>p&&(c=r*(d=p/s),h=p),ge(t,{width:c,height:h}),ge(t.getElementsByTagName("img")[0],he({width:n*d,height:o*d},De(he({translateX:-a*d,translateY:-l*d},e))))})))}},qe={bind:function(){var e=this.element,t=this.options,i=this.cropper;le(t.cropstart)&&Fe(e,j,t.cropstart),le(t.cropmove)&&Fe(e,L,t.cropmove),le(t.cropend)&&Fe(e,M,t.cropend),le(t.crop)&&Fe(e,B,t.crop),le(t.zoom)&&Fe(e,G,t.zoom),Fe(i,H,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Fe(i,X,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Fe(i,z,this.onDblclick=this.dblclick.bind(this)),Fe(e.ownerDocument,q,this.onCropMove=this.cropMove.bind(this)),Fe(e.ownerDocument,$,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Fe(window,W,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,i=this.cropper;le(t.cropstart)&&Ee(e,j,t.cropstart),le(t.cropmove)&&Ee(e,L,t.cropmove),le(t.cropend)&&Ee(e,M,t.cropend),le(t.crop)&&Ee(e,B,t.crop),le(t.zoom)&&Ee(e,G,t.zoom),Ee(i,H,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Ee(i,X,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Ee(i,z,this.onDblclick),Ee(e.ownerDocument,q,this.onCropMove),Ee(e.ownerDocument,$,this.onCropEnd),t.responsive&&Ee(window,W,this.onResize)}},$e={resize:function(){if(!this.disabled){var e,t,i=this.options,r=this.container,s=this.containerData,n=r.offsetWidth/s.width;if(1!==n||r.offsetHeight!==s.height)i.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),i.restore&&(this.setCanvasData(ce(e,(function(t,i){e[i]=t*n}))),this.setCropBoxData(ce(t,(function(e,i){t[i]=e*n}))))}},dblclick:function(){var e,t;this.disabled||this.options.dragMode===N||this.setDragMode((e=this.dragBox,t=C,(e.classList?e.classList.contains(t):e.className.indexOf(t)>-1)?I:D))},wheel:function(e){var t=this,i=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*i,e)))},cropStart:function(e){var t=e.buttons,i=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(ie(t)&&1!==t||ie(i)&&0!==i||e.ctrlKey))){var r,s=this.options,n=this.pointers;e.changedTouches?ce(e.changedTouches,(function(e){n[e.identifier]=Ie(e)})):n[e.pointerId||0]=Ie(e),r=Object.keys(n).length>1&&s.zoomable&&s.zoomOnTouch?g:Pe(e.target,T),Y.test(r)&&!1!==_e(this.element,j,{originalEvent:e,action:r})&&(e.preventDefault(),this.action=r,this.cropping=!1,r===f&&(this.cropping=!0,ye(this.dragBox,A)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var i=this.pointers;e.preventDefault(),!1!==_e(this.element,L,{originalEvent:e,action:t})&&(e.changedTouches?ce(e.changedTouches,(function(e){he(i[e.identifier]||{},Ie(e,!0))})):he(i[e.pointerId||0]||{},Ie(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,i=this.pointers;e.changedTouches?ce(e.changedTouches,(function(e){delete i[e.identifier]})):delete i[e.pointerId||0],t&&(e.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,be(this.dragBox,A,this.cropped&&this.options.modal)),_e(this.element,M,{originalEvent:e,action:t}))}}},Ve={change:function(e){var t,i=this.options,r=this.canvasData,s=this.containerData,o=this.cropBoxData,a=this.pointers,l=this.action,u=i.aspectRatio,p=o.left,c=o.top,h=o.width,C=o.height,E=p+h,_=c+C,O=0,A=0,R=s.width,T=s.height,U=!0;!u&&e.shiftKey&&(u=h&&C?h/C:1),this.limited&&(O=o.minLeft,A=o.minTop,R=O+Math.min(s.width,r.width,r.left+r.width),T=A+Math.min(s.height,r.height,r.top+r.height));var D=a[Object.keys(a)[0]],I={x:D.endX-D.startX,y:D.endY-D.startY},N=function(e){switch(e){case y:E+I.x>R&&(I.x=R-E);break;case v:p+I.xT&&(I.y=T-_)}};switch(l){case d:p+=I.x,c+=I.y;break;case y:if(I.x>=0&&(E>=R||u&&(c<=A||_>=T))){U=!1;break}N(y),(h+=I.x)<0&&(l=v,p-=h=-h),u&&(C=h/u,c+=(o.height-C)/2);break;case w:if(I.y<=0&&(c<=A||u&&(p<=O||E>=R))){U=!1;break}N(w),C-=I.y,c+=I.y,C<0&&(l=b,c-=C=-C),u&&(h=C*u,p+=(o.width-h)/2);break;case v:if(I.x<=0&&(p<=O||u&&(c<=A||_>=T))){U=!1;break}N(v),h-=I.x,p+=I.x,h<0&&(l=y,p-=h=-h),u&&(C=h/u,c+=(o.height-C)/2);break;case b:if(I.y>=0&&(_>=T||u&&(p<=O||E>=R))){U=!1;break}N(b),(C+=I.y)<0&&(l=w,c-=C=-C),u&&(h=C*u,p+=(o.width-h)/2);break;case S:if(u){if(I.y<=0&&(c<=A||E>=R)){U=!1;break}N(w),C-=I.y,c+=I.y,h=C*u}else N(w),N(y),I.x>=0?EA&&(C-=I.y,c+=I.y):(C-=I.y,c+=I.y);h<0&&C<0?(l=x,c-=C=-C,p-=h=-h):h<0?(l=P,p-=h=-h):C<0&&(l=k,c-=C=-C);break;case P:if(u){if(I.y<=0&&(c<=A||p<=O)){U=!1;break}N(w),C-=I.y,c+=I.y,h=C*u,p+=o.width-h}else N(w),N(v),I.x<=0?p>O?(h-=I.x,p+=I.x):I.y<=0&&c<=A&&(U=!1):(h-=I.x,p+=I.x),I.y<=0?c>A&&(C-=I.y,c+=I.y):(C-=I.y,c+=I.y);h<0&&C<0?(l=k,c-=C=-C,p-=h=-h):h<0?(l=S,p-=h=-h):C<0&&(l=x,c-=C=-C);break;case x:if(u){if(I.x<=0&&(p<=O||_>=T)){U=!1;break}N(v),h-=I.x,p+=I.x,C=h/u}else N(b),N(v),I.x<=0?p>O?(h-=I.x,p+=I.x):I.y>=0&&_>=T&&(U=!1):(h-=I.x,p+=I.x),I.y>=0?_=0&&(E>=R||_>=T)){U=!1;break}N(y),C=(h+=I.x)/u}else N(b),N(y),I.x>=0?E=0&&_>=T&&(U=!1):h+=I.x,I.y>=0?_0?l=I.y>0?k:S:I.x<0&&(p-=h,l=I.y>0?x:P),I.y<0&&(c-=C),this.cropped||(ve(this.cropBox,F),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}U&&(o.width=h,o.height=C,o.left=p,o.top=c,this.action=l,this.renderCropBox()),ce(a,(function(e){e.startX=e.endX,e.startY=e.endY}))}},We={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&ye(this.dragBox,A),ve(this.cropBox,F),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=he({},this.initialImageData),this.canvasData=he({},this.initialCanvasData),this.cropBoxData=he({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(he(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ve(this.dragBox,A),ye(this.cropBox,F)),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,ce(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,ve(this.cropper,E)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,ye(this.cropper,E)),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,i=this.canvasData,r=i.left,s=i.top;return this.moveTo(se(e)?e:r+Number(e),se(t)?t:s+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(ie(e)&&(i.left=e,r=!0),ie(t)&&(i.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var i=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(i.width*e/i.naturalWidth,null,t)},zoomTo:function(e,t,i){var r=this.options,s=this.canvasData,n=s.width,o=s.height,a=s.naturalWidth,l=s.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&r.zoomable){var u=a*e,p=l*e;if(!1===_e(this.element,G,{ratio:e,oldRatio:n/a,originalEvent:i}))return this;if(i){var c=this.pointers,h=Oe(this.cropper),d=c&&Object.keys(c).length?function(e){var t=0,i=0,r=0;return ce(e,(function(e){var s=e.startX,n=e.startY;t+=s,i+=n,r+=1})),{pageX:t/=r,pageY:i/=r}}(c):{pageX:i.pageX,pageY:i.pageY};s.left-=(u-n)*((d.pageX-h.left-s.left)/n),s.top-=(p-o)*((d.pageY-h.top-s.top)/o)}else ae(t)&&ie(t.x)&&ie(t.y)?(s.left-=(u-n)*((t.x-s.left)/n),s.top-=(p-o)*((t.y-s.top)/o)):(s.left-=(u-n)/2,s.top-=(p-o)/2);s.width=u,s.height=p,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return ie(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,ie(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(ie(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(ie(e)&&(i.scaleX=e,r=!0),ie(t)&&(i.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,r=this.imageData,s=this.canvasData,n=this.cropBoxData;if(this.ready&&this.cropped){e={x:n.left-s.left,y:n.top-s.top,width:n.width,height:n.height};var o=r.width/r.naturalWidth;if(ce(e,(function(t,i){e[i]=t/o})),t){var a=Math.round(e.y+e.height),l=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=l-e.x,e.height=a-e.y}}else e={x:0,y:0,width:0,height:0};return i.rotatable&&(e.rotate=r.rotate||0),i.scalable&&(e.scaleX=r.scaleX||1,e.scaleY=r.scaleY||1),e},setData:function(e){var t=this.options,i=this.imageData,r=this.canvasData,s={};if(this.ready&&!this.disabled&&ae(e)){var n=!1;t.rotatable&&ie(e.rotate)&&e.rotate!==i.rotate&&(i.rotate=e.rotate,n=!0),t.scalable&&(ie(e.scaleX)&&e.scaleX!==i.scaleX&&(i.scaleX=e.scaleX,n=!0),ie(e.scaleY)&&e.scaleY!==i.scaleY&&(i.scaleY=e.scaleY,n=!0)),n&&this.renderCanvas(!0,!0);var o=i.width/i.naturalWidth;ie(e.x)&&(s.left=e.x*o+r.left),ie(e.y)&&(s.top=e.y*o+r.top),ie(e.width)&&(s.width=e.width*o),ie(e.height)&&(s.height=e.height*o),this.setCropBoxData(s)}return this},getContainerData:function(){return this.ready?he({},this.containerData):{}},getImageData:function(){return this.sized?he({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&ce(["left","top","width","height","naturalWidth","naturalHeight"],(function(i){t[i]=e[i]})),t},setCanvasData:function(e){var t=this.canvasData,i=t.aspectRatio;return this.ready&&!this.disabled&&ae(e)&&(ie(e.left)&&(t.left=e.left),ie(e.top)&&(t.top=e.top),ie(e.width)?(t.width=e.width,t.height=e.width/i):ie(e.height)&&(t.height=e.height,t.width=e.height*i),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,i,r=this.cropBoxData,s=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&ae(e)&&(ie(e.left)&&(r.left=e.left),ie(e.top)&&(r.top=e.top),ie(e.width)&&e.width!==r.width&&(t=!0,r.width=e.width),ie(e.height)&&e.height!==r.height&&(i=!0,r.height=e.height),s&&(t?r.height=r.width/s:i&&(r.width=r.height*s)),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,i=Be(this.image,this.imageData,t,e);if(!this.cropped)return i;var r=this.getData(),s=r.x,n=r.y,a=r.width,l=r.height,u=i.width/Math.floor(t.naturalWidth);1!==u&&(s*=u,n*=u,a*=u,l*=u);var p=a/l,c=Ne({aspectRatio:p,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),h=Ne({aspectRatio:p,width:e.minWidth||0,height:e.minHeight||0},"cover"),d=Ne({aspectRatio:p,width:e.width||(1!==u?i.width:a),height:e.height||(1!==u?i.height:l)}),f=d.width,m=d.height;f=Math.min(c.width,Math.max(h.width,f)),m=Math.min(c.height,Math.max(h.height,m));var g=document.createElement("canvas"),y=g.getContext("2d");g.width=fe(f),g.height=fe(m),y.fillStyle=e.fillColor||"transparent",y.fillRect(0,0,f,m);var v=e.imageSmoothingEnabled,b=void 0===v||v,w=e.imageSmoothingQuality;y.imageSmoothingEnabled=b,w&&(y.imageSmoothingQuality=w);var S,P,k,x,C,E,F=i.width,_=i.height,O=s,A=n;O<=-a||O>F?(O=0,S=0,k=0,C=0):O<=0?(k=-O,O=0,C=S=Math.min(F,a+O)):O<=F&&(k=0,C=S=Math.min(a,F-O)),S<=0||A<=-l||A>_?(A=0,P=0,x=0,E=0):A<=0?(x=-A,A=0,E=P=Math.min(_,l+A)):A<=_&&(x=0,E=P=Math.min(l,_-A));var R=[O,A,S,P];if(C>0&&E>0){var T=f/a;R.push(k*T,x*T,C*T,E*T)}return y.drawImage.apply(y,[i].concat(o(R.map((function(e){return Math.floor(fe(e))}))))),g},setAspectRatio:function(e){var t=this.options;return this.disabled||se(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,i=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var s=e===D,n=t.movable&&e===I;e=s||n?e:N,t.dragMode=e,ke(i,T,e),be(i,C,s),be(i,R,n),t.cropBoxMovable||(ke(r,T,e),be(r,C,s),be(r,R,n))}return this}},Xe=u.Cropper,Ge=function(){function e(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,e),!i||!Z.test(i.tagName))throw new Error("The first argument is required and must be an or element.");this.element=i,this.options=he({},ee,ae(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,s,n;return r=e,n=[{key:"noConflict",value:function(){return window.Cropper=Xe,e}},{key:"setDefaults",value:function(e){he(ee,ae(e)&&e)}}],(s=[{key:"init",value:function(){var e,t=this.element,i=t.tagName.toLowerCase();if(!t.cropper){if(t.cropper=this,"img"===i){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===i&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var i=this.element,r=this.options;if(r.rotatable||r.scalable||(r.checkOrientation=!1),r.checkOrientation&&window.ArrayBuffer)if(Q.test(e))J.test(e)?this.read((s=e.replace(Le,""),n=atob(s),o=new ArrayBuffer(n.length),ce(a=new Uint8Array(o),(function(e,t){a[t]=n.charCodeAt(t)})),o)):this.clone();else{var s,n,o,a,l=new XMLHttpRequest,u=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=u,l.onerror=u,l.ontimeout=u,l.onprogress=function(){l.getResponseHeader("content-type")!==K&&l.abort()},l.onload=function(){t.read(l.response)},l.onloadend=function(){t.reloading=!1,t.xhr=null},r.checkCrossOrigin&&Te(e)&&i.crossOrigin&&(e=Ue(e)),l.open("GET",e),l.responseType="arraybuffer",l.withCredentials="use-credentials"===i.crossOrigin,l.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,i=this.imageData,r=je(e),s=0,n=1,o=1;if(r>1){this.url=function(e,t){for(var i=[],r=new Uint8Array(e);r.length>0;)i.push(Me.apply(null,pe(r.subarray(0,8192)))),r=r.subarray(8192);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}(e,K);var a=function(e){var t=0,i=1,r=1;switch(e){case 2:i=-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,i=-1;break;case 8:t=-90}return{rotate:t,scaleX:i,scaleY:r}}(r);s=a.rotate,n=a.scaleX,o=a.scaleY}t.rotatable&&(i.rotate=s),t.scalable&&(i.scaleX=n,i.scaleY=o),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,i=e.crossOrigin,r=t;this.options.checkCrossOrigin&&Te(t)&&(i||(i="anonymous"),r=Ue(t)),this.crossOrigin=i,this.crossOriginUrl=r;var s=document.createElement("img");i&&(s.crossOrigin=i),s.src=r||t,s.alt=e.alt||"The image to crop",this.image=s,s.onload=this.start.bind(this),s.onerror=this.stop.bind(this),ye(s,_),e.parentNode.insertBefore(s,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var i=u.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(u.navigator.userAgent),r=function(t,i){he(e.imageData,{naturalWidth:t,naturalHeight:i,aspectRatio:t/i}),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||i){var s=document.createElement("img"),n=document.body||document.documentElement;this.sizingImage=s,s.onload=function(){r(s.width,s.height),i||n.removeChild(s)},s.src=t.src,i||(s.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;",n.appendChild(s))}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,i=this.image,r=e.parentNode,s=document.createElement("div");s.innerHTML='
';var n=s.querySelector(".".concat(h,"-container")),o=n.querySelector(".".concat(h,"-canvas")),a=n.querySelector(".".concat(h,"-drag-box")),l=n.querySelector(".".concat(h,"-crop-box")),u=l.querySelector(".".concat(h,"-face"));this.container=r,this.cropper=n,this.canvas=o,this.dragBox=a,this.cropBox=l,this.viewBox=n.querySelector(".".concat(h,"-view-box")),this.face=u,o.appendChild(i),ye(e,F),r.insertBefore(n,e.nextSibling),this.isImg||ve(i,_),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,ye(l,F),t.guides||ye(l.getElementsByClassName("".concat(h,"-dashed")),F),t.center||ye(l.getElementsByClassName("".concat(h,"-center")),F),t.background&&ye(n,"".concat(h,"-bg")),t.highlight||ye(u,O),t.cropBoxMovable&&(ye(u,R),ke(u,T,d)),t.cropBoxResizable||(ye(l.getElementsByClassName("".concat(h,"-line")),F),ye(l.getElementsByClassName("".concat(h,"-point")),F)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),le(t.ready)&&Fe(e,V,t.ready,{once:!0}),_e(e,V)}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),ve(this.element,F))}},{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()}}])&&i(r.prototype,s),n&&i(r,n),e}();return he(Ge.prototype,ze,He,qe,$e,Ve,We),Ge}))},{}],9:[function(e,t,i){(function(r){(function(){i.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;e.splice(1,0,i,"color: inherit");let r=0,s=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))})),e.splice(s,0,i)},i.save=function(e){try{e?i.storage.setItem("debug",e):i.storage.removeItem("debug")}catch(e){}},i.load=function(){let e;try{e=i.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},i.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},i.storage=function(){try{return localStorage}catch(e){}}(),i.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),i.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],i.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(i);const{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":10,_process:42}],10:[function(e,t,i){t.exports=function(t){function i(e){let t,s,n,o=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),n=s-(t||s);r.diff=n,r.prev=t,r.curr=s,t=s,e[0]=i.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,s)=>{if("%%"===t)return"%";o++;const n=i.formatters[s];if("function"==typeof n){const i=e[o];t=n.call(r,i),e.splice(o,1),o--}return t})),i.formatArgs.call(r,e);(r.log||i.log).apply(r,e)}return a.namespace=e,a.useColors=i.useColors(),a.color=i.selectColor(e),a.extend=r,a.destroy=i.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(s!==i.namespaces&&(s=i.namespaces,n=i.enabled(e)),n),set:e=>{o=e}}),"function"==typeof i.init&&i.init(a),a}function r(e,t){const r=i(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return i.debug=i,i.default=i,i.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},i.disable=function(){const e=[...i.names.map(s),...i.skips.map(s).map((e=>"-"+e))].join(",");return i.enable(""),e},i.enable=function(e){let t;i.save(e),i.namespaces=e,i.names=[],i.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),s=r.length;for(t=0;t{i[e]=t[e]})),i.names=[],i.skips=[],i.formatters={},i.selectColor=function(e){let t=0;for(let i=0;inew r(e,t),t.exports.Socket=r,t.exports.protocol=r.protocol,t.exports.Transport=e("./transport"),t.exports.transports=e("./transports/index"),t.exports.parser=e("engine.io-parser")},{"./socket":13,"./transport":14,"./transports/index":15,"engine.io-parser":26}],13:[function(e,t,i){const r=e("./transports/index"),s=e("component-emitter"),n=e("debug")("engine.io-client:socket"),o=e("engine.io-parser"),a=e("parseuri"),l=e("parseqs");class u extends s{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=a(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=a(t.host).host),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,jsonp:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=l.decode(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",(()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())}),!1),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close")},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){n('creating transport "%s"',e);const t=function(e){const t={};for(let i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}(this.opts.query);t.EIO=o.protocol,t.transport=e,this.id&&(t.sid=this.id);const i=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return n("options: %j",i),new r[e](i)}open(){let e;if(this.opts.rememberUpgrade&&u.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void setTimeout((()=>{this.emit("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return n("error while creating transport: %s",e),this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){n("setting transport %s",e.name),this.transport&&(n("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(()=>{this.onClose("transport close")}))}probe(e){n('probing transport "%s"',e);let t=this.createTransport(e,{probe:1}),i=!1;u.priorWebsocketSuccess=!1;const r=()=>{i||(n('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(r=>{if(!i)if("pong"===r.type&&"probe"===r.data){if(n('probe transport "%s" pong',e),this.upgrading=!0,this.emit("upgrading",t),!t)return;u.priorWebsocketSuccess="websocket"===t.name,n('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{i||"closed"!==this.readyState&&(n("changing transport and sending upgrade packet"),c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emit("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{n('probe transport "%s" failed',e);const i=new Error("probe error");i.transport=t.name,this.emit("upgradeError",i)}})))};function s(){i||(i=!0,c(),t.close(),t=null)}const o=i=>{const r=new Error("probe error: "+i);r.transport=t.name,s(),n('probe transport "%s" failed because of error: %s',e,i),this.emit("upgradeError",r)};function a(){o("transport closed")}function l(){o("socket closed")}function p(e){t&&e.name!==t.name&&(n('"%s" works - aborting "%s"',e.name,t.name),s())}const c=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",a),this.removeListener("close",l),this.removeListener("upgrading",p)};t.once("open",r),t.once("error",o),t.once("close",a),this.once("close",l),this.once("upgrading",p),t.open()}onOpen(){if(n("socket open"),this.readyState="open",u.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){n("starting upgrade probes");let e=0;const t=this.upgrades.length;for(;e{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()}flush(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(n("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))}write(e,t,i){return this.sendPacket("message",e,t,i),this}send(e,t,i){return this.sendPacket("message",e,t,i),this}sendPacket(e,t,i,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof i&&(r=i,i=null),"closing"===this.readyState||"closed"===this.readyState)return;(i=i||{}).compress=!1!==i.compress;const s={type:e,data:t,options:i};this.emit("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),n("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.removeListener("upgrade",t),this.removeListener("upgradeError",t),e()},i=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?i():e()})):this.upgrading?i():e()),this}onError(e){n("socket error %j",e),u.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(n('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let i=0;const r=e.length;for(;i{},this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),super.doClose()}doPoll(){const e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=e=>{this.onError("jsonp poll error",e)};const t=document.getElementsByTagName("script")[0];t?t.parentNode.insertBefore(e,t):(document.head||document.body).appendChild(e),this.script=e;"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){const e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)}doWrite(e,t){let i;if(!this.form){const e=document.createElement("form"),t=document.createElement("textarea"),i=this.iframeId="eio_iframe_"+this.index;e.className="socketio",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.target=i,e.method="POST",e.setAttribute("accept-charset","utf-8"),t.name="d",e.appendChild(t),document.body.appendChild(e),this.form=e,this.area=t}function r(){s(),t()}this.form.action=this.uri();const s=()=>{if(this.iframe)try{this.form.removeChild(this.iframe)}catch(e){this.onError("jsonp polling iframe removal error",e)}try{const e='