1 line
517 KiB
JavaScript
1 line
517 KiB
JavaScript
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Uppy=e()}(function(){var define,module,exports,createModuleFactory=function(t){var r;return function(e){return r||t(r={exports:{},parent:e},r.exports),r.exports}},_$lib_60=createModuleFactory(function(e,t){var u=_$browser_66("socket.io-client");e.exports=t=r;var l=t.managers={};function r(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r=_$url_64(e),n=r.source,i=r.id,o=r.path,s=l[i]&&o in l[i].nsps,a=t.forceNew||t["force new connection"]||!1===t.multiplex||s?(u("ignoring socket cache for %s",n),_$manager_61(n,t)):(l[i]||(u("new io instance for %s",n),l[i]=_$manager_61(n,t)),l[i]);return r.query&&!t.query&&(t.query=r.query),a.socket(r.path,t)}t.protocol=_$socketIoParser_70.protocol,t.connect=r,t.Manager=_$manager_61,t.Socket=_$socket_63}),_$empty_7=createModuleFactory(function(e,t){}),_$buffer_8=createModuleFactory(function(e,A){(function(p){"use strict";A.Buffer=p,A.INSPECT_MAX_BYTES=50;var r=2147483647;function s(e){if(r<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=p.prototype,t}function p(e,t,r){if("number"!=typeof e)return n(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return i(e)}function n(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!p.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|l(e,t),n=s(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return o(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(C(e,ArrayBuffer)||e&&C(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r)).__proto__=p.prototype,n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return p.from(n,t,r);var i=function(e){if(p.isBuffer(e)){var t=0|u(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||P(e.length)?s(0):o(e):"Buffer"===e.type&&Array.isArray(e.data)?o(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return p.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function i(e){return a(e),s(e<0?0:0|u(e))}function o(e){for(var t=e.length<0?0:0|u(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function u(e){if(r<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||C(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 r=e.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(e).length;default:if(i)return n?-1:S(e).length;t=(""+t).toLowerCase(),i=!0}}function c(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function d(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),P(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=p.from(t,n)),p.isBuffer(t))return 0===t.length?-1:h(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):h(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function h(e,t,r,n,i){var o=1,s=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s/=o=2,a/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i)for(var l=-1,c=r;c<s;c++)if(u(e,c)===u(t,-1===l?0:c-l)){if(-1===l&&(l=c),c-l+1===a)return l*o}else-1!==l&&(c-=c-l),l=-1;else for(s<r+a&&(r=s-a),c=r;0<=c;c--){for(var p=!0,d=0;d<a;d++)if(u(e,c+d)!==u(t,d)){p=!1;break}if(p)return c}return-1}function f(e,t,r,n){return E(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,l=e[i],c=null,p=239<l?4:223<l?3:191<l?2:1;if(i+p<=r)switch(p){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&127<(u=(31&l)<<6|63&o)&&(c=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&2047<(u=(15&l)<<12|(63&o)<<6|63&s)&&(u<55296||57343<u)&&(c=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)&&u<1114112&&(c=u)}null===c?(c=65533,p=1):65535<c&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=p}return function(e){var t=e.length;if(t<=g)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=g));return r}(n)}(p.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),p.poolSize=8192,p.from=n,p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,p.alloc=function(e,t,r){return i=t,o=r,a(n=e),n<=0||void 0===i?s(n):"string"==typeof o?s(n).fill(i,o):s(n).fill(i);var n,i,o},p.allocUnsafe=i,p.allocUnsafeSlow=i,p.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==p.prototype},p.compare=function(e,t){if(C(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),C(t,Uint8Array)&&(t=p.from(t,t.offset,t.byteLength)),!p.isBuffer(e)||!p.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},p.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return p.alloc(0);if(void 0===t)for(i=t=0;i<e.length;++i)t+=e[i].length;for(var r=p.allocUnsafe(t),n=0,i=0;i<e.length;++i){var o=e[i];if(C(o,Uint8Array)&&(o=p.from(o)),!p.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n),n+=o.length}return r},p.byteLength=l,p.prototype._isBuffer=!0,p.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)c(this,t,t+1);return this},p.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)c(this,t,t+3),c(this,t+1,t+2);return this},p.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)c(this,t,t+7),c(this,t+1,t+6),c(this,t+2,t+5),c(this,t+3,t+4);return this},p.prototype.toLocaleString=p.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):function(e,t,r){var n,i,o,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,r){var n,i=e.length;(!t||t<0)&&(t=0),(!r||r<0||i<r)&&(r=i);for(var o="",s=t;s<r;++s)o+=(n=e[s])<16?"0"+n.toString(16):n.toString(16);return o}(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return n=this,o=r,0===(i=t)&&o===n.length?_$base64Js_5.fromByteArray(n):_$base64Js_5.fromByteArray(n.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,t,r);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=A.INSPECT_MAX_BYTES,e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim();return this.length>t&&(e+=" ... "),"<Buffer "+e+">"},p.prototype.compare=function(e,t,r,n,i){if(C(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.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===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=t)return 0;if(i<=n)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r),c=0;c<a;++c)if(u[c]!==l[c]){o=u[c],s=l[c];break}return o<s?-1:s<o?1:0},p.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},p.prototype.indexOf=function(e,t,r){return d(this,e,t,r,!0)},p.prototype.lastIndexOf=function(e,t,r){return d(this,e,t,r,!1)},p.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||i<r)&&(r=i),0<e.length&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,u,l,c,p,d,h,_=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;(!n||(n=Number(n))>i)&&(n=i);var o=t.length;o/2<n&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(P(a))return s;e[r+s]=a}return s}(this,e,t,r);case"utf8":case"utf-8":return d=t,h=r,E(S(e,(p=this).length-d),p,d,h);case"ascii":return f(this,e,t,r);case"latin1":case"binary":return f(this,e,t,r);case"base64":return u=this,l=t,c=r,E(k(e),u,l,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s=t,a=r,E(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,(o=this).length-s),o,s,a);default:if(_)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),_=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var g=4096;function y(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function m(e,t,r,n,i,o){if(!p.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<t||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function v(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function b(e,t,r,n,i){return t=+t,r>>>=0,i||v(e,0,r,4),_$ieee754_41.write(e,t,r,n,23,4),r+4}function w(e,t,r,n,i){return t=+t,r>>>=0,i||v(e,0,r,8),_$ieee754_41.write(e,t,r,n,52,8),r+8}p.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=p.prototype,n},p.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},p.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e+--t],i=1;0<t&&(i*=256);)n+=this[e+--t]*i;return n},p.prototype.readUInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),this[e]},p.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},p.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},p.prototype.readUInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},p.prototype.readUInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},p.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},p.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=t,i=1,o=this[e+--n];0<n&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},p.prototype.readInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},p.prototype.readInt16LE=function(e,t){e>>>=0,t||y(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt16BE=function(e,t){e>>>=0,t||y(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},p.prototype.readInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},p.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),_$ieee754_41.read(this,e,!0,23,4)},p.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),_$ieee754_41.read(this,e,!1,23,4)},p.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),_$ieee754_41.read(this,e,!0,52,8)},p.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),_$ieee754_41.read(this,e,!1,52,8)},p.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||m(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},p.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||m(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;0<=--i&&(o*=256);)this[t+i]=e/o&255;return t+r},p.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,1,255,0),this[t]=255&e,t+1},p.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||m(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},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||m(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},p.prototype.writeIntLE=function(e,t,r,n){var i;e=+e,t>>>=0,n||m(this,e,t,r,(i=Math.pow(2,8*r-1))-1,-i);var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},p.prototype.writeIntBE=function(e,t,r,n){var i;e=+e,t>>>=0,n||m(this,e,t,r,(i=Math.pow(2,8*r-1))-1,-i);var o=r-1,s=1,a=0;for(this[t+o]=255&e;0<=--o&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||m(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},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||m(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},p.prototype.writeFloatLE=function(e,t,r){return b(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return b(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return w(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return w(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),t=t||0,0<n&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var o=i-1;0<=o;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},p.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i;1===e.length&&(i=e.charCodeAt(0),("utf8"===n&&i<128||"latin1"===n)&&(e=i))}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o<r;++o)this[o]=e;else{var s=p.isBuffer(e)?e:p.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var t=/[^+\/0-9A-Za-z-_]/g;function S(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=e.charCodeAt(s))&&r<57344){if(!i){if(56319<r){-1<(t-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(t-=3)&&o.push(239,191,189);continue}i=r;continue}if(r<56320){-1<(t-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(t-=3)&&o.push(239,191,189);if(i=null,r<128){if(--t<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function k(e){return _$base64Js_5.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function E(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function C(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function P(e){return e!=e}}).call(this,_$buffer_8({}).Buffer)}),_$browser_55={},cachedSetTimeout,cachedClearTimeout,process=_$browser_55={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch(e){try{return cachedSetTimeout.call(null,t,0)}catch(e){return cachedSetTimeout.call(this,t,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,function(t){if(cachedClearTimeout===clearTimeout)return clearTimeout(t);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(t);try{cachedClearTimeout(t)}catch(e){try{return cachedClearTimeout.call(null,t)}catch(e){return cachedClearTimeout.call(this,t)}}}(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var _$es6Promise_34={exports:{}};(function(j,N){var e,t;e=this,t=function(){"use strict";function u(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},n=0,t=void 0,i=void 0,a=function(e,t){d[n]=e,d[n+1]=t,2===(n+=2)&&(i?i(h):m())},e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,l="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),c="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var e=setTimeout;return function(){return e(h,1)}}var d=new Array(1e3);function h(){for(var e=0;e<n;e+=2)(0,d[e])(d[e+1]),d[e]=void 0,d[e+1]=void 0;n=0}var _,f,g,y,m=void 0;function v(e,t){var r=this,n=new this.constructor(S);void 0===n[w]&&B(n);var i,o=r._state;return o?(i=arguments[o-1],a(function(){return R(o,n,i,r._result)})):O(r,n,e,t),n}function b(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(S);return A(t,e),t}m=l?function(){return j.nextTick(h)}:s?(f=0,g=new s(h),y=document.createTextNode(""),g.observe(y,{characterData:!0}),function(){y.data=f=++f%2}):c?((_=new MessageChannel).port1.onmessage=h,function(){return _.port2.postMessage(0)}):(void 0===e?function(){try{var e=Function("return this")().require("vertx");return void 0!==(t=e.runOnLoop||e.runOnContext)?function(){t(h)}:p()}catch(e){return p()}}:p)();var w=Math.random().toString(36).substring(2);function S(){}var k=void 0,E=1,C=2;function P(e,t,r){var i,o,n,s;t.constructor===e.constructor&&r===v&&t.constructor.resolve===b?(n=e,(s=t)._state===E?F(n,s._result):s._state===C?$(n,s._result):O(s,void 0,function(e){return A(n,e)},function(e){return $(n,e)})):void 0!==r&&u(r)?(i=t,o=r,a(function(r){var n=!1,e=function(e,t){try{e.call(t,function(e){n||(n=!0,(i!==e?A:F)(r,e))},function(e){n||(n=!0,$(r,e))})}catch(e){return e}}(o,i,r._label);!n&&e&&(n=!0,$(r,e))},e)):F(e,t)}function A(t,e){if(t===e)$(t,new TypeError("You cannot resolve a promise with itself"));else if(n=typeof e,null===e||"object"!=n&&"function"!=n)F(t,e);else{var r=void 0;try{r=e.then}catch(e){return void $(t,e)}P(t,e,r)}var n}function T(e){e._onerror&&e._onerror(e._result),x(e)}function F(e,t){e._state===k&&(e._result=t,e._state=E,0!==e._subscribers.length&&a(x,e))}function $(e,t){e._state===k&&(e._state=C,e._result=t,a(T,e))}function O(e,t,r,n){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+E]=r,i[o+C]=n,0===o&&e._state&&a(x,e)}function x(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n,i=void 0,o=e._result,s=0;s<t.length;s+=3)n=t[s],i=t[s+r],n?R(r,n,i,o):i(o);e._subscribers.length=0}}function R(e,t,r,n){var i=u(r),o=void 0,s=void 0,a=!0;if(i){try{o=r(n)}catch(e){a=!1,s=e}if(t===o)return void $(t,new TypeError("A promises callback cannot return that same promise."))}else o=n;t._state!==k||(i&&a?A(t,o):!1===a?$(t,s):e===E?F(t,o):e===C&&$(t,o))}var U=0;function B(e){e[w]=U++,e._state=void 0,e._result=void 0,e._subscribers=[]}var I=(L.prototype._enumerate=function(e){for(var t=0;this._state===k&&t<e.length;t++)this._eachEntry(e[t],t)},L.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===b){var i,o=void 0,s=void 0,a=!1;try{o=t.then}catch(e){a=!0,s=e}o===v&&t._state!==k?this._settledAt(t._state,e,t._result):"function"!=typeof o?(this._remaining--,this._result[e]=t):r===D?(i=new r(S),a?$(i,s):P(i,t,o),this._willSettleAt(i,e)):this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},L.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===k&&(this._remaining--,e===C?$(n,r):this._result[t]=r),0===this._remaining&&F(n,this._result)},L.prototype._willSettleAt=function(e,t){var r=this;O(e,void 0,function(e){return r._settledAt(E,t,e)},function(e){return r._settledAt(C,t,e)})},L),D=(M.prototype.catch=function(e){return this.then(null,e)},M.prototype.finally=function(t){var r=this.constructor;return u(t)?this.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})}):this.then(t,t)},M);function M(e){this[w]=U++,this._result=this._state=void 0,this._subscribers=[],S!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof M?function(t,e){try{e(function(e){A(t,e)},function(e){$(t,e)})}catch(e){$(t,e)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function L(e,t){this._instanceConstructor=e,this.promise=new e(S),this.promise[w]||B(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?F(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&F(this.promise,this._result))):$(this.promise,new Error("Array Methods must be provided an Array"))}return D.prototype.then=v,D.all=function(e){return new I(this,e).promise},D.race=function(i){var o=this;return r(i)?new o(function(e,t){for(var r=i.length,n=0;n<r;n++)o.resolve(i[n]).then(e,t)}):new o(function(e,t){return t(new TypeError("You must pass an array to race."))})},D.resolve=b,D.reject=function(e){var t=new this(S);return $(t,e),t},D._setScheduler=function(e){i=e},D._setAsap=function(e){a=e},D._asap=a,D.polyfill=function(){var e=void 0;if(void 0!==N)e=N;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=D},D.Promise=D},"object"==typeof _$es6Promise_34.exports?_$es6Promise_34.exports=t():"function"==typeof define&&define.amd?define(t):e.ES6Promise=t()}).call(this,_$browser_55,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$es6Promise_34=_$es6Promise_34.exports;var _$auto_33=_$es6Promise_34.polyfill(),_$fetchUmd_90={exports:{}},__global_90,factory,__global_90=this,factory=function(a){"use strict";var t,r,n="URLSearchParams"in self,i="Symbol"in self&&"iterator"in Symbol,u="FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in self,s="ArrayBuffer"in self;function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function e(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function p(t){this.map={},t instanceof p?t.forEach(function(e,t){this.append(t,e)},this):Array.isArray(t)?t.forEach(function(e){this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function _(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){(this._bodyInit=e)?"string"==typeof e?this._bodyText=e:u&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&u&&e&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||r(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(_)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=h(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}s&&(t=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(e){return e&&-1<t.indexOf(Object.prototype.toString.call(e))}),p.prototype.append=function(e,t){e=l(e),t=c(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},p.prototype.delete=function(e){delete this.map[l(e)]},p.prototype.get=function(e){return e=l(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(l(e))},p.prototype.set=function(e,t){this.map[l(e)]=c(t)},p.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},p.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),e(r)},p.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),e(t)},p.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),e(r)},i&&(p.prototype[Symbol.iterator]=p.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(e,t){var r,n,i=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),-1<y.indexOf(n)?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function v(e){var i=new FormData;return e.trim().split("&").forEach(function(e){var t,r,n;e&&(r=(t=e.split("=")).shift().replace(/\+/g," "),n=t.join("=").replace(/\+/g," "),i.append(decodeURIComponent(r),decodeURIComponent(n)))}),i}function b(e,t){t=t||{},this.type="default",this.status=void 0===t.status?200:t.status,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},g.call(m.prototype),g.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];b.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},a.DOMException=self.DOMException;try{new a.DOMException}catch(e){a.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function S(i,s){return new Promise(function(n,e){var t=new m(i,s);if(t.signal&&t.signal.aborted)return e(new a.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function r(){o.abort()}o.onload=function(){var e,i,t={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",i=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var t,r=e.split(":"),n=r.shift().trim();n&&(t=r.join(":").trim(),i.append(n,t))}),i)};t.url="responseURL"in o?o.responseURL:t.headers.get("X-Request-URL");var r="response"in o?o.response:o.responseText;n(new b(r,t))},o.onerror=function(){e(new TypeError("Network request failed"))},o.ontimeout=function(){e(new TypeError("Network request failed"))},o.onabort=function(){e(new a.DOMException("Aborted","AbortError"))},o.open(t.method,t.url,!0),"include"===t.credentials?o.withCredentials=!0:"omit"===t.credentials&&(o.withCredentials=!1),"responseType"in o&&u&&(o.responseType="blob"),t.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),t.signal&&(t.signal.addEventListener("abort",r),o.onreadystatechange=function(){4===o.readyState&&t.signal.removeEventListener("abort",r)}),o.send(void 0===t._bodyInit?null:t._bodyInit)})}S.polyfill=!0,self.fetch||(self.fetch=S,self.Headers=p,self.Request=m,self.Response=b),a.Headers=p,a.Request=m,a.Response=b,a.fetch=S,Object.defineProperty(a,"__esModule",{value:!0})};"object"==typeof _$fetchUmd_90.exports?factory(_$fetchUmd_90.exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory(__global_90.WHATWGFetch={}),_$fetchUmd_90=_$fetchUmd_90.exports;var _$hasProperty_210=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var _$Translator_190=(Ym=Xm.prototype,Ym._apply=function(e){var t;e&&e.strings&&(t=this.locale,this.locale=_extends({},t,{strings:_extends({},t.strings,e.strings)}),this.locale.pluralize=e.pluralize||t.pluralize)},Ym.interpolate=function(e,t){var r,n=String.prototype,o=n.split,i=n.replace,s=/\$/g,a=[e];for(var u in t)"_"!==u&&_$hasProperty_210(t,u)&&("string"==typeof(r=t[u])&&(r=i.call(t[u],s,"$$$$")),a=function(e,t,n){var i=[];return e.forEach(function(e){return"string"!=typeof e?i.push(e):void o.call(e,t).forEach(function(e,t,r){""!==e&&i.push(e),t<r.length-1&&i.push(n)})}),i}(a,new RegExp("%\\{"+u+"\\}","g"),r));return a},Ym.translate=function(e,t){return this.translateArray(e,t).join("")},Ym.translateArray=function(e,t){var r=this.locale.strings[e];if("object"!=typeof r)return this.interpolate(r,t);if(t&&void 0!==t.smart_count){var n=this.locale.pluralize(t.smart_count);return this.interpolate(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")},Xm),_$namespaceEmitter_50=function(){var n={},u=n._fns={};return n.emit=function(e,t,r,n,i,o,s){var a=function(e){for(var t=u[e]?u[e]:[],r=e.indexOf(":"),n=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(u),o=0,s=i.length;o<s;o++){var a=i[o];if("*"===a&&(t=t.concat(u[a])),2===n.length&&n[0]===a){t=t.concat(u[a]);break}}return t}(e);a.length&&function(e,t,r){for(var n=0,i=t.length;n<i&&t[n];n++)t[n].event=e,t[n].apply(t[n],r)}(e,a,[t,r,n,i,o,s])},n.on=function(e,t){u[e]||(u[e]=[]),u[e].push(t)},n.once=function(t,r){this.on(t,function e(){r.apply(this,arguments),n.off(t,e)})},n.off=function(e,t){var r=[];if(e&&t)for(var n=this._fns[e],i=0,o=n?n.length:0;i<o;i++)n[i]!==t&&r.push(n[i]);r.length?this._fns[e]=r:delete this._fns[e]},n},_$pad_16=function(e,t){var r="000000000"+e;return r.substr(r.length-t)},env="object"==typeof window?window:self,globalCount=Object.keys(env).length,clientId=_$pad_16(((navigator.mimeTypes?navigator.mimeTypes.length:0)+navigator.userAgent.length).toString(36)+globalCount.toString(36),4),_$fingerprintBrowser_14=function(){return clientId},getRandomValue,crypto="undefined"!=typeof window&&(window.crypto||window.msCrypto)||"undefined"!=typeof self&&self.crypto,Ym,lim,getRandomValue;function Xm(e){var t=this;this.locale={strings:{},pluralize:function(e){return 1===e?0:1}},Array.isArray(e)?e.forEach(function(e){return t._apply(e)}):this._apply(e)}getRandomValue=crypto?(lim=Math.pow(2,32)-1,function(){return Math.abs(crypto.getRandomValues(new Uint32Array(1))[0]/lim)}):Math.random;var _$getRandomValue_15=getRandomValue,_$cuid_13={},c=0,blockSize=4,base=36,discreteValues=Math.pow(base,blockSize);function randomBlock(){return _$pad_16((_$getRandomValue_15()*discreteValues<<0).toString(base),blockSize)}function safeCounter(){return c=c<discreteValues?c:0,++c-1}function cuid(){return"c"+(new Date).getTime().toString(base)+_$pad_16(safeCounter().toString(base),blockSize)+_$fingerprintBrowser_14()+(randomBlock()+randomBlock())}cuid.slug=function(){var e=(new Date).getTime().toString(36),t=safeCounter().toString(36).slice(-4),r=_$fingerprintBrowser_14().slice(0,1)+_$fingerprintBrowser_14().slice(-1),n=randomBlock().slice(-2);return e.slice(-2)+t+r+n},cuid.isCuid=function(e){return"string"==typeof e&&!!e.startsWith("c")},cuid.isSlug=function(e){if("string"!=typeof e)return!1;var t=e.length;return 7<=t&&t<=10},cuid.fingerprint=_$fingerprintBrowser_14,_$cuid_13=cuid;var _$lodashThrottle_46={};(function(e){function m(){return n.Date.now()}var v="Expected a function",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt,t="object"==typeof e&&e&&e.Object===Object&&e,r="object"==typeof self&&self&&self.Object===Object&&self,n=t||r||Function("return this")(),l=Object.prototype.toString,b=Math.max,w=Math.min;function S(e){var t=typeof e;return e&&("object"==t||"function"==t)}function k(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return NaN;var t,r;if(S(e)&&(e=S(r="function"==typeof e.valueOf?e.valueOf():e)?r+"":r),"string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||a.test(e)?u(e.slice(2),n?2:8):o.test(e)?NaN:+e}_$lodashThrottle_46=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError(v);return S(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),function(n,i,e){var o,s,r,a,u,l,c=0,p=!1,d=!1,t=!0;if("function"!=typeof n)throw new TypeError(v);function h(e){var t=o,r=s;return o=s=void 0,c=e,a=n.apply(r,t)}function _(e){var t=e-l;return void 0===l||i<=t||t<0||d&&r<=e-c}function f(){var e,t=m();if(_(t))return g(t);u=setTimeout(f,(e=i-(t-l),d?w(e,r-(t-c)):e))}function g(e){return u=void 0,t&&o?h(e):(o=s=void 0,a)}function y(){var e,t=m(),r=_(t);if(o=arguments,s=this,l=t,r){if(void 0===u)return c=e=l,u=setTimeout(f,i),p?h(e):a;if(d)return u=setTimeout(f,i),h(l)}return void 0===u&&(u=setTimeout(f,i)),a}return i=k(i)||0,S(e)&&(p=!!e.leading,r=(d="maxWait"in e)?b(k(e.maxWait)||0,i):r,t="trailing"in e?!!e.trailing:t),y.cancel=function(){void 0!==u&&clearTimeout(u),o=l=s=u=void(c=0)},y.flush=function(){return void 0===u?a:g(m())},y}(e,t,{leading:n,maxWait:t,trailing:i})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var _$prettierBytes_107=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return 10<=e||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i},_$wildcard_91={};function WildcardMatcher(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}WildcardMatcher.prototype.match=function(e){var t,r,n=!0,i=this.parts,o=i.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(r=(e||"").split(this.separator),t=0;n&&t<o;t++)"*"!==i[t]&&(n=t<r.length&&i[t]===r[t]);n=n&&r}else n=!1;else if("function"==typeof e.splice)for(n=[],t=e.length;t--;)this.match(e[t])&&(n[n.length]=e[t]);else if("object"==typeof e)for(var s in n={},e)this.match(s)&&(n[s]=e[s]);return n},_$wildcard_91=function(e,t,r){var n=new WildcardMatcher(e,r||/[\/\.]/);return void 0!==t?n.match(t):n};var reMimePartSplit=/[\/\+\.]/,_$mimeMatch_49=function(r,e){function t(e){var t=_$wildcard_91(e,r,reMimePartSplit);return t&&2<=t.length}return e?t(e.split(";")[0]):t},_$lib_171={};function ___extends_171(){return(___extends_171=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var DefaultStore=(aq=_p.prototype,aq.getState=function(){return this.state},aq.setState=function(e){var t=___extends_171({},this.state),r=___extends_171({},this.state,e);this.state=r,this._publish(t,r,e)},aq.subscribe=function(e){var t=this;return this.callbacks.push(e),function(){t.callbacks.splice(t.callbacks.indexOf(e),1)}},aq._publish=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.callbacks.forEach(function(e){e.apply(void 0,t)})},_p),aq;function _p(){this.state={},this.callbacks=[]}DefaultStore.VERSION="1.2.1",_$lib_171=function(){return new DefaultStore};var _$getFileNameAndExtension_204=function(e){var t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}},_$mimeTypes_216={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf"},_$getFileType_205=function(e){var t=(t=e.name?_$getFileNameAndExtension_204(e.name).extension:null)?t.toLowerCase():null;return e.type?e.type:t&&_$mimeTypes_216[t]?_$mimeTypes_216[t]:"application/octet-stream"};function encodeFilename(e){var t="";return e.replace(/[^A-Z0-9]/gi,function(e){return t+="-"+e.charCodeAt(0).toString(32),"/"})+t}var _$generateFileID_197=function(e){var t="uppy";return"string"==typeof e.name&&(t+="-"+encodeFilename(e.name.toLowerCase())),void 0!==e.type&&(t+="-"+e.type),e.meta&&"string"==typeof e.meta.relativePath&&(t+="-"+encodeFilename(e.meta.relativePath.toLowerCase())),void 0!==e.data.size&&(t+="-"+e.data.size),void 0!==e.data.lastModified&&(t+="-"+e.data.lastModified),t},_$supportsUploadProgress_106=function(e){if(null==e&&(e="undefined"!=typeof navigator?navigator.userAgent:null),!e)return!0;var t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;var r=t[1].split("."),n=r[0],i=r[1],n=parseInt(n,10),i=parseInt(i,10);return n<15||15===n&&i<15063||18<n||18===n&&18218<=i};function __pad_209(e){return 2!==e.length?0+e:e}var _$getTimeStamp_209=function(){var e=new Date;return __pad_209(e.getHours().toString())+":"+__pad_209(e.getMinutes().toString())+":"+__pad_209(e.getSeconds().toString())},justErrorsLogger={debug:function(){},warn:function(){},error:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=console).error.apply(e,["[Uppy] ["+_$getTimeStamp_209()+"]"].concat(r))}},debugLogger={debug:function(){for(var e=console.debug||console.log,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.call.apply(e,[console,"[Uppy] ["+_$getTimeStamp_209()+"]"].concat(r))},warn:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=console).warn.apply(e,["[Uppy] ["+_$getTimeStamp_209()+"]"].concat(r))},error:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=console).error.apply(e,["[Uppy] ["+_$getTimeStamp_209()+"]"].concat(r))}},_$loggers_105={justErrorsLogger:justErrorsLogger,debugLogger:debugLogger},_$preact_54={exports:{}};!function(){"use strict";function u(){}function r(e,t){for(var r,n,i,o=d,s=arguments.length;2<s--;)p.push(arguments[s]);for(t&&null!=t.children&&(p.length||p.push(t.children),delete t.children);p.length;)if((n=p.pop())&&void 0!==n.pop)for(s=n.length;s--;)p.push(n[s]);else"boolean"==typeof n&&(n=null),(i="function"!=typeof e)&&(null==n?n="":"number"==typeof n?n=String(n):"string"!=typeof n&&(i=!1)),i&&r?o[o.length-1]+=n:o===d?o=[n]:o.push(n),r=i;var a=new u;return a.nodeName=e,a.children=o,a.attributes=null==t?void 0:t,a.key=null==t?void 0:t.key,void 0!==I.vnode&&I.vnode(a),a}function C(e,t){for(var r in t)e[r]=t[r];return e}function o(e){!e.__d&&(e.__d=!0)&&1==i.push(e)&&(I.debounceRendering||n)(t)}function t(){var e,t=i;for(i=[];e=t.pop();)e.__d&&U(e)}function P(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function A(e){var t=C({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var n in r)void 0===t[n]&&(t[n]=r[n]);return t}function T(e){var t=e.parentNode;t&&t.removeChild(e)}function f(e,t,r,n,i){if("className"===t&&(t="class"),"key"!==t)if("ref"===t)r&&r(null),n&&n(e);else if("class"!==t||i)if("style"===t){if(n&&"string"!=typeof n&&"string"!=typeof r||(e.style.cssText=n||""),n&&"object"==typeof n){if("string"!=typeof r)for(var o in r)o in n||(e.style[o]="");for(var o in n)e.style[o]="number"==typeof n[o]&&!1===h.test(o)?n[o]+"px":n[o]}}else{var s,a;"dangerouslySetInnerHTML"===t?n&&(e.innerHTML=n.__html||""):"o"==t[0]&&"n"==t[1]?(s=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase().substring(2),n?r||e.addEventListener(t,l,s):e.removeEventListener(t,l,s),(e.__l||(e.__l={}))[t]=n):"list"!==t&&"type"!==t&&!i&&t in e?(function(e,t,r){try{e[t]=r}catch(e){}}(e,t,null==n?"":n),null!=n&&!1!==n||e.removeAttribute(t)):(a=i&&t!==(t=t.replace(/^xlink:?/,"")),null==n||!1===n?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof n&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):e.setAttribute(t,n)))}else e.className=n||""}function l(e){return this.__l[e.type](I.event&&I.event(e)||e)}function F(){for(var e;e=D.pop();)I.afterMount&&I.afterMount(e),e.componentDidMount&&e.componentDidMount()}function $(e,t,r,n,i,o){M++||(g=null!=i&&void 0!==i.ownerSVGElement,y=null!=e&&!("__preactattr_"in e));var s=function C(e,t,r,n,i){var o=e,s=g;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||i)?e.nodeValue!=t&&(e.nodeValue=t):(o=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(o,e),O(e,!0))),o.__preactattr_=!0,o;var a,u,l=t.nodeName;if("function"==typeof l)return function(e,t,r,n){for(var i=e&&e._component,o=i,s=e,a=i&&e._componentConstructor===t.nodeName,u=a,l=A(t);i&&!u&&(i=i.__u);)u=i.constructor===t.nodeName;return i&&u&&(!n||i._component)?(R(i,l,3,r,n),e=i.base):(o&&!a&&(B(o),e=s=null),i=x(t.nodeName,l,r),e&&!i.__b&&(i.__b=e,s=null),R(i,l,1,r,n),e=i.base,s&&e!==s&&(s._component=null,O(s,!1))),e}(e,t,r,n);if(g="svg"===l||"foreignObject"!==l&&g,l=String(l),(!e||!P(e,l))&&(a=l,(u=g?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).__n=a,o=u,e)){for(;e.firstChild;)o.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(o,e),O(e,!0)}var c=o.firstChild,p=o.__preactattr_,d=t.children;if(null==p){p=o.__preactattr_={};for(var h=o.attributes,_=h.length;_--;)p[h[_].name]=h[_].value}return!y&&d&&1===d.length&&"string"==typeof d[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=d[0]&&(c.nodeValue=d[0]):(d&&d.length||null!=c)&&function(e,t,r,n,i){var o,s,a,u,l,c,p,d,h=e.childNodes,_=[],f={},g=0,y=0,m=h.length,v=0,b=t?t.length:0;if(0!==m)for(var w=0;w<m;w++){var S,k=h[w],E=k.__preactattr_;null!=(S=b&&E?k._component?k._component.__k:E.key:null)?(g++,f[S]=k):(E||(void 0!==k.splitText?!i||k.nodeValue.trim():i))&&(_[v++]=k)}if(0!==b)for(w=0;w<b;w++){if((u=null)!=(S=(d=t[w]).key))g&&void 0!==f[S]&&(u=f[S],f[S]=void 0,g--);else if(!u&&y<v)for(o=y;o<v;o++)if(void 0!==_[o]&&(l=s=_[o],p=i,"string"==typeof(c=d)||"number"==typeof c?void 0!==l.splitText:"string"==typeof c.nodeName?!l._componentConstructor&&P(l,c.nodeName):p||l._componentConstructor===c.nodeName)){u=s,_[o]=void 0,o===v-1&&v--,o===y&&y++;break}u=C(u,d,r,n),a=h[w],u&&u!==e&&u!==a&&(null==a?e.appendChild(u):u===a.nextSibling?T(a):e.insertBefore(u,a))}if(g)for(var w in f)void 0!==f[w]&&O(f[w],!1);for(;y<=v;)void 0!==(u=_[v--])&&O(u,!1)}(o,d,r,n,y||null!=p.dangerouslySetInnerHTML),function(e,t,r){var n;for(n in r)t&&null!=t[n]||null==r[n]||f(e,n,r[n],r[n]=void 0,g);for(n in t)"children"===n||"innerHTML"===n||n in r&&t[n]===("value"===n||"checked"===n?e[n]:r[n])||f(e,n,r[n],r[n]=t[n],g)}(o,t.attributes,p),g=s,o}(e,t,r,n,o);return i&&s.parentNode!==i&&i.appendChild(s),--M||(y=!1,o||F()),s}function O(e,t){var r=e._component;r?B(r):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||T(e),s(e))}function s(e){for(e=e.lastChild;e;){var t=e.previousSibling;O(e,!0),e=t}}function x(e,t,r){var n,i=_[e.name];if(e.prototype&&e.prototype.render?(n=new e(t,r),c.call(n,t,r)):((n=new c(t,r)).constructor=e,n.render=a),i)for(var o=i.length;o--;)if(i[o].constructor===e){n.__b=i[o].__b,i.splice(o,1);break}return n}function a(e,t,r){return this.constructor(e,r)}function R(e,t,r,n,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,n),n&&n!==e.context&&(e.__c||(e.__c=e.context),e.context=n),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==r&&(1!==r&&!1===I.syncComponentUpdates&&e.base?o(e):U(e,1,i)),e.__r&&e.__r(e))}function U(e,t,r,n){if(!e.__x){var i,o,s,a=e.props,u=e.state,l=e.context,c=e.__p||a,p=e.__s||u,d=e.__c||l,h=e.base,_=e.__b,f=h||_,g=e._component,y=!1;if(h&&(e.props=c,e.state=p,e.context=d,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(a,u,l)?y=!0:e.componentWillUpdate&&e.componentWillUpdate(a,u,l),e.props=a,e.state=u,e.context=l),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!y){i=e.render(a,u,l),e.getChildContext&&(l=C(C({},l),e.getChildContext()));var m,v,b,w,S=i&&i.nodeName;if("function"==typeof S?(b=A(i),(o=g)&&o.constructor===S&&b.key==o.__k?R(o,b,1,l,!1):(m=o,e._component=o=x(S,b,l),o.__b=o.__b||_,o.__u=e,R(o,b,0,l,!1),U(o,1,r,!0)),v=o.base):(s=f,(m=g)&&(s=e._component=null),!f&&1!==t||(s&&(s._component=null),v=$(s,i,l,r||!h,f&&f.parentNode,!0))),!f||v===f||o===g||(w=f.parentNode)&&v!==w&&(w.replaceChild(v,f),m||(f._component=null,O(f,!1))),m&&B(m),(e.base=v)&&!n){for(var k=e,E=e;E=E.__u;)(k=E).base=v;v._component=k,v._componentConstructor=k.constructor}}if(!h||r?D.unshift(e):y||(e.componentDidUpdate&&e.componentDidUpdate(c,p,d),I.afterUpdate&&I.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);M||n||F()}}function B(e){I.beforeUnmount&&I.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var r,n,i=e._component;i?B(i):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),T(e.__b=t),n=(r=e).constructor.name,(_[n]||(_[n]=[])).push(r),s(t)),e.__r&&e.__r(null)}function c(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var I={},p=[],d=[],n="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,h=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,i=[],D=[],M=0,g=!1,y=!1,_={};C(c.prototype,{setState:function(e,t){var r=this.state;this.__s||(this.__s=C({},r)),C(r,"function"==typeof e?e(r,this.props):e),t&&(this.__h=this.__h||[]).push(t),o(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),U(this,2)},render:function(){}});var e={h:r,createElement:r,cloneElement:function(e,t){return r(e.nodeName,C(C({},e.attributes),t),2<arguments.length?[].slice.call(arguments,2):e.children)},Component:c,render:function(e,t,r){return $(r,e,{},!1,t,!1)},rerender:t,options:I};_$preact_54.exports=e}(),_$preact_54=_$preact_54.exports;var _$isDOMElement_211=function(e){return e&&"object"==typeof e&&e.nodeType===Node.ELEMENT_NODE},_$findDOMElement_196=function(e,t){return void 0===t&&(t=document),"string"==typeof e?t.querySelector(e):_$isDOMElement_211(e)?e:void 0};function ___extends_103(){return(___extends_103=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var _$Plugin_103=(zu=yu.prototype,zu.getPluginState=function(){return this.uppy.getState().plugins[this.id]||{}},zu.setPluginState=function(e){var t,r=this.uppy.getState().plugins;this.uppy.setState({plugins:___extends_103({},r,((t={})[this.id]=___extends_103({},r[this.id],{},e),t))})},zu.setOptions=function(e){this.opts=___extends_103({},this.opts,{},e),this.setPluginState()},zu.update=function(e){void 0!==this.el&&this._updateUI&&this._updateUI(e)},zu.afterUpdate=function(){},zu.onMount=function(){},zu.mount=function(e,t){var n,i,o,r,s,a=this,u=t.id,l=_$findDOMElement_196(e);if(l)return this.isTargetDOMEl=!0,this.rerender=function(e){a.uppy.getPlugin(a.id)&&(a.el=_$preact_54.render(a.render(e),l,a.el),a.afterUpdate())},this._updateUI=(n=this.rerender,i=null,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o=t,i=i||Promise.resolve().then(function(){return i=null,n.apply(void 0,o)})}),this.uppy.log("Installing "+u+" to a DOM element '"+e+"'"),this.opts.replaceTargetContent&&(l.innerHTML=""),this.el=_$preact_54.render(this.render(this.uppy.getState()),l),this.onMount(),this.el;if("object"==typeof e&&e instanceof yu?r=e:"function"==typeof e&&(s=e,this.uppy.iteratePlugins(function(e){if(e instanceof s)return r=e,!1})),r)return this.uppy.log("Installing "+u+" to "+r.id),this.parent=r,this.el=r.addTarget(t),this.onMount(),this.el;this.uppy.log("Not installing "+u);var c="Invalid target option given to "+u+".";throw new Error(c+="function"==typeof e?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.")},zu.render=function(e){throw new Error("Extend the render method to add your plugin to a DOM element")},zu.addTarget=function(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")},zu.unmount=function(){this.isTargetDOMEl&&this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},zu.install=function(){},zu.uninstall=function(){this.unmount()},yu),_$lib_104={},zu;function yu(e,t){this.uppy=e,this.opts=t||{},this.update=this.update.bind(this),this.mount=this.mount.bind(this),this.install=this.install.bind(this),this.uninstall=this.uninstall.bind(this)}function ___extends_104(){return(___extends_104=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _wrapNativeSuper(e){var r="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(t,e)})(e)}function _construct(e,t,r){return(_construct=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),1}catch(e){return}}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&_setPrototypeOf(i,r.prototype),i}).apply(null,arguments)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var __justErrorsLogger_104=_$loggers_105.justErrorsLogger,__debugLogger_104=_$loggers_105.debugLogger,RestrictionError=(zv=_wrapNativeSuper(Error),Bv=zv,(Av=Cv).prototype=Object.create(Bv.prototype),(Av.prototype.constructor=Av).__proto__=Bv,Cv),Uppy=(Kv=Hv.prototype,Kv.on=function(e,t){return this.emitter.on(e,t),this},Kv.off=function(e,t){return this.emitter.off(e,t),this},Kv.updateAll=function(t){this.iteratePlugins(function(e){e.update(t)})},Kv.setState=function(e){this.store.setState(e)},Kv.getState=function(){return this.store.getState()},Kv.setFileState=function(e,t){var r;if(!this.getState().files[e])throw new Error("Can’t set state for "+e+" (the file could have been removed)");this.setState({files:___extends_104({},this.getState().files,((r={})[e]=___extends_104({},this.getState().files[e],t),r))})},Kv.i18nInit=function(){this.translator=new _$Translator_190([this.defaultLocale,this.opts.locale]),this.locale=this.translator.locale,this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator)},Kv.setOptions=function(e){this.opts=___extends_104({},this.opts,{},e,{restrictions:___extends_104({},this.opts.restrictions,{},e&&e.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(function(e){e.setOptions()}),this.setState()},Kv.resetProgress=function(){var r={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},n=___extends_104({},this.getState().files),i={};Object.keys(n).forEach(function(e){var t=___extends_104({},n[e]);t.progress=___extends_104({},t.progress,r),i[e]=t}),this.setState({files:i,totalProgress:0}),this.emit("reset-progress")},Kv.addPreProcessor=function(e){this.preProcessors.push(e)},Kv.removePreProcessor=function(e){var t=this.preProcessors.indexOf(e);-1!==t&&this.preProcessors.splice(t,1)},Kv.addPostProcessor=function(e){this.postProcessors.push(e)},Kv.removePostProcessor=function(e){var t=this.postProcessors.indexOf(e);-1!==t&&this.postProcessors.splice(t,1)},Kv.addUploader=function(e){this.uploaders.push(e)},Kv.removeUploader=function(e){var t=this.uploaders.indexOf(e);-1!==t&&this.uploaders.splice(t,1)},Kv.setMeta=function(t){var e=___extends_104({},this.getState().meta,t),r=___extends_104({},this.getState().files);Object.keys(r).forEach(function(e){r[e]=___extends_104({},r[e],{meta:___extends_104({},r[e].meta,t)})}),this.log("Adding metadata:"),this.log(t),this.setState({meta:e,files:r})},Kv.setFileMeta=function(e,t){var r,n=___extends_104({},this.getState().files);n[e]?(r=___extends_104({},n[e].meta,t),n[e]=___extends_104({},n[e],{meta:r}),this.setState({files:n})):this.log("Was trying to set metadata for a file that has been removed: ",e)},Kv.getFile=function(e){return this.getState().files[e]},Kv.getFiles=function(){var t=this.getState().files;return Object.keys(t).map(function(e){return t[e]})},Kv._checkMinNumberOfFiles=function(e){var t=this.opts.restrictions.minNumberOfFiles;if(Object.keys(e).length<t)throw new RestrictionError(""+this.i18n("youHaveToAtLeastSelectX",{smart_count:t}))},Kv._checkRestrictions=function(e,t){var r=this.opts.restrictions,n=r.maxFileSize,i=r.maxNumberOfFiles,o=r.allowedFileTypes;if(i&&Object.keys(e).length+1>i)throw new RestrictionError(""+this.i18n("youCanOnlyUploadX",{smart_count:i}));if(o&&!o.some(function(e){return-1<e.indexOf("/")?!!t.type&&_$mimeMatch_49(t.type.replace(/;.*?$/,""),e):"."===e[0]&&t.extension.toLowerCase()===e.substr(1).toLowerCase()})){var s=o.join(", ");throw new RestrictionError(this.i18n("youCanOnlyUploadFileTypes",{types:s}))}if(n&&null!=t.data.size&&t.data.size>n)throw new RestrictionError(this.i18n("exceedsSize2",{backwardsCompat:this.i18n("exceedsSize"),size:_$prettierBytes_107(n)}))},Kv._showOrLogErrorAndThrow=function(e,t){var r=void 0===t?{}:t,n=r.showInformer,i=void 0===n||n,o=r.file,s=void 0===o?null:o,a=r.throwErr,u=void 0===a||a,l="object"==typeof e?e.message:e,c="object"==typeof e&&e.details?e.details:"",p=l;if(c&&(p+=" "+c),e.isRestriction?(this.log(p),this.emit("restriction-failed",s,e)):this.log(p,"error"),i&&this.info({message:l,details:c},"error",5e3),u)throw"object"==typeof e?e:new Error(e)},Kv._assertNewUploadAllowed=function(e){!1===this.getState().allowNewUpload&&this._showOrLogErrorAndThrow(new RestrictionError(this.i18n("noNewAlreadyUploading")),{file:e})},Kv._checkAndCreateFileStateObject=function(e,t){var r=_$getFileType_205(t);t.type=r;var n,i=this.opts.onBeforeFileAdded(t,e);!1===i&&this._showOrLogErrorAndThrow(new RestrictionError("Cannot add the file because onBeforeFileAdded returned false."),{showInformer:!1,file:t}),"object"==typeof i&&i&&(t=i),n=t.name?t.name:"image"===r.split("/")[0]?r.split("/")[0]+"."+r.split("/")[1]:"noname";var o=_$getFileNameAndExtension_204(n).extension,s=t.isRemote||!1,a=_$generateFileID_197(t);e[a]&&this._showOrLogErrorAndThrow(new RestrictionError(this.i18n("noDuplicates",{fileName:n})),{file:t});var u=t.meta||{};u.name=n,u.type=r;var l=isFinite(t.data.size)?t.data.size:null,c={source:t.source||"",id:a,name:n,extension:o||"",meta:___extends_104({},this.getState().meta,{},u),type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isRemote:s,remote:t.remote||"",preview:t.preview};try{this._checkRestrictions(e,c)}catch(e){this._showOrLogErrorAndThrow(e,{file:c})}return c},Kv._startIfAutoProceed=function(){var t=this;this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(function(){t.scheduledAutoProceed=null,t.upload().catch(function(e){e.isRestriction||t.log(e.stack||e.message||e)})},4))},Kv.addFile=function(e){var t;this._assertNewUploadAllowed(e);var r=this.getState().files,n=this._checkAndCreateFileStateObject(r,e);return this.setState({files:___extends_104({},r,((t={})[n.id]=n,t))}),this.emit("file-added",n),this.log("Added file: "+n.name+", "+n.id+", mime type: "+n.type),this._startIfAutoProceed(),n.id},Kv.addFiles=function(e){var t=this;this._assertNewUploadAllowed();for(var r=___extends_104({},this.getState().files),n=[],i=[],o=0;o<e.length;o++)try{var s=this._checkAndCreateFileStateObject(r,e[o]);n.push(s),r[s.id]=s}catch(u){u.isRestriction||i.push(u)}if(this.setState({files:r}),n.forEach(function(e){t.emit("file-added",e)}),5<n.length?this.log("Added batch of "+n.length+" files"):Object.keys(n).forEach(function(e){t.log("Added file: "+n[e].name+"\n id: "+n[e].id+"\n type: "+n[e].type)}),0<n.length&&this._startIfAutoProceed(),0<i.length){var a="Multiple errors occurred while adding files:\n";i.forEach(function(e){a+="\n * "+e.message}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:i.length}),details:a},"error",5e3);var u=new Error(a);throw u.errors=i,u}},Kv.removeFiles=function(e){var t=this,r=this.getState(),n=r.files,i=r.currentUploads,o=___extends_104({},n),s=___extends_104({},i),a=Object.create(null);function u(e){return void 0===a[e]}e.forEach(function(e){n[e]&&(a[e]=n[e],delete o[e])});var l=[];Object.keys(s).forEach(function(e){var t=i[e].fileIDs.filter(u);0!==t.length?s[e]=___extends_104({},i[e],{fileIDs:t}):l.push(e)}),l.forEach(function(e){delete s[e]});var c={currentUploads:s,files:o};0===Object.keys(o).length&&(c.allowNewUpload=!0,c.error=null),this.setState(c),this._calculateTotalProgress();var p=Object.keys(a);p.forEach(function(e){t.emit("file-removed",a[e])}),5<p.length?this.log("Removed "+p.length+" files"):this.log("Removed files: "+p.join(", "))},Kv.removeFile=function(e){this.removeFiles([e])},Kv.pauseResume=function(e){if(this.getState().capabilities.resumableUploads&&!this.getFile(e).uploadComplete){var t=!this.getFile(e).isPaused;return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}},Kv.pauseAll=function(){var r=___extends_104({},this.getState().files);Object.keys(r).filter(function(e){return!r[e].progress.uploadComplete&&r[e].progress.uploadStarted}).forEach(function(e){var t=___extends_104({},r[e],{isPaused:!0});r[e]=t}),this.setState({files:r}),this.emit("pause-all")},Kv.resumeAll=function(){var r=___extends_104({},this.getState().files);Object.keys(r).filter(function(e){return!r[e].progress.uploadComplete&&r[e].progress.uploadStarted}).forEach(function(e){var t=___extends_104({},r[e],{isPaused:!1,error:null});r[e]=t}),this.setState({files:r}),this.emit("resume-all")},Kv.retryAll=function(){var r=___extends_104({},this.getState().files),e=Object.keys(r).filter(function(e){return r[e].error});e.forEach(function(e){var t=___extends_104({},r[e],{isPaused:!1,error:null});r[e]=t}),this.setState({files:r,error:null}),this.emit("retry-all",e);var t=this._createUpload(e,{forceAllowNewUpload:!0});return this._runUpload(t)},Kv.cancelAll=function(){this.emit("cancel-all");var e=this.getState().files,t=Object.keys(e);t.length&&this.removeFiles(t),this.setState({totalProgress:0,error:null})},Kv.retryUpload=function(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);var t=this._createUpload([e],{forceAllowNewUpload:!0});return this._runUpload(t)},Kv.reset=function(){this.cancelAll()},Kv._calculateProgress=function(e,t){var r;this.getFile(e.id)?(r=isFinite(t.bytesTotal)&&0<t.bytesTotal,this.setFileState(e.id,{progress:___extends_104({},this.getFile(e.id).progress,{bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:r?Math.round(t.bytesUploaded/t.bytesTotal*100):0})}),this._calculateTotalProgress()):this.log("Not setting progress for a file that has been removed: "+e.id)},Kv._calculateTotalProgress=function(){var e=this.getFiles().filter(function(e){return e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess});if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});var t,r,n,i,o,s,a,u=e.filter(function(e){return null!=e.progress.bytesTotal}),l=e.filter(function(e){return null==e.progress.bytesTotal});0!==u.length?(t=u.reduce(function(e,t){return e+t.progress.bytesTotal},0),t+=(r=t/u.length)*l.length,n=0,u.forEach(function(e){n+=e.progress.bytesUploaded}),l.forEach(function(e){n+=r*(e.progress.percentage||0)/100}),100<(i=0===t?0:Math.round(n/t*100))&&(i=100),this.setState({totalProgress:i}),this.emit("progress",i)):(o=100*e.length,s=l.reduce(function(e,t){return e+t.progress.percentage},0),a=Math.round(s/o*100),this.setState({totalProgress:a}))},Kv._addListeners=function(){var o=this;this.on("error",function(e){var t="Unknown error";e.message&&(t=e.message),e.details&&(t+=" "+e.details),o.setState({error:t})}),this.on("upload-error",function(e,t,r){var n,i="Unknown error";t.message&&(i=t.message),t.details&&(i+=" "+t.details),o.setFileState(e.id,{error:i,response:r}),o.setState({error:t.message}),"object"==typeof t&&t.message?((n=new Error(t.message)).details=t.message,t.details&&(n.details+=" "+t.details),n.message=o.i18n("failedToUpload",{file:e.name}),o._showOrLogErrorAndThrow(n,{throwErr:!1})):o._showOrLogErrorAndThrow(t,{throwErr:!1})}),this.on("upload",function(){o.setState({error:null})}),this.on("upload-started",function(e,t){o.getFile(e.id)?o.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):o.log("Not setting progress for a file that has been removed: "+e.id)}),this.on("upload-progress",this._calculateProgress),this.on("upload-success",function(e,t){var r;o.getFile(e.id)?(r=o.getFile(e.id).progress,o.setFileState(e.id,{progress:___extends_104({},r,{uploadComplete:!0,percentage:100,bytesUploaded:r.bytesTotal}),response:t,uploadURL:t.uploadURL,isPaused:!1}),o._calculateTotalProgress()):o.log("Not setting progress for a file that has been removed: "+e.id)}),this.on("preprocess-progress",function(e,t){o.getFile(e.id)?o.setFileState(e.id,{progress:___extends_104({},o.getFile(e.id).progress,{preprocess:t})}):o.log("Not setting progress for a file that has been removed: "+e.id)}),this.on("preprocess-complete",function(e){var t;o.getFile(e.id)?((t=___extends_104({},o.getState().files))[e.id]=___extends_104({},t[e.id],{progress:___extends_104({},t[e.id].progress)}),delete t[e.id].progress.preprocess,o.setState({files:t})):o.log("Not setting progress for a file that has been removed: "+e.id)}),this.on("postprocess-progress",function(e,t){o.getFile(e.id)?o.setFileState(e.id,{progress:___extends_104({},o.getState().files[e.id].progress,{postprocess:t})}):o.log("Not setting progress for a file that has been removed: "+e.id)}),this.on("postprocess-complete",function(e){var t;o.getFile(e.id)?((t=___extends_104({},o.getState().files))[e.id]=___extends_104({},t[e.id],{progress:___extends_104({},t[e.id].progress)}),delete t[e.id].progress.postprocess,o.setState({files:t})):o.log("Not setting progress for a file that has been removed: "+e.id)}),this.on("restored",function(){o._calculateTotalProgress()}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",function(){return o.updateOnlineStatus()}),window.addEventListener("offline",function(){return o.updateOnlineStatus()}),setTimeout(function(){return o.updateOnlineStatus()},3e3))},Kv.updateOnlineStatus=function(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)},Kv.getID=function(){return this.opts.id},Kv.use=function(e,t){if("function"!=typeof e)throw new TypeError("Expected a plugin class, but got "+(null===e?"null":typeof e)+". Please verify that the plugin was imported and spelled correctly.");var r=new e(this,t),n=r.id;if(this.plugins[r.type]=this.plugins[r.type]||[],!n)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");var i=this.getPlugin(n);if(i){var o="Already found a plugin named '"+i.id+"'. Tried to use: '"+n+"'.\nUppy plugins must have unique `id` options. See https://uppy.io/docs/plugins/#id.";throw new Error(o)}return e.VERSION&&this.log("Using "+n+" v"+e.VERSION),this.plugins[r.type].push(r),r.install(),this},Kv.getPlugin=function(t){var r=null;return this.iteratePlugins(function(e){if(e.id===t)return r=e,!1}),r},Kv.iteratePlugins=function(t){var r=this;Object.keys(this.plugins).forEach(function(e){r.plugins[e].forEach(t)})},Kv.removePlugin=function(e){this.log("Removing plugin "+e.id),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();var t=this.plugins[e.type].slice(),r=t.indexOf(e);-1!==r&&(t.splice(r,1),this.plugins[e.type]=t);var n=this.getState();delete n.plugins[e.id],this.setState(n)},Kv.close=function(){var t=this;this.log("Closing Uppy instance "+this.opts.id+": removing all files and uninstalling plugins"),this.reset(),this._storeUnsubscribe(),this.iteratePlugins(function(e){t.removePlugin(e)})},Kv.info=function(e,t,r){void 0===t&&(t="info"),void 0===r&&(r=3e3);var n="object"==typeof e;this.setState({info:{isHidden:!1,type:t,message:n?e.message:e,details:n?e.details:null}}),this.emit("info-visible"),clearTimeout(this.infoTimeoutID),this.infoTimeoutID=0!==r?setTimeout(this.hideInfo,r):void 0},Kv.hideInfo=function(){var e=___extends_104({},this.getState().info,{isHidden:!0});this.setState({info:e}),this.emit("info-hidden")},Kv.log=function(e,t){var r=this.opts.logger;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e)}},Kv.run=function(){return this.log("Calling run() is no longer necessary.","warning"),this},Kv.restore=function(e){return this.log('Core: attempting to restore upload "'+e+'"'),this.getState().currentUploads[e]?this._runUpload(e):(this._removeUpload(e),Promise.reject(new Error("Nonexistent upload")))},Kv._createUpload=function(e,t){var r;void 0===t&&(t={});var n=t.forceAllowNewUpload,i=void 0!==n&&n,o=this.getState(),s=o.allowNewUpload,a=o.currentUploads;if(!s&&!i)throw new Error("Cannot create a new upload: already uploading.");var u=_$cuid_13();return this.emit("upload",{id:u,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploads,currentUploads:___extends_104({},a,((r={})[u]={fileIDs:e,step:0,result:{}},r))}),u},Kv._getUpload=function(e){return this.getState().currentUploads[e]},Kv.addResultData=function(e,t){var r,n,i;this._getUpload(e)?(i=___extends_104({},(n=this.getState().currentUploads)[e],{result:___extends_104({},n[e].result,t)}),this.setState({currentUploads:___extends_104({},n,((r={})[e]=i,r))})):this.log("Not setting result for an upload that has been removed: "+e)},Kv._removeUpload=function(e){var t=___extends_104({},this.getState().currentUploads);delete t[e],this.setState({currentUploads:t})},Kv._runUpload=function(s){var a=this,e=this.getState().currentUploads[s].step,t=[].concat(this.preProcessors,this.uploaders,this.postProcessors),r=Promise.resolve();return t.forEach(function(i,o){o<e||(r=r.then(function(){var e,t=a.getState().currentUploads,r=t[s];if(r){var n=___extends_104({},r,{step:o});return a.setState({currentUploads:___extends_104({},t,((e={})[s]=n,e))}),i(n.fileIDs,s)}}).then(function(e){return null}))}),r.catch(function(e){a.emit("error",e,s),a._removeUpload(s)}),r.then(function(){var e,t,r,n=a.getState().currentUploads[s];n&&(t=(e=n.fileIDs.map(function(e){return a.getFile(e)})).filter(function(e){return!e.error}),r=e.filter(function(e){return e.error}),a.addResultData(s,{successful:t,failed:r,uploadID:s}))}).then(function(){var e=a.getState().currentUploads;if(e[s]){var t=e[s].result;return a.emit("complete",t),a._removeUpload(s),t}}).then(function(e){return null==e&&a.log("Not setting result for an upload that has been removed: "+s),e})},Kv.upload=function(){var o=this;this.plugins.uploader||this.log("No uploader type plugins are used","warning");var t=this.getState().files,e=this.opts.onBeforeUpload(t);return!1===e?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(e&&"object"==typeof e&&(t=e,this.setState({files:t})),Promise.resolve().then(function(){return o._checkMinNumberOfFiles(t)}).catch(function(e){o._showOrLogErrorAndThrow(e)}).then(function(){var r=o.getState().currentUploads,n=Object.keys(r).reduce(function(e,t){return e.concat(r[t].fileIDs)},[]),i=[];Object.keys(t).forEach(function(e){var t=o.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||i.push(t.id)});var e=o._createUpload(i);return o._runUpload(e)}).catch(function(e){o._showOrLogErrorAndThrow(e,{showInformer:!1})}))},_defineProperties(Hv.prototype,[{key:"state",get:function(){return this.getState()}}]),Hv),Kv,zv,Av,Bv;function Hv(e){var n=this,t={id:"uppy",autoProceed:!(this.defaultLocale={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize2:"%{backwardsCompat} %{size}",exceedsSize:"This file exceeds maximum allowed size of",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noNewAlreadyUploading:"Cannot add new files: already uploading",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},selectAllFilesFromFolderNamed:"Select all files from folder %{name}",unselectAllFilesFromFolderNamed:"Unselect all files from folder %{name}",selectFileNamed:"Select file %{name}",unselectFileNamed:"Unselect file %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",emptyFolderAdded:"No files were added from empty folder",folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}}),allowMultipleUploads:!0,debug:!1,restrictions:{maxFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null},meta:{},onBeforeFileAdded:function(e,t){return e},onBeforeUpload:function(e){return e},store:_$lib_171(),logger:__justErrorsLogger_104};if(this.opts=___extends_104({},t,{},e,{restrictions:___extends_104({},t.restrictions,{},e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=__debugLogger_104),this.log("Using Core v"+this.constructor.VERSION),this.opts.restrictions.allowedFileTypes&&null!==this.opts.restrictions.allowedFileTypes&&!Array.isArray(this.opts.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");this.i18nInit(),this.plugins={},this.getState=this.getState.bind(this),this.getPlugin=this.getPlugin.bind(this),this.setFileMeta=this.setFileMeta.bind(this),this.setFileState=this.setFileState.bind(this),this.log=this.log.bind(this),this.info=this.info.bind(this),this.hideInfo=this.hideInfo.bind(this),this.addFile=this.addFile.bind(this),this.removeFile=this.removeFile.bind(this),this.pauseResume=this.pauseResume.bind(this),this._calculateProgress=_$lodashThrottle_46(this._calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.updateOnlineStatus=this.updateOnlineStatus.bind(this),this.resetProgress=this.resetProgress.bind(this),this.pauseAll=this.pauseAll.bind(this),this.resumeAll=this.resumeAll.bind(this),this.retryAll=this.retryAll.bind(this),this.cancelAll=this.cancelAll.bind(this),this.retryUpload=this.retryUpload.bind(this),this.upload=this.upload.bind(this),this.emitter=_$namespaceEmitter_50(),this.on=this.on.bind(this),this.off=this.off.bind(this),this.once=this.emitter.once.bind(this.emitter),this.emit=this.emitter.emit.bind(this.emitter),this.preProcessors=[],this.uploaders=[],this.postProcessors=[],this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:_$supportsUploadProgress_106(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:___extends_104({},this.opts.meta),info:{isHidden:!0,type:"info",message:""}}),this._storeUnsubscribe=this.store.subscribe(function(e,t,r){n.emit("state-update",e,t,r),n.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),this._addListeners()}function Cv(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=zv.call.apply(zv,[this].concat(r))||this).isRestriction=!0,e}function ___wrapNativeSuper_97(e){var r="function"==typeof Map?new Map:void 0;return(___wrapNativeSuper_97=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return ___construct_97(e,arguments,___getPrototypeOf_97(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),___setPrototypeOf_97(t,e)})(e)}function ___construct_97(e,t,r){return(___construct_97=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),1}catch(e){return}}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&___setPrototypeOf_97(i,r.prototype),i}).apply(null,arguments)}function ___setPrototypeOf_97(e,t){return(___setPrototypeOf_97=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ___getPrototypeOf_97(e){return(___getPrototypeOf_97=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Uppy.VERSION="1.11.0",_$lib_104=function(e){return new Uppy(e)},_$lib_104.Uppy=Uppy,_$lib_104.Plugin=_$Plugin_103,_$lib_104.debugLogger=__debugLogger_104;var AuthError=(XA=___wrapNativeSuper_97(Error),ZA=XA,(YA=$A).prototype=Object.create(ZA.prototype),(YA.prototype.constructor=YA).__proto__=ZA,$A),_$AuthError_97=AuthError,XA,YA,ZA;function $A(){var e;return(e=XA.call(this,"Authorization required")||this).name="AuthError",e.isAuthError=!0,e}function ___wrapNativeSuper_187(e){var r="function"==typeof Map?new Map:void 0;return(___wrapNativeSuper_187=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return ___construct_187(e,arguments,___getPrototypeOf_187(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),___setPrototypeOf_187(t,e)})(e)}function ___construct_187(e,t,r){return(___construct_187=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),1}catch(e){return}}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&___setPrototypeOf_187(i,r.prototype),i}).apply(null,arguments)}function ___setPrototypeOf_187(e,t){return(___setPrototypeOf_187=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ___getPrototypeOf_187(e){return(___getPrototypeOf_187=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var NetworkError=(uB=___wrapNativeSuper_187(Error),wB=uB,(vB=xB).prototype=Object.create(wB.prototype),(vB.prototype.constructor=vB).__proto__=wB,xB),_$NetworkError_187=NetworkError,_$fetchWithNetworkError_194=function(){return fetch.apply(void 0,arguments).catch(function(e){throw"AbortError"===e.name?e:new _$NetworkError_187(e)})},_class,_temp,uB,vB,wB;function xB(e,t){var r;return void 0===t&&(t=null),(r=uB.call(this,"This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.\n\nSource error: ["+e+"]")||this).isNetworkError=!0,r.request=t,r}function ___extends_99(){return(___extends_99=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___defineProperties_99(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var _$RequestClient_99=(NB=KB.prototype,NB.headers=function(){var e=this.opts.companionHeaders||this.opts.serverHeaders||{};return Promise.resolve(___extends_99({},this.defaultHeaders,{},e))},NB._getPostResponseFunc=function(t){var r=this;return function(e){return t?e:r.onReceiveResponse(e)}},NB.onReceiveResponse=function(e){var t,r=this.uppy.getState().companion||{},n=this.opts.companionUrl,i=e.headers;return i.has("i-am")&&i.get("i-am")!==r[n]&&this.uppy.setState({companion:___extends_99({},r,((t={})[n]=i.get("i-am"),t))}),e},NB._getUrl=function(e){return/^(https?:|)\/\//.test(e)?e:this.hostname+"/"+e},NB._json=function(e){if(401===e.status)throw new _$AuthError_97;if(e.status<200||300<e.status){var t="Failed request with status: "+e.status+". "+e.statusText;return e.json().then(function(e){throw t=e.message?t+" message: "+e.message:t,t=e.requestId?t+" request-Id: "+e.requestId:t,new Error(t)}).catch(function(){throw new Error(t)})}return e.json()},NB.preflight=function(r){var n=this;return new Promise(function(t,e){if(n.preflightDone)return t(n.allowedHeaders.slice());fetch(n._getUrl(r),{method:"OPTIONS"}).then(function(e){e.headers.has("access-control-allow-headers")&&(n.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map(function(e){return e.trim().toLowerCase()})),n.preflightDone=!0,t(n.allowedHeaders.slice())}).catch(function(e){n.uppy.log("[CompanionClient] unable to make preflight request "+e,"warning"),n.preflightDone=!0,t(n.allowedHeaders.slice())})})},NB.preflightAndHeaders=function(e){var n=this;return Promise.all([this.preflight(e),this.headers()]).then(function(e){var t=e[0],r=e[1];return Object.keys(r).forEach(function(e){-1===t.indexOf(e.toLowerCase())&&(n.uppy.log("[CompanionClient] excluding unallowed header "+e),delete r[e])}),r})},NB.get=function(n,i){var o=this;return new Promise(function(t,r){o.preflightAndHeaders(n).then(function(e){_$fetchWithNetworkError_194(o._getUrl(n),{method:"get",headers:e,credentials:"same-origin"}).then(o._getPostResponseFunc(i)).then(function(e){return o._json(e).then(t)}).catch(function(e){e=e.isAuthError?e:new Error("Could not get "+o._getUrl(n)+". "+e),r(e)})}).catch(r)})},NB.post=function(n,i,o){var s=this;return new Promise(function(t,r){s.preflightAndHeaders(n).then(function(e){_$fetchWithNetworkError_194(s._getUrl(n),{method:"post",headers:e,credentials:"same-origin",body:JSON.stringify(i)}).then(s._getPostResponseFunc(o)).then(function(e){return s._json(e).then(t)}).catch(function(e){e=e.isAuthError?e:new Error("Could not post "+s._getUrl(n)+". "+e),r(e)})}).catch(r)})},NB.delete=function(n,i,o){var s=this;return new Promise(function(t,r){s.preflightAndHeaders(n).then(function(e){_$fetchWithNetworkError_194(s.hostname+"/"+n,{method:"delete",headers:e,credentials:"same-origin",body:i?JSON.stringify(i):null}).then(s._getPostResponseFunc(o)).then(function(e){return s._json(e).then(t)}).catch(function(e){e=e.isAuthError?e:new Error("Could not delete "+s._getUrl(n)+". "+e),r(e)})}).catch(r)})},___defineProperties_99(KB.prototype,[{key:"hostname",get:function(){var e=this.uppy.getState().companion,t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}},{key:"defaultHeaders",get:function(){return{Accept:"application/json","Content-Type":"application/json","Uppy-Versions":"@uppy/companion-client="+KB.VERSION}}}]),_temp=_class=KB,_class.VERSION="1.5.0",_temp),_$tokenStorage_102={},NB;function KB(e,t){this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1}function ___extends_98(){return(___extends_98=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}_$tokenStorage_102.setItem=function(t,r){return new Promise(function(e){localStorage.setItem(t,r),e()})},_$tokenStorage_102.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},_$tokenStorage_102.removeItem=function(t){return new Promise(function(e){localStorage.removeItem(t),e()})};var _getName=function(e){return e.split("-").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" ")},_$Provider_98=function(i){var e,t;function r(e,t){var r;return(r=i.call(this,e,t)||this).provider=t.provider,r.id=r.provider,r.authProvider=t.authProvider||r.provider,r.name=r.opts.name||_getName(r.id),r.pluginId=r.opts.pluginId,r.tokenKey="companion-"+r.pluginId+"-auth-token",r}t=i,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var n=r.prototype;return n.headers=function(){var n=this;return new Promise(function(r,e){i.prototype.headers.call(n).then(function(t){n.getAuthToken().then(function(e){r(___extends_98({},t,{"uppy-auth-token":e}))})}).catch(e)})},n.onReceiveResponse=function(e){e=i.prototype.onReceiveResponse.call(this,e);var t=this.uppy.getPlugin(this.pluginId),r=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:r}),e},n.setAuthToken=function(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)},n.getAuthToken=function(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)},n.authUrl=function(){return this.hostname+"/"+this.id+"/connect"},n.fileUrl=function(e){return this.hostname+"/"+this.id+"/get/"+e},n.list=function(e){return this.get(this.id+"/list/"+(e||""))},n.logout=function(){var n=this;return new Promise(function(t,r){n.get(n.id+"/logout").then(function(e){n.uppy.getPlugin(n.pluginId).storage.removeItem(n.tokenKey).then(function(){return t(e)}).catch(r)}).catch(r)})},r.initPlugin=function(e,t,r){if(e.type="acquirer",e.files=[],r&&(e.opts=___extends_98({},r,t)),t.serverUrl||t.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(t.companionAllowedHosts){var n=t.companionAllowedHosts;if(!("string"==typeof n||Array.isArray(n)||n instanceof RegExp))throw new TypeError(e.id+': the option "companionAllowedHosts" must be one of string, Array, RegExp');e.opts.companionAllowedHosts=n}else/^(?!https?:\/\/).*$/i.test(t.companionUrl)?e.opts.companionAllowedHosts="https://"+t.companionUrl.replace(/^\/\//,""):e.opts.companionAllowedHosts=t.companionUrl;e.storage=e.opts.storage||_$tokenStorage_102},r}(_$RequestClient_99),_$Socket_100=(CD=BD.prototype,CD.open=function(){var r=this;this.socket=new WebSocket(this.opts.target),this.socket.onopen=function(e){for(r.isOpen=!0;0<r._queued.length&&r.isOpen;){var t=r._queued[0];r.send(t.action,t.payload),r._queued=r._queued.slice(1)}},this.socket.onclose=function(e){r.isOpen=!1},this.socket.onmessage=this._handleMessage},CD.close=function(){this.socket&&this.socket.close()},CD.send=function(e,t){this.isOpen?this.socket.send(JSON.stringify({action:e,payload:t})):this._queued.push({action:e,payload:t})},CD.on=function(e,t){this.emitter.on(e,t)},CD.emit=function(e,t){this.emitter.emit(e,t)},CD.once=function(e,t){this.emitter.once(e,t)},CD._handleMessage=function(e){try{var t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}},BD),_$lib_101={RequestClient:_$RequestClient_99,Provider:_$Provider_98,Socket:_$Socket_100},__h_147=_$preact_54.h,AuthView=(TD=_$preact_54.Component,VD=TD,(UD=WD).prototype=Object.create(VD.prototype),(UD.prototype.constructor=UD).__proto__=VD,WD.prototype.render=function(){var e=__h_147("span",{class:"uppy-Provider-authTitleName"},this.props.pluginName,__h_147("br",null));return __h_147("div",{class:"uppy-Provider-auth"},__h_147("div",{class:"uppy-Provider-authIcon"},this.props.pluginIcon()),__h_147("div",{class:"uppy-Provider-authTitle"},this.props.i18nArray("authenticateWithTitle",{pluginName:e})),__h_147("button",{type:"button",class:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn",onclick:this.props.handleAuth,"data-uppy-super-focusable":!0},this.props.i18nArray("authenticateWith",{pluginName:this.props.pluginName})))},WD),_$AuthView_147=AuthView,_$classnames_9={exports:{}},TD,UD,VD,CD;function WD(){return TD.apply(this,arguments)||this}function BD(e){this.opts=e,this._queued=[],this.isOpen=!1,this.emitter=_$namespaceEmitter_50(),this._handleMessage=this._handleMessage.bind(this),this.close=this.close.bind(this),this.emit=this.emit.bind(this),this.on=this.on.bind(this),this.once=this.once.bind(this),this.send=this.send.bind(this),e&&!1===e.autoOpen||this.open()}!function(){"use strict";var s={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var n=typeof r;if("string"==n||"number"==n)e.push(r);else if(Array.isArray(r)&&r.length){var i=a.apply(null,r);i&&e.push(i)}else if("object"==n)for(var o in r)s.call(r,o)&&r[o]&&e.push(o)}}return e.join(" ")}_$classnames_9.exports?(a.default=a,_$classnames_9.exports=a):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return a}):window.classNames=a}(),_$classnames_9=_$classnames_9.exports;var __h_148=_$preact_54.h,Breadcrumb=function(e){return __h_148("span",null,__h_148("button",{type:"button",class:"uppy-u-reset",onclick:e.getFolder},e.title),e.isLast?"":" / ")},_$Breadcrumbs_148=function(r){return __h_148("div",{class:"uppy-Provider-breadcrumbs"},__h_148("div",{class:"uppy-Provider-breadcrumbsIcon"},r.breadcrumbsIcon),r.directories.map(function(e,t){return __h_148(Breadcrumb,{key:e.id,getFolder:function(){return r.getFolder(e.id)},title:0===t?r.title:e.title,isLast:t+1===r.directories.length})}))},__h_150=_$preact_54.h,Component=_$preact_54.Component,_$Filter_150=function(r){var e,t;function n(e){var t;return(t=r.call(this,e)||this).preventEnterPress=t.preventEnterPress.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)),t}t=r,(e=n).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=n.prototype;return i.preventEnterPress=function(e){13===e.keyCode&&(e.stopPropagation(),e.preventDefault())},i.render=function(){var t=this;return __h_150("div",{class:"uppy-ProviderBrowser-search"},__h_150("input",{class:"uppy-u-reset uppy-ProviderBrowser-searchInput",type:"text",placeholder:this.props.i18n("filter"),"aria-label":this.props.i18n("filter"),onkeyup:this.preventEnterPress,onkeydown:this.preventEnterPress,onkeypress:this.preventEnterPress,oninput:function(e){return t.props.filterQuery(e)},value:this.props.filterInput}),__h_150("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon uppy-ProviderBrowser-searchIcon",width:"12",height:"12",viewBox:"0 0 12 12"},__h_150("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),this.props.filterInput&&__h_150("button",{class:"uppy-u-reset uppy-ProviderBrowser-searchClose",type:"button","aria-label":this.props.i18n("resetFilter"),title:this.props.i18n("resetFilter"),onclick:this.props.filterQuery},__h_150("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",viewBox:"0 0 19 19"},__h_150("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))))},n}(Component),__h_153=_$preact_54.h;function FileIcon(){return __h_153("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},__h_153("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function FolderIcon(){return __h_153("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",style:{width:16,marginRight:3},viewBox:"0 0 276.157 276.157"},__h_153("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function VideoIcon(){return __h_153("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 58 58"},__h_153("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),__h_153("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}var _$ItemIcon_153=function(e){if(null!==e.itemIconString)switch(e.itemIconString){case"file":return __h_153(FileIcon,null);case"folder":return __h_153(FolderIcon,null);case"video":return __h_153(VideoIcon,null);default:return __h_153("img",{src:e.itemIconString})}},__h_152=_$preact_54.h,_$GridLi_152=function(e){return __h_152("li",{class:e.className},__h_152("div",{"aria-hidden":!0,class:"uppy-ProviderBrowserItem-fakeCheckbox "+(e.isChecked?"uppy-ProviderBrowserItem-fakeCheckbox--is-checked":"")}),__h_152("button",{type:"button",class:"uppy-u-reset uppy-ProviderBrowserItem-inner",onclick:e.toggleCheckbox,role:"option","aria-label":e.isChecked?e.i18n("unselectFileNamed",{name:e.title}):e.i18n("selectFileNamed",{name:e.title}),"aria-selected":e.isChecked,"aria-disabled":e.isDisabled,"data-uppy-super-focusable":!0},e.itemIconEl,e.showTitles&&e.title))},__h_154=_$preact_54.h,getAriaLabelOfCheckbox=function(e){return"folder"===e.type?e.isChecked?e.i18n("unselectAllFilesFromFolderNamed",{name:e.title}):e.i18n("selectAllFilesFromFolderNamed",{name:e.title}):e.isChecked?e.i18n("unselectFileNamed",{name:e.title}):e.i18n("selectFileNamed",{name:e.title})},_$ListLi_154=function(e){return __h_154("li",{class:e.className},__h_154("button",{type:"button",class:"uppy-u-reset uppy-ProviderBrowserItem-fakeCheckbox "+(e.isChecked?"uppy-ProviderBrowserItem-fakeCheckbox--is-checked":""),onClick:e.toggleCheckbox,id:e.id,role:"option","aria-label":getAriaLabelOfCheckbox(e),"aria-selected":e.isChecked,"aria-disabled":e.isDisabled,"data-uppy-super-focusable":!0}),"file"===e.type?__h_154("label",{for:e.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},e.itemIconEl,e.showTitles&&e.title):__h_154("button",{type:"button",class:"uppy-u-reset uppy-ProviderBrowserItem-inner",onclick:e.handleFolderClick,"aria-label":e.i18n("openFolderNamed",{name:e.title})},e.itemIconEl,e.showTitles&&e.title))};function ___extends_155(){return(___extends_155=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __h_155=_$preact_54.h,_$Item_155=function(e){var t=e.getItemIcon(),r=_$classnames_9("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--selected":e.isChecked},{"uppy-ProviderBrowserItem--noPreview":"video"===t}),n=__h_155(_$ItemIcon_153,{itemIconString:t});switch(e.viewType){case"grid":return __h_155(_$GridLi_152,___extends_155({},e,{className:r,itemIconEl:n}));case"list":return __h_155(_$ListLi_154,___extends_155({},e,{className:r,itemIconEl:n}));default:throw new Error("There is no such type "+e.viewType)}};function ___extends_156(){return(___extends_156=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __h_156=_$preact_54.h,getSharedProps=function(t,r){return{id:t.id,title:t.name,getItemIcon:function(){return t.icon},isChecked:r.isChecked(t),toggleCheckbox:function(e){return r.toggleCheckbox(e,t)},columns:r.columns,showTitles:r.showTitles,viewType:r.viewType,i18n:r.i18n}},_$ItemList_156=function(t){return t.folders.length||t.files.length?__h_156("div",{class:"uppy-ProviderBrowser-body"},__h_156("ul",{class:"uppy-ProviderBrowser-list",onscroll:t.handleScroll,role:"listbox",tabindex:"-1"},t.folders.map(function(e){return _$Item_155(___extends_156({},getSharedProps(e,t),{type:"folder",isDisabled:!!t.isChecked(e)&&t.isChecked(e).loading,handleFolderClick:function(){return t.handleFolderClick(e)}}))}),t.files.map(function(e){return _$Item_155(___extends_156({},getSharedProps(e,t),{type:"file",isDisabled:!1}))}))):__h_156("div",{class:"uppy-Provider-empty"},t.i18n("noFilesFound"))},__h_151=_$preact_54.h,_$FooterActions_151=function(e){return __h_151("div",{class:"uppy-ProviderBrowser-footer"},__h_151("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",onclick:e.done},e.i18n("selectX",{smart_count:e.selected})),__h_151("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onclick:e.cancel},e.i18n("cancel")))};function ___extends_149(){return(___extends_149=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __h_149=_$preact_54.h,_$Browser_149=function(e){var t=e.folders,r=e.files;""!==e.filterInput&&(t=e.filterItems(e.folders),r=e.filterItems(e.files));var n=e.currentSelection.length;return __h_149("div",{class:_$classnames_9("uppy-ProviderBrowser","uppy-ProviderBrowser-viewType--"+e.viewType)},__h_149("div",{class:"uppy-ProviderBrowser-header"},__h_149("div",{class:_$classnames_9("uppy-ProviderBrowser-headerBar",!e.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},e.showBreadcrumbs&&_$Breadcrumbs_148({getFolder:e.getFolder,directories:e.directories,breadcrumbsIcon:e.pluginIcon&&e.pluginIcon(),title:e.title}),__h_149("span",{class:"uppy-ProviderBrowser-user"},e.username),__h_149("button",{type:"button",onclick:e.logout,class:"uppy-u-reset uppy-ProviderBrowser-userLogout"},e.i18n("logOut")))),e.showFilter&&__h_149(_$Filter_150,e),__h_149(_$ItemList_156,{columns:[{name:"Name",key:"title"}],folders:t,files:r,activeRow:e.isActiveRow,sortByTitle:e.sortByTitle,sortByDate:e.sortByDate,isChecked:e.isChecked,handleFolderClick:e.getNextFolder,toggleCheckbox:e.toggleCheckbox,handleScroll:e.handleScroll,title:e.title,showTitles:e.showTitles,i18n:e.i18n,viewType:e.viewType}),0<n&&__h_149(_$FooterActions_151,___extends_149({selected:n},e)))},__h_157=_$preact_54.h,_$Loader_157=function(e){return __h_157("div",{class:"uppy-Provider-loading"},__h_157("span",null,e.i18n("loading")))},_$isPreviewSupported_215=function(e){if(!e)return!1;var t=e.split("/")[1];return!!/^(jpe?g|gif|png|svg|svg\+xml|bmp|webp)$/.test(t)},___class_158,___temp_158;function ___extends_158(){return(___extends_158=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __h_158=_$preact_54.h,__Component_158=_$preact_54.Component,CloseWrapper=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),(t.prototype.constructor=t).__proto__=r;var i=n.prototype;return i.componentWillUnmount=function(){this.props.onUnmount()},i.render=function(){return this.props.children[0]},n}(__Component_158),_$lib_158=(jF=iF.prototype,jF.tearDown=function(){},jF._updateFilesAndFolders=function(e,t,r){this.nextPagePath=e.nextPagePath,e.items.forEach(function(e){e.isFolder?r.push(e):t.push(e)}),this.plugin.setPluginState({folders:r,files:t})},jF.preFirstRender=function(){this.plugin.setPluginState({didFirstRender:!0}),this.plugin.onFirstRender()},jF.getFolder=function(i,o){var s=this;return this._loaderWrapper(this.provider.list(i),function(e){var t=s.plugin.getPluginState(),r=function(e){for(var t,r=0;r<e.length;r++)if(t=e[r],i===t.id)return r;return-1}(t.directories),n=-1!==r?t.directories.slice(0,r+1):t.directories.concat([{id:i,title:o}]);s.username=s.username?s.username:e.username,s._updateFilesAndFolders(e,[],[]),s.plugin.setPluginState({directories:n})},this.handleError)},jF.getNextFolder=function(e){this.getFolder(e.requestPath,e.name),this.lastCheckbox=void 0},jF.addFile=function(e){var t={id:this.providerFileToId(e),source:this.plugin.id,data:e,name:e.name||e.id,type:e.mimeType,isRemote:!0,body:{fileId:e.id},remote:{companionUrl:this.plugin.opts.companionUrl,url:""+this.provider.fileUrl(e.requestPath),body:{fileId:e.id},providerOptions:this.provider.opts}},r=_$getFileType_205(t);r&&_$isPreviewSupported_215(r)&&(t.preview=e.thumbnail),this.plugin.uppy.log("Adding remote file");try{this.plugin.uppy.addFile(t)}catch(e){e.isRestriction||this.plugin.uppy.log(e)}},jF.removeFile=function(t){var e=this.plugin.getPluginState().currentSelection;this.plugin.setPluginState({currentSelection:e.filter(function(e){return e.id!==t})})},jF.logout=function(){var r=this;this.provider.logout().then(function(e){var t;e.ok&&(e.revoked||(t=r.plugin.uppy.i18n("companionUnauthorizeHint",{provider:r.plugin.title,url:e.manual_revoke_url}),r.plugin.uppy.info(t,"info",7e3)),r.plugin.setPluginState({authenticated:!1,files:[],folders:[],directories:[]}))}).catch(this.handleError)},jF.filterQuery=function(e){var t=this.plugin.getPluginState();this.plugin.setPluginState(___extends_158({},t,{filterInput:e?e.target.value:""}))},jF.toggleSearch=function(e){var t=this.plugin.getPluginState();this.plugin.setPluginState({isSearchVisible:!t.isSearchVisible,filterInput:""})},jF.filterItems=function(e){var t=this.plugin.getPluginState();return t.filterInput&&""!==t.filterInput?e.filter(function(e){return-1!==e.name.toLowerCase().indexOf(t.filterInput.toLowerCase())}):e},jF.sortByTitle=function(){var e=___extends_158({},this.plugin.getPluginState()),t=e.files,r=e.folders,n=e.sorting,i=t.sort(function(e,t){return"titleDescending"===n?t.name.localeCompare(e.name):e.name.localeCompare(t.name)}),o=r.sort(function(e,t){return"titleDescending"===n?t.name.localeCompare(e.name):e.name.localeCompare(t.name)});this.plugin.setPluginState(___extends_158({},e,{files:i,folders:o,sorting:"titleDescending"===n?"titleAscending":"titleDescending"}))},jF.sortByDate=function(){var e=___extends_158({},this.plugin.getPluginState()),t=e.files,r=e.folders,i=e.sorting,n=t.sort(function(e,t){var r=new Date(e.modifiedDate),n=new Date(t.modifiedDate);return"dateDescending"===i?n<r?-1:r<n?1:0:n<r?1:r<n?-1:0}),o=r.sort(function(e,t){var r=new Date(e.modifiedDate),n=new Date(t.modifiedDate);return"dateDescending"===i?n<r?-1:r<n?1:0:n<r?1:r<n?-1:0});this.plugin.setPluginState(___extends_158({},e,{files:n,folders:o,sorting:"dateDescending"===i?"dateAscending":"dateDescending"}))},jF.sortBySize=function(){var e,t=___extends_158({},this.plugin.getPluginState()),r=t.files,i=t.sorting;r.length&&this.plugin.getItemData(r[0]).size&&(e=r.sort(function(e,t){var r=e.size,n=t.size;return"sizeDescending"===i?n<r?-1:r<n?1:0:n<r?1:r<n?-1:0}),this.plugin.setPluginState(___extends_158({},t,{files:e,sorting:"sizeDescending"===i?"sizeAscending":"sizeDescending"})))},jF.isActiveRow=function(e){return this.plugin.getPluginState().activeRow===this.plugin.getItemId(e)},jF.isChecked=function(t){return this.plugin.getPluginState().currentSelection.some(function(e){return e.id===t.id})},jF.addFolder=function(n){var i=this,o=this.providerFileToId(n),s=this.plugin.getPluginState(),a=s.selectedFolders||{};if(!(o in a&&a[o].loading))return a[o]={loading:!0,files:[]},this.plugin.setPluginState({selectedFolders:a}),this.listAllFiles(n.requestPath).then(function(e){e.forEach(function(e){i.addFile(e)});var t,r=e.map(i.providerFileToId);(s=i.plugin.getPluginState()).selectedFolders[o]={loading:!1,files:r},i.plugin.setPluginState({selectedFolders:a}),t=e.length?i.plugin.uppy.i18n("folderAdded",{smart_count:e.length,folder:n.name}):i.plugin.uppy.i18n("emptyFolderAdded"),i.plugin.uppy.info(t)}).catch(function(e){delete(s=i.plugin.getPluginState()).selectedFolders[o],i.plugin.setPluginState({selectedFolders:s.selectedFolders}),i.handleError(e)})},jF.toggleCheckbox=function(e,t){e.stopPropagation(),e.preventDefault(),e.currentTarget.focus();var r,n,i,o,s=this.plugin.getPluginState(),a=s.folders,u=s.files,l=this.filterItems(a.concat(u));this.lastCheckbox&&e.shiftKey?(i=(r=l.indexOf(this.lastCheckbox))<(n=l.indexOf(t))?l.slice(r,n+1):l.slice(n,r+1),this.plugin.setPluginState({currentSelection:i})):(this.lastCheckbox=t,o=this.plugin.getPluginState().currentSelection,this.isChecked(t)?this.plugin.setPluginState({currentSelection:o.filter(function(e){return e.id!==t.id})}):this.plugin.setPluginState({currentSelection:o.concat([t])}))},jF.providerFileToId=function(e){return _$generateFileID_197({data:e,name:e.name||e.id,type:e.mimeType})},jF.handleAuth=function(){var n=this,e=btoa(JSON.stringify({origin:"origin"in location?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")})),t=encodeURIComponent("@uppy/provider-views="+iF.VERSION),r=this.provider.authUrl()+"?state="+e+"&uppyVersions="+t,i=window.open(r,"_blank");window.addEventListener("message",function e(t){var r;n._isOriginAllowed(t.origin,n.plugin.opts.companionAllowedHosts)&&t.source===i?(r="string"==typeof t.data?JSON.parse(t.data):t.data).token?(i.close(),window.removeEventListener("message",e),n.provider.setAuthToken(r.token),n.preFirstRender()):n.plugin.uppy.log("did not receive token from auth window"):n.plugin.uppy.log("rejecting event from "+t.origin+" vs allowed pattern "+n.plugin.opts.companionAllowedHosts)})},jF._isOriginAllowed=function(t,e){function r(e){return"string"==typeof e?new RegExp("^"+e+"$"):e instanceof RegExp?e:void 0}return(Array.isArray(e)?e.map(r):[r(e)]).filter(function(e){return null!=e}).some(function(e){return e.test(t)||e.test(t+"/")})},jF.handleError=function(e){var t,r=this.plugin.uppy;r.log(e.toString()),e.isAuthError||(t=r.i18n("companionError"),r.info({message:t,details:e.toString()},"error",5e3))},jF.handleScroll=function(e){var i=this,t=e.target.scrollHeight-(e.target.scrollTop+e.target.offsetHeight),r=this.nextPagePath||null;t<50&&r&&!this._isHandlingScroll&&(this.provider.list(r).then(function(e){var t=i.plugin.getPluginState(),r=t.files,n=t.folders;i._updateFilesAndFolders(e,r,n)}).catch(this.handleError).then(function(){i._isHandlingScroll=!1}),this._isHandlingScroll=!0)},jF.listAllFiles=function(e,i){var o=this;return void 0===i&&(i=null),i=i||[],new Promise(function(r,n){o.provider.list(e).then(function(e){e.items.forEach(function(e){e.isFolder||i.push(e)});var t=e.nextPagePath||null;return t?o.listAllFiles(t,i).then(function(e){return r(e)}).catch(function(e){return n(e)}):r(i)}).catch(function(e){return n(e)})})},jF.donePicking=function(){var t=this,e=this.plugin.getPluginState().currentSelection.map(function(e){return e.isFolder?t.addFolder(e):t.addFile(e)});this._loaderWrapper(Promise.all(e),function(){t.clearSelection()},function(){})},jF.cancelPicking=function(){this.clearSelection();var e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()},jF.clearSelection=function(){this.plugin.setPluginState({currentSelection:[]})},jF._loaderWrapper=function(e,t,r){var n=this;e.then(function(e){n.plugin.setPluginState({loading:!1}),t(e)}).catch(function(e){n.plugin.setPluginState({loading:!1}),r(e)}),this.plugin.setPluginState({loading:!0})},jF.render=function(e,t){void 0===t&&(t={});var r=this.plugin.getPluginState(),n=r.authenticated;if(r.didFirstRender||this.preFirstRender(),this.plugin.getPluginState().loading)return __h_158(CloseWrapper,{onUnmount:this.clearSelection},__h_158(_$Loader_157,{i18n:this.plugin.uppy.i18n}));if(!n)return __h_158(CloseWrapper,{onUnmount:this.clearSelection},__h_158(_$AuthView_147,{pluginName:this.plugin.title,pluginIcon:this.plugin.icon,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,i18nArray:this.plugin.uppy.i18nArray}));var i=___extends_158({},this.opts,{},t),o=___extends_158({},this.plugin.getPluginState(),{username:this.username,getNextFolder:this.getNextFolder,getFolder:this.getFolder,filterItems:this.filterItems,filterQuery:this.filterQuery,toggleSearch:this.toggleSearch,sortByTitle:this.sortByTitle,sortByDate:this.sortByDate,logout:this.logout,isActiveRow:this.isActiveRow,isChecked:this.isChecked,toggleCheckbox:this.toggleCheckbox,handleScroll:this.handleScroll,listAllFiles:this.listAllFiles,done:this.donePicking,cancel:this.cancelPicking,title:this.plugin.title,viewType:i.viewType,showTitles:i.showTitles,showFilter:i.showFilter,showBreadcrumbs:i.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:this.plugin.uppy.i18n});return __h_158(CloseWrapper,{onUnmount:this.clearSelection},__h_158(_$Browser_149,o))},___temp_158=___class_158=iF,___class_158.VERSION="1.6.8",___temp_158),_$lib_172={},jF;function iF(e,t){this.plugin=e,this.provider=t.provider,this.opts=___extends_158({},{viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0},{},t),this.addFile=this.addFile.bind(this),this.filterItems=this.filterItems.bind(this),this.filterQuery=this.filterQuery.bind(this),this.toggleSearch=this.toggleSearch.bind(this),this.getFolder=this.getFolder.bind(this),this.getNextFolder=this.getNextFolder.bind(this),this.logout=this.logout.bind(this),this.preFirstRender=this.preFirstRender.bind(this),this.handleAuth=this.handleAuth.bind(this),this.sortByTitle=this.sortByTitle.bind(this),this.sortByDate=this.sortByDate.bind(this),this.isActiveRow=this.isActiveRow.bind(this),this.isChecked=this.isChecked.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.handleError=this.handleError.bind(this),this.handleScroll=this.handleScroll.bind(this),this.listAllFiles=this.listAllFiles.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelPicking=this.cancelPicking.bind(this),this.clearSelection=this.clearSelection.bind(this),this.render=this.render.bind(this),this.clearSelection(),this.plugin.setPluginState({authenticated:!1,files:[],folders:[],directories:[],activeRow:-1,filterInput:"",isSearchVisible:!1})}function ___extends_172(){return(___extends_172=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var STATE_UPDATE="uppy/STATE_UPDATE",defaultSelector=function(t){return function(e){return e.uppy[t]}},ReduxStore=(_H=$H.prototype,_H.setState=function(e){this._store.dispatch({type:STATE_UPDATE,id:this._id,payload:e})},_H.getState=function(){return this._selector(this._store.getState())},_H.subscribe=function(o){var s=this,a=this.getState();return this._store.subscribe(function(){var t,r,e,n,i=s.getState();a!==i&&(t=a,r=i,e=Object.keys(r),n={},e.forEach(function(e){t[e]!==r[e]&&(n[e]=r[e])}),o(a,i,n),a=i)})},$H),_H;function $H(e){this._store=e.store,this._id=e.id||_$cuid_13(),this._selector=e.selector||defaultSelector(this._id),this.setState({})}ReduxStore.VERSION="1.2.1",_$lib_172=function(e){return new ReduxStore(e)},_$lib_172.STATE_UPDATE=STATE_UPDATE,_$lib_172.reducer=function(e,t){if(void 0===e&&(e={}),t.type!==STATE_UPDATE)return e;var r,n=___extends_172({},e[t.id],t.payload);return ___extends_172({},e,((r={})[t.id]=n,r))},_$lib_172.middleware=function(){return function(){return function(t){return function(e){t(e)}}}};var _$isShallowEqual_43=function(e,t){if(e===t)return!0;for(var r in e)if(!(r in t))return!1;for(var r in t)if(e[r]!==t[r])return!1;return!0},__h_126=_$preact_54.h,_$getFileTypeIcon_126=function(e){var t={color:"#838999",icon:__h_126("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},__h_126("g",{fill:"#A7AFB7","fill-rule":"nonzero"},__h_126("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),__h_126("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))};if(!e)return t;var r=e.split("/")[0],n=e.split("/")[1];return"text"===r?{color:"#5a5e69",icon:__h_126("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},__h_126("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69","fill-rule":"nonzero"}))}:"image"===r?{color:"#686de0",icon:__h_126("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},__h_126("g",{fill:"#686DE0","fill-rule":"evenodd"},__h_126("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z","fill-rule":"nonzero"}),__h_126("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z","fill-rule":"nonzero"}),__h_126("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}:"audio"===r?{color:"#068dbb",icon:__h_126("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},__h_126("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF","fill-rule":"nonzero"}))}:"video"===r?{color:"#19af67",icon:__h_126("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},__h_126("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67","fill-rule":"nonzero"}))}:"application"===r&&"pdf"===n?{color:"#e25149",icon:__h_126("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},__h_126("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A","fill-rule":"nonzero"}))}:"application"===r&&-1!==["zip","x-7z-compressed","x-rar-compressed","x-gtar","x-apple-diskimage","x-diskcopy"].indexOf(n)?{color:"#00C469",icon:__h_126("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},__h_126("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469","fill-rule":"nonzero"}))}:t},__h_118=_$preact_54.h,_$FilePreview_118=function(e){var t=e.file;if(t.preview)return __h_118("img",{class:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});var r=_$getFileTypeIcon_126(t.type),n=r.color,i=r.icon;return __h_118("div",{class:"uppy-Dashboard-Item-previewIconWrap"},__h_118("span",{class:"uppy-Dashboard-Item-previewIcon",style:{color:n}},i),__h_118("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},__h_118("rect",{fill:"#FFF",width:"58",height:"76",rx:"3","fill-rule":"evenodd"})))},__h_114=_$preact_54.h,_$FilePreviewAndLink_114=function(e){return __h_114("div",{class:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:_$getFileTypeIcon_126(e.file.type).color}},e.showLinkToFileUploadResult&&e.file.uploadURL&&__h_114("a",{class:"uppy-Dashboard-Item-previewLink",href:e.file.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.file.meta.name}),__h_114(_$FilePreview_118,{file:e.file}))},__h_115=_$preact_54.h;function progressIndicatorTitle(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function ProgressIndicatorButton(t){return __h_115("div",{class:"uppy-Dashboard-Item-progress"},__h_115("button",{class:"uppy-u-reset uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":progressIndicatorTitle(t),title:progressIndicatorTitle(t),onclick:function(){var e;(e=t).isUploaded||(!e.error||e.hideRetryButton?e.resumableUploads&&!e.hidePauseResumeButton?e.pauseUpload(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.cancelUpload(e.file.id):e.retryUpload(e.file.id))}},t.children))}function ProgressCircleContainer(e){var t=e.children;return __h_115("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",class:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function ProgressCircle(e){var t=e.progress,r=2*Math.PI*15;return __h_115("g",null,__h_115("circle",{class:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),__h_115("circle",{class:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)","stroke-width":"2",fill:"none","stroke-dasharray":r,"stroke-dashoffset":r-r/100*t}))}var _$FileProgress_115=function(e){return e.file.progress.uploadStarted?e.isUploaded?__h_115("div",{class:"uppy-Dashboard-Item-progress"},__h_115("div",{class:"uppy-Dashboard-Item-progressIndicator"},__h_115(ProgressCircleContainer,null,__h_115("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),__h_115("polygon",{class:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):e.error&&!e.hideRetryButton?__h_115(ProgressIndicatorButton,e,__h_115("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},__h_115("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),__h_115("path",{d:"M7.9 3H10v2H7.9z"}),__h_115("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),__h_115("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):e.resumableUploads&&!e.hidePauseResumeButton?__h_115(ProgressIndicatorButton,e,__h_115(ProgressCircleContainer,null,__h_115(ProgressCircle,{progress:e.file.progress.percentage}),e.file.isPaused?__h_115("polygon",{class:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):__h_115("g",{class:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},__h_115("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),__h_115("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?__h_115("div",{class:"uppy-Dashboard-Item-progress"},__h_115("div",{class:"uppy-Dashboard-Item-progressIndicator"},__h_115(ProgressCircleContainer,null,__h_115(ProgressCircle,{progress:e.file.progress.percentage})))):__h_115(ProgressIndicatorButton,e,__h_115(ProgressCircleContainer,null,__h_115(ProgressCircle,{progress:e.file.progress.percentage}),__h_115("polygon",{class:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):null},_$prettierBytes_130=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return 10<=e||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i},_$truncateString_129=function(e,t){if(e.length<=t)return e;if(t<="...".length)return e.substr(0,t);var r=t-"...".length,n=Math.ceil(r/2),i=Math.floor(r/2);return e.substr(0,n)+"..."+e.substr(e.length-i)},__h_113=_$preact_54.h,renderFileSource=function(r){return r.file.source&&r.file.source!==r.id&&__h_113("div",{class:"uppy-Dashboard-Item-sourceIcon"},r.acquirers.map(function(e){if(e.id===r.file.source)return t=e,__h_113("span",{title:r.i18n("fileSource",{name:t.name})},t.icon());var t}))},ErrorButton=function(e){var t=e.file,r=e.onClick;return t.error?__h_113("span",{class:"uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",role:"tooltip",onclick:r},"?"):null},_$FileInfo_113=function(e){return __h_113("div",{class:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.file.source},(t=e.containerWidth<=352?35:e.containerWidth<=576?60:30,__h_113("div",{class:"uppy-Dashboard-Item-name",title:e.file.meta.name},_$truncateString_129(e.file.meta.name,t))),__h_113("div",{class:"uppy-Dashboard-Item-status"},e.file.data.size&&__h_113("div",{class:"uppy-Dashboard-Item-statusSize"},_$prettierBytes_130(e.file.data.size)),renderFileSource(e),__h_113(ErrorButton,{file:e.file,onClick:function(){alert(e.file.error)}})));var t},_$copyToClipboard_123=function(n,i){return i=i||"Copy the URL below",new Promise(function(e){var t=document.createElement("textarea");t.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),t.value=n,document.body.appendChild(t),t.select();function r(){document.body.removeChild(t),window.prompt(i,n),e()}try{return document.execCommand("copy")?(document.body.removeChild(t),e()):r()}catch(e){return document.body.removeChild(t),r()}})},__h_112=_$preact_54.h;function EditButton(e){var t=e.file,r=e.uploadInProgressOrComplete,n=e.metaFields,i=e.i18n,o=e.onClick;return!r&&n&&0<n.length?__h_112("button",{class:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":i("editFile")+" "+t.meta.name,title:i("editFile"),onclick:function(){return o()}},__h_112("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},__h_112("g",{"fill-rule":"evenodd"},__h_112("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z","fill-rule":"nonzero"}),__h_112("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),__h_112("path",{"fill-rule":"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function RemoveButton(e){var t=e.i18n,r=e.onClick;return __h_112("button",{class:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile"),title:t("removeFile"),onclick:function(){return r()}},__h_112("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},__h_112("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),__h_112("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}var copyLinkToClipboard=function(e,t){_$copyToClipboard_123(t.file.uploadURL,t.i18n("copyLinkToClipboardFallback")).then(function(){t.log("Link copied to clipboard."),t.info(t.i18n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(function(){return e.target.focus({preventScroll:!0})})};function CopyLinkButton(t){return __h_112("button",{class:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":t.i18n("copyLink"),title:t.i18n("copyLink"),onclick:function(e){return copyLinkToClipboard(e,t)}},__h_112("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},__h_112("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}var _$Buttons_112=function(e){var t=e.file,r=e.uploadInProgressOrComplete,n=e.metaFields,i=e.showLinkToFileUploadResult,o=e.showRemoveButton,s=e.i18n,a=e.removeFile,u=e.toggleFileCard,l=e.log,c=e.info;return __h_112("div",{className:"uppy-Dashboard-Item-actionWrapper"},__h_112(EditButton,{i18n:s,file:t,uploadInProgressOrComplete:r,metaFields:n,onClick:function(){return u(t.id)}}),i&&t.uploadURL?__h_112(CopyLinkButton,{file:t,i18n:s,info:c,log:l}):null,o?__h_112(RemoveButton,{i18n:s,info:e.info,log:e.log,onClick:function(){return a(t.id)}}):null)},__h_116=_$preact_54.h,__Component_116=_$preact_54.Component,_$FileItem_116=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),(t.prototype.constructor=t).__proto__=r;var i=n.prototype;return i.shouldComponentUpdate=function(e){return!_$isShallowEqual_43(this.props,e)},i.componentDidMount=function(){var e=this.props.file;e.preview||this.props.handleRequestThumbnail(e)},i.componentWillUnmount=function(){var e=this.props.file;e.preview||this.props.handleCancelThumbnail(e)},i.render=function(){var e=this.props.file,t=e.progress.preprocess||e.progress.postprocess,r=e.progress.uploadComplete&&!t&&!e.error,n=e.progress.uploadStarted||t,i=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,s=(this.props.individualCancellation||!i)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(s=!0);var a=_$classnames_9({"uppy-Dashboard-Item":!0,"is-inprogress":i,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation});return __h_116("div",{class:a,id:"uppy_"+e.id,role:this.props.role},__h_116("div",{class:"uppy-Dashboard-Item-preview"},__h_116(_$FilePreviewAndLink_114,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult}),__h_116(_$FileProgress_115,{file:e,error:o,isUploaded:r,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,pauseUpload:this.props.pauseUpload,cancelUpload:this.props.cancelUpload,retryUpload:this.props.retryUpload,i18n:this.props.i18n})),__h_116("div",{class:"uppy-Dashboard-Item-fileInfoAndButtons"},__h_116(_$FileInfo_113,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,i18n:this.props.i18n}),__h_116(_$Buttons_112,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:s,uploadInProgressOrComplete:n,removeFile:this.props.removeFile,toggleFileCard:this.props.toggleFileCard,i18n:this.props.i18n,log:this.props.log,info:this.props.info})))},n}(__Component_116);function ___extends_121(){return(___extends_121=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __h_121=_$preact_54.h,__Component_121=_$preact_54.Component,STYLE_INNER={position:"relative",width:"100%",minHeight:"100%"},STYLE_CONTENT={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},VirtualList=function(r){var e,t;function n(e){var t;return(t=r.call(this,e)||this).handleResize=function(){t.resize()},t.handleScroll=function(){t.setState({offset:t.base.scrollTop}),t.props.sync&&t.forceUpdate()},t.focusElement=null,t.state={offset:0,height:0},t}t=r,(e=n).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=n.prototype;return i.resize=function(){this.state.height!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})},i.componentWillUpdate=function(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)},i.componentDidUpdate=function(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()},i.componentDidMount=function(){this.resize(),window.addEventListener("resize",this.handleResize)},i.componentWillUnmount=function(){window.removeEventListener("resize",this.handleResize)},i.render=function(e){var t=e.data,r=e.rowHeight,n=e.renderRow,i=e.overscanCount,o=void 0===i?10:i,s=(e.sync,function(e,t){if(null==e)return{};for(var r,n={},i=Object.keys(e),o=0;o<i.length;o++)r=i[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,["data","rowHeight","renderRow","overscanCount","sync"])),a=this.state,u=a.offset,l=a.height,c=Math.floor(u/r),p=Math.floor(l/r);o&&(c=Math.max(0,c-c%o),p+=o);var d=c+p+4,h=t.slice(c,d),_=___extends_121({},STYLE_INNER,{height:t.length*r}),f=___extends_121({},STYLE_CONTENT,{top:c*r});return __h_121("div",___extends_121({onScroll:this.handleScroll},s),__h_121("div",{role:"presentation",style:_},__h_121("div",{role:"presentation",style:f},h.map(n))))},n}(__Component_121),_$VirtualList_121=VirtualList;function ___extends_117(){return(___extends_117=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __h_117=_$preact_54.h,_$FileList_117=function(t){var e,r,n,i,o=0===t.totalFileCount,s=_$classnames_9("uppy-Dashboard-files",{"uppy-Dashboard-files--noFiles":o}),a=1===t.itemsPerRow?71:200,u={id:t.id,error:t.error,i18n:t.i18n,log:t.log,info:t.info,acquirers:t.acquirers,resumableUploads:t.resumableUploads,individualCancellation:t.individualCancellation,hideRetryButton:t.hideRetryButton,hidePauseResumeButton:t.hidePauseResumeButton,hideCancelButton:t.hideCancelButton,showLinkToFileUploadResult:t.showLinkToFileUploadResult,showRemoveButtonAfterComplete:t.showRemoveButtonAfterComplete,isWide:t.isWide,metaFields:t.metaFields,retryUpload:t.retryUpload,pauseUpload:t.pauseUpload,cancelUpload:t.cancelUpload,toggleFileCard:t.toggleFileCard,removeFile:t.removeFile,handleRequestThumbnail:t.handleRequestThumbnail,handleCancelThumbnail:t.handleCancelThumbnail},l=(e=Object.keys(t.files),r=t.itemsPerRow,n=[],i=[],e.forEach(function(e,t){i.length<r?i.push(e):(n.push(i),i=[e])}),i.length&&n.push(i),n);return __h_117(_$VirtualList_121,{class:s,role:"list",data:l,renderRow:function(e){return __h_117("div",{role:"presentation",key:e[0]},e.map(function(e){return __h_117(_$FileItem_116,___extends_117({key:e},u,{role:"listitem",file:t.files[e]}))}))},rowHeight:a})},__h_108=_$preact_54.h,AddFiles=function(i){var e,t;function r(){for(var n,e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(n=i.call.apply(i,[this].concat(t))||this).triggerFileInputClick=function(){n.fileInput.click()},n.onFileInputChange=function(e){n.props.handleInputChange(e),e.target.value=null},n.renderHiddenFileInput=function(){return __h_108("input",{class:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabindex:-1,type:"file",name:"files[]",multiple:1!==n.props.maxNumberOfFiles,onchange:n.onFileInputChange,accept:n.props.allowedFileTypes,ref:function(e){n.fileInput=e}})},n.renderMyDeviceAcquirer=function(){return __h_108("div",{class:"uppy-DashboardTab",role:"presentation"},__h_108("button",{type:"button",class:"uppy-DashboardTab-btn",role:"tab",tabindex:0,"data-uppy-super-focusable":!0,onclick:n.triggerFileInputClick},__h_108("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},__h_108("g",{fill:"none","fill-rule":"evenodd"},__h_108("rect",{width:"32",height:"32",rx:"16",fill:"#2275D7"}),__h_108("path",{d:"M21.973 21.152H9.863l-1.108-5.087h14.464l-1.246 5.087zM9.935 11.37h3.958l.886 1.444a.673.673 0 0 0 .585.316h6.506v1.37H9.935v-3.13zm14.898 3.44a.793.793 0 0 0-.616-.31h-.978v-2.126c0-.379-.275-.613-.653-.613H15.75l-.886-1.445a.673.673 0 0 0-.585-.316H9.232c-.378 0-.667.209-.667.587V14.5h-.782a.793.793 0 0 0-.61.303.795.795 0 0 0-.155.663l1.45 6.633c.078.36.396.618.764.618h13.354c.36 0 .674-.246.76-.595l1.631-6.636a.795.795 0 0 0-.144-.675z",fill:"#FFF"}))),__h_108("div",{class:"uppy-DashboardTab-name"},n.props.i18n("myDevice"))))},n.renderDropPasteBrowseTagline=function(){var e=n.props.acquirers.length,t=__h_108("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-browse",onclick:n.triggerFileInputClick,"data-uppy-super-focusable":0===e},n.props.i18n("browse"));return __h_108("div",{class:"uppy-Dashboard-AddFiles-title"},0<e?n.props.i18nArray("dropPasteImport",{browse:t}):n.props.i18nArray("dropPaste",{browse:t}))},n.renderAcquirer=function(e){return __h_108("div",{class:"uppy-DashboardTab",role:"presentation"},__h_108("button",{type:"button",class:"uppy-DashboardTab-btn",role:"tab",tabindex:0,"aria-controls":"uppy-DashboardContent-panel--"+e.id,"aria-selected":n.props.activePickerPanel.id===e.id,"data-uppy-super-focusable":!0,onclick:function(){return n.props.showPanel(e.id)}},e.icon(),__h_108("div",{class:"uppy-DashboardTab-name"},e.name)))},n.renderAcquirers=function(e){var t=[].concat(e),r=t.splice(e.length-2,e.length);return __h_108("div",{class:"uppy-Dashboard-AddFiles-list",role:"tablist"},n.renderMyDeviceAcquirer(),t.map(function(e){return n.renderAcquirer(e)}),__h_108("span",{role:"presentation",style:"white-space: nowrap;"},r.map(function(e){return n.renderAcquirer(e)})))},n}t=i,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var n=r.prototype;return n.renderPoweredByUppy=function(){var e=__h_108("span",null,__h_108("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},__h_108("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z","fill-rule":"evenodd"})),__h_108("span",{class:"uppy-Dashboard-poweredByUppy"},"Uppy")),t=this.props.i18nArray("poweredBy2",{backwardsCompat:this.props.i18n("poweredBy"),uppy:e});return __h_108("a",{tabindex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",class:"uppy-Dashboard-poweredBy"},t)},n.render=function(){return __h_108("div",{class:"uppy-Dashboard-AddFiles"},this.renderHiddenFileInput(),this.renderDropPasteBrowseTagline(),0<this.props.acquirers.length&&this.renderAcquirers(this.props.acquirers),__h_108("div",{class:"uppy-Dashboard-AddFiles-info"},this.props.note&&__h_108("div",{class:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))},r}(_$preact_54.Component),_$AddFiles_108=AddFiles,__h_109=_$preact_54.h,_$AddFilesPanel_109=function(t){return __h_109("div",{class:"uppy-Dashboard-AddFilesPanel","data-uppy-panelType":"AddFiles","aria-hidden":t.showAddFilesPanel},__h_109("div",{class:"uppy-DashboardContent-bar"},__h_109("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},t.i18n("addingMoreFiles")),__h_109("button",{class:"uppy-DashboardContent-back",type:"button",onclick:function(e){return t.toggleAddFilesPanel(!1)}},t.i18n("back"))),__h_109(_$AddFiles_108,t))},_$ignoreEvent_127=function(e){var t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&e.preventDefault(),e.stopPropagation()},__h_119=_$preact_54.h,_$PickerPanelContent_119=function(e){return __h_119("div",{class:"uppy-DashboardContent-panel",role:"tabpanel","data-uppy-panelType":"PickerPanel",id:"uppy-DashboardContent-panel--"+e.activePickerPanel.id,onDragOver:_$ignoreEvent_127,onDragLeave:_$ignoreEvent_127,onDrop:_$ignoreEvent_127,onPaste:_$ignoreEvent_127},__h_119("div",{class:"uppy-DashboardContent-bar"},__h_119("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("importFrom",{name:e.activePickerPanel.name})),__h_119("button",{class:"uppy-DashboardContent-back",type:"button",onclick:e.hideAllPanels},e.i18n("done"))),__h_119("div",{class:"uppy-DashboardContent-panelBody"},e.getPlugin(e.activePickerPanel.id).render(e.state)))},__h_120=_$preact_54.h,uploadStates={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function UploadStatus(e){switch(function(e,t,r,n){if(void 0===n&&(n={}),e)return uploadStates.STATE_ERROR;if(t)return uploadStates.STATE_COMPLETE;if(r)return uploadStates.STATE_PAUSED;for(var i=uploadStates.STATE_WAITING,o=Object.keys(n),s=0;s<o.length;s++){var a=n[o[s]].progress;if(a.uploadStarted&&!a.uploadComplete)return uploadStates.STATE_UPLOADING;a.preprocess&&i!==uploadStates.STATE_UPLOADING&&(i=uploadStates.STATE_PREPROCESSING),a.postprocess&&i!==uploadStates.STATE_UPLOADING&&i!==uploadStates.STATE_PREPROCESSING&&(i=uploadStates.STATE_POSTPROCESSING)}return i}(e.isAllErrored,e.isAllComplete,e.isAllPaused,e.files)){case"uploading":return e.i18n("uploadingXFiles",{smart_count:e.inProgressNotPausedFiles.length});case"preprocessing":case"postprocessing":return e.i18n("processingXFiles",{smart_count:e.processingFiles.length});case"paused":return e.i18n("uploadPaused");case"waiting":return e.i18n("xFilesSelected",{smart_count:e.newFiles.length});case"complete":return e.i18n("uploadComplete")}}var _$PickerPanelTopBar_120=function(e){var t=e.allowNewUpload;return t&&e.maxNumberOfFiles&&(t=e.totalFileCount<e.maxNumberOfFiles),__h_120("div",{class:"uppy-DashboardContent-bar"},e.isAllComplete||e.hideCancelButton?__h_120("div",null):__h_120("button",{class:"uppy-DashboardContent-back",type:"button",onclick:e.cancelAll},e.i18n("cancel")),__h_120("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},__h_120(UploadStatus,e)),t?__h_120("button",{class:"uppy-DashboardContent-addMore",type:"button","aria-label":e.i18n("addMoreFiles"),title:e.i18n("addMoreFiles"),onclick:function(){return e.toggleAddFilesPanel(!0)}},__h_120("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},__h_120("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),__h_120("span",{class:"uppy-DashboardContent-addMoreCaption"},e.i18n("addMore"))):__h_120("div",null))};function ___extends_111(){return(___extends_111=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __h_111=_$preact_54.h,__Component_111=_$preact_54.Component,FileCard=(ML=__Component_111,OL=ML,(NL=PL).prototype=Object.create(OL.prototype),(NL.prototype.constructor=NL).__proto__=OL,PL.prototype.render=function(){var e=this.props.files[this.props.fileCardFor];return __h_111("div",{class:"uppy-Dashboard-FileCard","data-uppy-panelType":"FileCard",onDragOver:_$ignoreEvent_127,onDragLeave:_$ignoreEvent_127,onDrop:_$ignoreEvent_127,onPaste:_$ignoreEvent_127},__h_111("div",{class:"uppy-DashboardContent-bar"},__h_111("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},this.props.i18nArray("editing",{file:__h_111("span",{class:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),__h_111("button",{class:"uppy-DashboardContent-back",type:"button",title:this.props.i18n("finishEditingFile"),onclick:this.handleSave},this.props.i18n("done"))),__h_111("div",{class:"uppy-Dashboard-FileCard-inner"},__h_111("div",{class:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:_$getFileTypeIcon_126(e.type).color}},__h_111(_$FilePreview_118,{file:e})),__h_111("div",{class:"uppy-Dashboard-FileCard-info"},this.renderMetaFields()),__h_111("div",{class:"uppy-Dashboard-FileCard-actions"},__h_111("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"button",onclick:this.handleSave},this.props.i18n("saveChanges")),__h_111("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onclick:this.handleCancel},this.props.i18n("cancel")))))},PL),_$FileCard_111=FileCard,_$isDragDropSupported_212=function(){var e=document.createElement("div");return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window},_$preactCssTransitionGroup_53={exports:{}},__global_53,__factory_53,ML,NL,OL;function PL(e){var n;(n=ML.call(this,e)||this).saveOnEnter=function(e){var t;13===e.keyCode&&(e.stopPropagation(),e.preventDefault(),t=n.props.files[n.props.fileCardFor],n.props.saveFileCard(n.state.formState,t.id))},n.updateMeta=function(e,t){var r;n.setState({formState:___extends_111({},n.state.formState,((r={})[t]=e,r))})},n.handleSave=function(){var e=n.props.fileCardFor;n.props.saveFileCard(n.state.formState,e)},n.handleCancel=function(){n.props.toggleFileCard()},n.renderMetaFields=function(){var e=n.props.metaFields||[],r={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(function(t){var e="uppy-Dashboard-FileCard-input-"+t.id;return __h_111("fieldset",{key:t.id,class:"uppy-Dashboard-FileCard-fieldset"},__h_111("label",{class:"uppy-Dashboard-FileCard-label",for:e},t.name),void 0!==t.render?t.render({value:n.state.formState[t.id],onChange:function(e){return n.updateMeta(e,t.id)},fieldCSSClasses:r},__h_111):__h_111("input",{class:r.text,id:e,type:t.type||"text",value:n.state.formState[t.id],placeholder:t.placeholder,onkeyup:n.saveOnEnter,onkeydown:n.saveOnEnter,onkeypress:n.saveOnEnter,oninput:function(e){return n.updateMeta(e.target.value,t.id)},"data-uppy-super-focusable":!0}))})};var t=n.props.files[n.props.fileCardFor],r=n.props.metaFields||[],i={};return r.forEach(function(e){i[e.id]=t.meta[e.id]||""}),n.state={formState:i},n}function ___extends_110(){return(___extends_110=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}__global_53=this,__factory_53=function(d){"use strict";function h(e){return e.attributes&&e.attributes.key}function c(e){return e.base}function _(e){return e&&e.filter(function(e){return null!==e})}function n(e,t){for(var r=e.length;r--;)if(t(e[r]))return!0;return!1}function f(e,t){return n(e,function(e){return h(e)===t})}function g(e,t){return f(e,h(t))}function i(e,t,r){return n(e,function(e){return h(e)===t&&e.props[r]})}function y(e,t,r){return i(e,h(t),r)}var o=/[\n\t\r]+/g;function p(e,t){var r;e.classList?(r=e.classList).add.apply(r,t.split(" ")):e.className+=" "+t}function m(e,t){if(t=t.trim(),e.classList){var r;(r=e.classList).remove.apply(r,t.split(" "))}else{var n=e.className.trim(),i=(" "+n+" ").replace(o," ");for(t=" "+t+" ";0<=i.indexOf(t);)i=i.replace(t," ");e.className=i.trim()}}var s={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},v=[];"undefined"!=typeof window&&function(){var e=document.createElement("div").style;for(var t in"AnimationEvent"in window||delete s.animationend.animation,"TransitionEvent"in window||delete s.transitionend.transition,s){var r=s[t];for(var n in r)if(n in e){v.push(r[n]);break}}}();function e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var t,a,l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},b=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},w=(a=d.Component,e(u,a),u.prototype.transition=function(e,n,t){var r,i,o=this,s=c(this),a=this.props.name[e]||this.props.name+"-"+e,u=this.props.name[e+"Active"]||a+"-active",l=null;this.endListener&&this.endListener(),this.endListener=function(e){var t,r;e&&e.target!==s||(clearTimeout(l),m(s,a),m(s,u),t=s,r=o.endListener,v.length&&v.forEach(function(e){t.removeEventListener(e,r,!1)}),o.endListener=null,n&&n())},t?(l=setTimeout(this.endListener,t),this.transitionTimeouts.push(l)):(r=s,i=this.endListener,v.length?v.forEach(function(e){r.addEventListener(e,i,!1)}):window.setTimeout(i,0)),p(s,a),this.queueClass(u)},u.prototype.queueClass=function(e){this.classNameQueue.push(e),this.timeout||(this.timeout=setTimeout(this.flushClassNameQueue,17))},u.prototype.stop=function(){this.timeout&&(clearTimeout(this.timeout),this.classNameQueue.length=0,this.timeout=null),this.endListener&&this.endListener()},u.prototype.componentWillMount=function(){this.classNameQueue=[],this.transitionTimeouts=[]},u.prototype.componentWillUnmount=function(){this.timeout&&clearTimeout(this.timeout),this.transitionTimeouts.forEach(function(e){clearTimeout(e)})},u.prototype.componentWillEnter=function(e){this.props.enter?this.transition("enter",e,this.props.enterTimeout):e()},u.prototype.componentWillLeave=function(e){this.props.leave?this.transition("leave",e,this.props.leaveTimeout):e()},u.prototype.render=function(){return(e=this.props.children)&&e[0];var e},u),r=(t=d.Component,e(S,t),S.prototype.shouldComponentUpdate=function(e,t){return t.children!==this.state.children},S.prototype.componentWillMount=function(){this.currentlyTransitioningKeys={},this.keysToEnter=[],this.keysToLeave=[]},S.prototype.componentWillReceiveProps=function(e){var r,n,i,o,s=this,t=e.children,a=e.exclusive,u=e.showProp,l=_(t||[]).slice(),c=_(a?this.props.children:this.state.children),p=(r=l,n=[],i={},o=[],c.forEach(function(e){var t=h(e);f(r,t)?o.length&&(i[t]=o,o=[]):o.push(e)}),r.forEach(function(e){var t=h(e);i.hasOwnProperty(t)&&(n=n.concat(i[t])),n.push(e)}),n.concat(o));u&&(p=p.map(function(e){var t;return!e.props[u]&&y(c,e,u)&&(e=d.cloneElement(e,((t={})[u]=!0,t))),e})),a&&p.forEach(function(e){return s.stop(h(e))}),this.setState({children:p}),this.forceUpdate(),l.forEach(function(e){var t,r,n=e.key,i=c&&g(c,e);u?i&&(t=y(c,e,u),r=e.props[u],t||!r||s.currentlyTransitioningKeys[n]||s.keysToEnter.push(n)):i||s.currentlyTransitioningKeys[n]||s.keysToEnter.push(n)}),c.forEach(function(e){var t,r,n=e.key,i=l&&g(l,e);u?i&&(t=y(l,e,u),r=e.props[u],t||!r||s.currentlyTransitioningKeys[n]||s.keysToLeave.push(n)):i||s.currentlyTransitioningKeys[n]||s.keysToLeave.push(n)})},S.prototype.performEnter=function(e){var t=this;this.currentlyTransitioningKeys[e]=!0;var r=this.refs[e];r.componentWillEnter?r.componentWillEnter(function(){return t._handleDoneEntering(e)}):this._handleDoneEntering(e)},S.prototype._handleDoneEntering=function(e){delete this.currentlyTransitioningKeys[e];var t=_(this.props.children),r=this.props.showProp;!t||!r&&!f(t,e)||r&&!i(t,e,r)?this.performLeave(e):this.setState({children:t})},S.prototype.stop=function(e){delete this.currentlyTransitioningKeys[e];var t=this.refs[e];t&&t.stop()},S.prototype.performLeave=function(e){var t=this;this.currentlyTransitioningKeys[e]=!0;var r=this.refs[e];r&&r.componentWillLeave?r.componentWillLeave(function(){return t._handleDoneLeaving(e)}):this._handleDoneLeaving(e)},S.prototype._handleDoneLeaving=function(e){delete this.currentlyTransitioningKeys[e];var t=this.props.showProp,r=_(this.props.children);t&&r&&i(r,e,t)||!t&&r&&f(r,e)?this.performEnter(e):this.setState({children:r})},S.prototype.componentDidUpdate=function(){var t=this,e=this.keysToEnter,r=this.keysToLeave;this.keysToEnter=[],e.forEach(function(e){return t.performEnter(e)}),this.keysToLeave=[],r.forEach(function(e){return t.performLeave(e)})},S.prototype.render=function(e,t){var r=e.component,n=(e.transitionName,e.transitionEnter,e.transitionLeave,e.transitionEnterTimeout,e.transitionLeaveTimeout,e.children,function(e,t){var r={};for(var n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["component","transitionName","transitionEnter","transitionLeave","transitionEnterTimeout","transitionLeaveTimeout","children"])),i=t.children;return d.h(r,n,_(i).map(this.renderChild))},S);function S(e){l(this,S);var u=b(this,t.call(this));return u.renderChild=function(t){var e=u.props,r=e.transitionName,n=e.transitionEnter,i=e.transitionLeave,o=e.transitionEnterTimeout,s=e.transitionLeaveTimeout,a=h(t);return d.h(w,{key:a,ref:function(e){(u.refs[a]=e)||(t=null)},name:r,enter:n,leave:i,enterTimeout:o,leaveTimeout:s},t)},u.refs={},u.state={children:(e.children||[]).slice()},u}function u(){var e,t;l(this,u);for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return e=t=b(this,a.call.apply(a,[this].concat(n))),t.flushClassNameQueue=function(){c(t)&&p(c(t),t.classNameQueue.join(" ")),t.classNameQueue.length=0,t.timeout=null},b(t,e)}return r.defaultProps={component:"span",transitionEnter:!0,transitionLeave:!0},r},"object"==typeof _$preactCssTransitionGroup_53.exports?_$preactCssTransitionGroup_53.exports=__factory_53(_$preact_54):"function"==typeof define&&define.amd?define(["preact"],__factory_53):__global_53.PreactCSSTransitionGroup=__factory_53(__global_53.preact),_$preactCssTransitionGroup_53=_$preactCssTransitionGroup_53.exports;var __h_110=_$preact_54.h;function TransitionWrapper(e){return __h_110(_$preactCssTransitionGroup_53,{transitionName:"uppy-transition-slideDownUp",transitionEnterTimeout:250,transitionLeaveTimeout:250},e.children)}var _$Dashboard_110=function(t){var e=0===t.totalFileCount,r=576<t.containerWidth,n=_$classnames_9({"uppy-Root":t.isTargetDOMEl,"uppy-Dashboard":!0,"uppy-Dashboard--animateOpenClose":t.animateOpenClose,"uppy-Dashboard--isClosing":t.isClosing,"uppy-Dashboard--isDraggingOver":t.isDraggingOver,"uppy-Dashboard--modal":!t.inline,"uppy-size--md":576<t.containerWidth,"uppy-size--lg":700<t.containerWidth,"uppy-size--xl":900<t.containerWidth,"uppy-size--height-md":400<t.containerHeight,"uppy-Dashboard--isAddFilesPanelVisible":t.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":t.areInsidesReadyToBeVisible}),i=1;900<t.containerWidth?i=5:700<t.containerWidth?i=4:576<t.containerWidth&&(i=3);var o=t.showSelectedFiles&&!e;return __h_110("div",{class:n,"data-uppy-theme":t.theme,"data-uppy-num-acquirers":t.acquirers.length,"data-uppy-drag-drop-supported":_$isDragDropSupported_212(),"aria-hidden":t.inline?"false":t.isHidden,"aria-label":t.inline?t.i18n("dashboardTitle"):t.i18n("dashboardWindowTitle"),onpaste:t.handlePaste,onDragOver:t.handleDragOver,onDragLeave:t.handleDragLeave,onDrop:t.handleDrop},__h_110("div",{class:"uppy-Dashboard-overlay",tabindex:-1,onclick:t.handleClickOutside}),__h_110("div",{class:"uppy-Dashboard-inner","aria-modal":!t.inline&&"true",role:!t.inline&&"dialog",style:{width:t.inline&&t.width?t.width:"",height:t.inline&&t.height?t.height:""}},t.inline?null:__h_110("button",{class:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":t.i18n("closeModal"),title:t.i18n("closeModal"),onclick:t.closeModal},__h_110("span",{"aria-hidden":"true"},"×")),__h_110("div",{class:"uppy-Dashboard-innerWrap"},__h_110("div",{class:"uppy-Dashboard-dropFilesHereHint"},t.i18n("dropHint")),o&&__h_110(_$PickerPanelTopBar_120,t),o?__h_110(_$FileList_117,___extends_110({},t,{itemsPerRow:i})):__h_110(_$AddFiles_108,___extends_110({},t,{isSizeMD:r})),__h_110(TransitionWrapper,null,t.showAddFilesPanel?__h_110(_$AddFilesPanel_109,___extends_110({key:"AddFilesPanel"},t,{isSizeMD:r})):null),__h_110(TransitionWrapper,null,t.fileCardFor?__h_110(_$FileCard_111,___extends_110({key:"FileCard"},t)):null),__h_110(TransitionWrapper,null,t.activePickerPanel?__h_110(_$PickerPanelContent_119,___extends_110({key:"PickerPanelContent"},t)):null),__h_110("div",{class:"uppy-Dashboard-progressindicators"},t.progressindicators.map(function(e){return t.getPlugin(e.id).render(t.state)})))))},_$StatusBarStates_168={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},_$prettierBytes_170=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return 10<=e||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i},_$secondsToTime_218=function(e){return{hours:Math.floor(e/3600)%24,minutes:Math.floor(e/60)%60,seconds:Math.floor(e%60)}},_$prettyETA_217=function(e){var t=_$secondsToTime_218(e),r=t.hours?t.hours+"h ":"",n=t.hours?("0"+t.minutes).substr(-2):t.minutes,i=n?n+"m":"",o=n?("0"+t.seconds).substr(-2):t.seconds;return r+i+(t.hours?"":n?" "+o+"s":o+"s")};function ___extends_167(){return(___extends_167=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __h_167=_$preact_54.h,_$StatusBar_167=function(e){var t,r,n,i=e=e||{},o=i.newFiles,s=i.allowNewUpload,a=i.isUploadInProgress,u=i.isAllPaused,l=i.resumableUploads,c=i.error,p=i.hideUploadButton,d=i.hidePauseResumeButton,h=i.hideCancelButton,_=i.hideRetryButton,f=e.uploadState,g=e.totalProgress;f===_$StatusBarStates_168.STATE_PREPROCESSING||f===_$StatusBarStates_168.STATE_POSTPROCESSING?("determinate"===(t=(n=function(r){var n=[];Object.keys(r).forEach(function(e){var t=r[e].progress;t.preprocess&&n.push(t.preprocess),t.postprocess&&n.push(t.postprocess)});var e=n[0];return{mode:e.mode,message:e.message,value:n.filter(function(e){return"determinate"===e.mode}).reduce(function(e,t,r,n){return e+t.value/n.length},0)}}(e.files)).mode)&&(g=100*n.value),r=ProgressBarProcessing(n)):f===_$StatusBarStates_168.STATE_COMPLETE?r=ProgressBarComplete(e):f===_$StatusBarStates_168.STATE_UPLOADING?(e.supportsUploadProgress||(t="indeterminate",g=null),r=ProgressBarUploading(e)):f===_$StatusBarStates_168.STATE_ERROR&&(g=void 0,r=ProgressBarError(e));var y="number"==typeof g?g:100,m=f===_$StatusBarStates_168.STATE_WAITING&&e.hideUploadButton||f===_$StatusBarStates_168.STATE_WAITING&&0<!e.newFiles||f===_$StatusBarStates_168.STATE_COMPLETE&&e.hideAfterFinish,v=!c&&o&&!a&&!u&&s&&!p,b=!h&&f!==_$StatusBarStates_168.STATE_WAITING&&f!==_$StatusBarStates_168.STATE_COMPLETE,w=l&&!d&&f===_$StatusBarStates_168.STATE_UPLOADING,S=c&&!_,k="uppy-StatusBar-progress\n "+(t?"is-"+t:""),E=_$classnames_9({"uppy-Root":e.isTargetDOMEl},"uppy-StatusBar","is-"+f);return __h_167("div",{class:E,"aria-hidden":m},__h_167("div",{class:k,style:{width:y+"%"},role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":g}),r,__h_167("div",{class:"uppy-StatusBar-actions"},v?__h_167(UploadBtn,___extends_167({},e,{uploadState:f})):null,S?__h_167(RetryBtn,e):null,w?__h_167(PauseResumeButton,e):null,b?__h_167(CancelBtn,e):null))},UploadBtn=function(e){var t=_$classnames_9("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":e.uploadState===_$StatusBarStates_168.STATE_WAITING});return __h_167("button",{type:"button",class:t,"aria-label":e.i18n("uploadXFiles",{smart_count:e.newFiles}),onclick:e.startUpload,"data-uppy-super-focusable":!0},e.newFiles&&e.isUploadStarted?e.i18n("uploadXNewFiles",{smart_count:e.newFiles}):e.i18n("uploadXFiles",{smart_count:e.newFiles}))},RetryBtn=function(e){return __h_167("button",{type:"button",class:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e.i18n("retryUpload"),onclick:e.retryAll,"data-uppy-super-focusable":!0},__h_167("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},__h_167("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e.i18n("retry"))},CancelBtn=function(e){return __h_167("button",{type:"button",class:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e.i18n("cancel"),"aria-label":e.i18n("cancel"),onclick:e.cancelAll,"data-uppy-super-focusable":!0},__h_167("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},__h_167("g",{fill:"none","fill-rule":"evenodd"},__h_167("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),__h_167("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))},PauseResumeButton=function(e){var t=e.isAllPaused,r=(0,e.i18n)(t?"resume":"pause");return __h_167("button",{title:r,"aria-label":r,class:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onclick:function(){return function(e){if(!e.isAllComplete)return e.resumableUploads?e.isAllPaused?e.resumeAll():e.pauseAll():e.cancelAll()}(e)},"data-uppy-super-focusable":!0},__h_167("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},__h_167("g",{fill:"none","fill-rule":"evenodd"},__h_167("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),__h_167("path",t?{fill:"#FFF",d:"M6 4.25L11.5 8 6 11.75z"}:{d:"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z",fill:"#FFF"}))))},LoadingSpinner=function(){return __h_167("svg",{class:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},__h_167("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0","fill-rule":"evenodd"}))},ProgressBarProcessing=function(e){var t=Math.round(100*e.value);return __h_167("div",{class:"uppy-StatusBar-content"},__h_167(LoadingSpinner,null),"determinate"===e.mode?t+"% · ":"",e.message)},UnknownProgressDetails=function(e){return __h_167("div",{class:"uppy-StatusBar-statusSecondary"},e.i18n("filesUploadedOfTotal",{complete:e.complete,smart_count:e.numUploads}))},UploadNewlyAddedFiles=function(e){var t=_$classnames_9("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return __h_167("div",{class:"uppy-StatusBar-statusSecondary"},__h_167("div",{class:"uppy-StatusBar-statusSecondaryHint"},e.i18n("xMoreFilesAdded",{smart_count:e.newFiles})),__h_167("button",{type:"button",class:t,"aria-label":e.i18n("uploadXFiles",{smart_count:e.newFiles}),onclick:e.startUpload},e.i18n("upload")))},ThrottledProgressDetails=_$lodashThrottle_46(function(e){var t=1<e.numUploads;return __h_167("div",{class:"uppy-StatusBar-statusSecondary"},t&&e.i18n("filesUploadedOfTotal",{complete:e.complete,smart_count:e.numUploads}),__h_167("span",{class:"uppy-StatusBar-additionalInfo"},t&&" · ",e.i18n("dataUploadedOfTotal",{complete:_$prettierBytes_170(e.totalUploadedSize),total:_$prettierBytes_170(e.totalSize)})," · ",e.i18n("xTimeLeft",{time:_$prettyETA_217(e.totalETA)})))},500,{leading:!0,trailing:!0}),ProgressBarUploading=function(e){if(!e.isUploadStarted||e.isAllComplete)return null;var t=e.isAllPaused?e.i18n("paused"):e.i18n("uploading"),r=e.newFiles&&e.isUploadStarted;return __h_167("div",{class:"uppy-StatusBar-content","aria-label":t,title:t},e.isAllPaused?null:__h_167(LoadingSpinner,null),__h_167("div",{class:"uppy-StatusBar-status"},__h_167("div",{class:"uppy-StatusBar-statusPrimary"},e.supportsUploadProgress?t+": "+e.totalProgress+"%":t),e.isAllPaused||r||!e.showProgressDetails?null:e.supportsUploadProgress?__h_167(ThrottledProgressDetails,e):__h_167(UnknownProgressDetails,e),r?__h_167(UploadNewlyAddedFiles,e):null))},ProgressBarComplete=function(e){e.totalProgress;var t=e.i18n;return __h_167("div",{class:"uppy-StatusBar-content",role:"status",title:t("complete")},__h_167("div",{class:"uppy-StatusBar-status"},__h_167("div",{class:"uppy-StatusBar-statusPrimary"},__h_167("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},__h_167("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))},ProgressBarError=function(e){var t=e.error,r=(e.retryAll,e.hideRetryButton,e.i18n);return __h_167("div",{class:"uppy-StatusBar-content",role:"alert",title:r("uploadFailed")},__h_167("div",{class:"uppy-StatusBar-status"},__h_167("div",{class:"uppy-StatusBar-statusPrimary"},__h_167("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},__h_167("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),r("uploadFailed"))),__h_167("span",{class:"uppy-StatusBar-details","aria-label":t,"data-microtip-position":"top-right","data-microtip-size":"medium",role:"tooltip",onclick:function(){var e=r("uploadFailed")+" \n\n "+t;alert(e)}},"?"))},_$getSpeed_208=function(e){if(!e.bytesUploaded)return 0;var t=new Date-e.uploadStarted;return e.bytesUploaded/(t/1e3)},_$getBytesRemaining_198=function(e){return e.bytesTotal-e.bytesUploaded},___class_169,___temp_169;function ___extends_169(){return(___extends_169=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_169=_$lib_104.Plugin,_$lib_169=(___temp_169=___class_169=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).startUpload=function(){return r.uppy.upload().catch(function(){})},r.id=r.opts.id||"StatusBar",r.title="StatusBar",r.type="progressindicator",r.defaultLocale={strings:{uploading:"Uploading",upload:"Upload",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"}}},r.opts=___extends_169({},{target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0},{},t),r.i18nInit(),r.render=r.render.bind(_assertThisInitialized(r)),r.install=r.install.bind(_assertThisInitialized(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.setOptions=function(e){n.prototype.setOptions.call(this,e),this.i18nInit()},i.i18nInit=function(){this.translator=new _$Translator_190([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},i.getTotalSpeed=function(e){var t=0;return e.forEach(function(e){t+=_$getSpeed_208(e.progress)}),t},i.getTotalETA=function(e){var t=this.getTotalSpeed(e);if(0===t)return 0;var r=e.reduce(function(e,t){return e+_$getBytesRemaining_198(t.progress)},0);return Math.round(r/t*10)/10},i.getUploadingState=function(e,t,r){if(e)return _$StatusBarStates_168.STATE_ERROR;if(t)return _$StatusBarStates_168.STATE_COMPLETE;for(var n=_$StatusBarStates_168.STATE_WAITING,i=Object.keys(r),o=0;o<i.length;o++){var s=r[i[o]].progress;if(s.uploadStarted&&!s.uploadComplete)return _$StatusBarStates_168.STATE_UPLOADING;s.preprocess&&n!==_$StatusBarStates_168.STATE_UPLOADING&&(n=_$StatusBarStates_168.STATE_PREPROCESSING),s.postprocess&&n!==_$StatusBarStates_168.STATE_UPLOADING&&n!==_$StatusBarStates_168.STATE_PREPROCESSING&&(n=_$StatusBarStates_168.STATE_POSTPROCESSING)}return n},i.render=function(e){var t=e.capabilities,r=e.files,n=e.allowNewUpload,i=e.totalProgress,o=e.error,s=Object.keys(r).map(function(e){return r[e]}),a=s.filter(function(e){return!e.progress.uploadStarted&&!e.progress.preprocess&&!e.progress.postprocess}),u=s.filter(function(e){return e.progress.uploadStarted}).filter(function(e){return e.isPaused}),l=s.filter(function(e){return e.progress.uploadComplete}),c=s.filter(function(e){return e.error}),p=s.filter(function(e){return!e.progress.uploadComplete&&e.progress.uploadStarted}),d=p.filter(function(e){return!e.isPaused}),h=s.filter(function(e){return e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess}),_=s.filter(function(e){return e.progress.preprocess||e.progress.postprocess}),f=this.getTotalETA(d),g=0,y=0;h.forEach(function(e){g+=e.progress.bytesTotal||0,y+=e.progress.bytesUploaded||0});var m=0<h.length,v=100===i&&l.length===Object.keys(r).length&&0===_.length,b=o&&c.length===s.length,w=0!==p.length&&u.length===p.length,S=0<p.length,k=t.resumableUploads||!1,E=!1!==t.uploadProgress;return _$StatusBar_167({error:o,uploadState:this.getUploadingState(b,v,e.files||{}),allowNewUpload:n,totalProgress:i,totalSize:g,totalUploadedSize:y,isAllComplete:v,isAllPaused:w,isAllErrored:b,isUploadStarted:m,isUploadInProgress:S,complete:l.length,newFiles:a.length,numUploads:h.length,totalETA:f,files:r,i18n:this.i18n,pauseAll:this.uppy.pauseAll,resumeAll:this.uppy.resumeAll,retryAll:this.uppy.retryAll,cancelAll:this.uppy.cancelAll,startUpload:this.startUpload,resumableUploads:k,supportsUploadProgress:E,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})},i.install=function(){var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},r}(__Plugin_169),___class_169.VERSION="1.7.0",___temp_169),___class_143,___temp_143;function ___extends_143(){return(___extends_143=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}for(var __Plugin_143=_$lib_104.Plugin,__h_143=_$preact_54.h,_$lib_143=(cS=__Plugin_143,eS=cS,(dS=fS).prototype=Object.create(eS.prototype),(dS.prototype.constructor=dS).__proto__=eS,fS.prototype.install=function(){var e=this.opts.target;e&&this.mount(e,this)},___temp_143=___class_143=fS,___class_143.VERSION="1.5.7",___temp_143),_$dataURItoBlob_192=function(e,t,r){var n=e.split(",")[1],i=t.mimeType||e.split(",")[0].split(":")[1].split(";")[0];null==i&&(i="plain/text");for(var o,s=atob(n),a=[],u=0;u<s.length;u++)a.push(s.charCodeAt(u));try{o=new Uint8Array(a)}catch(e){return null}return r?new File([o],t.name||"",{type:i}):new Blob([o],{type:i})},_$isObjectURL_214=function(e){return 0===e.indexOf("blob:")},_$mathLog2_47=Math.log2||function(e){return Math.log(e)*Math.LOG2E},_$base64Js_5={toByteArray:function(e){for(var t,r=getLens(e),n=r[0],i=r[1],o=new Arr(3*(n+i)/4-i),s=0,a=0<i?n-4:n,u=0;u<a;u+=4)t=revLookup[e.charCodeAt(u)]<<18|revLookup[e.charCodeAt(u+1)]<<12|revLookup[e.charCodeAt(u+2)]<<6|revLookup[e.charCodeAt(u+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=255&t;return 2===i&&(t=revLookup[e.charCodeAt(u)]<<2|revLookup[e.charCodeAt(u+1)]>>4,o[s++]=255&t),1===i&&(t=revLookup[e.charCodeAt(u)]<<10|revLookup[e.charCodeAt(u+1)]<<4|revLookup[e.charCodeAt(u+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t),o},fromByteArray:function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;o<s;o+=16383)i.push(encodeChunk(e,o,s<o+16383?s:o+16383));return 1==n?(t=e[r-1],i.push(lookup[t>>2]+lookup[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],i.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),i.join("")}},lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length,cS,dS,eS;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function fS(e,t){var o;return(o=cS.call(this,e,t)||this).render=function(e){var t=e.info,r=t.isHidden,n=t.message,i=t.details;return __h_143("div",{class:"uppy uppy-Informer","aria-hidden":r},__h_143("p",{role:"alert"},n," ",i&&__h_143("span",{"aria-label":i,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onclick:function(){alert(n+" \n\n "+i)},onMouseOver:function(){clearTimeout(o.uppy.infoTimeoutID)},onMouseLeave:function(){o.uppy.infoTimeoutID=setTimeout(o.uppy.hideInfo,2e3)}},"?")))},o.type="progressindicator",o.id=o.opts.id||"Informer",o.title="Informer",o.opts=___extends_143({},{},t),o}function getLens(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function encodeChunk(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(lookup[n>>18&63]+lookup[n>>12&63]+lookup[n>>6&63]+lookup[63&n]);return i.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_41={read:function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,p=r?i-1:0,d=r?-1:1,h=e[t+p];for(p+=d,o=h&(1<<-c)-1,h>>=-c,c+=a;0<c;o=256*o+e[t+p],p+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;0<c;s=256*s+e[t+p],p+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=l}return(h?-1:1)*s*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,p=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,_=n?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),2<=(t+=1<=s+p?d/u:d*Math.pow(2,1-p))*u&&(s++,u/=2),c<=s+p?(a=0,s=c):1<=s+p?(a=(t*u-1)*Math.pow(2,i),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));8<=i;e[r+h]=255&a,h+=_,a/=256,i-=8);for(s=s<<i|a,l+=i;0<l;e[r+h]=255&s,h+=_,s/=256,l-=8);e[r+h-_]|=128*f}},_$miniLegacyUmd_35={exports:{}},___class_173,___temp_173;function ___extends_173(){return(___extends_173=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}(function(Ot,xt,Rt){var e=this,t=function(t){"use strict";function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function e(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});var n=["prototype","__proto__","caller","arguments","length","name"];Object.getOwnPropertyNames(r).forEach(function(e){-1===n.indexOf(e)&&t[e]!==r[e]&&(t[e]=r[e])}),r&&o(t,r)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t,r){return(i=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),1}catch(e){return}}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&o(i,r.prototype),i}).apply(null,arguments)}function s(e){var r="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return i(e,arguments,a(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?c(e):t}function d(e,t,r){return(d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}var h=Object.values||function(e){var t=[];for(var r in e)t.push(e[r]);return t},_=Object.entries||function(e){var t=[];for(var r in e)t.push([r,e[r]]);return t},f=Object.assign||function(r){for(var e=arguments.length,t=new Array(1<e?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach(function(e){for(var t in e)r[t]=e[t]}),r},g=Object.fromEntries||function(e){var n={};return y(e).forEach(function(e){var t=e[0],r=e[1];n[t]=r}),n},y=Array.from||function(e){if(e instanceof E){var r=[];return e.forEach(function(e,t){return r.push([t,e])}),r}return Array.prototype.slice.call(e)};function m(e){return-1!==this.indexOf(e)}Array.prototype.includes||(Array.prototype.includes=m),String.prototype.includes||(String.prototype.includes=m),String.prototype.startsWith||(String.prototype.startsWith=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return this.substring(t,t+e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.length;return this.substring(t-e.length,t)===e});function v(e){return void 0!==e}var b="undefined"!=typeof self?self:xt,w=b.fetch||function(i){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(e,t){var r=new XMLHttpRequest;if(r.open("get",i,!0),r.responseType="arraybuffer",r.onerror=t,o.headers)for(var n in o.headers)r.setRequestHeader(n,o.headers[n]);r.onload=function(){e({ok:200<=r.status&&r.status<300,status:r.status,arrayBuffer:function(){return Promise.resolve(r.response)}})},r.send(null)})},S=function(e){var t=[];if(Object.defineProperties(t,{size:{get:function(){return this.length}},has:{value:function(e){return-1!==this.indexOf(e)}},add:{value:function(e){this.has(e)||this.push(e)}},delete:{value:function(e){var t;this.has(e)&&(t=this.indexOf(e),this.splice(t,1))}}}),Array.isArray(e))for(var r=0;r<e.length;r++)t.add(e[r]);return t},k=function(e){return new E(e)},E=void 0!==b.Map&&void 0!==b.Map.prototype.keys?b.Map:(e(x,[{key:"clear",value:function(){this._map={},this._keys=[]}},{key:"get",value:function(e){return this._map["map_"+e]}},{key:"set",value:function(e,t){return this._map["map_"+e]=t,this._keys.indexOf(e)<0&&this._keys.push(e),this}},{key:"has",value:function(e){return 0<=this._keys.indexOf(e)}},{key:"delete",value:function(e){var t=this._keys.indexOf(e);return!(t<0||(delete this._map["map_"+e],this._keys.splice(t,1),0))}},{key:"keys",value:function(){return this._keys.slice(0)}},{key:"values",value:function(){var t=this;return this._keys.map(function(e){return t.get(e)})}},{key:"entries",value:function(){var t=this;return this._keys.map(function(e){return[e,t.get(e)]})}},{key:"forEach",value:function(e,t){for(var r=0;r<this._keys.length;r++)e.call(t,this._map["map_"+this._keys[r]],this._keys[r],this)}},{key:"size",get:function(){return this._keys.length}}]),x),C="undefined"!=typeof self?self:xt,P="undefined"!=typeof navigator,A=P&&"undefined"==typeof HTMLImageElement,T=!(void 0===xt||void 0===Ot||!Ot.versions||!Ot.versions.node),F=C.Buffer,$=C.BigInt,O=!!F;function x(e){if(u(this,x),this.clear(),e)for(var t=0;t<e.length;t++)this.set(e[t][0],e[t][1])}function R(e){return void 0===e||(e instanceof E?0===e.size:0===h(e).filter(v).length)}function U(e){var t=new Error(e);return delete t.stack,t}function B(e){var t,r=(t=0,e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048);return e.jfif.enabled&&(r+=50),e.xmp.enabled&&(r+=2e4),e.iptc.enabled&&(r+=14e3),e.icc.enabled&&(r+=6e3),r}var I="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0,D=(e(M,null,[{key:"from",value:function(e,t){return e instanceof this&&e.le===t?e:new M(e,void 0,void 0,t)}}]),e(M,[{key:"_swapArrayBuffer",value:function(e){this._swapDataView(new DataView(e))}},{key:"_swapBuffer",value:function(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}},{key:"_swapDataView",value:function(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}},{key:"_lengthToEnd",value:function(e){return this.byteLength-e}},{key:"set",value:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:M;if(e instanceof DataView||e instanceof M?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e instanceof Uint8Array))throw U("BufferView.set(): Invalid data argument.");return this.toUint8().set(e,t),new r(this,t,e.byteLength)}},{key:"subarray",value:function(e,t){return new M(this,e,t=t||this._lengthToEnd(e))}},{key:"toUint8",value:function(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}},{key:"getUint8Array",value:function(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}},{key:"getString",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.byteLength;return e=this.getUint8Array(t,r),I?I.decode(e):O?Rt.from(e).toString("utf8"):decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}},{key:"getUnicodeString",value:function(){for(var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.byteLength,r=[],n=0;n<t&&e+n<this.byteLength;n+=2)r.push(this.getUint16(e+n));return r.map(function(e){return String.fromCharCode(e)}).join("")}},{key:"getInt8",value:function(e){return this.dataView.getInt8(e)}},{key:"getUint8",value:function(e){return this.dataView.getUint8(e)}},{key:"getInt16",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getInt16(e,t)}},{key:"getInt32",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getInt32(e,t)}},{key:"getUint16",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getUint16(e,t)}},{key:"getUint32",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getUint32(e,t)}},{key:"getFloat32",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat32(e,t)}},{key:"getFloat64",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat64(e,t)}},{key:"getFloat",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat32(e,t)}},{key:"getDouble",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat64(e,t)}},{key:"getUint64",value:function(e){var t=this.getUint32(e),r=this.getUint32(e+4);return t<1048575?t<<32|r:(console.warn("Using BigInt because of type 64uint but JS can only handle 53b numbers."),$(t)<<$(32)|$(r))}},{key:"getUintBytes",value:function(e,t,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64(e,r)}}},{key:"getUint",value:function(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64(e,r)}}},{key:"toString",value:function(e){return this.dataView.toString(e,this.constructor.name)}},{key:"ensureChunk",value:function(){}}]),M);function M(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length?arguments[2]:void 0,n=3<arguments.length?arguments[3]:void 0;if(u(this,M),"boolean"==typeof n&&(this.le=n),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===r&&(r=e.byteLength-t);var i=new DataView(e,t,r);this._swapDataView(i)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof M){if(void 0===r&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength)throw U("Creating view outside of available memory in ArrayBuffer");var o=new DataView(e.buffer,t,r);this._swapDataView(o)}else{if("number"!=typeof e)throw U("Invalid input argument for BufferView: "+e);var s=new DataView(new ArrayBuffer(e));this._swapDataView(s)}}function L(e,t){throw U("".concat(e," '").concat(t,"' was not loaded, try using full build of exifr."))}var j=(r(H,s(E)),e(H,[{key:"get",value:function(e,t){return this.has(e)||L(this.kind,e),t&&(e in t||function(e,t){throw U("Unknown ".concat(e," '").concat(t,"'."))}(this.kind,e),t[e].enabled||L(this.kind,e)),d(a(H.prototype),"get",this).call(this,e)}},{key:"keyList",value:function(){return y(this.keys())}}]),H),N=new j("file parser"),z=new j("segment parser"),q=new j("file reader");function H(e){var t;return u(this,H),(t=p(this,a(H).call(this))).kind=e,t}function V(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(r.apply(this,e))}catch(e){return Promise.reject(e)}}}function W(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var X=V(function(n){return new Promise(function(e,t){var r=new FileReader;r.onloadend=function(){return e(r.result||new ArrayBuffer)},r.onerror=t,r.readAsArrayBuffer(n)})}),K=V(function(e){return w(e).then(function(e){return e.arrayBuffer()})}),G=V(function(e,t){return W(t(e),function(e){return new D(e)})}),Y=V(function(e,t,r){var n=new(q.get(r))(e,t);return W(n.read(),function(){return n})}),J=V(function(e,t,r,n){if(q.has(r))return Y(e,t,r);if(n)return G(e,n);throw U("Parser ".concat(r," is not loaded"))});function Q(e,t){if((r=e).startsWith("data:")||1e4<r.length)return Y(e,t,"base64");if(P)return J(e,t,"url",K);if(T)return Y(e,t,"fs");throw U("Invalid input argument");var r}var Z=(r(ee,s(E)),e(ee,[{key:"tagKeys",get:function(){return this.allKeys||(this.allKeys=y(this.keys())),this.allKeys}},{key:"tagValues",get:function(){return this.allValues||(this.allValues=y(this.values())),this.allValues}}]),ee);function ee(){return u(this,ee),p(this,a(ee).apply(this,arguments))}function te(e,t,r){var n=new Z,i=r;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=y(i));for(var o=0;o<i.length;o++){var s=i[o],a=s[0],u=s[1];n.set(a,u)}if(Array.isArray(t)){var l=t;Array.isArray(l)||("function"==typeof l.entries&&(l=l.entries()),l=y(l));for(var c=0;c<l.length;c++){var p=l[c];e.set(p,n)}}else e.set(t,n);return n}function re(e,t,r){var n,i=e.get(t),o=r;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=y(o));for(var s=0;s<o.length;s++)n=o[s],i.set(n[0],n[1])}var ne=k(),ie=k(),oe=k(),se=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],ae=["jfif","xmp","icc","iptc"],ue=["tiff"].concat(ae),le=["ifd0","ifd1","exif","gps","interop"],ce=[].concat(ue,le),pe=["makerNote","userComment"],de=["translateKeys","translateValues","reviveValues","multiSegment"],he=[].concat(de,["sanitize","mergeOutput"]),_e=(e(we,[{key:"translate",get:function(){return this.translateKeys||this.translateValues||this.reviveValues}}]),we),fe=(r(be,_e),e(be,[{key:"needed",get:function(){return this.enabled||0<this.deps.size}}]),e(be,[{key:"applyInheritables",value:function(e){var t,r,n=de;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=y(n));for(var i=0;i<n.length;i++)void 0!==(r=e[t=n[i]])&&(this[t]=r)}},{key:"translateTagSet",value:function(e,t){if(this.dict){var r,n,i=this.dict,o=i.tagKeys,s=i.tagValues,a=e;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=y(a));for(var u=0;u<a.length;u++)"string"==typeof(r=a[u])?(-1===(n=s.indexOf(r))&&(n=o.indexOf(Number(r))),-1!==n&&t.add(Number(o[n]))):t.add(r)}else{var l=e;Array.isArray(l)||("function"==typeof l.entries&&(l=l.entries()),l=y(l));for(var c=0;c<l.length;c++){var p=l[c];t.add(p)}}}},{key:"finalizeFilters",value:function(){!this.enabled&&0<this.deps.size?(this.enabled=!0,Ee(this.pick,this.deps)):this.enabled&&0<this.pick.size&&Ee(this.pick,this.deps)}}]),be),ge={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},ye=k(),me=(r(ve,_e),e(ve,null,[{key:"useCached",value:function(e){var t=ye.get(e);return void 0!==t||(t=new this(e),ye.set(e,t)),t}}]),e(ve,[{key:"setupFromUndefined",value:function(){var e,t=se;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=y(t));for(var r=0;r<t.length;r++)this[e=t[r]]=ge[e];var n=he;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=y(n));for(var i=0;i<n.length;i++)this[e=n[i]]=ge[e];var o=pe;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=y(o));for(var s=0;s<o.length;s++)this[e=o[s]]=ge[e];var a=ce;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=y(a));for(var u=0;u<a.length;u++)this[e=a[u]]=new fe(e,ge[e],void 0,this)}},{key:"setupFromTrue",value:function(){var e,t=se;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=y(t));for(var r=0;r<t.length;r++)this[e=t[r]]=ge[e];var n=he;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=y(n));for(var i=0;i<n.length;i++)this[e=n[i]]=ge[e];var o=pe;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=y(o));for(var s=0;s<o.length;s++)this[e=o[s]]=!0;var a=ce;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=y(a));for(var u=0;u<a.length;u++)this[e=a[u]]=new fe(e,!0,void 0,this)}},{key:"setupFromArray",value:function(e){var t,r=se;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=y(r));for(var n=0;n<r.length;n++)this[t=r[n]]=ge[t];var i=he;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=y(i));for(var o=0;o<i.length;o++)this[t=i[o]]=ge[t];var s=pe;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=y(s));for(var a=0;a<s.length;a++)this[t=s[a]]=ge[t];var u=ce;Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=y(u));for(var l=0;l<u.length;l++)this[t=u[l]]=new fe(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,le)}},{key:"setupFromObject",value:function(e){var t;le.ifd0=le.ifd0||le.image,le.ifd1=le.ifd1||le.thumbnail,f(this,e);var r=se;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=y(r));for(var n=0;n<r.length;n++)this[t=r[n]]=ke(e[t],ge[t]);var i=he;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=y(i));for(var o=0;o<i.length;o++)this[t=i[o]]=ke(e[t],ge[t]);var s=pe;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=y(s));for(var a=0;a<s.length;a++)this[t=s[a]]=ke(e[t],ge[t]);var u=ue;Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=y(u));for(var l=0;l<u.length;l++)this[t=u[l]]=new fe(t,ge[t],e[t],this);var c=le;Array.isArray(c)||("function"==typeof c.entries&&(c=c.entries()),c=y(c));for(var p=0;p<c.length;p++)this[t=c[p]]=new fe(t,ge[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,le,ce),!0===e.tiff?this.batchEnableWithBool(le,!0):!1===e.tiff?this.batchEnableWithUserValue(le,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,le):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,le)}},{key:"batchEnableWithBool",value:function(e,t){var r=e;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=y(r));for(var n=0;n<r.length;n++)this[r[n]].enabled=t}},{key:"batchEnableWithUserValue",value:function(e,t){var r=e;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=y(r));for(var n=0;n<r.length;n++){var i=r[n],o=t[i];this[i].enabled=!1!==o&&void 0!==o}}},{key:"setupGlobalFilters",value:function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:r;if(e&&e.length){var i=n;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=y(i));for(var o=0;o<i.length;o++)this[i[o]].enabled=!1;var s=Se(e,r);Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=y(s));for(var a=0;a<s.length;a++){var u=s[a],l=u[0],c=u[1];Ee(this[l].pick,c),this[l].enabled=!0}}else if(t&&t.length){var p=Se(t,r);Array.isArray(p)||("function"==typeof p.entries&&(p=p.entries()),p=y(p));for(var d=0;d<p.length;d++){var h=p[d],_=h[0],f=h[1];Ee(this[_].skip,f)}}}},{key:"filterNestedSegmentTags",value:function(){var e=this.ifd0,t=this.exif,r=this.xmp,n=this.iptc,i=this.icc;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),n.enabled||e.skip.add(33723),i.enabled||e.skip.add(34675)}},{key:"traverseTiffDependencyTree",value:function(){var t=this,e=this.ifd0,r=this.exif,n=this.gps;this.interop.needed&&(r.deps.add(40965),e.deps.add(40965)),r.needed&&e.deps.add(34665),n.needed&&e.deps.add(34853),this.tiff.enabled=le.some(function(e){return!0===t[e].enabled})||this.makerNote||this.userComment;var i=le;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=y(i));for(var o=0;o<i.length;o++)this[i[o]].finalizeFilters()}},{key:"checkLoadedPlugins",value:function(){var e=ue;Array.isArray(e)||("function"==typeof e.entries&&(e=e.entries()),e=y(e));for(var t=0;t<e.length;t++){var r=e[t];this[r].enabled&&!z.has(r)&&L("segment parser",r)}}},{key:"onlyTiff",get:function(){var t=this;return!ae.map(function(e){return t[e].enabled}).some(function(e){return!0===e})&&this.tiff.enabled}}]),ve);function ve(e){var t;if(u(this,ve),t=p(this,a(ve).call(this)),!0===e)t.setupFromTrue();else if(void 0===e)t.setupFromUndefined();else if(Array.isArray(e))t.setupFromArray(e);else{if("object"!=typeof e)throw U("Invalid options argument ".concat(e));t.setupFromObject(e)}return void 0===t.firstChunkSize&&(t.firstChunkSize=P?t.firstChunkSizeBrowser:t.firstChunkSizeNode),t.mergeOutput&&(t.ifd1.enabled=!1),t.filterNestedSegmentTags(),t.traverseTiffDependencyTree(),t.checkLoadedPlugins(),t}function be(e,t,r,n){var i,o,s;if(u(this,be),l(c(i=p(this,a(be).call(this))),"enabled",!1),l(c(i),"skip",S()),l(c(i),"pick",S()),l(c(i),"deps",S()),l(c(i),"translateKeys",!1),l(c(i),"translateValues",!1),l(c(i),"reviveValues",!1),i.key=e,i.enabled=t,i.parse=i.enabled,i.applyInheritables(n),i.canBeFiltered=le.includes(e),i.canBeFiltered&&(i.dict=ne.get(e)),void 0!==r)if(Array.isArray(r))i.parse=i.enabled=!0,i.canBeFiltered&&0<r.length&&i.translateTagSet(r,i.pick);else if("object"==typeof r){i.enabled=!0,i.parse=!1!==r.parse,i.canBeFiltered&&(o=r.pick,s=r.skip,o&&0<o.length&&i.translateTagSet(o,i.pick),s&&0<s.length&&i.translateTagSet(s,i.skip)),i.applyInheritables(r)}else{if(!0!==r&&!1!==r)throw U("Invalid options argument: ".concat(r));i.parse=i.enabled=r}return i}function we(){u(this,we)}function Se(e,t){var r,n,i,o=[],s=t;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=y(s));for(var a=0;a<s.length;a++){n=s[a],r=[];var u=ne.get(n);Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=y(u));for(var l=0;l<u.length;l++)i=u[l],(e.includes(i[0])||e.includes(i[1]))&&r.push(i[0]);r.length&&o.push([n,r])}return o}function ke(e,t){return void 0!==e?e:void 0!==t?t:void 0}function Ee(e,t){var r=t;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=y(r));for(var n=0;n<r.length;n++){var i=r[n];e.add(i)}}l(me,"default",ge);var Ce={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},Pe=f({},Ce,{firstChunkSize:4e4,gps:[1,2,3,4]}),Ae=f({},Ce,{firstChunkSize:4e4,ifd0:[274]}),Te=f({},Ce,{tiff:!1,ifd1:!0,mergeOutput:!1});function Fe(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function $e(e,t){var r=e();return r&&r.then?r.then(t):t(r)}function Oe(){}var xe=(e(Re,[{key:"setup",value:function(){if(!this.fileParser){var e,t=this.file.getUint16(0);if(18761===t||19789===t)this.file.isTiff=!0,e=N.get("tiff");else if(65496===t)this.file.isJpeg=!0,e=N.get("jpeg");else{if(!function(e){if(0===e.getUint16(0)){var t=e.getUint16(2);if(!(50<t)){for(var r=16,n=[];r<t;)n.push(e.getString(r,4)),r+=4;return n.includes("heic")}}}(this.file))throw U("Unknown file format");this.file.isHeic=!0,e=N.get("heic")}this.fileParser=new e(this.options,this.file,this.parsers)}}},{key:"read",value:function(e){try{var t=this;return Fe(function(e,t){if("string"==typeof e)return Q(e,t);if(P&&!A&&e instanceof HTMLImageElement)return Q(e.src,t);if(e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView)return new D(e);if(P&&e instanceof Blob)return J(e,t,"blob",X);throw U("Invalid input argument")}(e,t.options),function(e){t.file=e})}catch(e){return Promise.reject(e)}}},{key:"parse",value:function(){try{var o=this;return o.setup(),Fe(o.fileParser.parse(),function(){var r,t={},i=[],e=h(o.parsers).map((r=function(r){var n;return $e(function(){return o.options.silentErrors?(t=function(){r.errors.length&&i.push.apply(i,r.errors)},(e=function(t){try{var e=Fe(r.parse(),function(e){n=e})}catch(e){return t(e)}return e&&e.then?e.then(void 0,t):e}(function(e){i.push(e)}))&&e.then?e.then(t):t()):Fe(r.parse(),function(e){n=e});var e,t},function(){r.assignToOutput(t,n)})},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(r.apply(this,e))}catch(e){return Promise.reject(e)}}));return Fe(Promise.all(e),function(){var e;return o.options.silentErrors&&0<i.length&&(t.errors=i),t=R(e=t)?void 0:e,o.file.close&&o.file.close(),t})})}catch(o){return Promise.reject(o)}}},{key:"extractThumbnail",value:function(){try{var t=this;t.setup();var r,n=z.get("tiff",t.options);return $e(function(){return t.file.isTiff?void(r={start:0,type:"tiff"}):function(){var e=function(){if(t.file.isJpeg)return Fe(t.fileParser.getOrFindSegment("tiff"),function(e){r=e})}();if(e&&e.then)return e.then(Oe)}()},function(){if(void 0!==r)return Fe(t.fileParser.ensureSegmentChunk(r),function(e){return Fe((t.parsers.tiff=new n(e,t.options,t.file)).extractThumbnail(),function(e){return t.file.close&&t.file.close(),e})})})}catch(t){return Promise.reject(t)}}}]),Re);function Re(e){u(this,Re),l(this,"parsers",{}),this.options=me.useCached(e)}function Ue(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Be(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(r.apply(this,e))}catch(e){return Promise.reject(e)}}}function Ie(e){return Ue(He(e),function(e){return f({canvas:t.rotateCanvas,css:t.rotateCss},Ge[e])})}var De,Me,Le,je,Ne,ze,qe,He=Be(function(e){var t=new xe(Ae);return Ue(t.read(e),function(){return Ue(t.parse(),function(e){if(e&&e.ifd0)return e.ifd0[274]})})}),Ve=Be(function(e){var t=new xe(Pe);return Ue(t.read(e),function(){return Ue(t.parse(),function(e){if(e&&e.gps){var t=e.gps;return{latitude:t.latitude,longitude:t.longitude}}})})}),We=Be(function(e){return Ue(this.thumbnail(e),function(e){if(void 0!==e){var t=new Blob([e]);return URL.createObjectURL(t)}})}),Xe=Be(function(e){var t=new xe(Te);return Ue(t.read(e),function(){return Ue(t.extractThumbnail(),function(e){return e&&O?F.from(e):e})})}),Ke=Be(function(e,t){var r=new xe(t);return Ue(r.read(e),function(){return r.parse()})}),Ge={1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}};t.rotateCanvas=!0,t.rotateCss=!0,"object"==typeof navigator&&(((De=navigator.userAgent).includes("iPad")||De.includes("iPhone"))&&((Me=De.match(/OS (\d+)_(\d+)/))[0],Le=Me[1],je=Me[2],Ne=Number(Le)+.1*Number(je),t.rotateCanvas=Ne<13.4,t.rotateCss=!1),De.includes("Chrome/")&&((ze=De.match(/Chrome\/(\d+)/))[0],qe=ze[1],81<=Number(qe)&&(t.rotateCanvas=t.rotateCss=!1)));var Ye=Object.freeze({__proto__:null,rotation:Ie,orientation:He,gps:Ve,thumbnailUrl:We,thumbnail:Xe,parse:Ke,rotations:Ge,get rotateCanvas(){return t.rotateCanvas},get rotateCss(){return t.rotateCss},Exifr:xe,fileParsers:N,segmentParsers:z,fileReaders:q,tagKeys:ne,tagValues:ie,tagRevivers:oe,createDictionary:te,extendDictionary:re,fetchUrlAsArrayBuffer:K,readBlobAsArrayBuffer:X,chunkedProps:se,otherSegments:ae,segments:ue,tiffBlocks:le,segmentsAndBlocks:ce,tiffExtractables:pe,inheritables:de,allFormatters:he,Options:me,disableAllOptions:Ce,gpsOnlyOptions:Pe,orientationOnlyOptions:Ae,thumbnailOnlyOptions:Te});function Je(){}var Qe=(r(tt,D),e(tt,[{key:"_tryExtend",value:function(e,t,r){var n,i,o;0===e&&0===this.byteLength&&r?(n=new DataView(r.buffer||r,r.byteOffset,r.byteLength),this._swapDataView(n)):(i=e+t)>this.byteLength&&(o=this._extend(i).dataView,this._swapDataView(o))}},{key:"_extend",value:function(e){var t=O?F.allocUnsafe(e):new Uint8Array(e),r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}},{key:"subarray",value:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),d(a(tt.prototype),"subarray",this).call(this,e,t)}},{key:"set",value:function(e,t){2<arguments.length&&void 0!==arguments[2]&&arguments[2]&&this._tryExtend(t,e.byteLength,e);var r=d(a(tt.prototype),"set",this).call(this,e,t);return this.ranges.add(t,r.byteLength),r}},{key:"ensureChunk",value:function(e,t){try{if(!this.chunked)return;if(this.ranges.available(e,t))return;return(r=this.readChunk(e,t))&&r.then?r.then(Je):Promise.resolve()}catch(e){return Promise.reject(e)}var r}},{key:"available",value:function(e,t){return this.ranges.available(e,t)}}]),tt),Ze=(e(et,[{key:"add",value:function(t,e){var r,n=t+e,i=this.list.filter(function(e){return rt(t,e.offset,n)||rt(t,e.end,n)});0<i.length?(t=Math.min.apply(Math,[t].concat(i.map(function(e){return e.offset}))),e=(n=Math.max.apply(Math,[n].concat(i.map(function(e){return e.end}))))-t,(r=i.shift()).offset=t,r.length=e,r.end=n,this.list=this.list.filter(function(e){return!i.includes(e)})):this.list.push({offset:t,length:e,end:n})}},{key:"available",value:function(t,e){var r=t+e;return this.list.some(function(e){return e.offset<=t&&r<=e.end})}},{key:"length",get:function(){return this.list.length}}]),et);function et(){u(this,et),l(this,"list",[])}function tt(){var e,t;u(this,tt);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return l(c(t=p(this,(e=a(tt)).call.apply(e,[this].concat(n)))),"ranges",new Ze),0!==t.byteLength&&t.ranges.add(0,t.byteLength),t}function rt(e,t,r){return e<=t&&t<=r}function nt(){}function it(e,t){if(!t)return e&&e.then?e.then(nt):Promise.resolve()}function ot(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var st=(r(ut,Qe),e(ut,[{key:"readWhole",value:function(){try{return this.chunked=!1,it(this.readChunk(this.nextChunkOffset))}catch(e){return Promise.reject(e)}}},{key:"readChunked",value:function(){try{return this.chunked=!0,it(this.readChunk(0,this.options.firstChunkSize))}catch(e){return Promise.reject(e)}}},{key:"readNextChunk",value:function(e){try{if(void 0===e&&(e=this.nextChunkOffset),this.fullyRead)return this.chunksRead++,!1;var t=this.options.chunkSize,r=this.readChunk(e,t),n=function(e){return!!e&&e.byteLength===t};return r&&r.then||(r=Promise.resolve(r)),r.then(n)}catch(e){return Promise.reject(e)}}},{key:"readChunk",value:function(e,t){try{if(this.chunksRead++,0===(t=this.safeWrapAddress(e,t)))return;return this._readChunk(e,t)}catch(e){return Promise.reject(e)}}},{key:"safeWrapAddress",value:function(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}},{key:"read",value:function(){return this.options.chunked?this.readChunked():this.readWhole()}},{key:"close",value:function(){}},{key:"nextChunkOffset",get:function(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}},{key:"canReadNextChunk",get:function(){return this.chunksRead<this.options.chunkLimit}},{key:"fullyRead",get:function(){return void 0!==this.size&&this.nextChunkOffset===this.size}}]),r(at,ut),e(at,[{key:"readWhole",value:function(){try{var t=this;return t.chunked=!1,ot(X(t.input),function(e){t._swapArrayBuffer(e)})}catch(t){return Promise.reject(t)}}},{key:"readChunked",value:function(){return this.chunked=!0,this.size=this.input.size,d(a(at.prototype),"readChunked",this).call(this)}},{key:"_readChunk",value:function(t,e){try{var r=this,n=e?t+e:void 0,i=r.input.slice(t,n);return ot(X(i),function(e){return r.set(e,t,!0)})}catch(t){return Promise.reject(t)}}}]),at);function at(){return u(this,at),p(this,a(at).apply(this,arguments))}function ut(e,t){var r;return u(this,ut),l(c(r=p(this,a(ut).call(this,0))),"chunksRead",0),r.input=e,r.options=t,r}q.set("blob",st);var lt=(e(dt,[{key:"createParser",value:function(e,t){var r=new(z.get(e))(t,this.options,this.file);return this.parsers[e]=r}}]),dt),ct=(e(pt,[{key:"normalizeInput",value:function(e){return e instanceof D?e:new D(e)}}],[{key:"findPosition",value:function(e,t){var r=e.getUint16(t+2)+2,n="function"==typeof this.headerLength?this.headerLength(e,t,r):this.headerLength,i=t+n,o=r-n;return{offset:t,length:r,headerLength:n,start:i,size:o,end:i+o}}},{key:"parse",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new this(e,new me(l({},this.type,t))).parse()}}]),e(pt,[{key:"translate",value:function(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}},{key:"translateBlock",value:function(e,t){var r=oe.get(t),n=ie.get(t),i=ne.get(t),o=this.options[t],s=o.reviveValues&&!!r,a=o.translateValues&&!!n,u=o.translateKeys&&!!i,l={},c=e;Array.isArray(c)||("function"==typeof c.entries&&(c=c.entries()),c=y(c));for(var p=0;p<c.length;p++){var d=c[p],h=d[0],_=d[1];s&&r.has(h)?_=r.get(h)(_):a&&n.has(h)&&(_=this.translateValue(_,n.get(h))),u&&i.has(h)&&(h=i.get(h)||h),l[h]=_}return l}},{key:"translateValue",value:function(e,t){return t[e]||e}},{key:"assignToOutput",value:function(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}},{key:"assignObjectToOutput",value:function(e,t,r){if(this.globalOptions.mergeOutput)return f(e,r);e[t]?f(e[t],r):e[t]=r}},{key:"output",get:function(){return this.translated?this.translated:this.raw?g(this.raw):void 0}}]),pt);function pt(e){var t=this,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length?arguments[2]:void 0;u(this,pt),l(this,"errors",[]),l(this,"raw",k()),l(this,"handleError",function(e){if(!t.options.silentErrors)throw e;t.errors.push(e.message)}),this.chunk=this.normalizeInput(e),this.file=n,this.type=this.constructor.type,this.globalOptions=this.options=r,this.localOptions=r[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}function dt(e,t,r){var n,a=this;u(this,dt),l(this,"ensureSegmentChunk",(n=function(i){var e,o=i.start,s=i.size||65536,t=function(e){return i.chunk};return(e=function(){if(a.file.chunked)return a.file.available(o,s)?void(i.chunk=a.file.subarray(o,s)):function(t){try{var e=(n=function(e){i.chunk=e},(r=a.file.readChunk(o,s))&&r.then||(r=Promise.resolve(r)),r.then(n))}catch(e){return t(e)}var r,n;return e&&e.then?e.then(void 0,t):e}(function(e){throw U("Couldn't read segment: ".concat(JSON.stringify(i),". ").concat(e.message))});if(a.file.byteLength>o+s)i.chunk=a.file.subarray(o,s);else{if(void 0!==i.size)throw U("Segment unreachable: "+JSON.stringify(i));i.chunk=a.file.subarray(o)}}())&&e.then?e.then(t):t()},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(n.apply(this,e))}catch(e){return Promise.reject(e)}})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}function ht(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function _t(){}function ft(e,t){if(!t)return e&&e.then?e.then(_t):Promise.resolve()}function gt(e,t){var r=e();return r&&r.then?r.then(t):t(r)}function yt(e,t,r){if(!e.s){if(r instanceof mt){if(!r.s)return void(r.o=yt.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(yt.bind(null,e,t),yt.bind(null,e,2));e.s=t,e.v=r;var n=e.o;n&&n(e)}}l(ct,"headerLength",4),l(ct,"type",void 0),l(ct,"multiSegment",!1),l(ct,"canHandle",function(){return!1});var mt=(vt.prototype.then=function(r,n){var i=new vt,e=this.s;if(e){var t=1&e?r:n;if(t){try{yt(i,1,t(this.v))}catch(e){yt(i,2,e)}return i}return this}return this.o=function(e){try{var t=e.v;1&e.s?yt(i,1,r?r(t):t):n?yt(i,1,n(t)):yt(i,2,t)}catch(e){yt(i,2,e)}},i},vt);function vt(){}function bt(e){return e instanceof mt&&1&e.s}var wt=(r(St,lt),e(St,[{key:"parse",value:function(){try{var e=this;return ht(e.findAppSegments(),function(){return ht(e.readSegments(),function(){e.mergeMultiSegments(),e.createParsers()})})}catch(e){return Promise.reject(e)}}},{key:"readSegments",value:function(){try{var e=this.appSegments.map(this.ensureSegmentChunk);return ft(Promise.all(e))}catch(e){return Promise.reject(e)}}},{key:"setupSegmentFinderArgs",value:function(e){var t=this;!0===e?(this.findAll=!0,this.wanted=S(z.keyList())):(e=void 0===e?z.keyList().filter(function(e){return t.options[e].enabled}):e.filter(function(e){return t.options[e].enabled&&z.has(e)}),this.findAll=!1,this.remaining=S(e),this.wanted=S(e)),this.unfinishedMultiSegment=!1}},{key:"findAppSegments",value:function(){var i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length?arguments[1]:void 0;try{var o=this;o.setupSegmentFinderArgs(e);var s=o.file,t=o.findAll,r=o.wanted,a=o.remaining;return gt(function(){if(!t&&o.file.chunked)return t=y(r).some(function(e){var t=z.get(e),r=o.options[e];return t.multiSegment&&r.multiSegment}),function(){var e=function(){if(t)return ft(o.file.readWhole())}();if(e&&e.then)return e.then(_t)}()},function(){var n=!1;if(i=o._findAppSegments(i,s.byteLength,t,r,a),!o.options.onlyTiff)return function(){if(s.chunked){var r=!1;return function(t,r,n){for(var e;;){var i=t();if(bt(i)&&(i=i.v),!i)return o;if(i.then){e=0;break}var o=n();if(o&&o.then){if(!bt(o)){e=1;break}o=o.s}if(r){var s=r();if(s&&s.then&&!bt(s)){e=2;break}}}var a=new mt,u=yt.bind(null,a,2);return(0===e?i.then(c):1===e?o.then(l):s.then(p)).then(void 0,u),a;function l(e){o=e;do{if(r&&(s=r())&&s.then&&!bt(s))return void s.then(p).then(void 0,u);if(!(i=t())||bt(i)&&!i.v)return void yt(a,1,o);if(i.then)return void i.then(c).then(void 0,u);bt(o=n())&&(o=o.v)}while(!o||!o.then);o.then(l).then(void 0,u)}function c(e){e?(o=n())&&o.then?o.then(l).then(void 0,u):l(o):yt(a,1,o)}function p(){(i=t())?i.then?i.then(c).then(void 0,u):c(i):yt(a,1,o)}}(function(){return!n&&0<a.size&&!r&&(!!s.canReadNextChunk||!!o.unfinishedMultiSegment)},void 0,function(){var e=s.nextChunkOffset,t=o.appSegments.some(function(e){return!o.file.available(e.offset||e.start,e.length||e.size)});return gt(function(){return ht(e<i&&!t?s.readNextChunk(i):s.readNextChunk(e),function(e){r=!e})},function(){void 0===(i=o._findAppSegments(i,s.byteLength))&&(n=!0)})})}}()})}catch(i){return Promise.reject(i)}}},{key:"_findAppSegments",value:function(e,t){for(var r,n,i,o,s,a,u,l,c=this.file,p=this.findAll,d=this.wanted,h=this.remaining,_=this.options;e<t;e++)if(255===c.getUint8(e))if(224<=(l=r=c.getUint8(e+1))&&l<=239){if(n=c.getUint16(e+2),(i=function(e,t){var r=z;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=y(r));for(var n=0;n<r.length;n++){var i=r[n],o=i[0];if(i[1].canHandle(e,t))return o}}(c,e))&&d.has(i)&&(s=(o=z.get(i)).findPosition(c,e),a=_[i],s.type=i,this.appSegments.push(s),!p&&(o.multiSegment&&a.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||h.delete(i)):h.delete(i),0===h.size)))break;_.recordUnknownSegments&&((s=ct.findPosition(c,e)).marker=r,this.unknownSegments.push(s)),e+=n+1}else if(192===(u=r)||194===u||196===u||219===u||221===u||218===u||254===u){if(n=c.getUint16(e+2),218===r&&!1!==_.stopAfterSos)return;_.recordJpegSegments&&this.jpegSegments.push({offset:e,length:n,marker:r}),e+=n+1}return e}},{key:"mergeMultiSegments",value:function(){var e,i=this;this.appSegments.some(function(e){return e.multiSegment})&&(e=function(e){for(var t,r,n,i=k(),o=0;o<e.length;o++)r=(t=e[o]).type,i.has(r)?n=i.get(r):i.set(r,n=[]),n.push(t);return y(i)}(this.appSegments),this.mergedAppSegments=e.map(function(e){var t=e[0],r=e[1],n=z.get(t,i.options);return n.handleMultiSegments?{type:t,chunk:n.handleMultiSegments(r)}:r[0]}))}},{key:"createParsers",value:function(){try{var e=this.mergedAppSegments||this.appSegments;Array.isArray(e)||("function"==typeof e.entries&&(e=e.entries()),e=y(e));for(var t=0;t<e.length;t++){var r,n,i=e[t],o=i.type,s=i.chunk;this.options[o].enabled&&((r=this.parsers[o])&&r.append||r||(n=new(z.get(o,this.options))(s,this.options,this.file),this.parsers[o]=n))}return ht()}catch(e){return Promise.reject(e)}}},{key:"getSegment",value:function(t){return this.appSegments.find(function(e){return e.type===t})}},{key:"getOrFindSegment",value:function(e){try{var t=this,r=t.getSegment(e);return gt(function(){if(void 0===r)return ht(t.findAppSegments(0,[e]),function(){r=t.getSegment(e)})},function(){return r})}catch(e){return Promise.reject(e)}}}]),St);function St(){var e,t;u(this,St);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return l(c(t=p(this,(e=a(St)).call.apply(e,[this].concat(n)))),"appSegments",[]),l(c(t),"jpegSegments",[]),l(c(t),"unknownSegments",[]),t}function kt(){}function Et(e,t){if(!t)return e&&e.then?e.then(kt):Promise.resolve()}function Ct(e,t){var r=e();return r&&r.then?r.then(t):t(r)}N.set("jpeg",wt);var Pt=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],At=(r(Ft,ct),e(Ft,[{key:"parseHeader",value:function(){var e=this.chunk.getUint16();if(18761===e)this.le=!0;else{if(19789!==e)throw U("Invalid EXIF data: expected byte order marker (0x4949 or 0x4D4D).");this.le=!1}if(this.chunk.le=this.le,42!==this.chunk.getUint16(2))throw U("Invalid EXIF data: expected 0x002A.");this.headerParsed=!0}},{key:"parseTags",value:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:k(),n=this.options[t],i=n.pick,o=n.skip,s=0<(i=S(i)).size,a=0===o.size,u=this.chunk.getUint16(e);e+=2;for(var l=0;l<u;l++){var c=this.chunk.getUint16(e);if(s){if(i.has(c)&&(r.set(c,this.parseTag(e,c,t)),i.delete(c),0===i.size))break}else!a&&o.has(c)||r.set(c,this.parseTag(e,c,t));e+=12}return r}},{key:"parseTag",value:function(e,t,r){var n,i=this.chunk.getUint16(e+2),o=this.chunk.getUint32(e+4),s=Pt[i];if(s*o<=4?e+=8:e=this.chunk.getUint32(e+8),i<1||13<i)throw U("Invalid TIFF value type. block: ".concat(r.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(i,", offset ").concat(e));if(e>this.chunk.byteLength)throw U("Invalid TIFF value offset. block: ".concat(r.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(i,", offset ").concat(e," is outside of chunk size ").concat(this.chunk.byteLength));if(1===i)return this.chunk.getUint8Array(e,o);if(2===i)return""===(n=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(this.chunk.getString(e,o)).trim())?void 0:n;if(7===i)return this.chunk.getUint8Array(e,o);if(1===o)return this.parseTagValue(i,e);for(var a=new(function(){switch(i){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}())(o),u=s,l=0;l<o;l++)a[l]=this.parseTagValue(i,e),e+=u;return a}},{key:"parseTagValue",value:function(e,t){switch(e){case 1:return this.chunk.getUint8(t);case 3:return this.chunk.getUint16(t);case 4:return this.chunk.getUint32(t);case 5:return this.chunk.getUint32(t)/this.chunk.getUint32(t+4);case 6:return this.chunk.getInt8(t);case 8:return this.chunk.getInt16(t);case 9:return this.chunk.getInt32(t);case 10:return this.chunk.getInt32(t)/this.chunk.getInt32(t+4);case 11:return this.chunk.getFloat(t);case 12:return this.chunk.getDouble(t);case 13:return this.chunk.getUint32(t);default:throw U("Invalid tiff type ".concat(e))}}}]),r(Tt,Ft),e(Tt,[{key:"parse",value:function(){try{var e=this;return e.parseHeader(),Ct(function(){if(e.options.ifd0.enabled)return Et(e.parseIfd0Block())},function(){return Ct(function(){if(e.options.exif.enabled)return Et(e.saveParseBlock("parseExifBlock"))},function(){return Ct(function(){if(e.options.gps.enabled)return Et(e.saveParseBlock("parseGpsBlock"))},function(){return Ct(function(){if(e.options.interop.enabled)return Et(e.saveParseBlock("parseInteropBlock"))},function(){return Ct(function(){if(e.options.ifd1.enabled)return Et(e.saveParseBlock("parseThumbnailBlock"))},function(){return e.createOutput()})})})})})}catch(e){return Promise.reject(e)}}},{key:"saveParseBlock",value:function(n){try{var i=this;return function(t){try{var e=((r=i[n]())&&r.then||(r=Promise.resolve(r)),r)}catch(e){return t(e)}var r;return e&&e.then?e.then(void 0,t):e}(function(e){i.handleError(e)})}catch(n){return Promise.reject(n)}}},{key:"findIfd0Offset",value:function(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}},{key:"findIfd1Offset",value:function(){var e,t;void 0===this.ifd1Offset&&(this.findIfd0Offset(),e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e,this.ifd1Offset=this.chunk.getUint32(t))}},{key:"parseBlock",value:function(e,t){var r=k();return this[t]=r,this.parseTags(e,t,r),r}},{key:"parseIfd0Block",value:function(){try{var t=this;if(t.ifd0)return;if(t.findIfd0Offset(),t.ifd0Offset<8)throw U("Invalid EXIF data: IFD0 offset should be less than 8");if(!t.file.chunked&&t.ifd0Offset>t.file.byteLength)throw U("IFD0 offset points to outside of file.\nthis.ifd0Offset: ".concat(t.ifd0Offset,", file.byteLength: ").concat(t.file.byteLength));return Ct(function(){if(t.file.isTiff)return Et(t.file.ensureChunk(t.ifd0Offset,B(t.options)))},function(){var e=t.parseBlock(t.ifd0Offset,"ifd0");if(0!==e.size)return t.exifOffset=e.get(34665),t.interopOffset=e.get(40965),t.gpsOffset=e.get(34853),t.xmp=e.get(700),t.iptc=e.get(33723),t.icc=e.get(34675),t.options.sanitize&&(e.delete(34665),e.delete(40965),e.delete(34853),e.delete(700),e.delete(33723),e.delete(34675)),e})}catch(t){return Promise.reject(t)}}},{key:"ensureBlockChunk",value:function(e,t){try{var r=this;return Ct(function(){if(r.file.isTiff)return Et(r.file.ensureChunk(e,t))},function(){e>r.chunk.byteLength&&(r.chunk=D.from(r.file,r.le))})}catch(e){return Promise.reject(e)}}},{key:"parseExifBlock",value:function(){try{var t=this;if(t.exif)return;return Ct(function(){if(!t.ifd0)return Et(t.parseIfd0Block())},function(){if(void 0!==t.exifOffset)return Ct(function(){if(t.file.isTiff)return Et(t.file.ensureChunk(t.exifOffset,B(t.options)))},function(){var e=t.parseBlock(t.exifOffset,"exif");return t.interopOffset||(t.interopOffset=e.get(40965)),t.makerNote=e.get(37500),t.userComment=e.get(37510),t.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),t.unpack(e,41728),t.unpack(e,41729),e})})}catch(t){return Promise.reject(t)}}},{key:"unpack",value:function(e,t){var r=e.get(t);r&&1===r.length&&e.set(t,r[0])}},{key:"parseGpsBlock",value:function(){try{var t=this;if(t.gps)return;return Ct(function(){if(!t.ifd0)return Et(t.parseIfd0Block())},function(){if(void 0!==t.gpsOffset){var e=t.parseBlock(t.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",$t.apply(void 0,e.get(2).concat([e.get(1)]))),e.set("longitude",$t.apply(void 0,e.get(4).concat([e.get(3)])))),e}})}catch(t){return Promise.reject(t)}}},{key:"parseInteropBlock",value:function(){try{var e=this;if(e.interop)return;return Ct(function(){if(!e.ifd0)return Et(e.parseIfd0Block())},function(){return Ct(function(){if(void 0===e.interopOffset&&!e.exif)return Et(e.parseExifBlock())},function(){if(void 0!==e.interopOffset)return e.parseBlock(e.interopOffset,"interop")})})}catch(e){return Promise.reject(e)}}},{key:"parseThumbnailBlock",value:function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];try{var t=this;if(t.ifd1||t.ifd1Parsed)return;if(t.options.mergeOutput&&!e)return;return t.findIfd1Offset(),0<t.ifd1Offset&&(t.parseBlock(t.ifd1Offset,"ifd1"),t.ifd1Parsed=!0),t.ifd1}catch(e){return Promise.reject(e)}}},{key:"extractThumbnail",value:function(){try{var r=this;return r.headerParsed||r.parseHeader(),Ct(function(){if(!r.ifd1Parsed)return Et(r.parseThumbnailBlock(!0))},function(){if(void 0!==r.ifd1){var e=r.ifd1.get(513),t=r.ifd1.get(514);return r.chunk.getUint8Array(e,t)}})}catch(r){return Promise.reject(r)}}},{key:"createOutput",value:function(){var e,t,r,n={},i=le;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=y(i));for(var o=0;o<i.length;o++)if(!R(e=this[t=i[o]]))if(r=this.canTranslate?this.translateBlock(e,t):g(e),this.options.mergeOutput){if("ifd1"===t)continue;f(n,r)}else n[t]=r;return this.makerNote&&(n.makerNote=this.makerNote),this.userComment&&(n.userComment=this.userComment),n}},{key:"assignToOutput",value:function(e,t){if(this.globalOptions.mergeOutput)f(e,t);else{var r=_(t);Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=y(r));for(var n=0;n<r.length;n++){var i=r[n],o=i[0],s=i[1];this.assignObjectToOutput(e,o,s)}}}},{key:"image",get:function(){return this.ifd0}},{key:"thumbnail",get:function(){return this.ifd1}}],[{key:"canHandle",value:function(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}}]),Tt);function Tt(){return u(this,Tt),p(this,a(Tt).apply(this,arguments))}function Ft(){return u(this,Ft),p(this,a(Ft).apply(this,arguments))}function $t(e,t,r,n){var i=e+t/60+r/3600;return"S"!==n&&"W"!==n||(i*=-1),i}l(At,"type","tiff"),l(At,"headerLength",10),z.set("tiff",At),t.Exifr=xe,t.Options=me,t.allFormatters=he,t.chunkedProps=se,t.createDictionary=te,t.default=Ye,t.disableAllOptions=Ce,t.extendDictionary=re,t.fetchUrlAsArrayBuffer=K,t.fileParsers=N,t.fileReaders=q,t.gps=Ve,t.gpsOnlyOptions=Pe,t.inheritables=de,t.orientation=He,t.orientationOnlyOptions=Ae,t.otherSegments=ae,t.parse=Ke,t.readBlobAsArrayBuffer=X,t.rotation=Ie,t.rotations=Ge,t.segmentParsers=z,t.segments=ue,t.segmentsAndBlocks=ce,t.tagKeys=ne,t.tagRevivers=oe,t.tagValues=ie,t.thumbnail=Xe,t.thumbnailOnlyOptions=Te,t.thumbnailUrl=We,t.tiffBlocks=le,t.tiffExtractables=pe,Object.defineProperty(t,"__esModule",{value:!0})};"object"==typeof _$miniLegacyUmd_35.exports?t(_$miniLegacyUmd_35.exports):"function"==typeof define&&define.amd?define("exifr",["exports"],t):t((e=e||self).exifr={})}).call(this,_$browser_55,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_$buffer_8({}).Buffer),_$miniLegacyUmd_35=_$miniLegacyUmd_35.exports;var __Plugin_173=_$lib_104.Plugin,_$lib_173=(___temp_173=___class_173=function(r){var e,t;function n(e,t){var n;if((n=r.call(this,e,t)||this).onFileAdded=function(e){e.preview||!_$isPreviewSupported_215(e.type)||e.isRemote||n.addToQueue(e.id)},n.onCancelRequest=function(e){var t=n.queue.indexOf(e.id);-1!==t&&n.queue.splice(t,1)},n.onFileRemoved=function(e){var t=n.queue.indexOf(e.id);-1!==t&&n.queue.splice(t,1),e.preview&&_$isObjectURL_214(e.preview)&&URL.revokeObjectURL(e.preview)},n.onRestored=function(){var e=n.uppy.getState().files;Object.keys(e).forEach(function(e){var t=n.uppy.getFile(e);t.isRestored&&(t.preview&&!_$isObjectURL_214(t.preview)||n.addToQueue(t.id))})},n.waitUntilAllProcessed=function(e){e.forEach(function(e){var t=n.uppy.getFile(e);n.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:n.i18n("generatingThumbnails")})});function r(){e.forEach(function(e){var t=n.uppy.getFile(e);n.uppy.emit("preprocess-complete",t)})}return new Promise(function(e,t){n.queueProcessing?n.uppy.once("thumbnail:all-generated",function(){r(),e()}):(r(),e())})},n.type="modifier",n.id=n.opts.id||"ThumbnailGenerator",n.title="Thumbnail Generator",n.queue=[],n.queueProcessing=!1,n.defaultThumbnailDimension=200,n.defaultLocale={strings:{generatingThumbnails:"Generating thumbnails..."}},n.opts=___extends_173({},{thumbnailWidth:null,thumbnailHeight:null,waitForThumbnailsBeforeUpload:!1,lazy:!1},{},t),n.opts.lazy&&n.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.");return n.i18nInit(),n}t=r,(e=n).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=n.prototype;return i.setOptions=function(e){r.prototype.setOptions.call(this,e),this.i18nInit()},i.i18nInit=function(){this.translator=new _$Translator_190([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},i.createThumbnail=function(e,s,a){var u=this,n=URL.createObjectURL(e.data),t=new Promise(function(e,t){var r=new Image;r.src=n,r.addEventListener("load",function(){URL.revokeObjectURL(n),e(r)}),r.addEventListener("error",function(e){URL.revokeObjectURL(n),t(e.error||new Error("Could not create thumbnail"))})}),r=_$miniLegacyUmd_35.rotation(e.data).catch(function(e){return 1});return Promise.all([t,r]).then(function(e){var t=e[0],r=e[1],n=u.getProportionalDimensions(t,s,a,r.deg),i=u.rotateImage(t,r),o=u.resizeImage(i,n.width,n.height);return u.canvasToBlob(o,"image/jpeg",80)}).then(function(e){return URL.createObjectURL(e)})},i.getProportionalDimensions=function(e,t,r,n){var i=e.width/e.height;return 90!==n&&270!==n||(i=e.height/e.width),null!=t?{width:t,height:Math.round(t/i)}:null!=r?{width:Math.round(r*i),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/i)}},i.protect=function(e){var t,r=e.width/e.height,n=Math.floor(Math.sqrt(5e6*r)),i=Math.floor(5e6/Math.sqrt(5e6*r));return 4096<n&&(n=4096,i=Math.round(n/r)),4096<i&&(i=4096,n=Math.round(r*i)),e.width>n&&((t=document.createElement("canvas")).width=n,t.height=i,t.getContext("2d").drawImage(e,0,0,n,i),e=t),e},i.resizeImage=function(e,t,r){e=this.protect(e);var n=Math.ceil(_$mathLog2_47(e.width/t));n<1&&(n=1);for(var i=t*Math.pow(2,n-1),o=r*Math.pow(2,n-1);n--;){var s=document.createElement("canvas");s.width=i,s.height=o,s.getContext("2d").drawImage(e,0,0,i,o),e=s,i=Math.round(i/2),o=Math.round(o/2)}return e},i.rotateImage=function(e,t){var r=e.width,n=e.height;90!==t.deg&&270!==t.deg||(r=e.height,n=e.width);var i=document.createElement("canvas");i.width=r,i.height=n;var o=i.getContext("2d");return o.translate(r/2,n/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),i},i.canvasToBlob=function(t,r,n){try{t.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return t.toBlob?new Promise(function(e){t.toBlob(e,r,n)}).then(function(e){if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e}):Promise.resolve().then(function(){return _$dataURItoBlob_192(t.toDataURL(r,n),{})}).then(function(e){if(null===e)throw new Error("could not extract blob, probably an old browser");return e})},i.setPreviewURL=function(e,t){this.uppy.setFileState(e,{preview:t})},i.addToQueue=function(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()},i.processQueue=function(){var e=this;if(this.queueProcessing=!0,0<this.queue.length){var t=this.uppy.getFile(this.queue.shift());return t?this.requestThumbnail(t).catch(function(e){}).then(function(){return e.processQueue()}):void this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error")}this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated")},i.requestThumbnail=function(t){var r=this;return _$isPreviewSupported_215(t.type)&&!t.isRemote?this.createThumbnail(t,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(function(e){r.setPreviewURL(t.id,e),r.uppy.log("[ThumbnailGenerator] Generated thumbnail for "+t.id),r.uppy.emit("thumbnail:generated",r.uppy.getFile(t.id),e)}).catch(function(e){r.uppy.log("[ThumbnailGenerator] Failed thumbnail for "+t.id+":","warning"),r.uppy.log(e,"warning"),r.uppy.emit("thumbnail:error",r.uppy.getFile(t.id),e)}):Promise.resolve()},i.install=function(){this.uppy.on("file-removed",this.onFileRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)},i.uninstall=function(){this.uppy.off("file-removed",this.onFileRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)},n}(__Plugin_173),___class_173.VERSION="1.6.2",___temp_173),_$findAllDOMElements_195=function(e){if("string"==typeof e){var t=[].slice.call(document.querySelectorAll(e));return 0<t.length?t:null}if("object"==typeof e&&_$isDOMElement_211(e))return[e]},_$toArray_220=function(e){return Array.prototype.slice.call(e||[],0)},_$getRelativePath_202=function(e){return e.fullPath&&e.fullPath!=="/"+e.name?e.fullPath:null},_$getFilesAndDirectoriesFromDirectory_201=function r(n,i,o,e){var s=e.onSuccess;n.readEntries(function(e){var t=[].concat(i,e);e.length?setTimeout(function(){r(n,t,o,{onSuccess:s})},0):s(t)},function(e){o(e),s(i)})},_$webkitGetAsEntryApi_203=function(e,i){var o=[],r=[];return _$toArray_220(e.items).forEach(function(e){var t=e.webkitGetAsEntry();t&&r.push(function n(t){return new Promise(function(r){var e;t.isFile?t.file(function(e){e.relativePath=_$getRelativePath_202(t),o.push(e),r()},function(e){i(e),r()}):t.isDirectory&&(e=t.createReader(),_$getFilesAndDirectoriesFromDirectory_201(e,[],i,{onSuccess:function(e){var t=e.map(n);Promise.all(t).then(function(){return r()})}}))})}(t))}),Promise.all(r).then(function(){return o})},_$fallbackApi_200=function(e){var t=_$toArray_220(e.files);return Promise.resolve(t)},_$getDroppedFiles_199=function(e,t){var r=(void 0===t?{}:t).logDropError,n=void 0===r?function(){}:r;return e.items&&e.items[0]&&"webkitGetAsEntry"in e.items[0]?_$webkitGetAsEntryApi_203(e,n):_$fallbackApi_200(e)},_$getActiveOverlayEl_125=function(e,t){if(t){var r=e.querySelector('[data-uppy-paneltype="'+t+'"]');if(r)return r}return e},_$FOCUSABLE_ELEMENTS_186=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function focusOnFirstNode(e,t){var r=t[0];r&&(r.focus(),e.preventDefault())}function trapFocus(e,t,r){var n,i,o=_$getActiveOverlayEl_125(r,t),s=_$toArray_220(o.querySelectorAll(_$FOCUSABLE_ELEMENTS_186)),a=s.indexOf(document.activeElement);o.contains(document.activeElement)?e.shiftKey&&0===a?(n=e,(i=s[s.length-1])&&(i.focus(),n.preventDefault())):e.shiftKey||a!==s.length-1||focusOnFirstNode(e,s):focusOnFirstNode(e,s)}var _$trapFocus_128={forModal:function(e,t,r){trapFocus(e,t,r)},forInline:function(e,t,r){null===t||trapFocus(e,t,r)}},_$ResizeObserver_59={exports:{}};(function(S){var e,t;e=this,t=function(){"use strict";function l(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e}function p(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||t}var n=function(){if("undefined"!=typeof Map)return Map;function n(e,r){var n=-1;return e.some(function(e,t){return e[0]===r&&(n=t,!0)}),n}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var t=n(this.__entries__,e),r=this.__entries__[t];return r&&r[1]},e.prototype.set=function(e,t){var r=n(this.__entries__,e);~r?this.__entries__[r][1]=t:this.__entries__.push([e,t])},e.prototype.delete=function(e){var t=this.__entries__,r=n(t,e);~r&&t.splice(r,1)},e.prototype.has=function(e){return!!~n(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var r=0,n=this.__entries__;r<n.length;r++){var i=n[r];e.call(t,i[1],i[0])}},e;function e(){this.__entries__=[]}}(),i="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,t=void 0!==S&&S.Math===Math?S:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),u="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(t):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},o=["top","right","bottom","left","width","height","size","weight"],e="undefined"!=typeof MutationObserver,s=(r.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},r.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},r.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),0<e.length},r.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),e?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},r.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},r.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;o.some(function(e){return!!~r.indexOf(e)})&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r),d=f(0,0,0,0);function r(){function e(){o&&(o=!1,n()),s&&r()}function t(){u(e)}function r(){var e=Date.now();if(o){if(e-a<2)return;s=!0}else s=!(o=!0),setTimeout(t,i);a=e}var n,i,o,s,a;this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=(n=this.refresh.bind(this),s=o=!(i=20),a=0,r)}function h(e){return parseFloat(e)||0}function _(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(e,t){return e+h(r["border-"+t+"-width"])},0)}var a="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof p(e).SVGGraphicsElement}:function(e){return e instanceof p(e).SVGElement&&"function"==typeof e.getBBox};function f(e,t,r,n){return{x:e,y:t,width:r,height:n}}function c(e,t){var r,n,i,o,s,a,u=(r=t.x,n=t.y,i=t.width,o=t.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(s.prototype),l(a,{x:r,y:n,width:i,height:o,top:n,right:r+i,bottom:o+n,left:r}),a);l(this,{target:e,contentRect:u})}function g(e){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=s.getInstance(),r=new m(e,t,this);v.set(this,r)}var y=(w.prototype.isActive=function(){var e,t,r=(e=this.target,i?a(e)?f(0,0,(t=e.getBBox()).width,t.height):function(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return d;var n,i,o=p(e).getComputedStyle(e),s=function(e){for(var t={},r=0,n=["top","right","bottom","left"];r<n.length;r++){var i=n[r],o=e["padding-"+i];t[i]=h(o)}return t}(o),a=s.left+s.right,u=s.top+s.bottom,l=h(o.width),c=h(o.height);return"border-box"===o.boxSizing&&(Math.round(l+a)!==t&&(l-=_(o,"left","right")+a),Math.round(c+u)!==r&&(c-=_(o,"top","bottom")+u)),e!==p(e).document.documentElement&&(n=Math.round(l+a)-t,i=Math.round(c+u)-r,1!==Math.abs(n)&&(l-=n),1!==Math.abs(i)&&(c-=i)),f(s.left,s.top,l,c)}(e):d);return(this.contentRect_=r).width!==this.broadcastWidth||r.height!==this.broadcastHeight},w.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},w),m=(b.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof p(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new y(e)),this.controller_.addObserver(this),this.controller_.refresh())}},b.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof p(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},b.prototype.broadcastActive=function(){var e,t;this.hasActive()&&(e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new c(e.target,e.broadcastRect())}),this.callback_.call(e,t,e),this.clearActive())},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return 0<this.activeObservations_.length},b),v=new("undefined"!=typeof WeakMap?WeakMap:n);function b(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}function w(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=f(0,0,0,0),this.target=e}return["observe","unobserve","disconnect"].forEach(function(t){g.prototype[t]=function(){var e;return(e=v.get(this))[t].apply(e,arguments)}}),void 0!==t.ResizeObserver?t.ResizeObserver:g},"object"==typeof _$ResizeObserver_59.exports?_$ResizeObserver_59.exports=t():"function"==typeof define&&define.amd?define(t):e.ResizeObserver=t()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$ResizeObserver_59=_$ResizeObserver_59.exports;var _$lodashDebounce_45={};(function(e){function m(){return n.Date.now()}var i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt,t="object"==typeof e&&e&&e.Object===Object&&e,r="object"==typeof self&&self&&self.Object===Object&&self,n=t||r||Function("return this")(),l=Object.prototype.toString,v=Math.max,b=Math.min;function w(e){var t=typeof e;return e&&("object"==t||"function"==t)}function S(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return NaN;var t,r;if(w(e)&&(e=w(r="function"==typeof e.valueOf?e.valueOf():e)?r+"":r),"string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||a.test(e)?u(e.slice(2),n?2:8):o.test(e)?NaN:+e}_$lodashDebounce_45=function(n,i,e){var o,s,r,a,u,l,c=0,p=!1,d=!1,t=!0;if("function"!=typeof n)throw new TypeError("Expected a function");function h(e){var t=o,r=s;return o=s=void 0,c=e,a=n.apply(r,t)}function _(e){var t=e-l;return void 0===l||i<=t||t<0||d&&r<=e-c}function f(){var e,t=m();if(_(t))return g(t);u=setTimeout(f,(e=i-(t-l),d?b(e,r-(t-c)):e))}function g(e){return u=void 0,t&&o?h(e):(o=s=void 0,a)}function y(){var e,t=m(),r=_(t);if(o=arguments,s=this,l=t,r){if(void 0===u)return c=e=l,u=setTimeout(f,i),p?h(e):a;if(d)return u=setTimeout(f,i),h(l)}return void 0===u&&(u=setTimeout(f,i)),a}return i=S(i)||0,w(e)&&(p=!!e.leading,r=(d="maxWait"in e)?v(S(e.maxWait)||0,i):r,t="trailing"in e?!!e.trailing:t),y.cancel=function(){void 0!==u&&clearTimeout(u),o=l=s=u=void(c=0)},y.flush=function(){return void 0===u?a:g(m())},y}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var _$createSuperFocus_124=function(){var s=!1;return _$lodashDebounce_45(function(e,t){var r,n,i=_$getActiveOverlayEl_125(e,t),o=i.contains(document.activeElement);o&&s||(r=i.querySelector("[data-uppy-super-focusable]"),o&&!r||(s=r?(r.focus({preventScroll:!0}),!0):((n=i.querySelector(_$FOCUSABLE_ELEMENTS_186))&&n.focus({preventScroll:!0}),!1)))},260)};function areInputsEqual(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}var _$memoizeOneCjs_48=function(r,n){var i;void 0===n&&(n=areInputsEqual);var o,s=[],a=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a&&i===this&&n(e,s)||(o=r.apply(this,e),a=!0,i=this,s=e),o}},___class_122,___temp_122;function ___extends_122(){return(___extends_122=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_122(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_122=_$lib_104.Plugin,ResizeObserver=_$ResizeObserver_59.default||_$ResizeObserver_59,memoize=_$memoizeOneCjs_48.default||_$memoizeOneCjs_48,TAB_KEY=9,ESC_KEY=27;function createPromise(){var r={};return r.promise=new Promise(function(e,t){r.resolve=e,r.reject=t}),r}function defaultPickerIcon(){return h("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},h("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var _$lib_122=(afa=__Plugin_122,cfa=afa,(bfa=dfa).prototype=Object.create(cfa.prototype),(bfa.prototype.constructor=bfa).__proto__=cfa,___temp_122=___class_122=dfa,___class_122.VERSION="1.10.1",___temp_122),___class_131,___temp_131,afa,bfa,cfa;function dfa(e,t){var b;(b=afa.call(this,e,t)||this).setOptions=function(e){afa.prototype.setOptions.call(___assertThisInitialized_122(b),e),b.i18nInit()},b.i18nInit=function(){b.translator=new _$Translator_190([b.defaultLocale,b.uppy.locale,b.opts.locale]),b.i18n=b.translator.translate.bind(b.translator),b.i18nArray=b.translator.translateArray.bind(b.translator),b.setPluginState()},b.removeTarget=function(t){var e=b.getPluginState().targets.filter(function(e){return e.id!==t.id});b.setPluginState({targets:e})},b.addTarget=function(e){var t=e.id||e.constructor.name,r=e.title||t,n=e.type;if("acquirer"===n||"progressindicator"===n||"presenter"===n){var i={id:t,name:r,type:n},o=b.getPluginState().targets.slice();return o.push(i),b.setPluginState({targets:o}),b.el}b.uppy.log("Dashboard: Modal can only be used by plugins of types: acquirer, progressindicator, presenter","error")},b.hideAllPanels=function(){var e={activePickerPanel:!1,showAddFilesPanel:!1,activeOverlayType:null},t=b.getPluginState();t.activePickerPanel===e.activePickerPanel&&t.showAddFilesPanel===e.showAddFilesPanel&&t.activeOverlayType===e.activeOverlayType||b.setPluginState(e)},b.showPanel=function(t){var e=b.getPluginState().targets.filter(function(e){return"acquirer"===e.type&&e.id===t})[0];b.setPluginState({activePickerPanel:e,activeOverlayType:"PickerPanel"})},b.openModal=function(){var e=createPromise(),t=e.promise,r=e.resolve;return b.savedScrollPosition=window.pageYOffset,b.savedActiveElement=document.activeElement,b.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),b.opts.animateOpenClose&&b.getPluginState().isClosing?b.el.addEventListener("animationend",function e(){b.setPluginState({isHidden:!1}),b.el.removeEventListener("animationend",e,!1),r()},!1):(b.setPluginState({isHidden:!1}),r()),b.opts.browserBackButtonClose&&b.updateBrowserHistory(),document.addEventListener("keydown",b.handleKeyDownInModal),b.uppy.emit("dashboard:modal-open"),t},b.closeModal=function(e){void 0===e&&(e={});var t=e.manualClose,r=void 0===t||t,n=b.getPluginState(),i=n.isHidden,o=n.isClosing;if(!i&&!o){var s=createPromise(),a=s.promise,u=s.resolve;return b.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),b.opts.animateOpenClose?(b.setPluginState({isClosing:!0}),b.el.addEventListener("animationend",function e(){b.setPluginState({isHidden:!0,isClosing:!1}),b.superFocus.cancel(),b.savedActiveElement.focus(),b.el.removeEventListener("animationend",e,!1),u()},!1)):(b.setPluginState({isHidden:!0}),b.superFocus.cancel(),b.savedActiveElement.focus(),u()),document.removeEventListener("keydown",b.handleKeyDownInModal),r&&b.opts.browserBackButtonClose&&history.state&&history.state[b.modalName]&&history.go(-1),b.uppy.emit("dashboard:modal-closed"),a}},b.isModalOpen=function(){return!b.getPluginState().isHidden||!1},b.requestCloseModal=function(){return b.opts.onRequestCloseModal?b.opts.onRequestCloseModal():b.closeModal()},b.setDarkModeCapability=function(e){var t=b.uppy.getState().capabilities;b.uppy.setState({capabilities:___extends_122({},t,{darkMode:e})})},b.handleSystemDarkModeChange=function(e){var t=e.matches;b.uppy.log("[Dashboard] Dark mode is "+(t?"on":"off")),b.setDarkModeCapability(t)},b.toggleFileCard=function(e){e?b.uppy.emit("dashboard:file-edit-start"):b.uppy.emit("dashboard:file-edit-complete"),b.setPluginState({fileCardFor:e||null,activeOverlayType:e?"FileCard":null})},b.toggleAddFilesPanel=function(e){b.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})},b.addFiles=function(e){var t=e.map(function(e){return{source:b.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}});try{b.uppy.addFiles(t)}catch(e){b.uppy.log(e)}},b.startListeningToResize=function(){b.resizeObserver=new ResizeObserver(function(e,t){var r=e[0].contentRect,n=r.width,i=r.height;b.uppy.log("[Dashboard] resized: "+n+" / "+i,"debug"),b.setPluginState({containerWidth:n,containerHeight:i,areInsidesReadyToBeVisible:!0})}),b.resizeObserver.observe(b.el.querySelector(".uppy-Dashboard-inner")),b.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(function(){var e=b.getPluginState(),t=!b.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(b.uppy.log("[Dashboard] resize event didn't fire on time: defaulted to mobile layout","debug"),b.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},b.stopListeningToResize=function(){b.resizeObserver.disconnect(),clearTimeout(b.makeDashboardInsidesVisibleAnywayTimeout)},b.recordIfFocusedOnUppyRecently=function(e){b.el.contains(e.target)?b.ifFocusedOnUppyRecently=!0:(b.ifFocusedOnUppyRecently=!1,b.superFocus.cancel())},b.updateBrowserHistory=function(){var e;history.state&&history.state[b.modalName]||history.pushState(___extends_122({},history.state,((e={})[b.modalName]=!0,e)),""),window.addEventListener("popstate",b.handlePopState,!1)},b.handlePopState=function(e){!b.isModalOpen()||e.state&&e.state[b.modalName]||b.closeModal({manualClose:!1}),!b.isModalOpen()&&e.state&&e.state[b.modalName]&&history.go(-1)},b.handleKeyDownInModal=function(e){e.keyCode===ESC_KEY&&b.requestCloseModal(e),e.keyCode===TAB_KEY&&_$trapFocus_128.forModal(e,b.getPluginState().activeOverlayType,b.el)},b.handleClickOutside=function(){b.opts.closeModalOnClickOutside&&b.requestCloseModal()},b.handlePaste=function(t){b.uppy.iteratePlugins(function(e){"acquirer"===e.type&&e.handleRootPaste&&e.handleRootPaste(t)});var e=_$toArray_220(t.clipboardData.files);b.addFiles(e)},b.handleInputChange=function(e){e.preventDefault();var t=_$toArray_220(e.target.files);b.addFiles(t)},b.handleDragOver=function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",clearTimeout(b.removeDragOverClassTimeout),b.setPluginState({isDraggingOver:!0})},b.handleDragLeave=function(e){e.preventDefault(),e.stopPropagation(),clearTimeout(b.removeDragOverClassTimeout),b.removeDragOverClassTimeout=setTimeout(function(){b.setPluginState({isDraggingOver:!1})},50)},b.handleDrop=function(t,e){t.preventDefault(),t.stopPropagation(),clearTimeout(b.removeDragOverClassTimeout),b.setPluginState({isDraggingOver:!1}),b.uppy.iteratePlugins(function(e){"acquirer"===e.type&&e.handleRootDrop&&e.handleRootDrop(t)});var r=!1;_$getDroppedFiles_199(t.dataTransfer,{logDropError:function(e){b.uppy.log(e,"error"),r||(b.uppy.info(e.message,"error"),r=!0)}}).then(function(e){0<e.length&&(b.uppy.log("[Dashboard] Files were dropped"),b.addFiles(e))})},b.handleRequestThumbnail=function(e){b.opts.waitForThumbnailsBeforeUpload||b.uppy.emit("thumbnail:request",e)},b.handleCancelThumbnail=function(e){b.opts.waitForThumbnailsBeforeUpload||b.uppy.emit("thumbnail:cancel",e)},b.handleKeyDownInInline=function(e){e.keyCode===TAB_KEY&&_$trapFocus_128.forInline(e,b.getPluginState().activeOverlayType,b.el)},b.handlePasteOnBody=function(e){b.el.contains(document.activeElement)&&b.handlePaste(e)},b.handleComplete=function(e){var t=e.failed;e.uploadID,b.opts.closeAfterFinish&&0===t.length&&b.requestCloseModal()},b.initEvents=function(){var e;b.opts.trigger&&!b.opts.inline&&((e=_$findAllDOMElements_195(b.opts.trigger))?e.forEach(function(e){return e.addEventListener("click",b.openModal)}):b.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")),b.startListeningToResize(),document.addEventListener("paste",b.handlePasteOnBody),b.uppy.on("plugin-remove",b.removeTarget),b.uppy.on("file-added",b.hideAllPanels),b.uppy.on("dashboard:modal-closed",b.hideAllPanels),b.uppy.on("complete",b.handleComplete),document.addEventListener("focus",b.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",b.recordIfFocusedOnUppyRecently,!0),b.opts.inline&&b.el.addEventListener("keydown",b.handleKeyDownInInline)},b.removeEvents=function(){var e=_$findAllDOMElements_195(b.opts.trigger);!b.opts.inline&&e&&e.forEach(function(e){return e.removeEventListener("click",b.openModal)}),b.stopListeningToResize(),document.removeEventListener("paste",b.handlePasteOnBody),window.removeEventListener("popstate",b.handlePopState,!1),b.uppy.off("plugin-remove",b.removeTarget),b.uppy.off("file-added",b.hideAllPanels),b.uppy.off("dashboard:modal-closed",b.hideAllPanels),b.uppy.off("complete",b.handleComplete),document.removeEventListener("focus",b.recordIfFocusedOnUppyRecently),document.removeEventListener("click",b.recordIfFocusedOnUppyRecently),b.opts.inline&&b.el.removeEventListener("keydown",b.handleKeyDownInInline)},b.superFocusOnEachUpdate=function(){var e=b.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,r=b.uppy.getState().info.isHidden,n=!b.opts.inline;r&&(n||e||t&&b.ifFocusedOnUppyRecently)?b.superFocus(b.el,b.getPluginState().activeOverlayType):b.superFocus.cancel()},b.afterUpdate=function(){b.superFocusOnEachUpdate()},b.cancelUpload=function(e){b.uppy.removeFile(e)},b.saveFileCard=function(e,t){b.uppy.setFileMeta(t,e),b.toggleFileCard()},b._attachRenderFunctionToTarget=function(e){var t=b.uppy.getPlugin(e.id);return ___extends_122({},e,{icon:t.icon||b.opts.defaultPickerIcon,render:t.render})},b._isTargetSupported=function(e){var t=b.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()},b._getAcquirers=memoize(function(e){return e.filter(function(e){return"acquirer"===e.type&&b._isTargetSupported(e)}).map(b._attachRenderFunctionToTarget)}),b._getProgressIndicators=memoize(function(e){return e.filter(function(e){return"progressindicator"===e.type}).map(b._attachRenderFunctionToTarget)}),b.render=function(e){var t=b.getPluginState(),r=e.files,n=e.capabilities,i=e.allowNewUpload,o=Object.keys(r).filter(function(e){return!r[e].progress.uploadStarted}),s=Object.keys(r).filter(function(e){return r[e].progress.uploadStarted}),a=Object.keys(r).filter(function(e){return r[e].isPaused}),u=Object.keys(r).filter(function(e){return r[e].progress.uploadComplete}),l=Object.keys(r).filter(function(e){return r[e].error}),c=Object.keys(r).filter(function(e){return!r[e].progress.uploadComplete&&r[e].progress.uploadStarted}),p=c.filter(function(e){return!r[e].isPaused}),d=Object.keys(r).filter(function(e){return r[e].progress.preprocess||r[e].progress.postprocess}),h=0<s.length,_=100===e.totalProgress&&u.length===Object.keys(r).length&&0===d.length,f=h&&l.length===s.length,g=0!==c.length&&a.length===c.length,y=b._getAcquirers(t.targets),m=b._getProgressIndicators(t.targets),v="auto"===b.opts.theme?n.darkMode?"dark":"light":b.opts.theme;return _$Dashboard_110({state:e,isHidden:t.isHidden,files:r,newFiles:o,uploadStartedFiles:s,completeFiles:u,erroredFiles:l,inProgressFiles:c,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:h,isAllComplete:_,isAllErrored:f,isAllPaused:g,totalFileCount:Object.keys(r).length,totalProgress:e.totalProgress,allowNewUpload:i,acquirers:y,theme:v,activePickerPanel:t.activePickerPanel,animateOpenClose:b.opts.animateOpenClose,isClosing:t.isClosing,getPlugin:b.uppy.getPlugin,progressindicators:m,autoProceed:b.uppy.opts.autoProceed,id:b.id,closeModal:b.requestCloseModal,handleClickOutside:b.handleClickOutside,handleInputChange:b.handleInputChange,handlePaste:b.handlePaste,inline:b.opts.inline,showPanel:b.showPanel,hideAllPanels:b.hideAllPanels,log:b.uppy.log,i18n:b.i18n,i18nArray:b.i18nArray,removeFile:b.uppy.removeFile,info:b.uppy.info,note:b.opts.note,metaFields:t.metaFields,resumableUploads:n.resumableUploads||!1,individualCancellation:n.individualCancellation,isMobileDevice:n.isMobileDevice,pauseUpload:b.uppy.pauseResume,retryUpload:b.uppy.retryUpload,cancelUpload:b.cancelUpload,cancelAll:b.uppy.cancelAll,fileCardFor:t.fileCardFor,toggleFileCard:b.toggleFileCard,toggleAddFilesPanel:b.toggleAddFilesPanel,showAddFilesPanel:t.showAddFilesPanel,saveFileCard:b.saveFileCard,width:b.opts.width,height:b.opts.height,showLinkToFileUploadResult:b.opts.showLinkToFileUploadResult,proudlyDisplayPoweredByUppy:b.opts.proudlyDisplayPoweredByUppy,hideCancelButton:b.opts.hideCancelButton,hideRetryButton:b.opts.hideRetryButton,hidePauseResumeButton:b.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:b.opts.showRemoveButtonAfterComplete,containerWidth:t.containerWidth,containerHeight:t.containerHeight,areInsidesReadyToBeVisible:t.areInsidesReadyToBeVisible,isTargetDOMEl:b.isTargetDOMEl,parentElement:b.el,allowedFileTypes:b.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:b.uppy.opts.restrictions.maxNumberOfFiles,showSelectedFiles:b.opts.showSelectedFiles,handleRequestThumbnail:b.handleRequestThumbnail,handleCancelThumbnail:b.handleCancelThumbnail,isDraggingOver:t.isDraggingOver,handleDragOver:b.handleDragOver,handleDragLeave:b.handleDragLeave,handleDrop:b.handleDrop})},b.discoverProviderPlugins=function(){b.uppy.iteratePlugins(function(e){e&&!e.target&&e.opts&&e.opts.target===b.constructor&&b.addTarget(e)})},b.install=function(){b.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:!1,metaFields:b.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});var e=b.opts,t=e.inline,r=e.closeAfterFinish;if(t&&r)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");b.uppy.opts.allowMultipleUploads&&r&&b.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploads` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");var n=b.opts.target;n&&b.mount(n,___assertThisInitialized_122(b)),(b.opts.plugins||[]).forEach(function(e){var t=b.uppy.getPlugin(e);t&&t.mount(___assertThisInitialized_122(b),t)}),b.opts.disableStatusBar||b.uppy.use(_$lib_169,{id:b.id+":StatusBar",target:___assertThisInitialized_122(b),hideUploadButton:b.opts.hideUploadButton,hideRetryButton:b.opts.hideRetryButton,hidePauseResumeButton:b.opts.hidePauseResumeButton,hideCancelButton:b.opts.hideCancelButton,showProgressDetails:b.opts.showProgressDetails,hideAfterFinish:b.opts.hideProgressAfterFinish,locale:b.opts.locale}),b.opts.disableInformer||b.uppy.use(_$lib_143,{id:b.id+":Informer",target:___assertThisInitialized_122(b)}),b.opts.disableThumbnailGenerator||b.uppy.use(_$lib_173,{id:b.id+":ThumbnailGenerator",thumbnailWidth:b.opts.thumbnailWidth,waitForThumbnailsBeforeUpload:b.opts.waitForThumbnailsBeforeUpload,lazy:!b.opts.waitForThumbnailsBeforeUpload}),b.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;var i=!!b.darkModeMediaQuery&&b.darkModeMediaQuery.matches;b.uppy.log("[Dashboard] Dark mode is "+(i?"on":"off")),b.setDarkModeCapability(i),"auto"===b.opts.theme&&b.darkModeMediaQuery.addListener(b.handleSystemDarkModeChange),b.discoverProviderPlugins(),b.initEvents()},b.uninstall=function(){var e,t,r;b.opts.disableInformer||(e=b.uppy.getPlugin(b.id+":Informer"))&&b.uppy.removePlugin(e),b.opts.disableStatusBar||(t=b.uppy.getPlugin(b.id+":StatusBar"))&&b.uppy.removePlugin(t),b.opts.disableThumbnailGenerator||(r=b.uppy.getPlugin(b.id+":ThumbnailGenerator"))&&b.uppy.removePlugin(r),(b.opts.plugins||[]).forEach(function(e){var t=b.uppy.getPlugin(e);t&&t.unmount()}),"auto"===b.opts.theme&&b.darkModeMediaQuery.removeListener(b.handleSystemDarkModeChange),b.unmount(),b.removeEvents()},b.id=b.opts.id||"Dashboard",b.title="Dashboard",b.type="orchestrator",b.modalName="uppy-Dashboard-"+_$cuid_13();var r={target:"body",metaFields:[],trigger:"#uppy-select-files",inline:!(b.defaultLocale={strings:{closeModal:"Close Modal",importFrom:"Import from %{name}",addingMoreFiles:"Adding more files",addMoreFiles:"Add more files",dashboardWindowTitle:"File Uploader Window (Press escape to close)",dashboardTitle:"File Uploader",copyLinkToClipboardSuccess:"Link copied to clipboard",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",fileSource:"File source: %{name}",done:"Done",back:"Back",addMore:"Add more",removeFile:"Remove file",editFile:"Edit file",editing:"Editing %{file}",finishEditingFile:"Finish editing file",saveChanges:"Save changes",cancel:"Cancel",myDevice:"My Device",dropPaste:"Drop files here, paste or %{browse}",dropPasteImport:"Drop files here, paste, %{browse} or import from:",dropHint:"Drop your files here",browse:"browse",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy2:"%{backwardsCompat} %{uppy}",poweredBy:"Powered by"}}),width:750,height:550,thumbnailWidth:280,waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:defaultPickerIcon,showLinkToFileUploadResult:!0,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:function(){return b.closeModal()},showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,theme:"light"};return b.opts=___extends_122({},r,{},t),b.i18nInit(),b.superFocus=_$createSuperFocus_124(),b.ifFocusedOnUppyRecently=!1,b.makeDashboardInsidesVisibleAnywayTimeout=null,b.removeDragOverClassTimeout=null,b}function ___extends_131(){return(___extends_131=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_131(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_131=_$lib_104.Plugin,__h_131=_$preact_54.h,_$lib_131=(___temp_131=___class_131=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).type="acquirer",r.id=r.opts.id||"DragDrop",r.title="Drag & Drop",r.defaultLocale={strings:{dropHereOr:"Drop files here or %{browse}",browse:"browse"}},r.opts=___extends_131({},{target:null,inputName:"files[]",width:"100%",height:"100%",note:null},{},t),r.isDragDropSupported=_$isDragDropSupported_212(),r.removeDragOverClassTimeout=null,r.i18nInit(),r.onInputChange=r.onInputChange.bind(___assertThisInitialized_131(r)),r.handleDragOver=r.handleDragOver.bind(___assertThisInitialized_131(r)),r.handleDragLeave=r.handleDragLeave.bind(___assertThisInitialized_131(r)),r.handleDrop=r.handleDrop.bind(___assertThisInitialized_131(r)),r.addFiles=r.addFiles.bind(___assertThisInitialized_131(r)),r.render=r.render.bind(___assertThisInitialized_131(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.setOptions=function(e){n.prototype.setOptions.call(this,e),this.i18nInit()},i.i18nInit=function(){this.translator=new _$Translator_190([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},i.addFiles=function(e){var t=this,r=e.map(function(e){return{source:t.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}});try{this.uppy.addFiles(r)}catch(e){this.uppy.log(e)}},i.onInputChange=function(e){this.uppy.log("[DragDrop] Files selected through input");var t=_$toArray_220(e.target.files);this.addFiles(t),e.target.value=null},i.handleDrop=function(e,t){var r=this;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.log("[DragDrop] Files were dropped"),_$getDroppedFiles_199(e.dataTransfer,{logDropError:function(e){r.uppy.log(e,"error")}}).then(function(e){return r.addFiles(e)})},i.handleDragOver=function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0})},i.handleDragLeave=function(e){var t=this;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(function(){t.setPluginState({isDraggingOver:!1})},50)},i.renderHiddenFileInput=function(){var t=this,e=this.uppy.opts.restrictions;return __h_131("input",{class:"uppy-DragDrop-input",type:"file",hidden:!0,ref:function(e){t.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes,onchange:this.onInputChange})},i.renderArrowSvg=function(){return __h_131("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},__h_131("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0","fill-rule":"evenodd"}))},i.renderLabel=function(){return __h_131("div",{class:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:__h_131("span",{class:"uppy-DragDrop-browse"},this.i18n("browse"))}))},i.renderNote=function(){return __h_131("span",{class:"uppy-DragDrop-note"},this.opts.note)},i.render=function(e){var t=this,r="uppy-Root\n uppy-u-reset\n uppy-DragDrop-container\n "+(this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":"")+"\n "+(this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":"")+"\n ",n={width:this.opts.width,height:this.opts.height};return __h_131("button",{type:"button",class:r,style:n,onClick:function(){return t.fileInputRef.click()},onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),__h_131("div",{class:"uppy-DragDrop-inner"},this.renderArrowSvg(),this.renderLabel(),this.renderNote()))},i.install=function(){this.setPluginState({isDraggingOver:!1});var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},r}(__Plugin_131),___class_131.VERSION="1.4.15",___temp_131),___class_134,___temp_134;function ___extends_134(){return(___extends_134=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_134(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_134=_$lib_104.Plugin,__h_134=_$preact_54.h,_$lib_134=(___temp_134=___class_134=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).id=r.opts.id||"FileInput",r.title="File Input",r.type="acquirer",r.defaultLocale={strings:{chooseFiles:"Choose files"}},r.opts=___extends_134({},{target:null,pretty:!0,inputName:"files[]"},{},t),r.i18nInit(),r.render=r.render.bind(___assertThisInitialized_134(r)),r.handleInputChange=r.handleInputChange.bind(___assertThisInitialized_134(r)),r.handleClick=r.handleClick.bind(___assertThisInitialized_134(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.setOptions=function(e){n.prototype.setOptions.call(this,e),this.i18nInit()},i.i18nInit=function(){this.translator=new _$Translator_190([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},i.addFiles=function(e){var t=this,r=e.map(function(e){return{source:t.id,name:e.name,type:e.type,data:e}});try{this.uppy.addFiles(r)}catch(e){this.uppy.log(e)}},i.handleInputChange=function(e){this.uppy.log("[FileInput] Something selected through input...");var t=_$toArray_220(e.target.files);this.addFiles(t),e.target.value=null},i.handleClick=function(e){this.input.click()},i.render=function(e){var t=this,r=this.uppy.opts.restrictions,n=r.allowedFileTypes?r.allowedFileTypes.join(","):null;return __h_134("div",{class:"uppy-Root uppy-FileInput-container"},__h_134("input",{class:"uppy-FileInput-input",style:this.opts.pretty&&{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},type:"file",name:this.opts.inputName,onchange:this.handleInputChange,multiple:1!==r.maxNumberOfFiles,accept:n,ref:function(e){t.input=e}}),this.opts.pretty&&__h_134("button",{class:"uppy-FileInput-btn",type:"button",onclick:this.handleClick},this.i18n("chooseFiles")))},i.install=function(){var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},r}(__Plugin_134),___class_134.VERSION="1.4.13",___temp_134),___class_146,___temp_146;function ___extends_146(){return(___extends_146=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __Plugin_146=_$lib_104.Plugin,__h_146=_$preact_54.h,_$lib_146=(___temp_146=___class_146=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).id=r.opts.id||"ProgressBar",r.title="Progress Bar",r.type="progressindicator",r.opts=___extends_146({},{target:"body",replaceTargetContent:!1,fixed:!1,hideAfterFinish:!0},t),r.render=r.render.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.render=function(e){var t=e.totalProgress||0,r=(0===t||100===t)&&this.opts.hideAfterFinish;return __h_146("div",{class:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":r},__h_146("div",{class:"uppy-ProgressBar-inner",style:{width:t+"%"}}),__h_146("div",{class:"uppy-ProgressBar-percentage"},t))},i.install=function(){var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},r}(__Plugin_146),___class_146.VERSION="1.3.15",___temp_146),___class_132,___temp_132;function ___assertThisInitialized_132(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_132=_$lib_104.Plugin,__Provider_132=_$lib_101.Provider,__h_132=_$preact_54.h,_$lib_132=(___temp_132=___class_132=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).id=r.opts.id||"Dropbox",__Provider_132.initPlugin(___assertThisInitialized_132(r),t),r.title=r.opts.title||"Dropbox",r.icon=function(){return __h_132("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},__h_132("g",{fill:"none","fill-rule":"evenodd"},__h_132("rect",{fill:"#0D2481",width:"32",height:"32",rx:"16"}),__h_132("path",{d:"M11 8l5 3.185-5 3.186-5-3.186L11 8zm10 0l5 3.185-5 3.186-5-3.186L21 8zM6 17.556l5-3.185 5 3.185-5 3.186-5-3.186zm15-3.185l5 3.185-5 3.186-5-3.186 5-3.185zm-10 7.432l5-3.185 5 3.185-5 3.186-5-3.186z",fill:"#FFF","fill-rule":"nonzero"})))},r.provider=new __Provider_132(e,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,provider:"dropbox",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(___assertThisInitialized_132(r)),r.render=r.render.bind(___assertThisInitialized_132(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.install=function(){this.view=new _$lib_158(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.view.tearDown(),this.unmount()},i.onFirstRender=function(){return this.view.getFolder()},i.render=function(e){return this.view.render(e)},r}(__Plugin_132),___class_132.VERSION="1.4.8",___temp_132),_$DriveProviderViews_141=(oja=_$lib_158,qja=oja,(pja=rja).prototype=Object.create(qja.prototype),(pja.prototype.constructor=pja).__proto__=qja,rja.prototype.toggleCheckbox=function(e,t){e.stopPropagation(),e.preventDefault(),t.custom.isTeamDrive||t.custom.isSharedDrive||oja.prototype.toggleCheckbox.call(this,e,t)},rja),___class_142,___temp_142,oja,pja,qja;function rja(){return oja.apply(this,arguments)||this}function ___assertThisInitialized_142(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_142=_$lib_104.Plugin,__Provider_142=_$lib_101.Provider,__h_142=_$preact_54.h,_$lib_142=(___temp_142=___class_142=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).id=r.opts.id||"GoogleDrive",r.title=r.opts.title||"Google Drive",__Provider_142.initPlugin(___assertThisInitialized_142(r),t),r.title=r.opts.title||"Google Drive",r.icon=function(){return __h_142("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},__h_142("g",{fill:"none","fill-rule":"evenodd"},__h_142("rect",{fill:"#4285F4",width:"32",height:"32",rx:"16"}),__h_142("path",{d:"M10.324 23.3l3-5.1H25l-3 5.1H10.324zM13 18.2l-3 5.1-3-5.1 5.839-9.924 2.999 5.1L13 18.2zm11.838-.276h-6L13 8h6l5.84 9.924h-.002z",fill:"#FFF"})))},r.provider=new __Provider_142(e,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,provider:"drive",authProvider:"google",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(___assertThisInitialized_142(r)),r.render=r.render.bind(___assertThisInitialized_142(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.install=function(){this.view=new _$DriveProviderViews_141(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.view.tearDown(),this.unmount()},i.onFirstRender=function(){return this.view.getFolder("root","/")},i.render=function(e){return this.view.render(e)},r}(__Plugin_142),___class_142.VERSION="1.5.8",___temp_142),___class_144,___temp_144;function ___assertThisInitialized_144(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_144=_$lib_104.Plugin,__Provider_144=_$lib_101.Provider,__h_144=_$preact_54.h,_$lib_144=(___temp_144=___class_144=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).id=r.opts.id||"Instagram",__Provider_144.initPlugin(___assertThisInitialized_144(r),t),r.title=r.opts.title||"Instagram",r.icon=function(){return __h_144("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},__h_144("g",{fill:"none","fill-rule":"evenodd"},__h_144("rect",{fill:"#E1306C",width:"32",height:"32",rx:"16"}),__h_144("path",{d:"M16 8.622c2.403 0 2.688.009 3.637.052.877.04 1.354.187 1.67.31.392.144.745.374 1.036.673.299.29.529.644.673 1.035.123.317.27.794.31 1.671.043.95.052 1.234.052 3.637s-.009 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.671a2.98 2.98 0 0 1-1.708 1.708c-.317.123-.794.27-1.671.31-.95.043-1.234.053-3.637.053s-2.688-.01-3.637-.053c-.877-.04-1.354-.187-1.671-.31a2.788 2.788 0 0 1-1.035-.673 2.788 2.788 0 0 1-.673-1.035c-.123-.317-.27-.794-.31-1.671-.043-.949-.052-1.234-.052-3.637s.009-2.688.052-3.637c.04-.877.187-1.354.31-1.67.144-.392.374-.745.673-1.036.29-.299.644-.529 1.035-.673.317-.123.794-.27 1.671-.31.95-.043 1.234-.052 3.637-.052zM16 7c-2.444 0-2.75.01-3.71.054-.959.044-1.613.196-2.185.419-.6.225-1.145.58-1.594 1.038-.458.45-.813.993-1.039 1.594-.222.572-.374 1.226-.418 2.184C7.01 13.25 7 13.556 7 16s.01 2.75.054 3.71c.044.959.196 1.613.419 2.185.226.6.58 1.145 1.038 1.594.45.458.993.813 1.594 1.038.572.223 1.227.375 2.184.419.96.044 1.267.054 3.711.054s2.75-.01 3.71-.054c.959-.044 1.613-.196 2.185-.419a4.602 4.602 0 0 0 2.632-2.632c.223-.572.375-1.226.419-2.184.044-.96.054-1.267.054-3.711s-.01-2.75-.054-3.71c-.044-.959-.196-1.613-.419-2.185A4.412 4.412 0 0 0 23.49 8.51a4.412 4.412 0 0 0-1.594-1.039c-.572-.222-1.226-.374-2.184-.418C18.75 7.01 18.444 7 16 7zm0 4.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9zm0 7.421a2.921 2.921 0 1 1 0-5.842 2.921 2.921 0 0 1 0 5.842zm4.875-6.671a1.125 1.125 0 1 1 0-2.25 1.125 1.125 0 0 1 0 2.25z",fill:"#FFF"})))},r.provider=new __Provider_144(e,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,provider:"instagram",authProvider:"instagram",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(___assertThisInitialized_144(r)),r.render=r.render.bind(___assertThisInitialized_144(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.install=function(){this.view=new _$lib_158(this,{provider:this.provider,viewType:"grid",showTitles:!1,showFilter:!1,showBreadcrumbs:!1});var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.view.tearDown(),this.unmount()},i.onFirstRender=function(){this.view.getFolder("recent")},i.render=function(e){return this.view.render(e)},r}(__Plugin_144),___class_144.VERSION="1.4.8",___temp_144),___class_145,___temp_145;function ___assertThisInitialized_145(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_145=_$lib_104.Plugin,__Provider_145=_$lib_101.Provider,__h_145=_$preact_54.h,_$lib_145=(___temp_145=___class_145=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).id=r.opts.id||"OneDrive",__Provider_145.initPlugin(___assertThisInitialized_145(r),t),r.title=r.opts.title||"OneDrive",r.icon=function(){return __h_145("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},__h_145("g",{fill:"none","fill-rule":"evenodd"},__h_145("rect",{width:"32",height:"32",rx:"16",fill:"#0262C0"}),__h_145("g",{fill:"#FFF","fill-rule":"nonzero"},__h_145("path",{d:"M24.157 22s1.492-.205 1.79-1.655a2.624 2.624 0 0 0 .03-.878c-.22-1.64-1.988-2.01-1.988-2.01s.307-1.765-1.312-2.69c-1.62-.925-3.1 0-3.1 0S18.711 13 16.366 13c-3.016 0-3.519 3.448-3.519 3.448S10 16.618 10 19.14c0 2.523 2.597 2.86 2.597 2.86h11.56z"}),__h_145("path",{d:"M9.421 19.246c0-2.197 1.606-3.159 2.871-3.472.44-1.477 1.654-3.439 4.135-3.439H16.445c1.721 0 2.79.823 3.368 1.476a3.99 3.99 0 0 1 1.147-.171h.01l.03.002C21.017 13.5 20.691 10 16.757 10c-2.69 0-3.639 2.345-3.639 2.345s-1.95-1.482-3.955.567c-1.028 1.052-.79 2.669-.79 2.669S6 15.824 6 18.412C6 20.757 8.452 21 8.452 21h1.372a3.77 3.77 0 0 1-.403-1.754z"}))))},r.provider=new __Provider_145(e,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,provider:"onedrive",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(___assertThisInitialized_145(r)),r.render=r.render.bind(___assertThisInitialized_145(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.install=function(){this.view=new _$lib_158(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.view.tearDown(),this.unmount()},i.onFirstRender=function(){return this.view.getFolder()},i.render=function(e){return this.view.render(e)},r}(__Plugin_145),___class_145.VERSION="1.1.8",___temp_145),___class_133,___temp_133;function ___assertThisInitialized_133(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_133=_$lib_104.Plugin,__Provider_133=_$lib_101.Provider,__h_133=_$preact_54.h,_$lib_133=(___temp_133=___class_133=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).id=r.opts.id||"Facebook",__Provider_133.initPlugin(___assertThisInitialized_133(r),t),r.title=r.opts.title||"Facebook",r.icon=function(){return __h_133("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},__h_133("g",{fill:"none","fill-rule":"evenodd"},__h_133("rect",{width:"32",height:"32",rx:"16",fill:"#3C5A99"}),__h_133("path",{d:"M17.842 26v-8.667h2.653l.398-3.377h-3.051v-2.157c0-.978.248-1.644 1.527-1.644H21V7.132A19.914 19.914 0 0 0 18.623 7c-2.352 0-3.963 1.574-3.963 4.465v2.49H12v3.378h2.66V26h3.182z",fill:"#FFF","fill-rule":"nonzero"})))},r.provider=new __Provider_133(e,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,provider:"facebook",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(___assertThisInitialized_133(r)),r.render=r.render.bind(___assertThisInitialized_133(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.install=function(){this.view=new _$lib_158(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.view.tearDown(),this.unmount()},i.onFirstRender=function(){return this.view.getFolder()},i.render=function(e){var t={};return this.getPluginState().files.length&&!this.getPluginState().folders.length&&(t.viewType="grid",t.showFilter=!1,t.showTitles=!1),this.view.render(e,t)},r}(__Plugin_133),___class_133.VERSION="1.1.8",___temp_133);function ___assertThisInitialized_182(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __h_182=_$preact_54.h,UrlUI=function(r){var e,t;function n(e){var t;return(t=r.call(this,e)||this).handleKeyPress=t.handleKeyPress.bind(___assertThisInitialized_182(t)),t.handleClick=t.handleClick.bind(___assertThisInitialized_182(t)),t}t=r,(e=n).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=n.prototype;return i.componentDidMount=function(){this.input.value=""},i.handleKeyPress=function(e){13===e.keyCode&&this.props.addFile(this.input.value)},i.handleClick=function(){this.props.addFile(this.input.value)},i.render=function(){var t=this;return __h_182("div",{class:"uppy-Url"},__h_182("input",{class:"uppy-u-reset uppy-c-textInput uppy-Url-input",type:"text","aria-label":this.props.i18n("enterUrlToImport"),placeholder:this.props.i18n("enterUrlToImport"),onkeyup:this.handleKeyPress,ref:function(e){t.input=e},"data-uppy-super-focusable":!0}),__h_182("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Url-importButton",type:"button",onclick:this.handleClick},this.props.i18n("import")))},n}(_$preact_54.Component),_$UrlUI_182=UrlUI,_$forEachDroppedOrPastedUrl_184=function(e,t,r){var n,i=_$toArray_220(e.items);switch(t){case"paste":if(i.some(function(e){return"file"===e.kind}))return;n=i.filter(function(e){return"string"===e.kind&&"text/plain"===e.type});break;case"drop":n=i.filter(function(e){return"string"===e.kind&&"text/uri-list"===e.type});break;default:throw new Error("isDropOrPaste must be either 'drop' or 'paste', but it's "+t)}n.forEach(function(e){e.getAsString(function(e){return r(e)})})},___class_183,___temp_183;function ___extends_183(){return(___extends_183=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_183(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_183=_$lib_104.Plugin,__h_183=_$preact_54.h,__RequestClient_183=_$lib_101.RequestClient;function UrlIcon(){return __h_183("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},__h_183("g",{fill:"none","fill-rule":"evenodd"},__h_183("rect",{fill:"#FF753E",width:"32",height:"32",rx:"16"}),__h_183("path",{d:"M22.788 15.389l-2.199 2.19a3.184 3.184 0 0 1-.513.437c-.806.584-1.686.876-2.638.876a4.378 4.378 0 0 1-3.519-1.752c-.22-.292-.146-.802.147-1.021.293-.22.806-.146 1.026.146.953 1.313 2.785 1.532 4.105.583a.571.571 0 0 0 .293-.292l2.199-2.189c1.1-1.167 1.1-2.992-.073-4.086a2.976 2.976 0 0 0-4.105 0l-1.246 1.24a.71.71 0 0 1-1.026 0 .703.703 0 0 1 0-1.022l1.246-1.24a4.305 4.305 0 0 1 6.083 0c1.833 1.605 1.906 4.451.22 6.13zm-7.183 5.035l-1.246 1.24a2.976 2.976 0 0 1-4.105 0c-1.172-1.094-1.172-2.991-.073-4.086l2.2-2.19.292-.291c.66-.438 1.393-.657 2.2-.584.805.146 1.465.51 1.905 1.168.22.292.733.365 1.026.146.293-.22.367-.73.147-1.022-.733-.949-1.76-1.532-2.859-1.678-1.1-.22-2.272.073-3.225.802l-.44.438-2.199 2.19c-1.686 1.75-1.612 4.524.074 6.202.88.803 1.979 1.241 3.078 1.241 1.1 0 2.199-.438 3.079-1.24l1.246-1.241a.703.703 0 0 0 0-1.022c-.294-.292-.807-.365-1.1-.073z",fill:"#FFF","fill-rule":"nonzero"})))}var _$lib_183=(___temp_183=___class_183=function(n){var e,t;function r(e,t){var r;if((r=n.call(this,e,t)||this).id=r.opts.id||"Url",r.title=r.opts.title||"Link",r.type="acquirer",r.icon=function(){return __h_183(UrlIcon,null)},r.defaultLocale={strings:{import:"Import",enterUrlToImport:"Enter URL to import a file",failedToFetch:"Companion failed to fetch this URL, please make sure it’s correct",enterCorrectUrl:"Incorrect URL: Please make sure you are entering a direct link to a file"}},r.opts=___extends_183({},{},{},t),r.i18nInit(),r.hostname=r.opts.companionUrl,!r.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");return r.getMeta=r.getMeta.bind(___assertThisInitialized_183(r)),r.addFile=r.addFile.bind(___assertThisInitialized_183(r)),r.handleRootDrop=r.handleRootDrop.bind(___assertThisInitialized_183(r)),r.handleRootPaste=r.handleRootPaste.bind(___assertThisInitialized_183(r)),r.client=new __RequestClient_183(e,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders}),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.setOptions=function(e){n.prototype.setOptions.call(this,e),this.i18nInit()},i.i18nInit=function(){this.translator=new _$Translator_190([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},i.getFileNameFromUrl=function(e){return e.substring(e.lastIndexOf("/")+1)},i.checkIfCorrectURL=function(e){if(!e)return!1;var t=e.match(/^([a-z0-9]+):\/\//)[1];return"http"===t||"https"===t},i.addProtocolToURL=function(e){return/^[a-z0-9]+:\/\//.test(e)?e:"http://"+e},i.getMeta=function(e){var t=this;return this.client.post("url/meta",{url:e}).then(function(e){if(e.error)throw t.uppy.log("[URL] Error:"),t.uppy.log(e.error),new Error("Failed to fetch the file");return e})},i.addFile=function(t){var r=this;return t=this.addProtocolToURL(t),this.checkIfCorrectURL(t)?this.getMeta(t).then(function(e){return{source:r.id,name:r.getFileNameFromUrl(t),type:e.type,data:{size:e.size},isRemote:!0,body:{url:t},remote:{companionUrl:r.opts.companionUrl,url:r.hostname+"/url/get",body:{fileId:t,url:t},providerOptions:r.client.opts}}}).then(function(e){r.uppy.log("[Url] Adding remote file");try{r.uppy.addFile(e)}catch(e){e.isRestriction||r.uppy.log(e)}}).catch(function(e){r.uppy.log(e),r.uppy.info({message:r.i18n("failedToFetch"),details:e},"error",4e3)}):(this.uppy.log("[URL] Incorrect URL entered: "+t),void this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3))},i.handleRootDrop=function(e){var t=this;_$forEachDroppedOrPastedUrl_184(e.dataTransfer,"drop",function(e){t.uppy.log("[URL] Adding file from dropped url: "+e),t.addFile(e)})},i.handleRootPaste=function(e){var t=this;_$forEachDroppedOrPastedUrl_184(e.clipboardData,"paste",function(e){t.uppy.log("[URL] Adding file from pasted url: "+e),t.addFile(e)})},i.render=function(e){return __h_183(_$UrlUI_182,{i18n:this.i18n,addFile:this.addFile})},i.install=function(){var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},r}(__Plugin_183),___class_183.VERSION="1.5.7",___temp_183),mimeToExtensions={"audio/mp3":"mp3","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"},_$getFileTypeExtension_206=function(e){return e=e.replace(/;.*$/,""),mimeToExtensions[e]||null},_$canvasToBlob_191=function(t,r,n){return t.toBlob?new Promise(function(e){t.toBlob(e,r,n)}):Promise.resolve().then(function(){return _$dataURItoBlob_192(t.toDataURL(r,n),{})})},_$supportsMediaRecorder_229=function(){return"function"==typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"==typeof MediaRecorder.prototype.start},__h_221=_$preact_54.h,_$CameraIcon_221=function(e){return __h_221("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},__h_221("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z","fill-rule":"evenodd"}))},__h_226=_$preact_54.h,_$SnapshotButton_226=function(e){var t=e.onSnapshot,r=e.i18n;return __h_226("button",{class:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:r("takePicture"),"aria-label":r("takePicture"),onclick:t,"data-uppy-super-focusable":!0},_$CameraIcon_221())},__h_224=_$preact_54.h,_$RecordButton_224=function(e){var t=e.recording,r=e.onStartRecording,n=e.onStopRecording,i=e.i18n;return t?__h_224("button",{class:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video",type:"button",title:i("stopRecording"),"aria-label":i("stopRecording"),onclick:n,"data-uppy-super-focusable":!0},__h_224("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},__h_224("rect",{x:"15",y:"15",width:"70",height:"70"}))):__h_224("button",{class:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video",type:"button",title:i("startRecording"),"aria-label":i("startRecording"),onclick:r,"data-uppy-super-focusable":!0},__h_224("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},__h_224("circle",{cx:"50",cy:"50",r:"40"})))},_$formatSeconds_227=function(e){return Math.floor(e/60)+":"+String(e%60).padStart(2,0)},__h_225=_$preact_54.h,_$RecordingLength_225=function(e){var t=e.recordingLengthSeconds,r=e.i18n,n=_$formatSeconds_227(t);return __h_225("div",{class:"uppy-Webcam-recordingLength","aria-label":r("recordingLength",{recording_length:n})},n)},__h_222=_$preact_54.h,__Component_222=_$preact_54.Component;function isModeAvailable(e,t){return-1!==e.indexOf(t)}var CameraScreen=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),(t.prototype.constructor=t).__proto__=r;var i=n.prototype;return i.componentDidMount=function(){this.props.onFocus()},i.componentWillUnmount=function(){this.props.onStop()},i.render=function(){var e=this.props.supportsRecording&&(isModeAvailable(this.props.modes,"video-only")||isModeAvailable(this.props.modes,"audio-only")||isModeAvailable(this.props.modes,"video-audio")),t=isModeAvailable(this.props.modes,"picture"),r=this.props.supportsRecording&&this.props.showRecordingLength;return __h_222("div",{class:"uppy uppy-Webcam-container"},__h_222("div",{class:"uppy-Webcam-videoContainer"},__h_222("video",{class:"uppy-Webcam-video "+(this.props.mirror?"uppy-Webcam-video--mirrored":""),autoplay:!0,muted:!0,playsinline:!0,srcObject:this.props.src||""})),__h_222("div",{class:"uppy-Webcam-buttonContainer"},r?_$RecordingLength_225(this.props):null," ",t?_$SnapshotButton_226(this.props):null," ",e?_$RecordButton_224(this.props):null))},n}(__Component_222),_$CameraScreen_222=CameraScreen,__h_223=_$preact_54.h,_$PermissionsScreen_223=function(e){return __h_223("div",{class:"uppy-Webcam-permissons"},__h_223("div",{class:"uppy-Webcam-permissonsIcon"},e.icon()),__h_223("h1",{class:"uppy-Webcam-title"},e.hasCamera?e.i18n("allowAccessTitle"):e.i18n("noCameraTitle")),__h_223("p",null,e.hasCamera?e.i18n("allowAccessDescription"):e.i18n("noCameraDescription")))},___class_228,___temp_228;function ___extends_228(){return(___extends_228=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_228(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __h_228=_$preact_54.h,__Plugin_228=_$lib_104.Plugin;function toMimeType(e){return"."===e[0]?_$mimeTypes_216[e.slice(1)]:e}function isVideoMimeType(e){return/^video\/[^*]+$/.test(e)}function isImageMimeType(e){return/^image\/[^*]+$/.test(e)}var _$lib_228=(___temp_228=___class_228=function(i){var e,t;function r(e,t){var r;(r=i.call(this,e,t)||this).mediaDevices=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var n=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return n?{getUserMedia:function(r){return new Promise(function(e,t){n.call(navigator,r,e,t)})}}:null}(),r.supportsUserMedia=!!r.mediaDevices,r.protocol=location.protocol.match(/https/i)?"https":"http",r.id=r.opts.id||"Webcam",r.title=r.opts.title||"Camera",r.type="acquirer",r.icon=function(){return __h_228("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},__h_228("g",{fill:"none","fill-rule":"evenodd"},__h_228("rect",{fill:"#03BFEF",width:"32",height:"32",rx:"16"}),__h_228("path",{d:"M22 11c1.133 0 2 .867 2 2v7.333c0 1.134-.867 2-2 2H10c-1.133 0-2-.866-2-2V13c0-1.133.867-2 2-2h2.333l1.134-1.733C13.6 9.133 13.8 9 14 9h4c.2 0 .4.133.533.267L19.667 11H22zm-6 1.533a3.764 3.764 0 0 0-3.8 3.8c0 2.129 1.672 3.801 3.8 3.801s3.8-1.672 3.8-3.8c0-2.13-1.672-3.801-3.8-3.801zm0 6.261c-1.395 0-2.46-1.066-2.46-2.46 0-1.395 1.065-2.461 2.46-2.461s2.46 1.066 2.46 2.46c0 1.395-1.065 2.461-2.46 2.461z",fill:"#FFF","fill-rule":"nonzero"})))};var n={onBeforeSnapshot:function(){return Promise.resolve()},countdown:!(r.defaultLocale={strings:{smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site.",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",recordingLength:"Recording length %{recording_length}"}}),modes:["video-audio","video-only","audio-only","picture"],mirror:!0,facingMode:"user",preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1};return r.opts=___extends_228({},n,{},t),r.i18nInit(),r.install=r.install.bind(___assertThisInitialized_228(r)),r.setPluginState=r.setPluginState.bind(___assertThisInitialized_228(r)),r.render=r.render.bind(___assertThisInitialized_228(r)),r._start=r._start.bind(___assertThisInitialized_228(r)),r._stop=r._stop.bind(___assertThisInitialized_228(r)),r._takeSnapshot=r._takeSnapshot.bind(___assertThisInitialized_228(r)),r._startRecording=r._startRecording.bind(___assertThisInitialized_228(r)),r._stopRecording=r._stopRecording.bind(___assertThisInitialized_228(r)),r._oneTwoThreeSmile=r._oneTwoThreeSmile.bind(___assertThisInitialized_228(r)),r._focus=r._focus.bind(___assertThisInitialized_228(r)),r.webcamActive=!1,r.opts.countdown&&(r.opts.onBeforeSnapshot=r._oneTwoThreeSmile),r}t=i,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var n=r.prototype;return n.setOptions=function(e){i.prototype.setOptions.call(this,e),this.i18nInit()},n.i18nInit=function(){this.translator=new _$Translator_190([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},n.hasCameraCheck=function(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then(function(e){return e.some(function(e){return"videoinput"===e.kind})}):Promise.resolve(!1)},n.getConstraints=function(){return{audio:-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),video:!(-1===this.opts.modes.indexOf("video-audio")&&-1===this.opts.modes.indexOf("video-only")&&-1===this.opts.modes.indexOf("picture"))&&{facingMode:this.opts.facingMode}}},n._start=function(){var t=this;if(!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0;var r=this.getConstraints();this.hasCameraCheck().then(function(e){return t.setPluginState({hasCamera:e}),t.mediaDevices.getUserMedia(r).then(function(e){t.stream=e,t.setPluginState({cameraReady:!0})}).catch(function(e){t.setPluginState({cameraError:e})})})},n._getMediaRecorderOptions=function(){var e,t,r,n={};return MediaRecorder.isTypeSupported&&(e=this.uppy.opts.restrictions,t=[],this.opts.preferredVideoMimeType?t=[this.opts.preferredVideoMimeType]:e.allowedFileTypes&&(t=e.allowedFileTypes.map(toMimeType).filter(isVideoMimeType)),0<(r=t.filter(function(e){return MediaRecorder.isTypeSupported(e)&&_$getFileTypeExtension_206(e)})).length&&(n.mimeType=r[0])),n},n._startRecording=function(){var i=this;this.recorder=new MediaRecorder(this.stream,this._getMediaRecorderOptions());var o=!(this.recordingChunks=[]);this.recorder.addEventListener("dataavailable",function(e){i.recordingChunks.push(e.data);var t,r,n=i.uppy.opts.restrictions;1<i.recordingChunks.length&&null!=n.maxFileSize&&!o&&(r=((t=i.recordingChunks.reduce(function(e,t){return e+t.size},0))-i.recordingChunks[0].size)/(i.recordingChunks.length-1)*3,t>Math.max(0,n.maxFileSize-r)&&(o=!0,i.uppy.info(i.i18n("recordingStoppedMaxSize"),"warning",4e3),i._stopRecording()))}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(function(){var e=i.getPluginState().recordingLengthSeconds;i.setPluginState({recordingLengthSeconds:e+1})},1e3)),this.setPluginState({isRecording:!0})},n._stopRecording=function(){var r=this;return new Promise(function(e,t){r.recorder.addEventListener("stop",function(){e()}),r.recorder.stop(),r.opts.showRecordingLength&&(clearInterval(r.recordingLengthTimer),r.setPluginState({recordingLengthSeconds:0}))}).then(function(){return r.setPluginState({isRecording:!1}),r.getVideo()}).then(function(e){try{r.uppy.addFile(e)}catch(e){e.isRestriction||r.uppy.log(e)}}).then(function(){r.recordingChunks=null,r.recorder=null},function(e){throw r.recordingChunks=null,r.recorder=null,e})},n._stop=function(){this.stream.getAudioTracks().forEach(function(e){e.stop()}),this.stream.getVideoTracks().forEach(function(e){e.stop()}),this.webcamActive=!1,this.stream=null},n._getVideoElement=function(){return this.el.querySelector(".uppy-Webcam-video")},n._oneTwoThreeSmile=function(){var i=this;return new Promise(function(e,t){var r=i.opts.countdown,n=setInterval(function(){return i.webcamActive?void(0<r?(i.uppy.info(r+"...","warning",800),r--):(clearInterval(n),i.uppy.info(i.i18n("smile"),"success",1500),setTimeout(function(){return e()},1500))):(clearInterval(n),i.captureInProgress=!1,t(new Error("Webcam is not active")))},1e3)})},n._takeSnapshot=function(){var r=this;this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch(function(e){var t="object"==typeof e?e.message:e;return r.uppy.info(t,"error",5e3),Promise.reject(new Error("onBeforeSnapshot: "+t))}).then(function(){return r._getImage()}).then(function(e){r.captureInProgress=!1;try{r.uppy.addFile(e)}catch(e){e.isRestriction||r.uppy.log(e)}},function(e){throw r.captureInProgress=!1,e}))},n._getImage=function(){var t=this,e=this._getVideoElement();if(!e)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));var r=e.videoWidth,n=e.videoHeight,i=document.createElement("canvas");i.width=r,i.height=n,i.getContext("2d").drawImage(e,0,0);var o=this.uppy.opts.restrictions,s=[];this.opts.preferredImageMimeType?s=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(s=o.allowedFileTypes.map(toMimeType).filter(isImageMimeType));var a=s[0]||"image/jpeg",u=_$getFileTypeExtension_206(a)||"jpg",l="cam-"+Date.now()+"."+u;return _$canvasToBlob_191(i,a).then(function(e){return{source:t.id,name:l,data:new Blob([e],{type:a}),type:a}})},n.getVideo=function(){var e=this.recordingChunks[0].type,t=_$getFileTypeExtension_206(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'+e+'"'));var r="webcam-"+Date.now()+"."+t,n=new Blob(this.recordingChunks,{type:e}),i={source:this.id,name:r,data:new Blob([n],{type:e}),type:e};return Promise.resolve(i)},n._focus=function(){var e=this;this.opts.countdown&&setTimeout(function(){e.uppy.info(e.i18n("smile"),"success",1500)},1e3)},n.render=function(){this.webcamActive||this._start();var e=this.getPluginState();return e.cameraReady&&e.hasCamera?__h_228(_$CameraScreen_222,___extends_228({},e,{onSnapshot:this._takeSnapshot,onStartRecording:this._startRecording,onStopRecording:this._stopRecording,onFocus:this._focus,onStop:this._stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,supportsRecording:_$supportsMediaRecorder_229(),recording:e.isRecording,mirror:this.opts.mirror,src:this.stream})):__h_228(_$PermissionsScreen_223,{icon:_$CameraIcon_221,i18n:this.i18n,hasCamera:e.hasCamera})},n.install=function(){this.setPluginState({cameraReady:!1,recordingLengthSeconds:0});var e=this.opts.target;e&&this.mount(e,this)},n.uninstall=function(){this.stream&&this._stop(),this.unmount()},r}(__Plugin_228),___class_228.VERSION="1.6.7",___temp_228),__h_162=_$preact_54.h,_$ScreenRecIcon_162=function(){return __h_162("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},__h_162("g",{fill:"none","fill-rule":"evenodd"},__h_162("rect",{fill:"#2C3E50",width:"32",height:"32",rx:"16"}),__h_162("path",{d:"M24.182 9H7.818C6.81 9 6 9.742 6 10.667v10c0 .916.81 1.666 1.818 1.666h4.546V24h7.272v-1.667h4.546c1 0 1.809-.75 1.809-1.666l.009-10C26 9.742 25.182 9 24.182 9zM24 21H8V11h16v10z",fill:"#FFF","fill-rule":"nonzero"}),__h_162("circle",{fill:"#FFF",cx:"16",cy:"16",r:"2"})))},__h_161=_$preact_54.h,_$RecordButton_161=function(e){var t=e.recording,r=e.onStartRecording,n=e.onStopRecording,i=e.i18n;return t?__h_161("button",{class:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video uppy-ScreenCapture-button--stop-rec",type:"button",title:i("stopRecording"),"aria-label":i("stopRecording"),onclick:n,"data-uppy-super-focusable":!0},__h_161("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},__h_161("rect",{x:"15",y:"15",width:"70",height:"70"}))):__h_161("button",{class:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video",type:"button",title:i("startCapturing"),"aria-label":i("stopCapturing"),onclick:r,"data-uppy-super-focusable":!0},__h_161("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},__h_161("circle",{cx:"50",cy:"50",r:"40"})))},__h_165=_$preact_54.h,_$SubmitButton_165=function(e){var t=e.recording,r=e.recordedVideo,n=e.onSubmit,i=e.i18n;return r&&!t?__h_165("button",{class:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--submit",type:"button",title:i("submitRecordedFile"),"aria-label":i("submitRecordedFile"),onclick:n,"data-uppy-super-focusable":!0},__h_165("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"48",height:"48",viewBox:"0 0 48 48"},__h_165("path",{d:"M0 0h48v48h-48z",fill:"none"}),__h_165("path",{d:"M38.71 20.07c-1.36-6.88-7.43-12.07-14.71-12.07-5.78 0-10.79 3.28-13.3 8.07-6.01.65-10.7 5.74-10.7 11.93 0 6.63 5.37 12 12 12h26c5.52 0 10-4.48 10-10 0-5.28-4.11-9.56-9.29-9.93zm-10.71 5.93v8h-8v-8h-6l10-10 10 10h-6z"}))):null};function ___extends_163(){return(___extends_163=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __h_163=_$preact_54.h,Stopwatch=function(r){var e,t;function n(e){var t;return(t=r.call(this,e)||this).state={elapsedTime:0},t.wrapperStyle={width:"100%",height:"100%",display:"flex"},t.overlayStyle={position:"absolute",width:"100%",height:"100%",background:"black",opacity:.7},t.infoContainerStyle={marginLeft:"auto",marginRight:"auto",marginTop:"auto",marginBottom:"auto",zIndex:1,color:"white"},t.infotextStyle={marginLeft:"auto",marginRight:"auto",marginBottom:"1rem",fontSize:"1.5rem"},t.timeStyle={display:"block",fontWeight:"bold",marginLeft:"auto",marginRight:"auto",fontSize:"3rem",fontFamily:"Courier New"},t}t=r,(e=n).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=n.prototype;return i.startTimer=function(){this.timerTick(),this.timerRunning=!0},i.resetTimer=function(){clearTimeout(this.timer),this.setState({elapsedTime:0}),this.timerRunning=!1},i.timerTick=function(){var e=this;this.timer=setTimeout(function(){e.setState({elapsedTime:e.state.elapsedTime+1}),e.timerTick()},1e3)},i.fmtMSS=function(e){return(e-(e%=60))/60+(9<e?":":":0")+e},i.render=function(){var e=___extends_163({},this.props),t=e.recording,r=e.i18n,n=this.fmtMSS(this.state.elapsedTime);return t&&!this.timerRunning&&this.startTimer(),!t&&this.timerRunning&&this.resetTimer(),t?__h_163("div",{style:this.wrapperStyle},__h_163("div",{style:this.overlayStyle}),__h_163("div",{style:this.infoContainerStyle},__h_163("div",{style:this.infotextStyle},r("recording")),__h_163("div",{style:this.timeStyle},n))):null},n}(_$preact_54.Component),_$Stopwatch_163=Stopwatch,__h_164=_$preact_54.h,_$StreamStatus_164=function(e){var t=e.streamActive,r=e.i18n;return t?__h_164("div",{title:r("streamActive"),"aria-label":r("streamActive"),class:"uppy-ScreenCapture-icon--stream uppy-ScreenCapture-icon--streamActive"},__h_164("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},__h_164("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),__h_164("path",{d:"M0 0h24v24H0z",fill:"none"}),__h_164("path",{d:"M1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm18-7H5v1.63c3.96 1.28 7.09 4.41 8.37 8.37H19V7zM1 10v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11zm20-7H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))):__h_164("div",{title:r("streamPassive"),"aria-label":r("streamPassive"),class:"uppy-ScreenCapture-icon--stream"},__h_164("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},__h_164("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),__h_164("path",{d:"M0 0h24v24H0z",fill:"none"}),__h_164("path",{d:"M21 3H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11z"})))};function ___extends_160(){return(___extends_160=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __h_160=_$preact_54.h,__Component_160=_$preact_54.Component,RecorderScreen=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),(t.prototype.constructor=t).__proto__=r;var i=n.prototype;return i.componentWillUnmount=function(){this.props.onStop()},i.render=function(){var t=this,e=this.props,r=e.recording,n=e.stream,i=e.recordedVideo,o={playsinline:!0};return!r&&(i||r)||(o.muted=!0,o.autoplay=!0,o.srcObject=n),i&&!r&&(o.muted=!1,o.controls=!0,o.src=i,this.videoElement&&(this.videoElement.srcObject=void 0)),__h_160("div",{class:"uppy uppy-ScreenCapture-container"},__h_160("div",{class:"uppy-ScreenCapture-videoContainer"},__h_160(_$StreamStatus_164,this.props),__h_160("video",___extends_160({ref:function(e){return t.videoElement=e},class:"uppy-ScreenCapture-video"},o)),__h_160(_$Stopwatch_163,this.props)),__h_160("div",{class:"uppy-ScreenCapture-buttonContainer"},__h_160(_$RecordButton_161,this.props),__h_160(_$SubmitButton_165,this.props)))},n}(__Component_160),_$RecorderScreen_160=RecorderScreen,___class_166,___temp_166;function ___extends_166(){return(___extends_166=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_166(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __h_166=_$preact_54.h,__Plugin_166=_$lib_104.Plugin,_$lib_166=(___temp_166=___class_166=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).mediaDevices=navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&window&&window.MediaRecorder?navigator.mediaDevices:null,r.protocol=location.protocol.match(/https/i)?"https":"http",r.id=r.opts.id||"ScreenCapture",r.title=r.opts.title||"Screencast",r.type="acquirer",r.icon=_$ScreenRecIcon_162,r.defaultLocale={strings:{startCapturing:"Begin screen capturing",stopCapturing:"Stop screen capturing",submitRecordedFile:"Submit captured video",streamActive:"Stream active",streamPassive:"Stream passive",micDisabled:"Microphone access denied by user",recording:"Recording"}},r.opts=___extends_166({},{displayMediaConstraints:{video:{width:1280,height:720,frameRate:{ideal:3,max:5},cursor:"motion",displaySurface:"monitor"}},userMediaConstraints:{audio:!0},preferredVideoMimeType:"video/webm"},{},t),r.translator=new _$Translator_190([r.defaultLocale,r.uppy.locale,r.opts.locale]),r.i18n=r.translator.translate.bind(r.translator),r.i18nArray=r.translator.translateArray.bind(r.translator),r.install=r.install.bind(___assertThisInitialized_166(r)),r.setPluginState=r.setPluginState.bind(___assertThisInitialized_166(r)),r.render=r.render.bind(___assertThisInitialized_166(r)),r.start=r.start.bind(___assertThisInitialized_166(r)),r.stop=r.stop.bind(___assertThisInitialized_166(r)),r.startRecording=r.startRecording.bind(___assertThisInitialized_166(r)),r.stopRecording=r.stopRecording.bind(___assertThisInitialized_166(r)),r.submit=r.submit.bind(___assertThisInitialized_166(r)),r.streamInterrupted=r.streamInactivated.bind(___assertThisInitialized_166(r)),r.captureActive=!1,r.capturedMediaFile=null,r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.install=function(){if(!this.mediaDevices)return this.uppy.log("Screen recorder access is not supported","error"),null;this.setPluginState({streamActive:!1,audioStreamActive:!1});var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.videoStream&&this.stop(),this.unmount()},i.start=function(){var t=this;if(!this.mediaDevices)return Promise.reject(new Error("Screen recorder access not supported"));this.captureActive=!0,this.selectAudioStreamSource(),this.selectVideoStreamSource().then(function(e){!1===e&&t.parent&&t.parent.hideAllPanels&&(t.parent.hideAllPanels(),t.captureActive=!1)})},i.selectVideoStreamSource=function(){var t=this;return this.videoStream?new Promise(function(e){return e(t.videoStream)}):this.mediaDevices.getDisplayMedia(this.opts.displayMediaConstraints).then(function(e){return t.videoStream=e,t.videoStream.addEventListener("inactive",function(e){t.streamInactivated()}),t.setPluginState({streamActive:!0}),e}).catch(function(e){return t.setPluginState({screenRecError:e}),t.userDenied=!0,setTimeout(function(){t.userDenied=!1},1e3),!1})},i.selectAudioStreamSource=function(){var t=this;return this.audioStream?new Promise(function(e){return e(t.audioStream)}):this.mediaDevices.getUserMedia(this.opts.userMediaConstraints).then(function(e){return t.audioStream=e,t.setPluginState({audioStreamActive:!0}),e}).catch(function(e){return"NotAllowedError"===e.name&&t.uppy.info(t.i18n("micDisabled"),"error",5e3),!1})},i.startRecording=function(){var r=this,n={};this.capturedMediaFile=null,this.recordingChunks=[];var i=this.opts.preferredVideoMimeType;this.selectVideoStreamSource().then(function(e){i&&MediaRecorder.isTypeSupported(i)&&_$getFileTypeExtension_206(i)&&(n.mimeType=i);var t=[e.getVideoTracks()[0]];r.audioStream&&t.push(r.audioStream.getAudioTracks()[0]),r.outputStream=new MediaStream(t),r.recorder=new MediaRecorder(r.outputStream,n),r.recorder.addEventListener("dataavailable",function(e){r.recordingChunks.push(e.data)}),r.recorder.start(),r.setPluginState({recording:!0})}).catch(function(e){r.uppy.log(e,"error")})},i.streamInactivated=function(){var e=___extends_166({},this.getPluginState()),t=e.recordedVideo,r=e.recording;t||r?r&&(this.uppy.log("Capture stream inactive — stop recording"),this.stopRecording()):this.parent&&this.parent.hideAllPanels&&this.parent.hideAllPanels(),this.videoStream=null,this.audioStream=null,this.setPluginState({streamActive:!1,audioStreamActive:!1})},i.stopRecording=function(){var r=this;return new Promise(function(e,t){r.recorder.addEventListener("stop",function(){e()}),r.recorder.stop()}).then(function(){return r.setPluginState({recording:!1}),r.getVideo()}).then(function(e){r.capturedMediaFile=e,r.setPluginState({recordedVideo:URL.createObjectURL(e.data)})}).then(function(){r.recordingChunks=null,r.recorder=null},function(e){throw r.recordingChunks=null,r.recorder=null,e})},i.submit=function(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}},i.stop=function(){this.videoStream&&(this.videoStream.getVideoTracks().forEach(function(e){e.stop()}),this.videoStream.getAudioTracks().forEach(function(e){e.stop()}),this.videoStream=null),this.audioStream&&(this.audioStream.getAudioTracks().forEach(function(e){e.stop()}),this.audioStream.getVideoTracks().forEach(function(e){e.stop()}),this.audioStream=null),this.outputStream&&(this.outputStream.getAudioTracks().forEach(function(e){e.stop()}),this.outputStream.getVideoTracks().forEach(function(e){e.stop()}),this.outputStream=null),this.setPluginState({recordedVideo:null}),this.captureActive=!1},i.getVideo=function(){var e=this.recordingChunks[0].type,t=_$getFileTypeExtension_206(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'+e+'"'));var r="screencap-"+Date.now()+"."+t,n=new Blob(this.recordingChunks,{type:e}),i={source:this.id,name:r,data:new Blob([n],{type:e}),type:e};return Promise.resolve(i)},i.render=function(e){var t=this.getPluginState();return t.streamActive||this.captureActive||this.userDenied||this.start(),__h_166(_$RecorderScreen_160,___extends_166({},t,{onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onStop:this.stop,onSubmit:this.submit,i18n:this.i18n,stream:this.videoStream}))},r}(__Plugin_166),___class_166.VERSION="1.0.3",___temp_166),_$requiresPort_58=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e},_$querystringify_57={},undef,__has_57=Object.prototype.hasOwnProperty;function decode(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}_$querystringify_57.stringify=function(e,t){t=t||"";var r,n,i=[];for(n in"string"!=typeof t&&(t="?"),e)if(__has_57.call(e,n)){if((r=e[n])||null!==r&&r!==undef&&!isNaN(r)||(r=""),n=encodeURIComponent(n),r=encodeURIComponent(r),null===n||null===r)continue;i.push(n+"="+r)}return i.length?t+i.join("&"):""},_$querystringify_57.parse=function(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,n={};t=r.exec(e);){var i=decode(t[1]),o=decode(t[2]);null===i||null===o||i in n||(n[i]=o)}return n};var _$urlParse_89={};(function(o){"use strict";var s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,r=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,t=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function h(e){return(e||"").toString().replace(t,"")}var _=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],a={hash:1,query:1};function f(e){var t,r=("undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof self?self:{}).location||{},n={},i=typeof(e=e||r);if("blob:"===e.protocol)n=new y(unescape(e.pathname),{});else if("string"==i)for(t in n=new y(e,{}),a)delete n[t];else if("object"==i){for(t in e)t in a||(n[t]=e[t]);void 0===n.slashes&&(n.slashes=s.test(e.href))}return n}function g(e){e=h(e);var t=r.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function y(e,t,r){if(e=h(e),!(this instanceof y))return new y(e,t,r);var n,i,o,s,a,u,l=_.slice(),c=typeof t,p=this,d=0;for("object"!=c&&"string"!=c&&(r=t,t=null),r&&"function"!=typeof r&&(r=_$querystringify_57.parse),t=f(t),n=!(i=g(e||"")).protocol&&!i.slashes,p.slashes=i.slashes||n&&t.slashes,p.protocol=i.protocol||t.protocol||"",e=i.rest,i.slashes||(l[3]=[/(.*)/,"pathname"]);d<l.length;d++)"function"!=typeof(s=l[d])?(o=s[0],u=s[1],o!=o?p[u]=e:"string"==typeof o?~(a=e.indexOf(o))&&(e="number"==typeof s[2]?(p[u]=e.slice(0,a),e.slice(a+s[2])):(p[u]=e.slice(a),e.slice(0,a))):(a=o.exec(e))&&(p[u]=a[1],e=e.slice(0,a.index)),p[u]=p[u]||n&&s[3]&&t[u]||"",s[4]&&(p[u]=p[u].toLowerCase())):e=s(e);r&&(p.query=r(p.query)),n&&t.slashes&&"/"!==p.pathname.charAt(0)&&(""!==p.pathname||""!==t.pathname)&&(p.pathname=function(e,t){if(""===e)return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),s++):s&&(0===n&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),"."!==i&&".."!==i||r.push(""),r.join("/")}(p.pathname,t.pathname)),_$requiresPort_58(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(s=p.auth.split(":"),p.username=s[0]||"",p.password=s[1]||""),p.origin=p.protocol&&p.host&&"file:"!==p.protocol?p.protocol+"//"+p.host:"null",p.href=p.toString()}y.prototype={set:function(e,t,r){var n,i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||_$querystringify_57.parse)(t)),i[e]=t;break;case"port":i[e]=t,_$requiresPort_58(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!r;break;case"pathname":case"hash":t?(n="pathname"===e?"/":"#",i[e]=t.charAt(0)!==n?n+t:t):i[e]=t;break;default:i[e]=t}for(var o=0;o<_.length;o++){var s=_[o];s[4]&&(i[s[1]]=i[s[1]].toLowerCase())}return i.origin=i.protocol&&i.host&&"file:"!==i.protocol?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=_$querystringify_57.stringify);var t,r=this,n=r.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var i=n+(r.slashes?"//":"");return r.username&&(i+=r.username,r.password&&(i+=":"+r.password),i+="@"),i+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(i+=r.hash),i}},y.extractProtocol=g,y.location=f,y.trimLeft=h,y.qs=_$querystringify_57,_$urlParse_89=y}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var _$RateLimitedQueue_189=(vqa=uqa.prototype,vqa._call=function(e){var t=this;this.activeRequests+=1;var r,n=!1;try{r=e()}catch(e){throw--this.activeRequests,e}return{abort:function(){n||(n=!0,--t.activeRequests,r(),t._queueNext())},done:function(){n||(n=!0,--t.activeRequests,t._queueNext())}}},vqa._queueNext=function(){var e=this;Promise.resolve().then(function(){e._next()})},vqa._next=function(){var e,t;this.activeRequests>=this.limit||0===this.queuedHandlers.length||(e=this.queuedHandlers.shift(),t=this._call(e.fn),e.abort=t.abort,e.done=t.done)},vqa._queue=function(e,t){var r=this;void 0===t&&(t={});var n={fn:e,priority:t.priority||0,abort:function(){r._dequeue(n)},done:function(){throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=function(e){for(var t,r=0;r<e.length;r++)if(t=e[r],n.priority>t.priority)return r;return-1}(this.queuedHandlers);return-1===i?this.queuedHandlers.push(n):this.queuedHandlers.splice(i,0,n),n},vqa._dequeue=function(e){var t=this.queuedHandlers.indexOf(e);-1!==t&&this.queuedHandlers.splice(t,1)},vqa.run=function(e,t){return this.activeRequests<this.limit?this._call(e):this._queue(e,t)},vqa.wrapPromiseFunction=function(a,u){var l=this;return function(){for(var e=arguments.length,o=new Array(e),t=0;t<e;t++)o[t]=arguments[t];var s,r=new Promise(function(n,i){s=l.run(function(){var t,r;try{r=Promise.resolve(a.apply(void 0,o))}catch(e){r=Promise.reject(e)}return r.then(function(e){t?i(t):(s.done(),n(e))},function(e){t?i(t):(s.done(),i(e))}),function(){t=new Error("Cancelled")}},u)});return r.abort=function(){s.abort()},r}},uqa),_$settle_219=function(e){var t=[],r=[];function n(e){t.push(e)}function i(e){r.push(e)}return Promise.all(e.map(function(e){return e.then(n,i)})).then(function(){return{successful:t,failed:r}})},__has_56=Object.prototype.hasOwnProperty,_$queryStringify_56=function e(t,r){var n,i,o,s=[];for(var a in t){__has_56.call(t,a)&&(n=t[a],i=encodeURIComponent(a),o="object"==typeof n?e(n,r?r+"["+i+"]":i):(r?r+"["+i+"]":i)+"="+encodeURIComponent(n),s.push(o))}return s.join("&")},_$emitSocketProgress_193=_$lodashThrottle_46(function(e,t,r){var n=t.progress,i=t.bytesUploaded,o=t.bytesTotal;n&&(e.uppy.log("Upload progress: "+n),e.uppy.emit("upload-progress",r,{uploader:e,bytesUploaded:i,bytesTotal:o}))},300,{leading:!0,trailing:!0}),_$getSocketHost_207=function(e){var t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return(/^http:\/\//i.test(e)?"ws":"wss")+"://"+t},_$EventTracker_185=(Era=Dra.prototype,Era.on=function(e,t){return this._events.push([e,t]),this._emitter.on(e,t)},Era.remove=function(){var n=this;this._events.forEach(function(e){var t=e[0],r=e[1];n._emitter.off(t,r)})},Dra),ProgressTimeout=(Nra=Mra.prototype,Nra.progress=function(){this._isDone||0<this._timeout&&(this._aliveTimer&&clearTimeout(this._aliveTimer),this._aliveTimer=setTimeout(this._onTimedOut,this._timeout))},Nra.done=function(){this._aliveTimer&&(clearTimeout(this._aliveTimer),this._aliveTimer=null),this._isDone=!0},Mra),_$ProgressTimeout_188=ProgressTimeout,_$isNetworkError_213=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)},Nra,Era,vqa;function Mra(e,t){this._timeout=e,this._onTimedOut=t,this._isDone=!1,this._aliveTimer=null,this._onTimedOut=this._onTimedOut.bind(this)}function Dra(e){this._events=[],this._emitter=e}function uqa(e){this.limit="number"!=typeof e||0===e?1/0:e,this.activeRequests=0,this.queuedHandlers=[]}function ___extends_95(){return(___extends_95=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __Provider_95=_$lib_101.Provider,__RequestClient_95=_$lib_101.RequestClient,__Socket_95=_$lib_101.Socket;function buildResponseError(e,t){return"string"==typeof(t=t||new Error("Upload error"))&&(t=new Error(t)),t instanceof Error||(t=___extends_95(new Error("Upload error"),{data:t})),_$isNetworkError_213(e)?t=new _$NetworkError_187(t,e):(t.request=e,t)}var _$MiniXHRUpload_95=(Yra=Xra.prototype,Yra._getOptions=function(e){var t=this.uppy.getState().xhrUpload,r=___extends_95({},this.opts,{},t||{},{},e.xhrUpload||{},{headers:{}});return ___extends_95(r.headers,this.opts.headers),t&&___extends_95(r.headers,t.headers),e.xhrUpload&&___extends_95(r.headers,e.xhrUpload.headers),r},Yra.uploadFile=function(e,t,r){var n=this.uppy.getFile(e);if(n.error)throw new Error(n.error);return n.isRemote?this._uploadRemoteFile(n,t,r):this._uploadLocalFile(n,t,r)},Yra._addMetadata=function(t,r,e){(Array.isArray(e.metaFields)?e.metaFields:Object.keys(r)).forEach(function(e){t.append(e,r[e])})},Yra._createFormDataUpload=function(e,t){var r=new FormData;this._addMetadata(r,e.meta,t);var n=e.data.slice(0,e.data.size,e.meta.type);return e.name?r.append(t.fieldName,n,e.meta.name):r.append(t.fieldName,n),r},Yra._createBareUpload=function(e,t){return e.data},Yra._onFileRemoved=function(t,r){this.uploaderEvents[t].on("file-removed",function(e){t===e.id&&r(e.id)})},Yra._onRetry=function(t,r){this.uploaderEvents[t].on("upload-retry",function(e){t===e&&r()})},Yra._onRetryAll=function(t,r){var n=this;this.uploaderEvents[t].on("retry-all",function(e){n.uppy.getFile(t)&&r()})},Yra._onCancelAll=function(e,t){var r=this;this.uploaderEvents[e].on("cancel-all",function(){r.uppy.getFile(e)&&t()})},Yra._uploadLocalFile=function(h,e,t){var _=this,f=this._getOptions(h);return this.uppy.log("uploading "+e+" of "+t),new Promise(function(a,u){var e=f.formData?_._createFormDataUpload(h,f):_._createBareUpload(h,f),l=new XMLHttpRequest;_.uploaderEvents[h.id]=new _$EventTracker_185(_.uppy);var c=new _$ProgressTimeout_188(f.timeout,function(){l.abort(),d.done();var e=new Error(_.i18n("timedOut",{seconds:Math.ceil(f.timeout/1e3)}));_.uppy.emit("upload-error",h,e),u(e)}),p=_$cuid_13();l.upload.addEventListener("loadstart",function(e){_.uppy.log("[AwsS3/XHRUpload] "+p+" started")}),l.upload.addEventListener("progress",function(e){_.uppy.log("[AwsS3/XHRUpload] "+p+" progress: "+e.loaded+" / "+e.total),c.progress(),e.lengthComputable&&_.uppy.emit("upload-progress",h,{uploader:_,bytesUploaded:e.loaded,bytesTotal:e.total})}),l.addEventListener("load",function(e){if(_.uppy.log("[AwsS3/XHRUpload] "+p+" finished"),c.done(),d.done(),_.uploaderEvents[h.id]&&(_.uploaderEvents[h.id].remove(),_.uploaderEvents[h.id]=null),f.validateStatus(e.target.status,l.responseText,l)){var t=f.getResponseData(l.responseText,l),r=t[f.responseUrlFieldName],n={status:e.target.status,body:t,uploadURL:r};return _.uppy.emit("upload-success",h,n),r&&_.uppy.log("Download "+h.name+" from "+r),a(h)}var i=f.getResponseData(l.responseText,l),o=buildResponseError(l,f.getResponseError(l.responseText,l)),s={status:e.target.status,body:i};return _.uppy.emit("upload-error",h,o,s),u(o)}),l.addEventListener("error",function(e){_.uppy.log("[AwsS3/XHRUpload] "+p+" errored"),c.done(),d.done(),_.uploaderEvents[h.id]&&(_.uploaderEvents[h.id].remove(),_.uploaderEvents[h.id]=null);var t=buildResponseError(l,f.getResponseError(l.responseText,l));return _.uppy.emit("upload-error",h,t),u(t)}),l.open(f.method.toUpperCase(),f.endpoint,!0),l.withCredentials=f.withCredentials,""!==f.responseType&&(l.responseType=f.responseType),Object.keys(f.headers).forEach(function(e){l.setRequestHeader(e,f.headers[e])});var d=_.requests.run(function(){return l.send(e),function(){c.done(),l.abort()}},{priority:1});_._onFileRemoved(h.id,function(){d.abort(),u(new Error("File removed"))}),_._onCancelAll(h.id,function(){d.abort(),u(new Error("Upload cancelled"))})})},Yra._uploadRemoteFile=function(a,e,t){var u=this,l=this._getOptions(a);return new Promise(function(o,s){var t={};(Array.isArray(l.metaFields)?l.metaFields:Object.keys(a.meta)).forEach(function(e){t[e]=a.meta[e]}),new(a.remote.providerOptions.provider?__Provider_95:__RequestClient_95)(u.uppy,a.remote.providerOptions).post(a.remote.url,___extends_95({},a.remote.body,{endpoint:l.endpoint,size:a.data.size,fieldname:l.fieldName,metadata:t,httpMethod:l.method,useFormData:l.formData,headers:l.headers})).then(function(e){var t=e.token,r=_$getSocketHost_207(a.remote.companionUrl),n=new __Socket_95({target:r+"/api/"+t,autoOpen:!1});u.uploaderEvents[a.id]=new _$EventTracker_185(u.uppy),u._onFileRemoved(a.id,function(){n.send("pause",{}),i.abort(),o("upload "+a.id+" was removed")}),u._onCancelAll(a.id,function(){n.send("pause",{}),i.abort(),o("upload "+a.id+" was canceled")}),u._onRetry(a.id,function(){n.send("pause",{}),n.send("resume",{})}),u._onRetryAll(a.id,function(){n.send("pause",{}),n.send("resume",{})}),n.on("progress",function(e){return _$emitSocketProgress_193(u,e,a)}),n.on("success",function(e){var t=l.getResponseData(e.response.responseText,e.response),r=t[l.responseUrlFieldName],n={status:e.response.status,body:t,uploadURL:r};return u.uppy.emit("upload-success",a,n),i.done(),u.uploaderEvents[a.id]&&(u.uploaderEvents[a.id].remove(),u.uploaderEvents[a.id]=null),o()}),n.on("error",function(e){var t=e.response,r=t?l.getResponseError(t.responseText,t):___extends_95(new Error(e.error.message),{cause:e.error});u.uppy.emit("upload-error",a,r),i.done(),u.uploaderEvents[a.id]&&(u.uploaderEvents[a.id].remove(),u.uploaderEvents[a.id]=null),s(r)});var i=u.requests.run(function(){return n.open(),a.isPaused&&n.send("pause",{}),function(){return n.close()}})}).catch(function(e){u.uppy.emit("upload-error",a,e),s(e)})})},Xra),___class_96,___temp_96,Yra;function Xra(e,t){this.uppy=e,this.opts=___extends_95({validateStatus:function(e,t,r){return 200<=e&&e<300}},t),this.requests=t.__queue,this.uploaderEvents=Object.create(null)}function ___assertThisInitialized_96(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ___extends_96(){return(___extends_96=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var URL_="function"==typeof URL?URL:_$urlParse_89,__Plugin_96=_$lib_104.Plugin,__RequestClient_96=_$lib_101.RequestClient;function isXml(e,t){var r=t.headers?t.headers["content-type"]:t.getResponseHeader("Content-Type");if(null!==r){var n=r.replace(/;.*$/,"").toLowerCase();if("string"==typeof n){if("application/xml"===n||"text/xml"===n)return 1;if("text/html"===n&&/^<\?xml /.test(e))return 1}}}function getXmlValue(e,t){var r=e.indexOf("<"+t+">"),n=e.indexOf("</"+t+">",r);return-1!==r&&-1!==n?e.slice(r+t.length+2,n):""}function assertServerError(e){if(e&&e.error){var t=new Error(e.message);throw ___extends_96(t,e.error),t}return e}var warnedSuccessActionStatus=!1,_$lib_96=(___temp_96=___class_96=function(i){var e,t;function r(e,t){var r;(r=i.call(this,e,t)||this).type="uploader",r.id=r.opts.id||"AwsS3",r.title="AWS S3";var n={timeout:3e4,limit:0,metaFields:[],getUploadParameters:r.getUploadParameters.bind(___assertThisInitialized_96(r))};return r.opts=___extends_96({},n,{},t),r.client=new __RequestClient_96(e,t),r.handleUpload=r.handleUpload.bind(___assertThisInitialized_96(r)),r.requests=new _$RateLimitedQueue_189(r.opts.limit),r}t=i,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var n=r.prototype;return n.getUploadParameters=function(t){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address.");var e=t.meta.name,r=t.meta.type,n={};this.opts.metaFields.forEach(function(e){null!=t.meta[e]&&(n[e]=t.meta[e].toString())});var i=_$queryStringify_56({filename:e,type:r,metadata:n});return this.client.get("s3/params?"+i).then(assertServerError)},n.validateParameters=function(e,t){if("object"!=typeof t||!t||"string"!=typeof t.url||"object"!=typeof t.fields&&null!=t.fields||null!=t.method&&!/^(put|post)$/i.test(t.method)){var r=new TypeError("AwsS3: got incorrect result from 'getUploadParameters()' for file '"+e.name+"', expected an object '{ url, method, fields, headers }'.\nSee https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.");throw console.error(r),r}},n.handleUpload=function(e){var c=this,p=Object.create(null);function t(e){var t=e.id;_$hasProperty_210(p,t)&&p[t].abort()}this.uppy.on("file-removed",t),e.forEach(function(e){var t=c.uppy.getFile(e);c.uppy.emit("upload-started",t)});var r=this.requests.wrapPromiseFunction(function(e){return c.opts.getUploadParameters(e)}),d=e.length;return _$settle_219(e.map(function(u,l){return p[u]=r(c.uppy.getFile(u)),p[u].then(function(e){delete p[u];var t=c.uppy.getFile(u);c.validateParameters(t,e);var r=e.method,n=void 0===r?"post":r,i=e.url,o=e.fields,s=e.headers,a={method:n,formData:"post"===n.toLowerCase(),endpoint:i,metaFields:o?Object.keys(o):[]};return s&&(a.headers=s),c.uppy.setFileState(t.id,{meta:___extends_96({},t.meta,{},o),xhrUpload:a}),c._uploader.uploadFile(t.id,l,d)}).catch(function(e){delete p[u];var t=c.uppy.getFile(u);c.uppy.emit("upload-error",t,e)})})).then(function(e){return c.uppy.off("file-removed",t),e})},n.install=function(){var i=this.uppy;this.uppy.addUploader(this.handleUpload);var e={fieldName:"file",responseUrlFieldName:"location",timeout:this.opts.timeout,__queue:this.requests,responseType:"text",getResponseData:this.opts.getResponseData||function(e,t){var r,n;return isXml(e,t)?{location:(r=t.responseURL,n=getXmlValue(e,"Location"),r?new URL_(n,r).toString():new URL_(n).toString()),bucket:getXmlValue(e,"Bucket"),key:getXmlValue(e,"Key"),etag:getXmlValue(e,"ETag")}:"POST"===this.method.toUpperCase()?(warnedSuccessActionStatus||(i.log("[AwsS3] No response data found, make sure to set the success_action_status AWS SDK option to 201. See https://uppy.io/docs/aws-s3/#POST-Uploads","warning"),warnedSuccessActionStatus=!0),{location:null}):t.responseURL?{location:t.responseURL.replace(/\?.*$/,"")}:{location:null}},getResponseError:function(e,t){if(isXml(e,t)){var r=getXmlValue(e,"Message");return new Error(r)}}};this._uploader=new _$MiniXHRUpload_95(this.uppy,e),this._uploader.i18n=this.uppy.i18n},n.uninstall=function(){this.uppy.removePreProcessor(this.handleUpload)},r}(__Plugin_96),___class_96.VERSION="1.6.6",___temp_96);function ___extends_93(){return(___extends_93=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var defaultOptions={limit:1,getChunkSize:function(e){return Math.ceil(e.size/1e4)},onStart:function(){},onProgress:function(){},onPartComplete:function(){},onSuccess:function(){},onError:function(e){throw e}};function remove(e,t){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}var MultipartUploader=(Xua=Wua.prototype,Xua._initChunks=function(){for(var e=[],t=this.options.getChunkSize(this.file),r=Math.max(5242880,Math.ceil(this.file.size/1e4)),n=Math.max(t,r),i=0;i<this.file.size;i+=n){var o=Math.min(this.file.size,i+n);e.push(this.file.slice(i,o))}this.chunks=e,this.chunkState=e.map(function(){return{uploaded:0,busy:!1,done:!1}})},Xua._createUpload=function(){var t=this;return this.createdPromise=Promise.resolve().then(function(){return t.options.createMultipartUpload()}),this.createdPromise.then(function(e){if("object"!=typeof e||!e||"string"!=typeof e.uploadId||"string"!=typeof e.key)throw new TypeError("AwsS3/Multipart: Got incorrect result from `createMultipartUpload()`, expected an object `{ uploadId, key }`.");t.key=e.key,t.uploadId=e.uploadId,t.options.onStart(e),t._uploadParts()}).catch(function(e){t._onError(e)})},Xua._resumeUpload=function(){var r=this;return Promise.resolve().then(function(){return r.options.listParts({uploadId:r.uploadId,key:r.key})}).then(function(e){e.forEach(function(t){var e=t.PartNumber-1;r.chunkState[e]={uploaded:t.Size,etag:t.ETag,done:!0},r.parts.some(function(e){return e.PartNumber===t.PartNumber})||r.parts.push({PartNumber:t.PartNumber,ETag:t.ETag})}),r._uploadParts()}).catch(function(e){r._onError(e)})},Xua._uploadParts=function(){var t=this;if(!this.isPaused){var e=this.options.limit-this.uploading.length;if(0!=e)if(this.chunkState.every(function(e){return e.done}))this._completeUpload();else{for(var r=[],n=0;n<this.chunkState.length;n++){var i=this.chunkState[n];if(!i.done&&!i.busy&&(r.push(n),r.length>=e))break}r.forEach(function(e){t._uploadPart(e)})}}},Xua._uploadPart=function(n){var i=this,e=this.chunks[n];return this.chunkState[n].busy=!0,Promise.resolve().then(function(){return i.options.prepareUploadPart({key:i.key,uploadId:i.uploadId,body:e,number:n+1})}).then(function(e){if("object"!=typeof e||!e||"string"!=typeof e.url)throw new TypeError("AwsS3/Multipart: Got incorrect result from `prepareUploadPart()`, expected an object `{ url }`.");return e}).then(function(e){var t=e.url,r=e.headers;i._uploadPartBytes(n,t,r)},function(e){i._onError(e)})},Xua._onPartProgress=function(e,t,r){this.chunkState[e].uploaded=t;var n=this.chunkState.reduce(function(e,t){return e+t.uploaded},0);this.options.onProgress(n,this.file.size)},Xua._onPartComplete=function(e,t){this.chunkState[e].etag=t,this.chunkState[e].done=!0;var r={PartNumber:e+1,ETag:t};this.parts.push(r),this.options.onPartComplete(r),this._uploadParts()},Xua._uploadPartBytes=function(r,e,t){var n=this,i=this.chunks[r],o=new XMLHttpRequest;o.open("PUT",e,!0),t&&Object.keys(t).map(function(e){o.setRequestHeader(e,t[e])}),o.responseType="text",this.uploading.push(o),o.upload.addEventListener("progress",function(e){e.lengthComputable&&n._onPartProgress(r,e.loaded,e.total)}),o.addEventListener("abort",function(e){remove(n.uploading,e.target),n.chunkState[r].busy=!1}),o.addEventListener("load",function(e){var t;remove(n.uploading,e.target),n.chunkState[r].busy=!1,e.target.status<200||300<=e.target.status?n._onError(new Error("Non 2xx")):(n._onPartProgress(r,i.size,i.size),null!==(t=e.target.getResponseHeader("ETag"))?n._onPartComplete(r,t):n._onError(new Error("AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. Seee https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions.")))}),o.addEventListener("error",function(e){remove(n.uploading,e.target),n.chunkState[r].busy=!1;var t=new Error("Unknown error");t.source=e.target,n._onError(t)}),o.send(i)},Xua._completeUpload=function(){var t=this;return this.parts.sort(function(e,t){return e.PartNumber-t.PartNumber}),Promise.resolve().then(function(){return t.options.completeMultipartUpload({key:t.key,uploadId:t.uploadId,parts:t.parts})}).then(function(e){t.options.onSuccess(e)},function(e){t._onError(e)})},Xua._abortUpload=function(){var e=this;this.uploading.slice().forEach(function(e){e.abort()}),this.createdPromise.then(function(){e.options.abortMultipartUpload({key:e.key,uploadId:e.uploadId})},function(){}),this.uploading=[]},Xua._onError=function(e){this.options.onError(e)},Xua.start=function(){this.isPaused=!1,this.uploadId?this._resumeUpload():this._createUpload()},Xua.pause=function(){this.uploading.slice().forEach(function(e){e.abort()}),this.isPaused=!0},Xua.abort=function(e){if(void 0===e&&(e={}),!e.really)return this.pause();this._abortUpload()},Wua),_$MultipartUploader_93=MultipartUploader,___class_94,___temp_94,Xua;function Wua(e,t){this.options=___extends_93({},defaultOptions,{},t),this.options.getChunkSize||(this.options.getChunkSize=defaultOptions.getChunkSize),this.file=e,this.key=this.options.key||null,this.uploadId=this.options.uploadId||null,this.parts=this.options.parts||[],this.createdPromise=Promise.reject(),this.isPaused=!1,this.chunks=null,this.chunkState=null,this.uploading=[],this._initChunks(),this.createdPromise.catch(function(){})}function ___assertThisInitialized_94(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ___extends_94(){return(___extends_94=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var __Plugin_94=_$lib_104.Plugin,__Socket_94=_$lib_101.Socket,__Provider_94=_$lib_101.Provider,__RequestClient_94=_$lib_101.RequestClient;function __assertServerError_94(e){if(e&&e.error){var t=new Error(e.message);throw ___extends_94(t,e.error),t}return e}var _$lib_94=(___temp_94=___class_94=function(i){var e,t;function r(e,t){var r;(r=i.call(this,e,t)||this).type="uploader",r.id=r.opts.id||"AwsS3Multipart",r.title="AWS S3 Multipart",r.client=new __RequestClient_94(e,t);var n={timeout:3e4,limit:0,createMultipartUpload:r.createMultipartUpload.bind(___assertThisInitialized_94(r)),listParts:r.listParts.bind(___assertThisInitialized_94(r)),prepareUploadPart:r.prepareUploadPart.bind(___assertThisInitialized_94(r)),abortMultipartUpload:r.abortMultipartUpload.bind(___assertThisInitialized_94(r)),completeMultipartUpload:r.completeMultipartUpload.bind(___assertThisInitialized_94(r))};return r.opts=___extends_94({},n,{},t),r.upload=r.upload.bind(___assertThisInitialized_94(r)),r.requests=new _$RateLimitedQueue_189(r.opts.limit),r.uploaders=Object.create(null),r.uploaderEvents=Object.create(null),r.uploaderSockets=Object.create(null),r}t=i,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var n=r.prototype;return n.resetUploaderReferences=function(e,t){void 0===t&&(t={}),this.uploaders[e]&&(this.uploaders[e].abort({really:t.abort||!1}),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null),this.uploaderSockets[e]&&(this.uploaderSockets[e].close(),this.uploaderSockets[e]=null)},n.assertHost=function(){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address.")},n.createMultipartUpload=function(t){this.assertHost();var r={};return Object.keys(t.meta).map(function(e){null!=t.meta[e]&&(r[e]=t.meta[e].toString())}),this.client.post("s3/multipart",{filename:t.name,type:t.type,metadata:r}).then(__assertServerError_94)},n.listParts=function(e,t){var r=t.key,n=t.uploadId;this.assertHost();var i=encodeURIComponent(r);return this.client.get("s3/multipart/"+n+"?key="+i).then(__assertServerError_94)},n.prepareUploadPart=function(e,t){var r=t.key,n=t.uploadId,i=t.number;this.assertHost();var o=encodeURIComponent(r);return this.client.get("s3/multipart/"+n+"/"+i+"?key="+o).then(__assertServerError_94)},n.completeMultipartUpload=function(e,t){var r=t.key,n=t.uploadId,i=t.parts;this.assertHost();var o=encodeURIComponent(r),s=encodeURIComponent(n);return this.client.post("s3/multipart/"+s+"/complete?key="+o,{parts:i}).then(__assertServerError_94)},n.abortMultipartUpload=function(e,t){var r=t.key,n=t.uploadId;this.assertHost();var i=encodeURIComponent(r),o=encodeURIComponent(n);return this.client.delete("s3/multipart/"+o+"?key="+i).then(__assertServerError_94)},n.uploadFile=function(o){var s=this;return new Promise(function(r,t){var n=new _$MultipartUploader_93(o.data,___extends_94({createMultipartUpload:s.opts.createMultipartUpload.bind(s,o),listParts:s.opts.listParts.bind(s,o),prepareUploadPart:s.opts.prepareUploadPart.bind(s,o),completeMultipartUpload:s.opts.completeMultipartUpload.bind(s,o),abortMultipartUpload:s.opts.abortMultipartUpload.bind(s,o),getChunkSize:s.opts.getChunkSize?s.opts.getChunkSize.bind(s):null,onStart:function(e){var t=s.uppy.getFile(o.id);s.uppy.setFileState(o.id,{s3Multipart:___extends_94({},t.s3Multipart,{key:e.key,uploadId:e.uploadId,parts:[]})})},onProgress:function(e,t){s.uppy.emit("upload-progress",o,{uploader:s,bytesUploaded:e,bytesTotal:t})},onError:function(e){s.uppy.log(e),s.uppy.emit("upload-error",o,e),i.done(),s.resetUploaderReferences(o.id),t(e)},onSuccess:function(e){var t={uploadURL:e.location};i.done(),s.resetUploaderReferences(o.id),s.uppy.emit("upload-success",o,t),e.location&&s.uppy.log("Download "+n.file.name+" from "+e.location),r(n)},onPartComplete:function(e){var t=s.uppy.getFile(o.id);t&&(s.uppy.setFileState(o.id,{s3Multipart:___extends_94({},t.s3Multipart,{parts:[].concat(t.s3Multipart.parts,[e])})}),s.uppy.emit("s3-multipart:part-uploaded",t,e))},limit:s.opts.limit||5},o.s3Multipart));s.uploaders[o.id]=n,s.uploaderEvents[o.id]=new _$EventTracker_185(s.uppy);var i=s.requests.run(function(){return o.isPaused||n.start(),function(){}});s.onFileRemove(o.id,function(e){i.abort(),s.resetUploaderReferences(o.id,{abort:!0}),r("upload "+e.id+" was removed")}),s.onCancelAll(o.id,function(){i.abort(),s.resetUploaderReferences(o.id,{abort:!0}),r("upload "+o.id+" was canceled")}),s.onFilePause(o.id,function(e){e?(i.abort(),n.pause()):(i.abort(),i=s.requests.run(function(){return n.start(),function(){}}))}),s.onPauseAll(o.id,function(){i.abort(),n.pause()}),s.onResumeAll(o.id,function(){i.abort(),o.error&&n.abort(),i=s.requests.run(function(){return n.start(),function(){}})}),o.isRestored||s.uppy.emit("upload-started",o,n)})},n.uploadRemote=function(r){var n=this;return this.resetUploaderReferences(r.id),this.uppy.emit("upload-started",r),r.serverToken?this.connectToServerSocket(r):new Promise(function(e,t){new(r.remote.providerOptions.provider?__Provider_94:__RequestClient_94)(n.uppy,r.remote.providerOptions).post(r.remote.url,___extends_94({},r.remote.body,{protocol:"s3-multipart",size:r.data.size,metadata:r.meta})).then(function(e){return n.uppy.setFileState(r.id,{serverToken:e.token}),r=n.uppy.getFile(r.id)}).then(function(e){return n.connectToServerSocket(e)}).then(function(){e()}).catch(function(e){n.uppy.emit("upload-error",r,e),t(e)})})},n.connectToServerSocket=function(s){var a=this;return new Promise(function(r,t){var e=s.serverToken,n=_$getSocketHost_207(s.remote.companionUrl),i=new __Socket_94({target:n+"/api/"+e,autoOpen:!1});a.uploaderSockets[s.id]=i,a.uploaderEvents[s.id]=new _$EventTracker_185(a.uppy),a.onFileRemove(s.id,function(e){o.abort(),i.send("pause",{}),a.resetUploaderReferences(s.id,{abort:!0}),r("upload "+s.id+" was removed")}),a.onFilePause(s.id,function(e){e?(o.abort(),i.send("pause",{})):(o.abort(),o=a.requests.run(function(){return i.send("resume",{}),function(){}}))}),a.onPauseAll(s.id,function(){o.abort(),i.send("pause",{})}),a.onCancelAll(s.id,function(){o.abort(),i.send("pause",{}),a.resetUploaderReferences(s.id),r("upload "+s.id+" was canceled")}),a.onResumeAll(s.id,function(){o.abort(),s.error&&i.send("pause",{}),o=a.requests.run(function(){i.send("resume",{})})}),a.onRetry(s.id,function(){i.isOpen&&(i.send("pause",{}),i.send("resume",{}))}),a.onRetryAll(s.id,function(){i.isOpen&&(i.send("pause",{}),i.send("resume",{}))}),i.on("progress",function(e){return _$emitSocketProgress_193(a,e,s)}),i.on("error",function(e){a.uppy.emit("upload-error",s,new Error(e.error)),a.resetUploaderReferences(s.id),o.done(),t(new Error(e.error))}),i.on("success",function(e){var t={uploadURL:e.url};a.uppy.emit("upload-success",s,t),a.resetUploaderReferences(s.id),o.done(),r()});var o=a.requests.run(function(){return i.open(),s.isPaused&&i.send("pause",{}),function(){}})})},n.upload=function(e){var r=this;if(0===e.length)return Promise.resolve();var t=e.map(function(e){var t=r.uppy.getFile(e);return t.isRemote?r.uploadRemote(t):r.uploadFile(t)});return Promise.all(t)},n.onFileRemove=function(t,r){this.uploaderEvents[t].on("file-removed",function(e){t===e.id&&r(e.id)})},n.onFilePause=function(r,n){this.uploaderEvents[r].on("upload-pause",function(e,t){r===e&&n(t)})},n.onRetry=function(t,r){this.uploaderEvents[t].on("upload-retry",function(e){t===e&&r()})},n.onRetryAll=function(t,r){var n=this;this.uploaderEvents[t].on("retry-all",function(e){n.uppy.getFile(t)&&r()})},n.onPauseAll=function(e,t){var r=this;this.uploaderEvents[e].on("pause-all",function(){r.uppy.getFile(e)&&t()})},n.onCancelAll=function(e,t){var r=this;this.uploaderEvents[e].on("cancel-all",function(){r.uppy.getFile(e)&&t()})},n.onResumeAll=function(e,t){var r=this;this.uploaderEvents[e].on("resume-all",function(){r.uppy.getFile(e)&&t()})},n.install=function(){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:___extends_94({},e,{resumableUploads:!0})}),this.uppy.addUploader(this.upload)},n.uninstall=function(){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:___extends_94({},e,{resumableUploads:!1})}),this.uppy.removeUploader(this.upload)},r}(__Plugin_94),___class_94.VERSION="1.7.1",___temp_94),_$error_86={};Object.defineProperty(_$error_86,"__esModule",{value:!0});var DetailedError=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(mya,Error),mya);function mya(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;!function(e){if(!(e instanceof mya))throw new TypeError("Cannot call a class as a function")}(this);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(mya.__proto__||Object.getPrototypeOf(mya)).call(this,e.message));n.originalRequest=r,n.causingError=t;var i=e.message;return null!=t&&(i+=", caused by "+t.toString()),null!=r&&(i+=", originated from request (response code: "+r.status+", response text: "+r.responseText+")"),n.message=i,n}_$error_86.default=DetailedError;var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===toStr.call(e)},isPlainObject=function(e){if(!e||"[object Object]"!==toStr.call(e))return!1;var t,r=hasOwn.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&hasOwn.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;for(t in e);return void 0===t||hasOwn.call(e,t)},setProperty=function(e,t){defineProperty&&"__proto__"===t.name?defineProperty(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},getProperty=function(e,t){if("__proto__"===t){if(!hasOwn.call(e,t))return;if(gOPD)return gOPD(e,t).value}return e[t]},_$extend_36=function e(t,r){var n,i,o,s,a,u,l=t,c=1,p=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=r||{},c=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});c<p;++c)if(null!=(n=arguments[c]))for(i in n)o=getProperty(l,i),l!==(s=getProperty(n,i))&&(d&&s&&(isPlainObject(s)||(a=isArray(s)))?(u=a?(a=!1,o&&isArray(o)?o:[]):o&&isPlainObject(o)?o:{},setProperty(l,{name:i,newValue:e(d,u,s)})):void 0!==s&&setProperty(l,{name:i,newValue:s}));return l},_$base64_44={exports:{}};(function(global){var Sya,Tya;Sya="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==global?global:this,Tya=function(global){"use strict";global=global||{};var _Base64=global.Base64,version="2.5.2",buffer;if(_$base64_44.exports)try{buffer=eval("require('buffer').Buffer")}catch(e){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(e){for(var t={},r=0,n=e.length;r<n;r++)t[e.charAt(r)]=r;return t}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?fromCharCode(192|t>>>6)+fromCharCode(128|63&t):fromCharCode(224|t>>>12&15)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fromCharCode(240|t>>>18&7)+fromCharCode(128|t>>>12&63)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(e){return e.replace(re_utob,cb_utob)},cb_encode=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(1<e.length?e.charCodeAt(1):0)<<8|(2<e.length?e.charCodeAt(2):0);return[b64chars.charAt(r>>>18),b64chars.charAt(r>>>12&63),2<=t?"=":b64chars.charAt(r>>>6&63),1<=t?"=":b64chars.charAt(63&r)].join("")},btoa=global.btoa?function(e){return global.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)?e.toString("base64"):btoa(utob(String(e)))},encode=function(e,t){return t?_encode(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):_encode(e)},encodeURI=function(e){return encode(e,!0)},re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return fromCharCode(55296+(t>>>10))+fromCharCode(56320+(1023&t));case 3:return fromCharCode((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fromCharCode((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=function(e){return e.replace(re_btou,cb_btou)},cb_decode=function(e){var t=e.length,r=t%4,n=(0<t?b64tab[e.charAt(0)]<<18:0)|(1<t?b64tab[e.charAt(1)]<<12:0)|(2<t?b64tab[e.charAt(2)]<<6:0)|(3<t?b64tab[e.charAt(3)]:0),i=[fromCharCode(n>>>16),fromCharCode(n>>>8&255),fromCharCode(255&n)];return i.length-=[0,0,2,1][r],i.join("")},_atob=global.atob?function(e){return global.atob(e)}:function(e){return e.replace(/\S{1,4}/g,cb_decode)},atob=function(e){return _atob(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e,"base64")).toString()}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e,"base64")).toString()}:function(e){return btou(_atob(e))},decode=function(e){return _decode(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var e=global.Base64;return global.Base64=_Base64,e},noEnum;return global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"==typeof Object.defineProperty&&(noEnum=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}},global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(e){return encode(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}),global.Meteor&&(Base64=global.Base64),_$base64_44.exports?_$base64_44.exports.Base64=global.Base64:"function"==typeof define&&define.amd&&define([],function(){return global.Base64}),{Base64:global.Base64}},"object"==typeof _$base64_44.exports?_$base64_44.exports=Tya(Sya):"function"==typeof define&&define.amd?define(Tya):Tya(Sya)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$base64_44=_$base64_44.exports;var _$request_82={};Object.defineProperty(_$request_82,"__esModule",{value:!0}),_$request_82.newRequest=function(){return new window.XMLHttpRequest},_$request_82.resolveUrl=function(e,t){return new _urlParse2.default(t,e).toString()};var obj,_urlParse2=(obj=_$urlParse_89)&&obj.__esModule?obj:{default:obj},_$isReactNative_80={};Object.defineProperty(_$isReactNative_80,"__esModule",{value:!0}),_$isReactNative_80.default=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};var _$uriToBlob_85={};Object.defineProperty(_$uriToBlob_85,"__esModule",{value:!0}),_$uriToBlob_85.default=function(e,t){var r=new XMLHttpRequest;r.responseType="blob",r.onload=function(){var e=r.response;t(null,e)},r.onerror=function(e){t(e)},r.open("GET",e),r.send()};var _$isCordova_79={};Object.defineProperty(_$isCordova_79,"__esModule",{value:!0}),_$isCordova_79.default=function(){return"undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)};var _$readAsByteArray_81={};Object.defineProperty(_$readAsByteArray_81,"__esModule",{value:!0}),_$readAsByteArray_81.default=function(e,t){var r=new FileReader;r.onload=function(){t(null,new Uint8Array(r.result))},r.onerror=function(e){t(e)},r.readAsArrayBuffer(e)};var _$source_83={};Object.defineProperty(_$source_83,"__esModule",{value:!0});var _createClass=function(e,t,r){return t&&Oza(e.prototype,t),r&&Oza(e,r),e};function Oza(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}_$source_83.getSource=function(e,t,r){if((0,_isReactNative2.default)()&&e&&void 0!==e.uri)(0,_uriToBlob2.default)(e.uri,function(e,t){return e?r(new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. "+e)):void r(null,new FileSource(t))});else{if("function"!=typeof e.slice||void 0===e.size)return"function"==typeof e.read?(t=+t,isFinite(t)?void r(null,new StreamSource(e,t)):void r(new Error("cannot create source for stream without a finite value for the `chunkSize` option"))):void r(new Error("source object may only be an instance of File, Blob, or Reader in this environment"));r(null,new FileSource(e))}};var _isReactNative2=_interopRequireDefault(_$isReactNative_80),_uriToBlob2=_interopRequireDefault(_$uriToBlob_85),_isCordova2=_interopRequireDefault(_$isCordova_79),_readAsByteArray2=_interopRequireDefault(_$readAsByteArray_81);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var FileSource=(_createClass(cAa,[{key:"slice",value:function(e,t,r){(0,_isCordova2.default)()?(0,_readAsByteArray2.default)(this._file.slice(e,t),function(e,t){return e?r(e):void r(null,t)}):r(null,this._file.slice(e,t))}},{key:"close",value:function(){}}]),cAa),StreamSource=(_createClass(jAa,[{key:"slice",value:function(e,t,r){if(!(e<this._bufferOffset))return this._readUntilEnoughDataOrDone(e,t,r);r(new Error("Requested data is before the reader's current offset"))}},{key:"_readUntilEnoughDataOrDone",value:function(r,n,i){var e,o=this,t=n<=this._bufferOffset+__len_83(this._buffer);this._done||t?(e=this._getDataFromBuffer(r,n),i(null,e,null==e&&this._done)):this._reader.read().then(function(e){var t=e.value;e.done?o._done=!0:void 0===o._buffer?o._buffer=t:o._buffer=function(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}throw new Error("Unknown data type")}(o._buffer,t),o._readUntilEnoughDataOrDone(r,n,i)}).catch(function(e){i(new Error("Error during read: "+e))})}},{key:"_getDataFromBuffer",value:function(e,t){e>this._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var r=0===__len_83(this._buffer);return this._done&&r?null:this._buffer.slice(0,t-e)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}]),jAa);function jAa(e,t){_classCallCheck(this,jAa),this._chunkSize=t,this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}function cAa(e){_classCallCheck(this,cAa),this._file=e,this.size=e.size}function __len_83(e){return void 0===e?0:void 0!==e.size?e.size:e.length}var _$storage_84={};Object.defineProperty(_$storage_84,"__esModule",{value:!0});var ___createClass_84=function(e,t,r){return t&&FAa(e.prototype,t),r&&FAa(e,r),e};function FAa(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}_$storage_84.getStorage=function(){return hasStorage?new LocalStorage:null};var hasStorage=!1;try{hasStorage="localStorage"in window;var key="tusSupport";localStorage.setItem(key,localStorage.getItem(key))}catch(e){if(e.code!==e.SECURITY_ERR&&e.code!==e.QUOTA_EXCEEDED_ERR)throw e;hasStorage=!1}_$storage_84.canStoreURLs=hasStorage;var LocalStorage=(___createClass_84(OAa,[{key:"setItem",value:function(e,t,r){r(null,localStorage.setItem(e,t))}},{key:"getItem",value:function(e,t){t(null,localStorage.getItem(e))}},{key:"removeItem",value:function(e,t){t(null,localStorage.removeItem(e))}}]),OAa),_$fingerprint_78={};function OAa(){!function(e){if(!(e instanceof OAa))throw new TypeError("Cannot call a class as a function")}(this)}Object.defineProperty(_$fingerprint_78,"__esModule",{value:!0}),_$fingerprint_78.default=function(e,t,r){return(0,___isReactNative2_78.default)()?r(null,(i=t,o=(n=e).exif?function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t}(JSON.stringify(n.exif)):"noexif",["tus-rn",n.name||"noname",n.size||"nosize",o,i.endpoint].join("/"))):r(null,["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"));var n,i,o};var __obj_78,___isReactNative2_78=(__obj_78=_$isReactNative_80)&&__obj_78.__esModule?__obj_78:{default:__obj_78},_$upload_88={};Object.defineProperty(_$upload_88,"__esModule",{value:!0});var ___createClass_88=function(e,t,r){return t&&fBa(e.prototype,t),r&&fBa(e,r),e},_error2=___interopRequireDefault_88(_$error_86),_extend2=___interopRequireDefault_88(_$extend_36);function fBa(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ___interopRequireDefault_88(e){return e&&e.__esModule?e:{default:e}}var __defaultOptions_88={endpoint:null,fingerprint:___interopRequireDefault_88(_$fingerprint_78).default,resume:!0,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,headers:{},chunkSize:1/0,withCredentials:!1,uploadUrl:null,uploadSize:null,overridePatchMethod:!1,retryDelays:null,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,urlStorage:null,fileReader:null,uploadDataDuringCreation:!1},Upload=(___createClass_88(oBa,[{key:"start",value:function(){var r=this,e=this.file;e?this.options.endpoint||this.options.uploadUrl?(this.options.resume&&null==this._storage&&(this._storage=(0,_$storage_84.getStorage)()),this._source?this._start(this._source):(this.options.fileReader||_$source_83.getSource)(e,this.options.chunkSize,function(e,t){e?r._emitError(e):(r._source=t,r._start(t))})):this._emitError(new Error("tus: neither an endpoint or an upload URL is provided")):this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"_start",value:function(e){var o=this,t=this.file;if(this.options.uploadLengthDeferred)this._size=null;else if(null!=this.options.uploadSize){if(this._size=+this.options.uploadSize,isNaN(this._size))return void this._emitError(new Error("tus: cannot convert `uploadSize` option into a number"))}else if(this._size=e.size,null==this._size)return void this._emitError(new Error("tus: cannot automatically derive upload's size from input and must be specified manually using the `uploadSize` option"));var s=this.options.retryDelays;if(null!=s){if("[object Array]"!==Object.prototype.toString.call(s))return void this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));var a=this.options.onError;this.options.onError=function(e){o.options.onError=a,null!=o._offset&&o._offset>o._offsetBeforeRetry&&(o._retryAttempt=0);var t=!0;"undefined"!=typeof window&&"navigator"in window&&!1===window.navigator.onLine&&(t=!1);var r,n=e.originalRequest?e.originalRequest.status:0,i=!inStatusCategory(n,400)||409===n||423===n;o._retryAttempt<s.length&&null!=e.originalRequest&&i&&t?(r=s[o._retryAttempt++],o._offsetBeforeRetry=o._offset,o.options.uploadUrl=o.url,o._retryTimeout=setTimeout(function(){o.start()},r)):o._emitError(e)}}if(this._aborted=!1,null==this.url)return null!=this.options.uploadUrl?(this.url=this.options.uploadUrl,void this._resumeUpload()):void(this._hasStorage()?this.options.fingerprint(t,this.options,function(e,t){e?o._emitError(e):(o._fingerprint=t,o._storage.getItem(o._fingerprint,function(e,t){e?o._emitError(e):null!=t?(o.url=t,o._resumeUpload()):o._createUpload()}))}):this._createUpload());this._resumeUpload()}},{key:"abort",value:function(e,r){var n=this;null!==this._xhr&&(this._xhr.abort(),this._source.close()),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),r=r||function(){},e?oBa.terminate(this.url,this.options,function(e,t){return e?r(e,t):void(n._hasStorage()?n._storage.removeItem(n._fingerprint,r):r())}):r()}},{key:"_hasStorage",value:function(){return this.options.resume&&this._storage}},{key:"_emitXhrError",value:function(e,t,r){this._emitError(new _error2.default(t,r,e))}},{key:"_emitError",value:function(e){if("function"!=typeof this.options.onError)throw e;this.options.onError(e)}},{key:"_emitSuccess",value:function(){"function"==typeof this.options.onSuccess&&this.options.onSuccess()}},{key:"_emitProgress",value:function(e,t){"function"==typeof this.options.onProgress&&this.options.onProgress(e,t)}},{key:"_emitChunkComplete",value:function(e,t,r){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,r)}},{key:"_setupXHR",value:function(e){setupXHR(this._xhr=e,this.options)}},{key:"_createUpload",value:function(){var t,e,r=this;this.options.endpoint?((t=(0,_$request_82.newRequest)()).open("POST",this.options.endpoint,!0),t.onload=function(){if(inStatusCategory(t.status,200)){var e=t.getResponseHeader("Location");if(null!=e){if(r.url=(0,_$request_82.resolveUrl)(r.options.endpoint,e),0===r._size)return r._emitSuccess(),void r._source.close();r._hasStorage()&&r._storage.setItem(r._fingerprint,r.url,function(e){e&&r._emitError(e)}),r.options.uploadDataDuringCreation?r._handleUploadResponse(t):(r._offset=0,r._startUpload())}else r._emitXhrError(t,new Error("tus: invalid or missing Location header"))}else r._emitXhrError(t,new Error("tus: unexpected response while creating upload"))},t.onerror=function(e){r._emitXhrError(t,new Error("tus: failed to create upload"),e)},this._setupXHR(t),this.options.uploadLengthDeferred?t.setRequestHeader("Upload-Defer-Length",1):t.setRequestHeader("Upload-Length",this._size),""!==(e=function(e){var t=[];for(var r in e)t.push(r+" "+_$base64_44.Base64.encode(e[r]));return t.join(",")}(this.options.metadata))&&t.setRequestHeader("Upload-Metadata",e),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,this._addChunkToRequest(t)):t.send(null)):this._emitError(new Error("tus: unable to create upload because no endpoint is provided"))}},{key:"_resumeUpload",value:function(){var r=this,n=(0,_$request_82.newRequest)();n.open("HEAD",this.url,!0),n.onload=function(){if(!inStatusCategory(n.status,200))return r._hasStorage()&&inStatusCategory(n.status,400)&&r._storage.removeItem(r._fingerprint,function(e){e&&r._emitError(e)}),423===n.status?void r._emitXhrError(n,new Error("tus: upload is currently locked; retry later")):r.options.endpoint?(r.url=null,void r._createUpload()):void r._emitXhrError(n,new Error("tus: unable to resume upload (new upload cannot be created without an endpoint)"));var e=parseInt(n.getResponseHeader("Upload-Offset"),10);if(isNaN(e))r._emitXhrError(n,new Error("tus: invalid or missing offset value"));else{var t=parseInt(n.getResponseHeader("Upload-Length"),10);if(!isNaN(t)||r.options.uploadLengthDeferred){if(e===t)return r._emitProgress(t,t),void r._emitSuccess();r._offset=e,r._startUpload()}else r._emitXhrError(n,new Error("tus: invalid or missing length value"))}},n.onerror=function(e){r._emitXhrError(n,new Error("tus: failed to resume upload"),e)},this._setupXHR(n),n.send(null)}},{key:"_startUpload",value:function(){var t,r=this;this._aborted||(t=(0,_$request_82.newRequest)(),this.options.overridePatchMethod?(t.open("POST",this.url,!0),t.setRequestHeader("X-HTTP-Method-Override","PATCH")):t.open("PATCH",this.url,!0),t.onload=function(){inStatusCategory(t.status,200)?r._handleUploadResponse(t):r._emitXhrError(t,new Error("tus: unexpected response while uploading chunk"))},t.onerror=function(e){r._aborted||r._emitXhrError(t,new Error("tus: failed to upload chunk at offset "+r._offset),e)},this._setupXHR(t),t.setRequestHeader("Upload-Offset",this._offset),this._addChunkToRequest(t))}},{key:"_addChunkToRequest",value:function(n){var i=this;"upload"in n&&(n.upload.onprogress=function(e){e.lengthComputable&&i._emitProgress(t+e.loaded,i._size)}),n.setRequestHeader("Content-Type","application/offset+octet-stream");var t=this._offset,e=this._offset+this.options.chunkSize;(e===1/0||e>this._size)&&!this.options.uploadLengthDeferred&&(e=this._size),this._source.slice(t,e,function(e,t,r){e?i._emitError(e):(i.options.uploadLengthDeferred&&r&&(i._size=i._offset+(t&&t.size?t.size:0),n.setRequestHeader("Upload-Length",i._size)),null===t?n.send():(n.send(t),i._emitProgress(i._offset,i._size)))})}},{key:"_handleUploadResponse",value:function(e){var t=this,r=parseInt(e.getResponseHeader("Upload-Offset"),10);if(isNaN(r))this._emitXhrError(e,new Error("tus: invalid or missing offset value"));else{if(this._emitProgress(r,this._size),this._emitChunkComplete(r-this._offset,r,this._size),(this._offset=r)==this._size)return this.options.removeFingerprintOnSuccess&&this.options.resume&&this._storage.removeItem(this._fingerprint,function(e){e&&t._emitError(e)}),this._emitSuccess(),void this._source.close();this._startUpload()}}}],[{key:"terminate",value:function(e,t,r){if("function"!=typeof t&&"function"!=typeof r)throw new Error("tus: a callback function must be specified");"function"==typeof t&&(r=t,t={});var n=(0,_$request_82.newRequest)();n.open("DELETE",e,!0),n.onload=function(){204===n.status?r():r(new _error2.default(new Error("tus: unexpected response while terminating upload"),null,n))},n.onerror=function(e){r(new _error2.default(e,new Error("tus: failed to terminate upload"),n))},setupXHR(n,t),n.send(null)}}]),oBa);function oBa(e,t){!function(e){if(!(e instanceof oBa))throw new TypeError("Cannot call a class as a function")}(this),this.options=(0,_extend2.default)(!0,{},__defaultOptions_88,t),this._storage=this.options.urlStorage,this.file=e,this.url=null,this._xhr=null,this._fingerprint=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0}function inStatusCategory(e,t){return t<=e&&e<t+100}function setupXHR(e,t){e.setRequestHeader("Tus-Resumable","1.0.0");var r=t.headers||{};for(var n in r)e.setRequestHeader(n,r[n]);e.withCredentials=t.withCredentials}Upload.defaultOptions=__defaultOptions_88,_$upload_88.default=Upload;var __obj_87,_upload2=(__obj_87=_$upload_88)&&__obj_87.__esModule?__obj_87:{default:__obj_87},storage=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(_$storage_84),__defaultOptions_87=_upload2.default.defaultOptions,moduleExport={Upload:_upload2.default,canStoreURLs:storage.canStoreURLs,defaultOptions:__defaultOptions_87},_window,__XMLHttpRequest_87,__Blob_87;"undefined"!=typeof window?(_window=window,__XMLHttpRequest_87=_window.XMLHttpRequest,__Blob_87=_window.Blob,moduleExport.isSupported=__XMLHttpRequest_87&&__Blob_87&&"function"==typeof __Blob_87.prototype.slice):(moduleExport.isSupported=!0,moduleExport.FileStorage=storage.FileStorage);var _$moduleExport_87=moduleExport,_$getFingerprint_180=function(n){return function(e,t,r){return"undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)||"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()?_$moduleExport_87.Upload.defaultOptions.fingerprint(e,t,r):r(null,["tus",n.id,t.endpoint].join("-"))}},___class_181,___temp_181;function ___extends_181(){return(___extends_181=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_181(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_181=_$lib_104.Plugin,__Provider_181=_$lib_101.Provider,__RequestClient_181=_$lib_101.RequestClient,__Socket_181=_$lib_101.Socket,tusDefaultOptions={endpoint:"",resume:!0,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,headers:{},chunkSize:1/0,withCredentials:!1,uploadUrl:null,uploadSize:null,overridePatchMethod:!1,retryDelays:null},_$lib_181=(___temp_181=___class_181=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).type="uploader",r.id=r.opts.id||"Tus",r.title="Tus",r.opts=___extends_181({},{resume:!0,autoRetry:!0,useFastRemoteRetry:!0,limit:0,retryDelays:[0,1e3,3e3,5e3]},t),r.requests=new _$RateLimitedQueue_189(r.opts.limit),r.uploaders=Object.create(null),r.uploaderEvents=Object.create(null),r.uploaderSockets=Object.create(null),r.handleResetProgress=r.handleResetProgress.bind(___assertThisInitialized_181(r)),r.handleUpload=r.handleUpload.bind(___assertThisInitialized_181(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.handleResetProgress=function(){var r=___extends_181({},this.uppy.getState().files);Object.keys(r).forEach(function(e){var t;r[e].tus&&r[e].tus.uploadUrl&&(delete(t=___extends_181({},r[e].tus)).uploadUrl,r[e]=___extends_181({},r[e],{tus:t}))}),this.uppy.setState({files:r})},i.resetUploaderReferences=function(e,t){var r;void 0===t&&(t={}),this.uploaders[e]&&((r=this.uploaders[e]).abort(),t.abort&&setTimeout(function(){return r.abort(!0)},1e3),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null),this.uploaderSockets[e]&&(this.uploaderSockets[e].close(),this.uploaderSockets[e]=null)},i.upload=function(a,e,t){var u=this;return this.resetUploaderReferences(a.id),new Promise(function(t,r){u.uppy.emit("upload-started",a);var e=___extends_181({},tusDefaultOptions,u.opts,a.tus||{});e.fingerprint=_$getFingerprint_180(a),e.onError=function(e){u.uppy.log(e),_$isNetworkError_213(e.originalRequest)&&(e=new _$NetworkError_187(e,e.originalRequest)),u.resetUploaderReferences(a.id),s.done(),u.uppy.emit("upload-error",a,e),r(e)},e.onProgress=function(e,t){u.onReceiveUploadUrl(a,o.url),u.uppy.emit("upload-progress",a,{uploader:u,bytesUploaded:e,bytesTotal:t})},e.onSuccess=function(){var e={uploadURL:o.url};u.resetUploaderReferences(a.id),s.done(),u.uppy.emit("upload-success",a,e),o.url&&u.uppy.log("Download "+o.file.name+" from "+o.url),t(o)};function n(e,t,r){_$hasProperty_210(e,t)&&!_$hasProperty_210(e,r)&&(e[r]=e[t])}var i={};(Array.isArray(e.metaFields)?e.metaFields:Object.keys(a.meta)).forEach(function(e){i[e]=a.meta[e]}),n(i,"type","filetype"),n(i,"name","filename"),e.metadata=i;var o=new _$moduleExport_87.Upload(a.data,e);u.uploaders[a.id]=o,u.uploaderEvents[a.id]=new _$EventTracker_185(u.uppy);var s=u.requests.run(function(){return a.isPaused||o.start(),function(){}});u.onFileRemove(a.id,function(e){s.abort(),u.resetUploaderReferences(a.id,{abort:!!o.url}),t("upload "+e+" was removed")}),u.onPause(a.id,function(e){e?(s.abort(),o.abort()):(s.abort(),s=u.requests.run(function(){return o.start(),function(){}}))}),u.onPauseAll(a.id,function(){s.abort(),o.abort()}),u.onCancelAll(a.id,function(){s.abort(),u.resetUploaderReferences(a.id,{abort:!!o.url}),t("upload "+a.id+" was canceled")}),u.onResumeAll(a.id,function(){s.abort(),a.error&&o.abort(),s=u.requests.run(function(){return o.start(),function(){}})})}).catch(function(e){throw u.uppy.emit("upload-error",a,e),e})},i.uploadRemote=function(r,e,t){var n=this;this.resetUploaderReferences(r.id);var i=___extends_181({},this.opts);return r.tus&&___extends_181(i,r.tus),this.uppy.emit("upload-started",r),this.uppy.log(r.remote.url),r.serverToken?this.connectToServerSocket(r):new Promise(function(e,t){new(r.remote.providerOptions.provider?__Provider_181:__RequestClient_181)(n.uppy,r.remote.providerOptions).post(r.remote.url,___extends_181({},r.remote.body,{endpoint:i.endpoint,uploadUrl:i.uploadUrl,protocol:"tus",size:r.data.size,metadata:r.meta})).then(function(e){return n.uppy.setFileState(r.id,{serverToken:e.token}),r=n.uppy.getFile(r.id),n.connectToServerSocket(r)}).then(function(){e()}).catch(function(e){n.uppy.emit("upload-error",r,e),t(e)})})},i.connectToServerSocket=function(s){var a=this;return new Promise(function(r,n){var e=s.serverToken,t=_$getSocketHost_207(s.remote.companionUrl),i=new __Socket_181({target:t+"/api/"+e,autoOpen:!1});a.uploaderSockets[s.id]=i,a.uploaderEvents[s.id]=new _$EventTracker_185(a.uppy),a.onFileRemove(s.id,function(){o.abort(),i.send("pause",{}),i.send("cancel",{}),a.resetUploaderReferences(s.id),r("upload "+s.id+" was removed")}),a.onPause(s.id,function(e){e?(o.abort(),i.send("pause",{})):(o.abort(),o=a.requests.run(function(){return i.send("resume",{}),function(){}}))}),a.onPauseAll(s.id,function(){o.abort(),i.send("pause",{})}),a.onCancelAll(s.id,function(){o.abort(),i.send("pause",{}),i.send("cancel",{}),a.resetUploaderReferences(s.id),r("upload "+s.id+" was canceled")}),a.onResumeAll(s.id,function(){o.abort(),s.error&&i.send("pause",{}),o=a.requests.run(function(){return i.send("resume",{}),function(){}})}),a.onRetry(s.id,function(){i.isOpen&&(i.send("pause",{}),i.send("resume",{}))}),a.onRetryAll(s.id,function(){i.isOpen&&(i.send("pause",{}),i.send("resume",{}))}),i.on("progress",function(e){return _$emitSocketProgress_193(a,e,s)}),i.on("error",function(e){var t=e.error.message,r=___extends_181(new Error(t),{cause:e.error});a.opts.useFastRemoteRetry?i.close():(a.resetUploaderReferences(s.id),a.uppy.setFileState(s.id,{serverToken:null})),a.uppy.emit("upload-error",s,r),o.done(),n(r)}),i.on("success",function(e){var t={uploadURL:e.url};a.uppy.emit("upload-success",s,t),a.resetUploaderReferences(s.id),o.done(),r()});var o=a.requests.run(function(){return i.open(),s.isPaused&&i.send("pause",{}),function(){}})})},i.onReceiveUploadUrl=function(e,t){var r=this.uppy.getFile(e.id);r&&(r.tus&&r.tus.uploadUrl===t||(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(r.id,{tus:___extends_181({},r.tus,{uploadUrl:t})})))},i.onFileRemove=function(t,r){this.uploaderEvents[t].on("file-removed",function(e){t===e.id&&r(e.id)})},i.onPause=function(r,n){this.uploaderEvents[r].on("upload-pause",function(e,t){r===e&&n(t)})},i.onRetry=function(t,r){this.uploaderEvents[t].on("upload-retry",function(e){t===e&&r()})},i.onRetryAll=function(t,r){var n=this;this.uploaderEvents[t].on("retry-all",function(e){n.uppy.getFile(t)&&r()})},i.onPauseAll=function(e,t){var r=this;this.uploaderEvents[e].on("pause-all",function(){r.uppy.getFile(e)&&t()})},i.onCancelAll=function(e,t){var r=this;this.uploaderEvents[e].on("cancel-all",function(){r.uppy.getFile(e)&&t()})},i.onResumeAll=function(e,t){var r=this;this.uploaderEvents[e].on("resume-all",function(){r.uppy.getFile(e)&&t()})},i.uploadFiles=function(i){var o=this,e=i.map(function(e,t){var r=t+1,n=i.length;return"error"in e&&e.error?Promise.reject(new Error(e.error)):e.isRemote?o.uploadRemote(e,r,n):o.upload(e,r,n)});return _$settle_219(e)},i.handleUpload=function(e){var t=this;if(0===e.length)return this.uppy.log("[Tus] No files to upload"),Promise.resolve();0===this.opts.limit&&this.uppy.log("[Tus] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/tus/#limit-0","warning"),this.uppy.log("[Tus] Uploading...");var r=e.map(function(e){return t.uppy.getFile(e)});return this.uploadFiles(r).then(function(){return null})},i.install=function(){this.uppy.setState({capabilities:___extends_181({},this.uppy.getState().capabilities,{resumableUploads:!0})}),this.uppy.addUploader(this.handleUpload),this.uppy.on("reset-progress",this.handleResetProgress),this.opts.autoRetry&&this.uppy.on("back-online",this.uppy.retryAll)},i.uninstall=function(){this.uppy.setState({capabilities:___extends_181({},this.uppy.getState().capabilities,{resumableUploads:!1})}),this.uppy.removeUploader(this.handleUpload),this.opts.autoRetry&&this.uppy.off("back-online",this.uppy.retryAll)},r}(__Plugin_181),___class_181.VERSION="1.6.0",___temp_181),re=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],_$parseuri_52=function(e){var t=e,r=e.indexOf("["),n=e.indexOf("]");-1!=r&&-1!=n&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));for(var i=re.exec(e||""),o={},s=14;s--;)o[parts[s]]=i[s]||"";return-1!=r&&-1!=n&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o},s=1e3,m=60*s,__h_68=60*m,d=24*__h_68,y=365.25*d;function plural(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var _$ms_68=function(e,t){t=t||{};var r,n,i=typeof e;if("string"==i&&0<e.length)return function(e){if(!(100<(e=String(e)).length)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*y;case"days":case"day":case"d":return r*d;case"hours":case"hour":case"hrs":case"hr":case"h":return r*__h_68;case"minutes":case"minute":case"mins":case"min":case"m":return r*m;case"seconds":case"second":case"secs":case"sec":case"s":return r*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"==i&&!1===isNaN(e))return t.long?plural(r=e,d,"day")||plural(r,__h_68,"hour")||plural(r,m,"minute")||plural(r,s,"second")||r+" ms":d<=(n=e)?Math.round(n/d)+"d":__h_68<=n?Math.round(n/__h_68)+"h":m<=n?Math.round(n/m)+"m":s<=n?Math.round(n/s)+"s":n+"ms";throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},_$debug_67={};function createDebug(e){var n;function a(){if(a.enabled){var i=a,e=+new Date,t=e-(n||e);i.diff=t,i.prev=n,i.curr=e,n=e;for(var o=new Array(arguments.length),r=0;r<o.length;r++)o[r]=arguments[r];o[0]=_$debug_67.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var s=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return e;s++;var r,n=_$debug_67.formatters[t];return"function"==typeof n&&(r=o[s],e=n.call(i,r),o.splice(s,1),s--),e}),_$debug_67.formatArgs.call(i,o),(a.log||_$debug_67.log||console.log.bind(console)).apply(i,o)}}return a.namespace=e,a.enabled=_$debug_67.enabled(e),a.useColors=_$debug_67.useColors(),a.color=function(e){var t,r=0;for(t in e)r=(r<<5)-r+e.charCodeAt(t),r|=0;return _$debug_67.colors[Math.abs(r)%_$debug_67.colors.length]}(e),a.destroy=destroy,"function"==typeof _$debug_67.init&&_$debug_67.init(a),_$debug_67.instances.push(a),a}function destroy(){var e=_$debug_67.instances.indexOf(this);return-1!==e&&(_$debug_67.instances.splice(e,1),!0)}_$debug_67=createDebug.debug=createDebug.default=createDebug,_$debug_67.coerce=function(e){return e instanceof Error?e.stack||e.message:e},_$debug_67.disable=function(){_$debug_67.enable("")},_$debug_67.enable=function(e){_$debug_67.save(e),_$debug_67.names=[],_$debug_67.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),r=t.length,n=0;n<r;n++)t[n]&&("-"===(e=t[n].replace(/\*/g,".*?"))[0]?_$debug_67.skips.push(new RegExp("^"+e.substr(1)+"$")):_$debug_67.names.push(new RegExp("^"+e+"$")));for(n=0;n<_$debug_67.instances.length;n++){var i=_$debug_67.instances[n];i.enabled=_$debug_67.enabled(i.namespace)}},_$debug_67.enabled=function(e){if("*"===e[e.length-1])return!0;for(var t=0,r=_$debug_67.skips.length;t<r;t++)if(_$debug_67.skips[t].test(e))return!1;for(t=0,r=_$debug_67.names.length;t<r;t++)if(_$debug_67.names[t].test(e))return!0;return!1},_$debug_67.humanize=_$ms_68,_$debug_67.instances=[],_$debug_67.names=[],_$debug_67.skips=[],_$debug_67.formatters={};var _$browser_66={};(function(t){function e(){var e;try{e=_$browser_66.storage.debug}catch(e){}return!e&&void 0!==t&&"env"in t&&(e=t.env.DEBUG),e}(_$browser_66=_$debug_67).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},_$browser_66.formatArgs=function(e){var t,r,n,i=this.useColors;e[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+e[0]+(i?"%c ":" ")+"+"+_$browser_66.humanize(this.diff),i&&(t="color: "+this.color,e.splice(1,0,t,"color: inherit"),e[n=r=0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(r++,"%c"===e&&(n=r))}),e.splice(n,0,t))},_$browser_66.save=function(e){try{null==e?_$browser_66.storage.removeItem("debug"):_$browser_66.storage.debug=e}catch(e){}},_$browser_66.load=e,_$browser_66.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},_$browser_66.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),_$browser_66.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"],_$browser_66.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},_$browser_66.enable(e())}).call(this,_$browser_55);var debug=_$browser_66("socket.io-client:url"),_$url_64=function(e,t){var r=e;t=t||"undefined"!=typeof location&&location,null==e&&(e=t.protocol+"//"+t.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(debug("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),debug("parse %s",e),r=_$parseuri_52(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var n=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+n+":"+r.port,r.href=r.protocol+"://"+n+(t&&t.port===r.port?"":":"+r.port),r},__s_76=1e3,__m_76=60*__s_76,__h_76=60*__m_76,__d_76=24*__h_76,__y_76=365.25*__d_76;function __plural_76(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var _$ms_76=function(e,t){t=t||{};var r,n,i=typeof e;if("string"==i&&0<e.length)return function(e){if(!(100<(e=String(e)).length)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*__y_76;case"days":case"day":case"d":return r*__d_76;case"hours":case"hour":case"hrs":case"hr":case"h":return r*__h_76;case"minutes":case"minute":case"mins":case"min":case"m":return r*__m_76;case"seconds":case"second":case"secs":case"sec":case"s":return r*__s_76;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"==i&&!1===isNaN(e))return t.long?__plural_76(r=e,__d_76,"day")||__plural_76(r,__h_76,"hour")||__plural_76(r,__m_76,"minute")||__plural_76(r,__s_76,"second")||r+" ms":__d_76<=(n=e)?Math.round(n/__d_76)+"d":__h_76<=n?Math.round(n/__h_76)+"h":__m_76<=n?Math.round(n/__m_76)+"m":__s_76<=n?Math.round(n/__s_76)+"s":n+"ms";throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},_$debug_74={};function __createDebug_74(e){var n;function a(){if(a.enabled){var i=a,e=+new Date,t=e-(n||e);i.diff=t,i.prev=n,i.curr=e,n=e;for(var o=new Array(arguments.length),r=0;r<o.length;r++)o[r]=arguments[r];o[0]=_$debug_74.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var s=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return e;s++;var r,n=_$debug_74.formatters[t];return"function"==typeof n&&(r=o[s],e=n.call(i,r),o.splice(s,1),s--),e}),_$debug_74.formatArgs.call(i,o),(a.log||_$debug_74.log||console.log.bind(console)).apply(i,o)}}return a.namespace=e,a.enabled=_$debug_74.enabled(e),a.useColors=_$debug_74.useColors(),a.color=function(e){var t,r=0;for(t in e)r=(r<<5)-r+e.charCodeAt(t),r|=0;return _$debug_74.colors[Math.abs(r)%_$debug_74.colors.length]}(e),a.destroy=__destroy_74,"function"==typeof _$debug_74.init&&_$debug_74.init(a),_$debug_74.instances.push(a),a}function __destroy_74(){var e=_$debug_74.instances.indexOf(this);return-1!==e&&(_$debug_74.instances.splice(e,1),!0)}_$debug_74=__createDebug_74.debug=__createDebug_74.default=__createDebug_74,_$debug_74.coerce=function(e){return e instanceof Error?e.stack||e.message:e},_$debug_74.disable=function(){_$debug_74.enable("")},_$debug_74.enable=function(e){_$debug_74.save(e),_$debug_74.names=[],_$debug_74.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),r=t.length,n=0;n<r;n++)t[n]&&("-"===(e=t[n].replace(/\*/g,".*?"))[0]?_$debug_74.skips.push(new RegExp("^"+e.substr(1)+"$")):_$debug_74.names.push(new RegExp("^"+e+"$")));for(n=0;n<_$debug_74.instances.length;n++){var i=_$debug_74.instances[n];i.enabled=_$debug_74.enabled(i.namespace)}},_$debug_74.enabled=function(e){if("*"===e[e.length-1])return!0;for(var t=0,r=_$debug_74.skips.length;t<r;t++)if(_$debug_74.skips[t].test(e))return!1;for(t=0,r=_$debug_74.names.length;t<r;t++)if(_$debug_74.names[t].test(e))return!0;return!1},_$debug_74.humanize=_$ms_76,_$debug_74.instances=[],_$debug_74.names=[],_$debug_74.skips=[],_$debug_74.formatters={};var _$browser_73={};(function(t){function e(){var e;try{e=_$browser_73.storage.debug}catch(e){}return!e&&void 0!==t&&"env"in t&&(e=t.env.DEBUG),e}(_$browser_73=_$debug_74).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},_$browser_73.formatArgs=function(e){var t,r,n,i=this.useColors;e[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+e[0]+(i?"%c ":" ")+"+"+_$browser_73.humanize(this.diff),i&&(t="color: "+this.color,e.splice(1,0,t,"color: inherit"),e[n=r=0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(r++,"%c"===e&&(n=r))}),e.splice(n,0,t))},_$browser_73.save=function(e){try{null==e?_$browser_73.storage.removeItem("debug"):_$browser_73.storage.debug=e}catch(e){}},_$browser_73.load=e,_$browser_73.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},_$browser_73.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),_$browser_73.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"],_$browser_73.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},_$browser_73.enable(e())}).call(this,_$browser_55);var _$componentEmitter_72={exports:{}};function Emitter(e){if(e)return function(e){for(var t in Emitter.prototype)e[t]=Emitter.prototype[t];return e}(e)}_$componentEmitter_72.exports=Emitter,Emitter.prototype.on=Emitter.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Emitter.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<n.length;i++)if((r=n[i])===t||r.fn===t){n.splice(i,1);break}return this},Emitter.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),r=this._callbacks["$"+e];if(r)for(var n=0,i=(r=r.slice(0)).length;n<i;++n)r[n].apply(this,t);return this},Emitter.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Emitter.prototype.hasListeners=function(e){return!!this.listeners(e).length},_$componentEmitter_72=_$componentEmitter_72.exports;var toString={}.toString,_$isarray_75=Array.isArray||function(e){return"[object Array]"==toString.call(e)},_$isBuffer_71={};(function(t){_$isBuffer_71=function(e){return r&&t.isBuffer(e)||n&&(e instanceof ArrayBuffer||i(e))};var r="function"==typeof t&&"function"==typeof t.isBuffer,n="function"==typeof ArrayBuffer,i=function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}).call(this,_$buffer_8({}).Buffer);var _$binary_69={},__toString_69=Object.prototype.toString,withNativeBlob="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===__toString_69.call(Blob),withNativeFile="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===__toString_69.call(File);_$binary_69.deconstructPacket=function(e){var t=[],r=e.data,n=e;return n.data=function e(t,r){if(!t)return t;if(_$isBuffer_71(t)){var n={_placeholder:!0,num:r.length};return r.push(t),n}if(_$isarray_75(t)){for(var i=new Array(t.length),o=0;o<t.length;o++)i[o]=e(t[o],r);return i}if("object"!=typeof t||t instanceof Date)return t;for(var s in i={},t)i[s]=e(t[s],r);return i}(r,t),n.attachments=t.length,{packet:n,buffers:t}},_$binary_69.reconstructPacket=function(e,t){return e.data=function e(t,r){if(!t)return t;if(t&&t._placeholder)return r[t.num];if(_$isarray_75(t))for(var n=0;n<t.length;n++)t[n]=e(t[n],r);else if("object"==typeof t)for(var i in t)t[i]=e(t[i],r);return t}(e.data,t),e.attachments=void 0,e},_$binary_69.removeBlobs=function(e,a){var u=0,l=e;!function e(t,r,n){if(!t)return t;if(withNativeBlob&&t instanceof Blob||withNativeFile&&t instanceof File){u++;var i=new FileReader;i.onload=function(){n?n[r]=this.result:l=this.result,--u||a(l)},i.readAsArrayBuffer(t)}else if(_$isarray_75(t))for(var o=0;o<t.length;o++)e(t[o],o,t);else if("object"==typeof t&&!_$isBuffer_71(t))for(var s in t)e(t[s],s,t)}(l),u||a(l)};var _$socketIoParser_70={},__debug_70=_$browser_73("socket.io-parser");function Encoder(){}_$socketIoParser_70.protocol=4,_$socketIoParser_70.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],_$socketIoParser_70.CONNECT=0,_$socketIoParser_70.DISCONNECT=1,_$socketIoParser_70.EVENT=2,_$socketIoParser_70.ACK=3,_$socketIoParser_70.ERROR=4,_$socketIoParser_70.BINARY_EVENT=5,_$socketIoParser_70.BINARY_ACK=6,_$socketIoParser_70.Encoder=Encoder,_$socketIoParser_70.Decoder=Decoder;var ERROR_PACKET=_$socketIoParser_70.ERROR+'"encode error"';function encodeAsString(e){var t=""+e.type;if(_$socketIoParser_70.BINARY_EVENT!==e.type&&_$socketIoParser_70.BINARY_ACK!==e.type||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data){var r=function(e){try{return JSON.stringify(e)}catch(e){return!1}}(e.data);if(!1===r)return ERROR_PACKET;t+=r}return __debug_70("encoded %j as %s",e,t),t}function Decoder(){this.reconstructor=null}function BinaryReconstructor(e){this.reconPack=e,this.buffers=[]}function error(e){return{type:_$socketIoParser_70.ERROR,data:"parser error: "+e}}Encoder.prototype.encode=function(e,t){var i;__debug_70("encoding packet %j",e),_$socketIoParser_70.BINARY_EVENT===e.type||_$socketIoParser_70.BINARY_ACK===e.type?(i=t,_$binary_69.removeBlobs(e,function(e){var t=_$binary_69.deconstructPacket(e),r=encodeAsString(t.packet),n=t.buffers;n.unshift(r),i(n)})):t([encodeAsString(e)])},_$componentEmitter_72(Decoder.prototype),Decoder.prototype.add=function(e){var t;if("string"==typeof e)t=function(e){var t=0,r={type:Number(e.charAt(0))};if(null==_$socketIoParser_70.types[r.type])return error("unknown packet type "+r.type);if(_$socketIoParser_70.BINARY_EVENT===r.type||_$socketIoParser_70.BINARY_ACK===r.type){for(var n="";"-"!==e.charAt(++t)&&(n+=e.charAt(t),t!=e.length););if(n!=Number(n)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(n)}if("/"===e.charAt(t+1))for(r.nsp="";++t&&","!==(i=e.charAt(t))&&(r.nsp+=i,t!==e.length););else r.nsp="/";var i,o=e.charAt(t+1);if(""!==o&&Number(o)==o){for(r.id="";++t;){if(null==(i=e.charAt(t))||Number(i)!=i){--t;break}if(r.id+=e.charAt(t),t===e.length)break}r.id=Number(r.id)}if(e.charAt(++t)){var s=function(e){try{return JSON.parse(e)}catch(e){return!1}}(e.substr(t));if(!1===s||r.type!==_$socketIoParser_70.ERROR&&!_$isarray_75(s))return error("invalid payload");r.data=s}return __debug_70("decoded %s as %j",e,r),r}(e),_$socketIoParser_70.BINARY_EVENT===t.type||_$socketIoParser_70.BINARY_ACK===t.type?(this.reconstructor=new BinaryReconstructor(t),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",t)):this.emit("decoded",t);else{if(!_$isBuffer_71(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,this.emit("decoded",t))}},Decoder.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},BinaryReconstructor.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length!==this.reconPack.attachments)return null;var t=_$binary_69.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t},BinaryReconstructor.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]};var _$componentEmitter_26={exports:{}};function __Emitter_26(e){if(e)return function(e){for(var t in __Emitter_26.prototype)e[t]=__Emitter_26.prototype[t];return e}(e)}_$componentEmitter_26.exports=__Emitter_26,__Emitter_26.prototype.on=__Emitter_26.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},__Emitter_26.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},__Emitter_26.prototype.off=__Emitter_26.prototype.removeListener=__Emitter_26.prototype.removeAllListeners=__Emitter_26.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<n.length;i++)if((r=n[i])===t||r.fn===t){n.splice(i,1);break}return this},__Emitter_26.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),r=this._callbacks["$"+e];if(r)for(var n=0,i=(r=r.slice(0)).length;n<i;++n)r[n].apply(this,t);return this},__Emitter_26.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},__Emitter_26.prototype.hasListeners=function(e){return!!this.listeners(e).length},_$componentEmitter_26=_$componentEmitter_26.exports;var __s_29=1e3,__m_29=60*__s_29,__h_29=60*__m_29,__d_29=24*__h_29,__y_29=365.25*__d_29;function __plural_29(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var _$ms_29=function(e,t){t=t||{};var r,n,i=typeof e;if("string"==i&&0<e.length)return function(e){if(!(100<(e=String(e)).length)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*__y_29;case"days":case"day":case"d":return r*__d_29;case"hours":case"hour":case"hrs":case"hr":case"h":return r*__h_29;case"minutes":case"minute":case"mins":case"min":case"m":return r*__m_29;case"seconds":case"second":case"secs":case"sec":case"s":return r*__s_29;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"==i&&!1===isNaN(e))return t.long?__plural_29(r=e,__d_29,"day")||__plural_29(r,__h_29,"hour")||__plural_29(r,__m_29,"minute")||__plural_29(r,__s_29,"second")||r+" ms":__d_29<=(n=e)?Math.round(n/__d_29)+"d":__h_29<=n?Math.round(n/__h_29)+"h":__m_29<=n?Math.round(n/__m_29)+"m":__s_29<=n?Math.round(n/__s_29)+"s":n+"ms";throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},_$debug_28={};function __createDebug_28(e){var n;function a(){if(a.enabled){var i=a,e=+new Date,t=e-(n||e);i.diff=t,i.prev=n,i.curr=e,n=e;for(var o=new Array(arguments.length),r=0;r<o.length;r++)o[r]=arguments[r];o[0]=_$debug_28.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var s=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return e;s++;var r,n=_$debug_28.formatters[t];return"function"==typeof n&&(r=o[s],e=n.call(i,r),o.splice(s,1),s--),e}),_$debug_28.formatArgs.call(i,o),(a.log||_$debug_28.log||console.log.bind(console)).apply(i,o)}}return a.namespace=e,a.enabled=_$debug_28.enabled(e),a.useColors=_$debug_28.useColors(),a.color=function(e){var t,r=0;for(t in e)r=(r<<5)-r+e.charCodeAt(t),r|=0;return _$debug_28.colors[Math.abs(r)%_$debug_28.colors.length]}(e),a.destroy=__destroy_28,"function"==typeof _$debug_28.init&&_$debug_28.init(a),_$debug_28.instances.push(a),a}function __destroy_28(){var e=_$debug_28.instances.indexOf(this);return-1!==e&&(_$debug_28.instances.splice(e,1),!0)}_$debug_28=__createDebug_28.debug=__createDebug_28.default=__createDebug_28,_$debug_28.coerce=function(e){return e instanceof Error?e.stack||e.message:e},_$debug_28.disable=function(){_$debug_28.enable("")},_$debug_28.enable=function(e){_$debug_28.save(e),_$debug_28.names=[],_$debug_28.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),r=t.length,n=0;n<r;n++)t[n]&&("-"===(e=t[n].replace(/\*/g,".*?"))[0]?_$debug_28.skips.push(new RegExp("^"+e.substr(1)+"$")):_$debug_28.names.push(new RegExp("^"+e+"$")));for(n=0;n<_$debug_28.instances.length;n++){var i=_$debug_28.instances[n];i.enabled=_$debug_28.enabled(i.namespace)}},_$debug_28.enabled=function(e){if("*"===e[e.length-1])return!0;for(var t=0,r=_$debug_28.skips.length;t<r;t++)if(_$debug_28.skips[t].test(e))return!1;for(t=0,r=_$debug_28.names.length;t<r;t++)if(_$debug_28.names[t].test(e))return!0;return!1},_$debug_28.humanize=_$ms_29,_$debug_28.instances=[],_$debug_28.names=[],_$debug_28.skips=[],_$debug_28.formatters={};var _$browser_27={};(function(t){function e(){var e;try{e=_$browser_27.storage.debug}catch(e){}return!e&&void 0!==t&&"env"in t&&(e=t.env.DEBUG),e}(_$browser_27=_$debug_28).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},_$browser_27.formatArgs=function(e){var t,r,n,i=this.useColors;e[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+e[0]+(i?"%c ":" ")+"+"+_$browser_27.humanize(this.diff),i&&(t="color: "+this.color,e.splice(1,0,t,"color: inherit"),e[n=r=0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(r++,"%c"===e&&(n=r))}),e.splice(n,0,t))},_$browser_27.save=function(e){try{null==e?_$browser_27.storage.removeItem("debug"):_$browser_27.storage.debug=e}catch(e){}},_$browser_27.load=e,_$browser_27.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},_$browser_27.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),_$browser_27.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"],_$browser_27.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},_$browser_27.enable(e())}).call(this,_$browser_55);var indexOf=[].indexOf,_$indexof_42=function(e,t){if(indexOf)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1},_$parseqs_51={encode:function(e){var t="";for(var r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t},decode:function(e){for(var t={},r=e.split("&"),n=0,i=r.length;n<i;n++){var o=r[n].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}},_$keys_31=Object.keys||function(e){var t=[],r=Object.prototype.hasOwnProperty;for(var n in e)r.call(e,n)&&t.push(n);return t},__toString_39={}.toString,_$isarray_39=Array.isArray||function(e){return"[object Array]"==__toString_39.call(e)},_$hasBinary_38={};(function(o){var e=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===e.call(Blob),a="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===e.call(File);_$hasBinary_38=function e(t){if(!t||"object"!=typeof t)return!1;if(_$isarray_39(t)){for(var r=0,n=t.length;r<n;r++)if(e(t[r]))return!0;return!1}if("function"==typeof o&&o.isBuffer&&o.isBuffer(t)||"function"==typeof ArrayBuffer&&t instanceof ArrayBuffer||s&&t instanceof Blob||a&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return!0;return!1}}).call(this,_$buffer_8({}).Buffer);var _$arraybufferSlice_2=function(e,t,r){var n=e.byteLength;if(t=t||0,r=r||n,e.slice)return e.slice(t,r);if(t<0&&(t+=n),r<0&&(r+=n),n<r&&(r=n),n<=t||r<=t||0===n)return new ArrayBuffer(0);for(var i=new Uint8Array(e),o=new Uint8Array(r-t),s=t,a=0;s<r;s++,a++)o[a]=i[s];return o.buffer};function __noop_1(){}var _$after_1=function(e,r,n){var i=!1;return n=n||__noop_1,0===(o.count=e)?r():o;function o(e,t){if(o.count<=0)throw new Error("after called too many times");--o.count,e?(i=!0,r(e),r=n):0!==o.count||i||r(null,t)}},byteArray,byteCount,byteIndex,stringFromCharCode=String.fromCharCode;function ucs2decode(e){for(var t,r,n=[],i=0,o=e.length;i<o;)55296<=(t=e.charCodeAt(i++))&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function checkScalarValue(e,t){if(!(55296<=e&&e<=57343))return 1;if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function createByte(e,t){return stringFromCharCode(e>>t&63|128)}function encodeCodePoint(e,t){if(0==(4294967168&e))return stringFromCharCode(e);var r="";return 0==(4294965248&e)?r=stringFromCharCode(e>>6&31|192):0==(4294901760&e)?(checkScalarValue(e,t)||(e=65533),r=stringFromCharCode(e>>12&15|224),r+=createByte(e,6)):0==(4292870144&e)&&(r=stringFromCharCode(e>>18&7|240),r+=createByte(e,12),r+=createByte(e,6)),r+stringFromCharCode(63&e|128)}function readContinuationByte(){if(byteCount<=byteIndex)throw Error("Invalid byte index");var e=255&byteArray[byteIndex];if(byteIndex++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function decodeSymbol(e){var t,r;if(byteCount<byteIndex)throw Error("Invalid byte index");if(byteIndex==byteCount)return!1;if(t=255&byteArray[byteIndex],byteIndex++,0==(128&t))return t;if(192==(224&t)){if(128<=(r=(31&t)<<6|readContinuationByte()))return r;throw Error("Invalid continuation byte")}if(224==(240&t)){if(2048<=(r=(15&t)<<12|readContinuationByte()<<6|readContinuationByte()))return checkScalarValue(r,e)?r:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&65536<=(r=(7&t)<<18|readContinuationByte()<<12|readContinuationByte()<<6|readContinuationByte())&&r<=1114111)return r;throw Error("Invalid UTF-8 detected")}var _$utf8_32={encode:function(e,t){for(var r=!1!==(t=t||{}).strict,n=ucs2decode(e),i=n.length,o=-1,s="";++o<i;)s+=encodeCodePoint(n[o],r);return s},decode:function(e,t){var r=!1!==(t=t||{}).strict;byteArray=ucs2decode(e),byteCount=byteArray.length,byteIndex=0;for(var n,i=[];!1!==(n=decodeSymbol(r));)i.push(n);return function(e){for(var t,r=e.length,n=-1,i="";++n<r;)65535<(t=e[n])&&(i+=stringFromCharCode((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=stringFromCharCode(t);return i}(i)}},_$base64Arraybuffer_4={};!function(){"use strict";for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=new Uint8Array(256),e=0;e<o.length;e++)p[o.charCodeAt(e)]=e;_$base64Arraybuffer_4.encode=function(e){for(var t=new Uint8Array(e),r=t.length,n="",i=0;i<r;i+=3)n+=o[t[i]>>2],n+=o[(3&t[i])<<4|t[i+1]>>4],n+=o[(15&t[i+1])<<2|t[i+2]>>6],n+=o[63&t[i+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n},_$base64Arraybuffer_4.decode=function(e){var t,r,n,i,o=.75*e.length,s=e.length,a=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);for(var u=new ArrayBuffer(o),l=new Uint8Array(u),c=0;c<s;c+=4)t=p[e.charCodeAt(c)],r=p[e.charCodeAt(c+1)],n=p[e.charCodeAt(c+2)],i=p[e.charCodeAt(c+3)],l[a++]=t<<2|r>>4,l[a++]=(15&r)<<4|n>>2,l[a++]=(3&n)<<6|63&i;return u}}();var _$blob_6={},BlobBuilder=void 0!==BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,blobSupported=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),blobSupportsArrayBufferView=blobSupported&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),blobBuilderSupported=BlobBuilder&&BlobBuilder.prototype.append&&BlobBuilder.prototype.getBlob;function mapArrayBufferViews(e){return e.map(function(e){if(e.buffer instanceof ArrayBuffer){var t,r=e.buffer;return e.byteLength!==r.byteLength&&((t=new Uint8Array(e.byteLength)).set(new Uint8Array(r,e.byteOffset,e.byteLength)),r=t.buffer),r}return e})}function BlobBuilderConstructor(e,t){t=t||{};var r=new BlobBuilder;return mapArrayBufferViews(e).forEach(function(e){r.append(e)}),t.type?r.getBlob(t.type):r.getBlob()}function BlobConstructor(e,t){return new Blob(mapArrayBufferViews(e),t||{})}"undefined"!=typeof Blob&&(BlobBuilderConstructor.prototype=Blob.prototype,BlobConstructor.prototype=Blob.prototype),_$blob_6=blobSupported?blobSupportsArrayBufferView?Blob:BlobConstructor:blobBuilderSupported?BlobBuilderConstructor:void 0;var _$browser_30={},base64encoder;"undefined"!=typeof ArrayBuffer&&(base64encoder=_$base64Arraybuffer_4);var isAndroid="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),isPhantomJS="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),dontSendBlobs=isAndroid||isPhantomJS;_$browser_30.protocol=3;var packets=_$browser_30.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},packetslist=_$keys_31(packets),err={type:"error",data:"parser error"};function map(e,t,r){for(var i=new Array(e.length),n=_$after_1(e.length,r),o=0;o<e.length;o++)!function(r,e,n){t(e,function(e,t){i[r]=t,n(e,i)})}(o,e[o],n)}_$browser_30.encodePacket=function(e,s,t,r){"function"==typeof s&&(r=s,s=!1),"function"==typeof t&&(r=t,t=null);var n=void 0===e.data?void 0:e.data.buffer||e.data;if("undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer)return function(e,t){if(!s)return _$browser_30.encodeBase64Packet(e,t);var r=e.data,n=new Uint8Array(r),i=new Uint8Array(1+r.byteLength);i[0]=packets[e.type];for(var o=0;o<n.length;o++)i[o+1]=n[o];return t(i.buffer)}(e,r);if(void 0!==_$blob_6&&n instanceof _$blob_6)return function(e,t,r){if(!t)return _$browser_30.encodeBase64Packet(e,r);if(dontSendBlobs)return function(e,t,r){if(!t)return _$browser_30.encodeBase64Packet(e,r);var n=new FileReader;return n.onload=function(){_$browser_30.encodePacket({type:e.type,data:n.result},t,!0,r)},n.readAsArrayBuffer(e.data)}(e,t,r);var n=new Uint8Array(1);return n[0]=packets[e.type],r(new _$blob_6([n.buffer,e.data]))}(e,s,r);if(n&&n.base64)return r("b"+_$browser_30.packets[e.type]+e.data.data);var i=packets[e.type];return void 0!==e.data&&(i+=t?_$utf8_32.encode(String(e.data),{strict:!1}):String(e.data)),r(""+i)},_$browser_30.encodeBase64Packet=function(t,r){var n,i="b"+_$browser_30.packets[t.type];if(void 0!==_$blob_6&&t.data instanceof _$blob_6){var o=new FileReader;return o.onload=function(){var e=o.result.split(",")[1];r(i+e)},o.readAsDataURL(t.data)}try{n=String.fromCharCode.apply(null,new Uint8Array(t.data))}catch(e){for(var s=new Uint8Array(t.data),a=new Array(s.length),u=0;u<s.length;u++)a[u]=s[u];n=String.fromCharCode.apply(null,a)}return i+=btoa(n),r(i)},_$browser_30.decodePacket=function(e,t,r){if(void 0===e)return err;if("string"==typeof e){if("b"===e.charAt(0))return _$browser_30.decodeBase64Packet(e.substr(1),t);if(r&&!1===(e=function(e){try{e=_$utf8_32.decode(e,{strict:!1})}catch(e){return!1}return e}(e)))return err;var n=e.charAt(0);return Number(n)==n&&packetslist[n]?1<e.length?{type:packetslist[n],data:e.substring(1)}:{type:packetslist[n]}:err}n=new Uint8Array(e)[0];var i=_$arraybufferSlice_2(e,1);return _$blob_6&&"blob"===t&&(i=new _$blob_6([i])),{type:packetslist[n],data:i}},_$browser_30.decodeBase64Packet=function(e,t){var r=packetslist[e.charAt(0)];if(!base64encoder)return{type:r,data:{base64:!0,data:e.substr(1)}};var n=base64encoder.decode(e.substr(1));return"blob"===t&&_$blob_6&&(n=new _$blob_6([n])),{type:r,data:n}},_$browser_30.encodePayload=function(e,r,n){"function"==typeof r&&(n=r,r=null);var i=_$hasBinary_38(e);return r&&i?_$blob_6&&!dontSendBlobs?_$browser_30.encodePayloadAsBlob(e,n):_$browser_30.encodePayloadAsArrayBuffer(e,n):e.length?void map(e,function(e,t){_$browser_30.encodePacket(e,!!i&&r,!1,function(e){t(null,e.length+":"+e)})},function(e,t){return n(t.join(""))}):n("0:")},_$browser_30.decodePayload=function(e,t,r){if("string"!=typeof e)return _$browser_30.decodePayloadAsBinary(e,t,r);var n;if("function"==typeof t&&(r=t,t=null),""===e)return r(err,0,1);for(var i,o,s="",a=0,u=e.length;a<u;a++){var l=e.charAt(a);if(":"===l){if(""===s||s!=(i=Number(s)))return r(err,0,1);if(s!=(o=e.substr(a+1,i)).length)return r(err,0,1);if(o.length){if(n=_$browser_30.decodePacket(o,t,!1),err.type===n.type&&err.data===n.data)return r(err,0,1);if(!1===r(n,a+i,u))return}a+=i,s=""}else s+=l}return""!==s?r(err,0,1):void 0},_$browser_30.encodePayloadAsArrayBuffer=function(e,n){if(!e.length)return n(new ArrayBuffer(0));map(e,function(e,t){_$browser_30.encodePacket(e,!0,!0,function(e){return t(null,e)})},function(e,t){var r=t.reduce(function(e,t){var r;return e+(r="string"==typeof t?t.length:t.byteLength).toString().length+r+2},0),s=new Uint8Array(r),a=0;return t.forEach(function(e){var t="string"==typeof e,r=e;if(t){for(var n=new Uint8Array(e.length),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);r=n.buffer}s[a++]=t?0:1;for(var o=r.byteLength.toString(),i=0;i<o.length;i++)s[a++]=parseInt(o[i]);for(s[a++]=255,n=new Uint8Array(r),i=0;i<n.length;i++)s[a++]=n[i]}),n(s.buffer)})},_$browser_30.encodePayloadAsBlob=function(e,r){map(e,function(e,a){_$browser_30.encodePacket(e,!0,!0,function(e){var t=new Uint8Array(1);if(t[0]=1,"string"==typeof e){for(var r=new Uint8Array(e.length),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);e=r.buffer,t[0]=0}for(var i,o=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),s=new Uint8Array(o.length+1),n=0;n<o.length;n++)s[n]=parseInt(o[n]);s[o.length]=255,_$blob_6&&(i=new _$blob_6([t.buffer,s.buffer,e]),a(null,i))})},function(e,t){return r(new _$blob_6(t))})},_$browser_30.decodePayloadAsBinary=function(e,r,n){"function"==typeof r&&(n=r,r=null);for(var t=e,i=[];0<t.byteLength;){for(var o=new Uint8Array(t),s=0===o[0],a="",u=1;255!==o[u];u++){if(310<a.length)return n(err,0,1);a+=o[u]}t=_$arraybufferSlice_2(t,2+a.length),a=parseInt(a);var l=_$arraybufferSlice_2(t,0,a);if(s)try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(e){var c=new Uint8Array(l);for(l="",u=0;u<c.length;u++)l+=String.fromCharCode(c[u])}i.push(l),t=_$arraybufferSlice_2(t,a)}var p=i.length;i.forEach(function(e,t){n(_$browser_30.decodePacket(e,r,!0),t,p)})};var _$transport_19={};function Transport(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}_$transport_19=Transport,_$componentEmitter_26(Transport.prototype),Transport.prototype.onError=function(e,t){var r=new Error(e);return r.type="TransportError",r.description=t,this.emit("error",r),this},Transport.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},Transport.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},Transport.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},Transport.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},Transport.prototype.onData=function(e){var t=_$browser_30.decodePacket(e,this.socket.binaryType);this.onPacket(t)},Transport.prototype.onPacket=function(e){this.emit("packet",e)},Transport.prototype.onClose=function(){this.readyState="closed",this.emit("close")};var _$hasCors_40={};try{_$hasCors_40="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(err){_$hasCors_40=!1}var _$xmlhttprequest_25=function(e){var t=e.xdomain,r=e.xscheme,n=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||_$hasCors_40))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!r&&n)return new XDomainRequest}catch(e){}if(!t)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}},_$componentInherit_12=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},_$yeast_92={},prev,alphabet="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),length=64,__map_92={},seed=0,__i_92=0;function encode(e){for(var t="";t=alphabet[e%length]+t,0<(e=Math.floor(e/length)););return t}function yeast(){var e=encode(+new Date);return e!==prev?(seed=0,prev=e):e+"."+encode(seed++)}for(;__i_92<length;__i_92++)__map_92[alphabet[__i_92]]=__i_92;yeast.encode=encode,yeast.decode=function(e){var t=0;for(__i_92=0;__i_92<e.length;__i_92++)t=t*length+__map_92[e.charAt(__i_92)];return t},_$yeast_92=yeast;var __debug_23=_$browser_27("engine.io-client:polling"),_$Polling_23=Polling,hasXHR2=null!=new _$xmlhttprequest_25({xdomain:!1}).responseType;function Polling(e){var t=e&&e.forceBase64;hasXHR2&&!t||(this.supportsBinary=!1),_$transport_19.call(this,e)}_$componentInherit_12(Polling,_$transport_19),Polling.prototype.name="polling",Polling.prototype.doOpen=function(){this.poll()},Polling.prototype.pause=function(e){var t,r=this;function n(){__debug_23("paused"),r.readyState="paused",e()}this.readyState="pausing",this.polling||!this.writable?(t=0,this.polling&&(__debug_23("we are currently polling - waiting to pause"),t++,this.once("pollComplete",function(){__debug_23("pre-pause polling complete"),--t||n()})),this.writable||(__debug_23("we are currently writing - waiting to pause"),t++,this.once("drain",function(){__debug_23("pre-pause writing complete"),--t||n()}))):n()},Polling.prototype.poll=function(){__debug_23("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},Polling.prototype.onData=function(e){var n=this;__debug_23("polling got data %s",e),_$browser_30.decodePayload(e,this.socket.binaryType,function(e,t,r){return"opening"===n.readyState&&n.onOpen(),"close"===e.type?(n.onClose(),!1):void n.onPacket(e)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():__debug_23('ignoring poll - transport state "%s"',this.readyState))},Polling.prototype.doClose=function(){var e=this;function t(){__debug_23("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(__debug_23("transport open - closing"),t()):(__debug_23("transport not open - deferring close"),this.once("open",t))},Polling.prototype.write=function(e){var t=this;this.writable=!1;function r(){t.writable=!0,t.emit("drain")}_$browser_30.encodePayload(e,this.supportsBinary,function(e){t.doWrite(e,r)})},Polling.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(e[this.timestampParam]=_$yeast_92()),this.supportsBinary||e.sid||(e.b64=1),e=_$parseqs_51.encode(e),this.port&&("https"==t&&443!==Number(this.port)||"http"==t&&80!==Number(this.port))&&(r=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e};var _$pollingXhr_22={},__debug_22=_$browser_27("engine.io-client:polling-xhr");function empty(){}function XHR(e){var t,r;_$Polling_23.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,"undefined"!=typeof location&&(t="https:"===location.protocol,r=(r=location.port)||(t?443:80),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||r!==e.port,this.xs=e.secure!==t)}function Request(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}var terminationEvent,_$pollingXhr_22=XHR;function unloadHandler(){for(var e in Request.requests)Request.requests.hasOwnProperty(e)&&Request.requests[e].abort()}_$pollingXhr_22.Request=Request,_$componentInherit_12(XHR,_$Polling_23),XHR.prototype.supportsBinary=!0,XHR.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new Request(e)},XHR.prototype.doWrite=function(e,t){var r="string"!=typeof e&&void 0!==e,n=this.request({method:"POST",data:e,isBinary:r}),i=this;n.on("success",t),n.on("error",function(e){i.onError("xhr post error",e)}),this.sendXhr=n},XHR.prototype.doPoll=function(){__debug_22("xhr poll");var e=this.request(),t=this;e.on("data",function(e){t.onData(e)}),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e},_$componentEmitter_26(Request.prototype),Request.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new _$xmlhttprequest_25(e),r=this;try{__debug_22("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var n in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(n)&&t.setRequestHeader(n,this.extraHeaders[n])}catch(e){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){r.onLoad()},t.onerror=function(){r.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState)try{var e=t.getResponseHeader("Content-Type");r.supportsBinary&&"application/octet-stream"===e&&(t.responseType="arraybuffer")}catch(e){}4===t.readyState&&(200===t.status||1223===t.status?r.onLoad():setTimeout(function(){r.onError(t.status)},0))},__debug_22("xhr data %s",this.data),t.send(this.data)}catch(e){return void setTimeout(function(){r.onError(e)},0)}"undefined"!=typeof document&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)},Request.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Request.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},Request.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},Request.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=empty:this.xhr.onreadystatechange=empty,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete Request.requests[this.index],this.xhr=null}},Request.prototype.onLoad=function(){var e,t;try{try{t=this.xhr.getResponseHeader("Content-Type")}catch(e){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},Request.prototype.hasXDR=function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR},Request.prototype.abort=function(){this.cleanup()},Request.requestsCount=0,Request.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",unloadHandler):"function"==typeof addEventListener&&(terminationEvent="onpagehide"in self?"pagehide":"unload",addEventListener(terminationEvent,unloadHandler,!1)));var _$JSONPPolling_21={};(function(n){var i,l=/\n/g,c=/\\n/g;function o(){}function e(e){var t;_$Polling_23.call(this,e),this.query=this.query||{},i||(t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{},i=t.___eio=t.___eio||[]),this.index=i.length;var r=this;i.push(function(e){r.onData(e)}),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",function(){r.script&&(r.script.onerror=o)},!1)}_$componentInherit_12(_$JSONPPolling_21=e,_$Polling_23),e.prototype.supportsBinary=!1,e.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),_$Polling_23.prototype.doClose.call(this)},e.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(e,r):(document.head||document.body).appendChild(e),this.script=e,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},e.prototype.doWrite=function(e,t){var r,n,i,o,s=this;function a(){u(),t()}function u(){if(s.iframe)try{s.form.removeChild(s.iframe)}catch(e){s.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+s.iframeId+'">';r=document.createElement(e)}catch(e){(r=document.createElement("iframe")).name=s.iframeId,r.src="javascript:0"}r.id=s.iframeId,s.form.appendChild(r),s.iframe=r}this.form||(n=document.createElement("form"),i=document.createElement("textarea"),o=this.iframeId="eio_iframe_"+this.index,n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=o,n.method="POST",n.setAttribute("accept-charset","utf-8"),i.name="d",n.appendChild(i),document.body.appendChild(n),this.form=n,this.area=i),this.form.action=this.uri(),u(),e=e.replace(c,"\\\n"),this.area.value=e.replace(l,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===s.iframe.readyState&&a()}:this.iframe.onload=a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var _$websocket_24={};(function(o){var t,r,s=_$browser_27("engine.io-client:websocket");if("undefined"!=typeof WebSocket)t=WebSocket;else if("undefined"!=typeof self)t=self.WebSocket||self.MozWebSocket;else try{r=_$empty_7({})}catch(e){}var n=t||r;function e(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=t&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(n=r),_$transport_19.call(this,e)}_$componentInherit_12(_$websocket_24=e,_$transport_19),e.prototype.name="websocket",e.prototype.supportsBinary=!0,e.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new n(e,t):new n(e):new n(e,t,r)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},e.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},e.prototype.write=function(e){var n=this;this.writable=!1;for(var i=e.length,t=0,r=i;t<r;t++)!function(r){_$browser_30.encodePacket(r,n.supportsBinary,function(e){var t;n.usingBrowserWebSocket||(t={},r.options&&(t.compress=r.options.compress),n.perMessageDeflate&&("string"==typeof e?o.byteLength(e):e.length)<n.perMessageDeflate.threshold&&(t.compress=!1));try{n.usingBrowserWebSocket?n.ws.send(e):n.ws.send(e,t)}catch(e){s("websocket closed before onclose event")}--i||(n.emit("flush"),setTimeout(function(){n.writable=!0,n.emit("drain")},0))})}(e[t])},e.prototype.onClose=function(){_$transport_19.prototype.onClose.call(this)},e.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},e.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",r="";return this.port&&("wss"==t&&443!==Number(this.port)||"ws"==t&&80!==Number(this.port))&&(r=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=_$yeast_92()),this.supportsBinary||(e.b64=1),(e=_$parseqs_51.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e},e.prototype.check=function(){return!(!n||"__initialize"in n&&this.name===e.prototype.name)}}).call(this,_$buffer_8({}).Buffer);var _$transports_20={polling:function(e){var t,r,n=!1,i=!1,o=!1!==e.jsonp;if("undefined"!=typeof location&&(t="https:"===location.protocol,r=(r=location.port)||(t?443:80),n=e.hostname!==location.hostname||r!==e.port,i=e.secure!==t),e.xdomain=n,e.xscheme=i,"open"in new _$xmlhttprequest_25(e)&&!e.forceJSONP)return new _$pollingXhr_22(e);if(!o)throw new Error("JSONP disabled");return new _$JSONPPolling_21(e)}};_$transports_20.websocket=_$websocket_24;var _$socket_18={},__debug_18=_$browser_27("engine.io-client:socket");function __Socket_18(e,t){if(!(this instanceof __Socket_18))return new __Socket_18(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=_$parseuri_52(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=_$parseuri_52(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.agent=t.agent||!1,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.query=t.query||{},"string"==typeof this.query&&(this.query=_$parseqs_51.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized||t.rejectUnauthorized,this.forceNode=!!t.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),"undefined"!=typeof self&&!this.isReactNative||(t.extraHeaders&&0<Object.keys(t.extraHeaders).length&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}_$socket_18=__Socket_18,__Socket_18.priorWebsocketSuccess=!1,_$componentEmitter_26(__Socket_18.prototype),__Socket_18.protocol=_$browser_30.protocol,__Socket_18.Socket=__Socket_18,__Socket_18.Transport=_$transport_19,__Socket_18.transports=_$transports_20,__Socket_18.parser=_$browser_30,__Socket_18.prototype.createTransport=function(e){__debug_18('creating transport "%s"',e);var t=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}(this.query);t.EIO=_$browser_30.protocol,t.transport=e;var r=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new _$transports_20[e]({query:t,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0,isReactNative:this.isReactNative})},__Socket_18.prototype.open=function(){var e;if(this.rememberUpgrade&&__Socket_18.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout(function(){t.emit("error","No transports available")},0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},__Socket_18.prototype.setTransport=function(e){__debug_18("setting transport %s",e.name);var t=this;this.transport&&(__debug_18("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),(this.transport=e).on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},__Socket_18.prototype.probe=function(r){__debug_18('probing transport "%s"',r);var n=this.createTransport(r,{probe:1}),i=!1,o=this;function e(){var e;o.onlyBinaryUpgrades&&(e=!this.supportsBinary&&o.transport.supportsBinary,i=i||e),i||(__debug_18('probe transport "%s" opened',r),n.send([{type:"ping",data:"probe"}]),n.once("packet",function(e){if(!i)if("pong"===e.type&&"probe"===e.data){if(__debug_18('probe transport "%s" pong',r),o.upgrading=!0,o.emit("upgrading",n),!n)return;__Socket_18.priorWebsocketSuccess="websocket"===n.name,__debug_18('pausing current transport "%s"',o.transport.name),o.transport.pause(function(){i||"closed"!==o.readyState&&(__debug_18("changing transport and sending upgrade packet"),c(),o.setTransport(n),n.send([{type:"upgrade"}]),o.emit("upgrade",n),n=null,o.upgrading=!1,o.flush())})}else{__debug_18('probe transport "%s" failed',r);var t=new Error("probe error");t.transport=n.name,o.emit("upgradeError",t)}}))}function s(){i||(i=!0,c(),n.close(),n=null)}function t(e){var t=new Error("probe error: "+e);t.transport=n.name,s(),__debug_18('probe transport "%s" failed because of error: %s',r,e),o.emit("upgradeError",t)}function a(){t("transport closed")}function u(){t("socket closed")}function l(e){n&&e.name!==n.name&&(__debug_18('"%s" works - aborting "%s"',e.name,n.name),s())}function c(){n.removeListener("open",e),n.removeListener("error",t),n.removeListener("close",a),o.removeListener("close",u),o.removeListener("upgrading",l)}__Socket_18.priorWebsocketSuccess=!1,n.once("open",e),n.once("error",t),n.once("close",a),this.once("close",u),this.once("upgrading",l),n.open()},__Socket_18.prototype.onOpen=function(){if(__debug_18("socket open"),this.readyState="open",__Socket_18.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){__debug_18("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},__Socket_18.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(__debug_18('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else __debug_18('packet received with socket readyState "%s"',this.readyState)},__Socket_18.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},__Socket_18.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){"closed"!==t.readyState&&t.onClose("ping timeout")},e||t.pingInterval+t.pingTimeout)},__Socket_18.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){__debug_18("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},__Socket_18.prototype.ping=function(){var e=this;this.sendPacket("ping",function(){e.emit("ping")})},__Socket_18.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),(this.prevBufferLen=0)===this.writeBuffer.length?this.emit("drain"):this.flush()},__Socket_18.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(__debug_18("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},__Socket_18.prototype.write=__Socket_18.prototype.send=function(e,t,r){return this.sendPacket("message",e,t,r),this},__Socket_18.prototype.sendPacket=function(e,t,r,n){var i;"function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState&&((r=r||{}).compress=!1!==r.compress,i={type:e,data:t,options:r},this.emit("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush())},__Socket_18.prototype.close=function(){var e;function t(){e.onClose("forced close"),__debug_18("socket closing - telling transport to close"),e.transport.close()}function r(){e.removeListener("upgrade",r),e.removeListener("upgradeError",r),t()}function n(){e.once("upgrade",r),e.once("upgradeError",r)}return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",(e=this).writeBuffer.length?this.once("drain",function(){(this.upgrading?n:t)()}):(this.upgrading?n:t)()),this},__Socket_18.prototype.onError=function(e){__debug_18("socket error %j",e),__Socket_18.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},__Socket_18.prototype.onClose=function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(__debug_18('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)},__Socket_18.prototype.filterUpgrades=function(e){for(var t=[],r=0,n=e.length;r<n;r++)~_$indexof_42(this.transports,e[r])&&t.push(e[r]);return t};var _$lib_17={},_$lib_17=_$socket_18;_$lib_17.parser=_$browser_30;var _$componentEmitter_65={exports:{}};function __Emitter_65(e){if(e)return function(e){for(var t in __Emitter_65.prototype)e[t]=__Emitter_65.prototype[t];return e}(e)}_$componentEmitter_65.exports=__Emitter_65,__Emitter_65.prototype.on=__Emitter_65.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},__Emitter_65.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},__Emitter_65.prototype.off=__Emitter_65.prototype.removeListener=__Emitter_65.prototype.removeAllListeners=__Emitter_65.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<n.length;i++)if((r=n[i])===t||r.fn===t){n.splice(i,1);break}return this},__Emitter_65.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),r=this._callbacks["$"+e];if(r)for(var n=0,i=(r=r.slice(0)).length;n<i;++n)r[n].apply(this,t);return this},__Emitter_65.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},__Emitter_65.prototype.hasListeners=function(e){return!!this.listeners(e).length},_$componentEmitter_65=_$componentEmitter_65.exports;var _$toArray_77=function(e,t){for(var r=[],n=(t=t||0)||0;n<e.length;n++)r[n-t]=e[n];return r},_$on_62=function(e,t,r){return e.on(t,r),{destroy:function(){e.removeListener(t,r)}}},slice=[].slice,_$componentBind_10=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var r=slice.call(arguments,2);return function(){return t.apply(e,r.concat(slice.call(arguments)))}},_$socket_63={},__debug_63=_$browser_66("socket.io-client:socket"),_$socket_63=__Socket_63,events={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},emit=_$componentEmitter_65.prototype.emit;function __Socket_63(e,t,r){this.io=e,this.nsp=t,(this.json=this).ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},r&&r.query&&(this.query=r.query),this.io.autoConnect&&this.open()}_$componentEmitter_65(__Socket_63.prototype),__Socket_63.prototype.subEvents=function(){var e;this.subs||(e=this.io,this.subs=[_$on_62(e,"open",_$componentBind_10(this,"onopen")),_$on_62(e,"packet",_$componentBind_10(this,"onpacket")),_$on_62(e,"close",_$componentBind_10(this,"onclose"))])},__Socket_63.prototype.open=__Socket_63.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},__Socket_63.prototype.send=function(){var e=_$toArray_77(arguments);return e.unshift("message"),this.emit.apply(this,e),this},__Socket_63.prototype.emit=function(e){if(events.hasOwnProperty(e))return emit.apply(this,arguments),this;var t=_$toArray_77(arguments),r={type:(void 0!==this.flags.binary?this.flags.binary:_$hasBinary_38(t))?_$socketIoParser_70.BINARY_EVENT:_$socketIoParser_70.EVENT,data:t,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(__debug_63("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this.flags={},this},__Socket_63.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},__Socket_63.prototype.onopen=function(){var e;__debug_63("transport is open - connecting"),"/"!==this.nsp&&(this.query?(e="object"==typeof this.query?_$parseqs_51.encode(this.query):this.query,__debug_63("sending connect packet with query %s",e),this.packet({type:_$socketIoParser_70.CONNECT,query:e})):this.packet({type:_$socketIoParser_70.CONNECT}))},__Socket_63.prototype.onclose=function(e){__debug_63("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},__Socket_63.prototype.onpacket=function(e){var t=e.nsp===this.nsp,r=e.type===_$socketIoParser_70.ERROR&&"/"===e.nsp;if(t||r)switch(e.type){case _$socketIoParser_70.CONNECT:this.onconnect();break;case _$socketIoParser_70.EVENT:case _$socketIoParser_70.BINARY_EVENT:this.onevent(e);break;case _$socketIoParser_70.ACK:case _$socketIoParser_70.BINARY_ACK:this.onack(e);break;case _$socketIoParser_70.DISCONNECT:this.ondisconnect();break;case _$socketIoParser_70.ERROR:this.emit("error",e.data)}},__Socket_63.prototype.onevent=function(e){var t=e.data||[];__debug_63("emitting event %j",t),null!=e.id&&(__debug_63("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?emit.apply(this,t):this.receiveBuffer.push(t)},__Socket_63.prototype.ack=function(t){var r=this,n=!1;return function(){var e;n||(n=!0,e=_$toArray_77(arguments),__debug_63("sending ack %j",e),r.packet({type:_$hasBinary_38(e)?_$socketIoParser_70.BINARY_ACK:_$socketIoParser_70.ACK,id:t,data:e}))}},__Socket_63.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(__debug_63("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):__debug_63("bad ack %s",e.id)},__Socket_63.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},__Socket_63.prototype.emitBuffered=function(){for(var e=0;e<this.receiveBuffer.length;e++)emit.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},__Socket_63.prototype.ondisconnect=function(){__debug_63("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},__Socket_63.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},__Socket_63.prototype.close=__Socket_63.prototype.disconnect=function(){return this.connected&&(__debug_63("performing disconnect (%s)",this.nsp),this.packet({type:_$socketIoParser_70.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},__Socket_63.prototype.compress=function(e){return this.flags.compress=e,this},__Socket_63.prototype.binary=function(e){return this.flags.binary=e,this};var _$backo2_3={};function Backoff(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=0<e.jitter&&e.jitter<=1?e.jitter:0,this.attempts=0}_$backo2_3=Backoff,Backoff.prototype.duration=function(){var e,t,r=this.ms*Math.pow(this.factor,this.attempts++);return this.jitter&&(e=Math.random(),t=Math.floor(e*this.jitter*r),r=0==(1&Math.floor(10*e))?r-t:r+t),0|Math.min(r,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(e){this.ms=e},Backoff.prototype.setMax=function(e){this.max=e},Backoff.prototype.setJitter=function(e){this.jitter=e};var _$manager_61={},__debug_61=_$browser_66("socket.io-client:manager"),__has_61=Object.prototype.hasOwnProperty;function Manager(e,t){if(!(this instanceof Manager))return new Manager(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new _$backo2_3({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=t.parser||_$socketIoParser_70;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}_$manager_61=Manager,Manager.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)__has_61.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},Manager.prototype.updateSocketIds=function(){for(var e in this.nsps)__has_61.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},Manager.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},_$componentEmitter_65(Manager.prototype),Manager.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},Manager.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},Manager.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},Manager.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},Manager.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},Manager.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},Manager.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Manager.prototype.open=Manager.prototype.connect=function(r,e){if(__debug_61("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;__debug_61("opening %s",this.uri),this.engine=_$lib_17(this.uri,this.opts);var t=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var i,o,s=_$on_62(t,"open",function(){n.onopen(),r&&r()}),a=_$on_62(t,"error",function(e){var t;__debug_61("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",e),r?((t=new Error("Connection error")).data=e,r(t)):n.maybeReconnectOnOpen()});return!1!==this._timeout&&(i=this._timeout,__debug_61("connect attempt will timeout after %d",i),o=setTimeout(function(){__debug_61("connect attempt timed out after %d",i),s.destroy(),t.close(),t.emit("error","timeout"),n.emitAll("connect_timeout",i)},i),this.subs.push({destroy:function(){clearTimeout(o)}})),this.subs.push(s),this.subs.push(a),this},Manager.prototype.onopen=function(){__debug_61("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(_$on_62(e,"data",_$componentBind_10(this,"ondata"))),this.subs.push(_$on_62(e,"ping",_$componentBind_10(this,"onping"))),this.subs.push(_$on_62(e,"pong",_$componentBind_10(this,"onpong"))),this.subs.push(_$on_62(e,"error",_$componentBind_10(this,"onerror"))),this.subs.push(_$on_62(e,"close",_$componentBind_10(this,"onclose"))),this.subs.push(_$on_62(this.decoder,"decoded",_$componentBind_10(this,"ondecoded")))},Manager.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Manager.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Manager.prototype.ondata=function(e){this.decoder.add(e)},Manager.prototype.ondecoded=function(e){this.emit("packet",e)},Manager.prototype.onerror=function(e){__debug_61("error",e),this.emitAll("error",e)},Manager.prototype.socket=function(e,t){var r,n=this.nsps[e];function i(){~_$indexof_42(r.connecting,n)||r.connecting.push(n)}return n||(n=new _$socket_63(this,e,t),this.nsps[e]=n,r=this,n.on("connecting",i),n.on("connect",function(){n.id=r.generateId(e)}),this.autoConnect&&i()),n},Manager.prototype.destroy=function(e){var t=_$indexof_42(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},Manager.prototype.packet=function(r){__debug_61("writing packet %j",r);var n=this;r.query&&0===r.type&&(r.nsp+="?"+r.query),n.encoding?n.packetBuffer.push(r):(n.encoding=!0,this.encoder.encode(r,function(e){for(var t=0;t<e.length;t++)n.engine.write(e[t],r.options);n.encoding=!1,n.processPacketQueue()}))},Manager.prototype.processPacketQueue=function(){var e;0<this.packetBuffer.length&&!this.encoding&&(e=this.packetBuffer.shift(),this.packet(e))},Manager.prototype.cleanup=function(){__debug_61("cleanup");for(var e=this.subs.length,t=0;t<e;t++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},Manager.prototype.close=Manager.prototype.disconnect=function(){__debug_61("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},Manager.prototype.onclose=function(e){__debug_61("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},Manager.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e,t,r=this;this.backoff.attempts>=this._reconnectionAttempts?(__debug_61("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1):(e=this.backoff.duration(),__debug_61("will wait %dms before reconnect attempt",e),this.reconnecting=!0,t=setTimeout(function(){r.skipReconnect||(__debug_61("attempting reconnect"),r.emitAll("reconnect_attempt",r.backoff.attempts),r.emitAll("reconnecting",r.backoff.attempts),r.skipReconnect||r.open(function(e){e?(__debug_61("reconnect attempt error"),r.reconnecting=!1,r.reconnect(),r.emitAll("reconnect_error",e.data)):(__debug_61("reconnect success"),r.onreconnect())}))},e),this.subs.push({destroy:function(){clearTimeout(t)}}))},Manager.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)};var _$componentEmitter_11={exports:{}};function __Emitter_11(e){if(e)return function(e){for(var t in __Emitter_11.prototype)e[t]=__Emitter_11.prototype[t];return e}(e)}_$componentEmitter_11.exports=__Emitter_11,__Emitter_11.prototype.on=__Emitter_11.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},__Emitter_11.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},__Emitter_11.prototype.off=__Emitter_11.prototype.removeListener=__Emitter_11.prototype.removeAllListeners=__Emitter_11.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<n.length;i++)if((r=n[i])===t||r.fn===t){n.splice(i,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},__Emitter_11.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){n=0;for(var i=(r=r.slice(0)).length;n<i;++n)r[n].apply(this,t)}return this},__Emitter_11.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},__Emitter_11.prototype.hasListeners=function(e){return!!this.listeners(e).length},_$componentEmitter_11=_$componentEmitter_11.exports;var _$parseUrl_179=function(e){var t=/^\w+:\/\//.exec(e),r=0;t&&(r=t[0].length+1);var n=e.indexOf("/",r);return-1===n?{origin:e,pathname:"/"}:{origin:e.slice(0,n),pathname:e.slice(n)}};function ___extends_174(){return(___extends_174=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var socketIo,io=function(){return socketIo=socketIo||_$lib_60({})},statusOrder=["ASSEMBLY_UPLOADING","ASSEMBLY_EXECUTING","ASSEMBLY_COMPLETED"];function isStatus(e,t){return statusOrder.indexOf(e)>=statusOrder.indexOf(t)}var TransloaditAssembly=function(r){var e,t;function n(e){var t;return(t=r.call(this)||this).status=e,t.socket=null,t.pollInterval=null,t.closed=!1,t}t=r,(e=n).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=n.prototype;return i.connect=function(){this._connectSocket(),this._beginPolling()},i._onFinished=function(){this.emit("finished"),this.close()},i._connectSocket=function(){var r=this,e=_$parseUrl_179(this.status.websocket_url),t=io().connect(e.origin,{transports:["websocket"],path:e.pathname});t.on("connect",function(){t.emit("assembly_connect",{id:r.status.assembly_id}),r.emit("connect")}),t.on("connect_failed",function(){r._onError(new _$NetworkError_187("Transloadit Socket.io connection error")),r.socket=null}),t.on("error",function(){t.disconnect(),r.socket=null}),t.on("assembly_finished",function(){r._onFinished()}),t.on("assembly_upload_finished",function(e){r.emit("upload",e),r.status.uploads.push(e)}),t.on("assembly_uploading_finished",function(){r.emit("executing")}),t.on("assembly_upload_meta_data_extracted",function(){r.emit("metadata"),r._fetchStatus({diff:!1})}),t.on("assembly_result_finished",function(e,t){r.emit("result",e,t),r.status.results[e]||(r.status.results[e]=[]),r.status.results[e].push(t)}),t.on("assembly_error",function(e){r._onError(e),r._fetchStatus({diff:!1})}),this.socket=t},i._onError=function(e){this.emit("error",___extends_174(new Error(e.message),e))},i._beginPolling=function(){var e=this;this.pollInterval=setInterval(function(){e.socket&&e.socket.connected||e._fetchStatus()},2e3)},i._fetchStatus=function(e){var t=this,r=(void 0===e?{}:e).diff,n=void 0===r||r;return _$fetchWithNetworkError_194(this.status.assembly_ssl_url).then(function(e){return e.json()}).then(function(e){t.closed||(t.emit("status",e),n?t.updateStatus(e):t.status=e)}).catch(function(e){return t._onError(e)})},i.update=function(){return this._fetchStatus({diff:!0})},i.updateStatus=function(e){this._diffStatus(this.status,e),this.status=e},i._diffStatus=function(n,i){var o=this,e=n.ok,t=i.ok;if(i.error&&!n.error)return this._onError(i);var r=isStatus(t,"ASSEMBLY_EXECUTING")&&!isStatus(e,"ASSEMBLY_EXECUTING");r&&this.emit("executing"),Object.keys(i.uploads).filter(function(e){return!_$hasProperty_210(n.uploads,e)}).map(function(e){return i.uploads[e]}).forEach(function(e){o.emit("upload",e)}),r&&this.emit("metadata"),Object.keys(i.results).forEach(function(t){var e=i.results[t],r=n.results[t];e.filter(function(t){return!r||!r.some(function(e){return e.id===t.id})}).forEach(function(e){o.emit("result",t,e)})}),isStatus(t,"ASSEMBLY_COMPLETED")&&!isStatus(e,"ASSEMBLY_COMPLETED")&&this.emit("finished")},i.close=function(){this.closed=!0,this.socket&&(this.socket.disconnect(),this.socket=null),clearInterval(this.pollInterval)},n}(_$componentEmitter_11),_$TransloaditAssembly_174=TransloaditAssembly,_$Client_177=(aVa=_Ua.prototype,aVa.createAssembly=function(e){var t=this,r=(e.templateId,e.params),n=e.fields,i=e.signature,o=e.expectedFiles,s=new FormData;s.append("params","string"==typeof r?r:JSON.stringify(r)),i&&s.append("signature",i),Object.keys(n).forEach(function(e){s.append(e,n[e])}),s.append("num_expected_upload_files",o);var a=this.opts.service+"/assemblies";return _$fetchWithNetworkError_194(a,{method:"post",headers:this._headers,body:s}).then(function(e){return e.json()}).then(function(e){if(e.error){var t=new Error(e.error);throw t.details=e.message,(t.assembly=e).assembly_id&&(t.details+=" Assembly ID: "+e.assembly_id),t}return e}).catch(function(e){return t._reportError(e,{url:a,type:"API_ERROR"})})},aVa.reserveFile=function(t,r){var n=this,e=encodeURIComponent(r.size),i=t.assembly_ssl_url+"/reserve_file?size="+e;return _$fetchWithNetworkError_194(i,{method:"post",headers:this._headers}).then(function(e){return e.json()}).catch(function(e){return n._reportError(e,{assembly:t,file:r,url:i,type:"API_ERROR"})})},aVa.addFile=function(t,r){var n=this;if(!r.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));var e=encodeURIComponent(r.size),i=encodeURIComponent(r.uploadURL),o="size="+e+"&filename="+encodeURIComponent(r.name)+"&fieldname=file&s3Url="+i,s=t.assembly_ssl_url+"/add_file?"+o;return _$fetchWithNetworkError_194(s,{method:"post",headers:this._headers}).then(function(e){return e.json()}).catch(function(e){return n._reportError(e,{assembly:t,file:r,url:s,type:"API_ERROR"})})},aVa.cancelAssembly=function(e){var t=this,r=e.assembly_ssl_url;return _$fetchWithNetworkError_194(r,{method:"delete",headers:this._headers}).then(function(e){return e.json()}).catch(function(e){return t._reportError(e,{url:r,type:"API_ERROR"})})},aVa.getAssemblyStatus=function(t){var r=this;return _$fetchWithNetworkError_194(t,{headers:this._headers}).then(function(e){return e.json()}).catch(function(e){return r._reportError(e,{url:t,type:"STATUS_ERROR"})})},aVa.submitError=function(e,t){var r=t.endpoint,n=t.instance,i=t.assembly,o=e.details?e.message+" ("+e.details+")":e.message;return _$fetchWithNetworkError_194("https://status.transloadit.com/client_error",{method:"post",body:JSON.stringify({endpoint:r,instance:n,assembly_id:i,agent:"undefined"!=typeof navigator?navigator.userAgent:"",client:this.opts.client,error:o})}).then(function(e){return e.json()})},aVa._reportError=function(e,t){if(!1===this.opts.errorReporting)throw e;var r={type:t.type};throw t.assembly&&(r.assembly=t.assembly.assembly_id,r.instance=t.assembly.instance),t.url&&(r.endpoint=t.url),this.submitError(e,r).catch(function(e){}),e},_Ua),_$AssemblyOptions_175={},aVa;function _Ua(e){void 0===e&&(e={}),this.opts=e,this._reportError=this._reportError.bind(this),this._headers={"Transloadit-Client":this.opts.client}}function validateParams(e){if(!e)throw new Error("Transloadit: The `params` option is required.");if("string"==typeof e)try{e=JSON.parse(e)}catch(e){throw e.message="Transloadit: The `params` option is a malformed JSON string: "+e.message,e}if(!e.auth||!e.auth.key)throw new Error("Transloadit: The `params.auth.key` option is required. You can find your Transloadit API key at https://transloadit.com/account/api-settings.")}var AssemblyOptions=(aWa=_Va.prototype,aWa._normalizeAssemblyOptions=function(t,r){var e;return Array.isArray(r.fields)&&(e=r.fields,r.fields={},e.forEach(function(e){r.fields[e]=t.meta[e]})),r.fields||(r.fields={}),r},aWa._getAssemblyOptions=function(t){var r=this,e=this.opts;return Promise.resolve().then(function(){return e.getAssemblyOptions(t,e)}).then(function(e){return r._normalizeAssemblyOptions(t,e)}).then(function(e){return validateParams(e.params),{fileIDs:[t.id],options:e}})},aWa._dedupe=function(e){var o=Object.create(null);return e.forEach(function(e){var t,r=e.fileIDs,n=e.options,i=JSON.stringify(n);o[i]?(t=o[i].fileIDs).push.apply(t,r):o[i]={options:n,fileIDs:[].concat(r)}}),Object.keys(o).map(function(e){return o[e]})},aWa.build=function(){var t=this,e=this.opts;return 0<this.files.length?Promise.all(this.files.map(function(e){return t._getAssemblyOptions(e)})).then(function(e){return t._dedupe(e)}):e.alwaysRunAssembly?Promise.resolve(e.getAssemblyOptions(null,e)).then(function(e){return validateParams(e.params),[{fileIDs:t.files.map(function(e){return e.id}),options:e}]}):Promise.resolve([])},_Va),aWa;function _Va(e,t){this.files=e,this.opts=t}function ___assertThisInitialized_176(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}_$AssemblyOptions_175=AssemblyOptions,_$AssemblyOptions_175.validateParams=validateParams;var TransloaditAssemblyWatcher=function(n){var e,t;function r(e,t){var r;return(r=n.call(this)||this)._uppy=e,r._assemblyIDs=t,r._remaining=t.length,r.promise=new Promise(function(e,t){r._resolve=e,r._reject=t}),r._onAssemblyComplete=r._onAssemblyComplete.bind(___assertThisInitialized_176(r)),r._onAssemblyCancel=r._onAssemblyCancel.bind(___assertThisInitialized_176(r)),r._onAssemblyError=r._onAssemblyError.bind(___assertThisInitialized_176(r)),r._onImportError=r._onImportError.bind(___assertThisInitialized_176(r)),r._addListeners(),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i._watching=function(e){return-1!==this._assemblyIDs.indexOf(e)},i._onAssemblyComplete=function(e){this._watching(e.assembly_id)&&(this._uppy.log("[Transloadit] AssemblyWatcher: Got Assembly finish "+e.assembly_id),this.emit("assembly-complete",e.assembly_id),this._checkAllComplete())},i._onAssemblyCancel=function(e){this._watching(e.assembly_id)&&this._checkAllComplete()},i._onAssemblyError=function(e,t){this._watching(e.assembly_id)&&(this._uppy.log("[Transloadit] AssemblyWatcher: Got Assembly error "+e.assembly_id),this._uppy.log(t),this.emit("assembly-error",e.assembly_id,t),this._checkAllComplete())},i._onImportError=function(e,t,r){this._watching(e.assembly_id)&&this._onAssemblyError(e,r)},i._checkAllComplete=function(){--this._remaining,0===this._remaining&&(this._removeListeners(),this._resolve())},i._removeListeners=function(){this._uppy.off("transloadit:complete",this._onAssemblyComplete),this._uppy.off("transloadit:assembly-cancel",this._onAssemblyCancel),this._uppy.off("transloadit:assembly-error",this._onAssemblyError),this._uppy.off("transloadit:import-error",this._onImportError)},i._addListeners=function(){this._uppy.on("transloadit:complete",this._onAssemblyComplete),this._uppy.on("transloadit:assembly-cancel",this._onAssemblyCancel),this._uppy.on("transloadit:assembly-error",this._onAssemblyError),this._uppy.on("transloadit:import-error",this._onImportError)},r}(_$componentEmitter_11),_$TransloaditAssemblyWatcher_176=TransloaditAssemblyWatcher,_$lib_178={},___class_178,___temp_178;function ___extends_178(){return(___extends_178=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_178(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_178=_$lib_104.Plugin;function defaultGetAssemblyOptions(e,t){return{params:t.params,signature:t.signature,fields:t.fields}}var COMPANION="https://api2.transloadit.com/companion",TL_COMPANION=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/companion/,TL_UPPY_SERVER=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/uppy-server/,___class_230,___temp_230;function ___extends_230(){return(___extends_230=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}___temp_178=___class_178=function(o){var e,t;function r(e,t){var r;(r=o.call(this,e,t)||this).type="uploader",r.id=r.opts.id||"Transloadit",r.title="Transloadit";var n={service:"https://api2.transloadit.com",errorReporting:!0,waitForEncoding:!(r.defaultLocale={strings:{creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",encoding:"Encoding..."}}),waitForMetadata:!1,alwaysRunAssembly:!1,importFromUploadURLs:!1,signature:null,params:null,fields:{},getAssemblyOptions:defaultGetAssemblyOptions,limit:0};r.opts=___extends_178({},n,{},t),r.i18nInit(),r._prepareUpload=r._prepareUpload.bind(___assertThisInitialized_178(r)),r._afterUpload=r._afterUpload.bind(___assertThisInitialized_178(r)),r._onError=r._onError.bind(___assertThisInitialized_178(r)),r._onTusError=r._onTusError.bind(___assertThisInitialized_178(r)),r._onCancelAll=r._onCancelAll.bind(___assertThisInitialized_178(r)),r._onFileUploadURLAvailable=r._onFileUploadURLAvailable.bind(___assertThisInitialized_178(r)),r._onRestored=r._onRestored.bind(___assertThisInitialized_178(r)),r._getPersistentData=r._getPersistentData.bind(___assertThisInitialized_178(r));var i=r.opts.getAssemblyOptions!==n.getAssemblyOptions;return r.opts.params?_$AssemblyOptions_175.validateParams(r.opts.params):i||_$AssemblyOptions_175.validateParams(null),r.client=new _$Client_177({service:r.opts.service,client:r._getClientVersion(),errorReporting:r.opts.errorReporting}),r.activeAssemblies={},r.assemblyWatchers={},r.completedFiles=Object.create(null),r}t=o,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var n=r.prototype;return n.setOptions=function(e){o.prototype.setOptions.call(this,e),this.i18nInit()},n.i18nInit=function(){this.translator=new _$Translator_190([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},n._getClientVersion=function(){function e(e,t){var r=n.uppy.getPlugin(e);r&&i.push(t+":"+r.constructor.VERSION)}var n=this,i=["uppy-core:"+this.uppy.constructor.VERSION,"uppy-transloadit:"+this.constructor.VERSION,"uppy-tus:"+_$lib_181.VERSION];return this.opts.importFromUploadURLs&&(e("XHRUpload","uppy-xhr-upload"),e("AwsS3","uppy-aws-s3"),e("AwsS3Multipart","uppy-aws-s3-multipart")),e("Dropbox","uppy-dropbox"),e("Facebook","uppy-facebook"),e("GoogleDrive","uppy-google-drive"),e("Instagram","uppy-instagram"),e("OneDrive","uppy-onedrive"),e("Url","uppy-url"),i.join(",")},n._attachAssemblyMetadata=function(e,t){var r,n,i=___extends_178({},e.meta,{assembly_url:t.assembly_url,filename:e.name,fieldname:"file"}),o=___extends_178({},e.tus,{endpoint:t.tus_url}),s=e.remote;if(e.remote&&TL_UPPY_SERVER.test(e.remote.companionUrl)){var a=new Error("The https://api2.transloadit.com/uppy-server endpoint was renamed to https://api2.transloadit.com/companion, please update your `companionUrl` options accordingly.");throw this.uppy.log(a),a}e.remote&&TL_COMPANION.test(e.remote.companionUrl)&&(r=t.companion_url.replace(/\/$/,""),n=e.remote.url.replace(e.remote.companionUrl,"").replace(/^\//,""),s=___extends_178({},e.remote,{companionUrl:r,url:r+"/"+n}));var u=___extends_178({},e,{transloadit:{assembly:t.assembly_id}});return this.opts.importFromUploadURLs||___extends_178(u,{meta:i,tus:o,remote:s}),u},n._createAssembly=function(p,d,e){var h=this;return this.uppy.log("[Transloadit] Create Assembly"),this.client.createAssembly({params:e.params,fields:e.fields,expectedFiles:p.length,signature:e.signature}).then(function(e){var t,r,n=new _$TransloaditAssembly_174(e),i=n.status,o=i.assembly_id,s=h.getPluginState(),a=s.assemblies,u=s.uploadsAssemblies;h.setPluginState({assemblies:___extends_178({},a,((t={})[o]=i,t)),uploadsAssemblies:___extends_178({},u,((r={})[d]=[].concat(u[d],[o]),r))});var l=h.uppy.getState().files,c={};return p.forEach(function(e){c[e]=h._attachAssemblyMetadata(h.uppy.getFile(e),i)}),h.uppy.setState({files:___extends_178({},l,{},c)}),h.uppy.emit("transloadit:assembly-created",i,p),h.uppy.log("[Transloadit] Created Assembly "+o),n}).catch(function(e){throw e.message=h.i18n("creatingAssemblyFailed")+": "+e.message,e})},n._createAssemblyWatcher=function(e,t,r){var n=this,i=new _$TransloaditAssemblyWatcher_176(this.uppy,e);i.on("assembly-complete",function(e){n.getAssemblyFiles(e).forEach(function(e){n.completedFiles[e.id]=!0,n.uppy.emit("postprocess-complete",e)})}),i.on("assembly-error",function(e,t){n.getAssemblyFiles(e).forEach(function(e){n.uppy.emit("upload-error",e,t),n.uppy.emit("postprocess-complete",e)})}),this.assemblyWatchers[r]=i},n._shouldWaitAfterUpload=function(){return this.opts.waitForEncoding||this.opts.waitForMetadata},n._reserveFiles=function(r,e){var n=this;return Promise.all(e.map(function(e){var t=n.uppy.getFile(e);return n.client.reserveFile(r,t)}))},n._onFileUploadURLAvailable=function(t){var r,n=this;t&&t.transloadit&&t.transloadit.assembly&&(r=this.getPluginState().assemblies[t.transloadit.assembly],this.client.addFile(r,t).catch(function(e){n.uppy.log(e),n.uppy.emit("transloadit:import-error",r,t.id,e)}))},n._findFile=function(e){for(var t=this.uppy.getFiles(),r=0;r<t.length;r++){var n=t[r];if(n.uploadURL===e.tus_upload_url)return n;if(n.tus&&n.tus.uploadUrl===e.tus_upload_url)return n;if(!e.is_tus_file&&n.name===e.name&&n.size===e.size)return n}},n._onFileUploadComplete=function(e,t){var r,n=this.getPluginState(),i=this._findFile(t);i?(this.setPluginState({files:___extends_178({},n.files,((r={})[t.id]={assembly:e,id:i.id,uploadedFile:t},r))}),this.uppy.emit("transloadit:upload",t,this.getAssembly(e))):this.uppy.log("[Transloadit] Couldn’t file the file, it was likely removed in the process")},n._onResult=function(e,t,r){var n=this.getPluginState(),i=n.files[r.original_id];r.localId=i?i.id:null;var o={result:r,stepName:t,id:r.id,assembly:e};this.setPluginState({results:[].concat(n.results,[o])}),this.uppy.emit("transloadit:result",t,r,this.getAssembly(e))},n._onAssemblyFinished=function(e){var i=this,t=e.assembly_ssl_url;this.client.getAssemblyStatus(t).then(function(e){var t,r=e.assembly_id,n=i.getPluginState();i.setPluginState({assemblies:___extends_178({},n.assemblies,((t={})[r]=e,t))}),i.uppy.emit("transloadit:complete",e)})},n._cancelAssembly=function(e){var t=this;return this.client.cancelAssembly(e).then(function(){t.uppy.emit("transloadit:assembly-cancelled",e)})},n._onCancelAll=function(){var r=this,n=this.getPluginState().uploadsAssemblies,e=Object.keys(n).reduce(function(e,t){return e.push.apply(e,n[t]),e},[]).map(function(e){var t=r.getAssembly(e);return r._cancelAssembly(t)});Promise.all(e).catch(function(e){r.uppy.log(e)})},n._getPersistentData=function(e){var t,r=this.getPluginState(),n=r.assemblies,i=r.uploadsAssemblies;e(((t={})[this.id]={assemblies:n,uploadsAssemblies:i},t))},n._onRestored=function(e){var u=this,t=e&&e[this.id]?e[this.id]:{},i=t.assemblies||{},l=t.uploadsAssemblies||{};0!==Object.keys(l).length&&(this.restored=Promise.resolve().then(function(){var e,t,r,n,o=i,s={},a=[];return Object.keys(o).forEach(function(n){var e=o[n];e.uploads.forEach(function(e){var t=u._findFile(e);s[e.id]={id:t.id,assembly:n,uploadedFile:e}});var i=u.getPluginState();Object.keys(e.results).forEach(function(r){e.results[r].forEach(function(e){var t=i.files[e.original_id];e.localId=t?t.id:null,a.push({id:e.id,result:e,stepName:r,assembly:n})})})}),u.setPluginState({assemblies:o,files:s,results:a,uploadsAssemblies:l}),t=u.getPluginState(),r=t.assemblies,n=t.uploadsAssemblies,Object.keys(n).forEach(function(e){var t=n[e],r=t.reduce(function(e,t){var r=u.getAssemblyFiles(t).map(function(e){return e.id});return e.push.apply(e,r),e},[]);u._createAssemblyWatcher(t,r,e)}),Object.keys(r).forEach(function(e){var t=new _$TransloaditAssembly_174(r[e]);u._connectAssembly(t)}),e=u.getPluginState().assemblies,Promise.all(Object.keys(e).map(function(e){return u.activeAssemblies[e].update()}))}),this.restored.then(function(){u.restored=null}))},n._connectAssembly=function(r){var n=this,i=r.status.assembly_id;return(this.activeAssemblies[i]=r).on("status",function(e){var t,r=n.getPluginState().assemblies;n.setPluginState({assemblies:___extends_178({},r,((t={})[i]=e,t))})}),r.on("upload",function(e){n._onFileUploadComplete(i,e)}),r.on("error",function(e){e.assembly=r.status,n.uppy.emit("transloadit:assembly-error",r.status,e)}),r.on("executing",function(){n.uppy.emit("transloadit:assembly-executing",r.status)}),this.opts.waitForEncoding&&r.on("result",function(e,t){n._onResult(i,e,t)}),this.opts.waitForEncoding?r.on("finished",function(){n._onAssemblyFinished(r.status)}):this.opts.waitForMetadata&&r.on("metadata",function(){n._onAssemblyFinished(r.status)}),"ASSEMBLY_COMPLETE"===r.ok||(new Promise(function(e,t){r.once("connect",e),r.once("status",e),r.once("error",t)}).then(function(){n.uppy.log("[Transloadit] Socket is ready")}),r.connect()),r},n._prepareUpload=function(n,i){var e,o=this;(n=n.filter(function(e){return!e.error})).forEach(function(e){var t=o.uppy.getFile(e);o.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:o.i18n("creatingAssembly")})});function t(e){var t,n=e.fileIDs,r=e.options;return o._createAssembly(n,i,r).then(function(e){if(t=e,o.opts.importFromUploadURLs)return o._reserveFiles(e,n)}).then(function(){return n.forEach(function(e){var t=o.uppy.getFile(e);o.uppy.emit("preprocess-complete",t)}),t}).catch(function(r){throw n.forEach(function(e){var t=o.uppy.getFile(e);o.uppy.emit("preprocess-complete",t),o.uppy.emit("upload-error",t,r)}),r})}var r=this.getPluginState().uploadsAssemblies;this.setPluginState({uploadsAssemblies:___extends_178({},r,((e={})[i]=[],e))});var s=n.map(function(e){return o.uppy.getFile(e)});return new _$AssemblyOptions_175(s,this.opts).build().then(function(e){return Promise.all(e.map(t)).then(function(e){var t=e.map(function(e){return e.status.assembly_id});o._createAssemblyWatcher(t,n,i),e.map(function(e){return o._connectAssembly(e)})})},function(r){throw n.forEach(function(e){var t=o.uppy.getFile(e);o.uppy.emit("preprocess-complete",t),o.uppy.emit("upload-error",t,r)}),r})},n._afterUpload=function(e,r){var n=this,t=e.map(function(e){return n.uppy.getFile(e)});e=t.filter(function(e){return!e.error}).map(function(e){return e.id});var i=this.getPluginState();if(this.restored)return this.restored.then(function(){return n._afterUpload(e,r)});var o=i.uploadsAssemblies[r];if(this._shouldWaitAfterUpload())return 0===o.length?(this.uppy.addResultData(r,{transloadit:[]}),Promise.resolve()):(t.filter(function(e){return!_$hasProperty_210(n.completedFiles,e.id)}).forEach(function(e){n.uppy.emit("postprocess-progress",e,{mode:"indeterminate",message:n.i18n("encoding")})}),this.assemblyWatchers[r].promise.then(function(){var e=o.map(function(e){return n.getAssembly(e)}),t=___extends_178({},n.getPluginState().uploadsAssemblies);delete t[r],n.setPluginState({uploadsAssemblies:t}),n.uppy.addResultData(r,{transloadit:e})}));o.forEach(function(e){n.activeAssemblies[e].close(),delete n.activeAssemblies[e]});var s=o.map(function(e){return n.getAssembly(e)});return this.uppy.addResultData(r,{transloadit:s}),Promise.resolve()},n._onError=function(e,t){var r=this;void 0===e&&(e=null),this.getPluginState().uploadsAssemblies[t].forEach(function(e){r.activeAssemblies[e]&&r.activeAssemblies[e].close()})},n._onTusError=function(e){var t;e&&/^tus: /.test(e.message)&&(t=e.originalRequest&&e.originalRequest.responseURL?e.originalRequest.responseURL:null,this.client.submitError(e,{url:t,type:"TUS_ERROR"}).then(function(e){}))},n.install=function(){this.uppy.addPreProcessor(this._prepareUpload),this.uppy.addPostProcessor(this._afterUpload),this.uppy.on("error",this._onError),this.uppy.on("cancel-all",this._onCancelAll),this.uppy.on("upload-error",this._onTusError),this.opts.importFromUploadURLs?this.uppy.on("upload-success",this._onFileUploadURLAvailable):this.uppy.use(_$lib_181,{resume:!1,useFastRemoteRetry:!1,metaFields:["assembly_url","filename","fieldname"],limit:this.opts.limit}),this.uppy.on("restore:get-data",this._getPersistentData),this.uppy.on("restored",this._onRestored),this.setPluginState({assemblies:{},uploadsAssemblies:{},files:{},results:[]});var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:___extends_178({},e,{individualCancellation:!1})})},n.uninstall=function(){this.uppy.removePreProcessor(this._prepareUpload),this.uppy.removePostProcessor(this._afterUpload),this.uppy.off("error",this._onError),this.opts.importFromUploadURLs&&this.uppy.off("upload-success",this._onFileUploadURLAvailable);var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:___extends_178({},e,{individualCancellation:!0})})},n.getAssembly=function(e){return this.getPluginState().assemblies[e]},n.getAssemblyFiles=function(t){return this.uppy.getFiles().filter(function(e){return e&&e.transloadit&&e.transloadit.assembly===t})},r}(__Plugin_178),___class_178.VERSION="1.6.1",_$lib_178=___temp_178,_$lib_178.COMPANION=COMPANION,_$lib_178.UPPY_SERVER=COMPANION,_$lib_178.COMPANION_PATTERN=/\.transloadit\.com$/;var __Plugin_230=_$lib_104.Plugin,__Provider_230=_$lib_101.Provider,__RequestClient_230=_$lib_101.RequestClient,__Socket_230=_$lib_101.Socket;function __buildResponseError_230(e,t){return"string"==typeof(t=t||new Error("Upload error"))&&(t=new Error(t)),t instanceof Error||(t=___extends_230(new Error("Upload error"),{data:t})),_$isNetworkError_213(e)?t=new _$NetworkError_187(t,e):(t.request=e,t)}function setTypeInBlob(e){return e.data.slice(0,e.data.size,e.meta.type)}var _$lib_230=(___temp_230=___class_230=function(i){var e,t;function r(e,t){var r;(r=i.call(this,e,t)||this).type="uploader",r.id=r.opts.id||"XHRUpload",r.title="XHRUpload";var n={formData:!0,fieldName:"files[]",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!(r.defaultLocale={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}}),headers:{},timeout:3e4,limit:0,withCredentials:!1,responseType:"",getResponseData:function(e,t){var r={};try{r=JSON.parse(e)}catch(e){console.log(e)}return r},getResponseError:function(e,t){var r=new Error("Upload error");return _$isNetworkError_213(t)&&(r=new _$NetworkError_187(r,t)),r},validateStatus:function(e,t,r){return 200<=e&&e<300}};if(r.opts=___extends_230({},n,{},t),r.i18nInit(),r.handleUpload=r.handleUpload.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r)),r.opts.__queue instanceof _$RateLimitedQueue_189?r.requests=r.opts.__queue:r.requests=new _$RateLimitedQueue_189(r.opts.limit),r.opts.bundle&&!r.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");return r.uploaderEvents=Object.create(null),r}t=i,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var n=r.prototype;return n.setOptions=function(e){i.prototype.setOptions.call(this,e),this.i18nInit()},n.i18nInit=function(){this.translator=new _$Translator_190([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},n.getOptions=function(e){var t=this.uppy.getState().xhrUpload,r=___extends_230({},this.opts,{},t||{},{},e.xhrUpload||{},{headers:{}});return ___extends_230(r.headers,this.opts.headers),t&&___extends_230(r.headers,t.headers),e.xhrUpload&&___extends_230(r.headers,e.xhrUpload.headers),r},n.addMetadata=function(t,r,e){(Array.isArray(e.metaFields)?e.metaFields:Object.keys(r)).forEach(function(e){t.append(e,r[e])})},n.createFormDataUpload=function(e,t){var r=new FormData;this.addMetadata(r,e.meta,t);var n=setTypeInBlob(e);return e.name?r.append(t.fieldName,n,e.meta.name):r.append(t.fieldName,n),r},n.createBundledUpload=function(e,t){var n=this,i=new FormData,r=this.uppy.getState().meta;return this.addMetadata(i,r,t),e.forEach(function(e){var t=n.getOptions(e),r=setTypeInBlob(e);e.name?i.append(t.fieldName,r,e.name):i.append(t.fieldName,r)}),i},n.createBareUpload=function(e,t){return e.data},n.upload=function(h,e,t){var _=this,f=this.getOptions(h);return this.uppy.log("uploading "+e+" of "+t),new Promise(function(a,u){_.uppy.emit("upload-started",h);var e=f.formData?_.createFormDataUpload(h,f):_.createBareUpload(h,f),l=new XMLHttpRequest;_.uploaderEvents[h.id]=new _$EventTracker_185(_.uppy);var c=new _$ProgressTimeout_188(f.timeout,function(){l.abort(),d.done();var e=new Error(_.i18n("timedOut",{seconds:Math.ceil(f.timeout/1e3)}));_.uppy.emit("upload-error",h,e),u(e)}),p=_$cuid_13();l.upload.addEventListener("loadstart",function(e){_.uppy.log("[XHRUpload] "+p+" started")}),l.upload.addEventListener("progress",function(e){_.uppy.log("[XHRUpload] "+p+" progress: "+e.loaded+" / "+e.total),c.progress(),e.lengthComputable&&_.uppy.emit("upload-progress",h,{uploader:_,bytesUploaded:e.loaded,bytesTotal:e.total})}),l.addEventListener("load",function(e){if(_.uppy.log("[XHRUpload] "+p+" finished"),c.done(),d.done(),_.uploaderEvents[h.id]&&(_.uploaderEvents[h.id].remove(),_.uploaderEvents[h.id]=null),f.validateStatus(e.target.status,l.responseText,l)){var t=f.getResponseData(l.responseText,l),r=t[f.responseUrlFieldName],n={status:e.target.status,body:t,uploadURL:r};return _.uppy.emit("upload-success",h,n),r&&_.uppy.log("Download "+h.name+" from "+r),a(h)}var i=f.getResponseData(l.responseText,l),o=__buildResponseError_230(l,f.getResponseError(l.responseText,l)),s={status:e.target.status,body:i};return _.uppy.emit("upload-error",h,o,s),u(o)}),l.addEventListener("error",function(e){_.uppy.log("[XHRUpload] "+p+" errored"),c.done(),d.done(),_.uploaderEvents[h.id]&&(_.uploaderEvents[h.id].remove(),_.uploaderEvents[h.id]=null);var t=__buildResponseError_230(l,f.getResponseError(l.responseText,l));return _.uppy.emit("upload-error",h,t),u(t)}),l.open(f.method.toUpperCase(),f.endpoint,!0),l.withCredentials=f.withCredentials,""!==f.responseType&&(l.responseType=f.responseType),Object.keys(f.headers).forEach(function(e){l.setRequestHeader(e,f.headers[e])});var d=_.requests.run(function(){return l.send(e),function(){c.done(),l.abort()}});_.onFileRemove(h.id,function(){d.abort(),u(new Error("File removed"))}),_.onCancelAll(h.id,function(){d.abort(),u(new Error("Upload cancelled"))})})},n.uploadRemote=function(a,e,t){var u=this,l=this.getOptions(a);return new Promise(function(o,s){u.uppy.emit("upload-started",a);var t={};(Array.isArray(l.metaFields)?l.metaFields:Object.keys(a.meta)).forEach(function(e){t[e]=a.meta[e]}),new(a.remote.providerOptions.provider?__Provider_230:__RequestClient_230)(u.uppy,a.remote.providerOptions).post(a.remote.url,___extends_230({},a.remote.body,{endpoint:l.endpoint,size:a.data.size,fieldname:l.fieldName,metadata:t,httpMethod:l.method,useFormData:l.formData,headers:l.headers})).then(function(e){var t=e.token,r=_$getSocketHost_207(a.remote.companionUrl),n=new __Socket_230({target:r+"/api/"+t,autoOpen:!1});u.uploaderEvents[a.id]=new _$EventTracker_185(u.uppy),u.onFileRemove(a.id,function(){n.send("pause",{}),i.abort(),o("upload "+a.id+" was removed")}),u.onCancelAll(a.id,function(){n.send("pause",{}),i.abort(),o("upload "+a.id+" was canceled")}),u.onRetry(a.id,function(){n.send("pause",{}),n.send("resume",{})}),u.onRetryAll(a.id,function(){n.send("pause",{}),n.send("resume",{})}),n.on("progress",function(e){return _$emitSocketProgress_193(u,e,a)}),n.on("success",function(e){var t=l.getResponseData(e.response.responseText,e.response),r=t[l.responseUrlFieldName],n={status:e.response.status,body:t,uploadURL:r};return u.uppy.emit("upload-success",a,n),i.done(),u.uploaderEvents[a.id]&&(u.uploaderEvents[a.id].remove(),u.uploaderEvents[a.id]=null),o()}),n.on("error",function(e){var t=e.response,r=t?l.getResponseError(t.responseText,t):___extends_230(new Error(e.error.message),{cause:e.error});u.uppy.emit("upload-error",a,r),i.done(),u.uploaderEvents[a.id]&&(u.uploaderEvents[a.id].remove(),u.uploaderEvents[a.id]=null),s(r)});var i=u.requests.run(function(){return n.open(),a.isPaused&&n.send("pause",{}),function(){return n.close()}})}).catch(function(e){u.uppy.emit("upload-error",a,e),s(e)})})},n.uploadBundle=function(l){var c=this;return new Promise(function(i,o){var e=c.opts.endpoint,t=c.opts.method,r=c.uppy.getState().xhrUpload,n=c.createBundledUpload(l,___extends_230({},c.opts,{},r||{})),s=new XMLHttpRequest,a=new _$ProgressTimeout_188(c.opts.timeout,function(){s.abort();var e=new Error(c.i18n("timedOut",{seconds:Math.ceil(c.opts.timeout/1e3)}));u(e),o(e)}),u=function(t){l.forEach(function(e){c.uppy.emit("upload-error",e,t)})};s.upload.addEventListener("loadstart",function(e){c.uppy.log("[XHRUpload] started uploading bundle"),a.progress()}),s.upload.addEventListener("progress",function(t){a.progress(),t.lengthComputable&&l.forEach(function(e){c.uppy.emit("upload-progress",e,{uploader:c,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})})}),s.addEventListener("load",function(e){if(a.done(),c.opts.validateStatus(e.target.status,s.responseText,s)){var t=c.opts.getResponseData(s.responseText,s),r={status:e.target.status,body:t};return l.forEach(function(e){c.uppy.emit("upload-success",e,r)}),i()}var n=c.opts.getResponseError(s.responseText,s)||new Error("Upload error");return n.request=s,u(n),o(n)}),s.addEventListener("error",function(e){a.done();var t=c.opts.getResponseError(s.responseText,s)||new Error("Upload error");return u(t),o(t)}),c.uppy.on("cancel-all",function(){a.done(),s.abort()}),s.open(t.toUpperCase(),e,!0),s.withCredentials=c.opts.withCredentials,""!==c.opts.responseType&&(s.responseType=c.opts.responseType),Object.keys(c.opts.headers).forEach(function(e){s.setRequestHeader(e,c.opts.headers[e])}),s.send(n),l.forEach(function(e){c.uppy.emit("upload-started",e)})})},n.uploadFiles=function(i){var o=this,e=i.map(function(e,t){var r=parseInt(t,10)+1,n=i.length;return e.error?Promise.reject(new Error(e.error)):e.isRemote?o.uploadRemote(e,r,n):o.upload(e,r,n)});return _$settle_219(e)},n.onFileRemove=function(t,r){this.uploaderEvents[t].on("file-removed",function(e){t===e.id&&r(e.id)})},n.onRetry=function(t,r){this.uploaderEvents[t].on("upload-retry",function(e){t===e&&r()})},n.onRetryAll=function(t,r){var n=this;this.uploaderEvents[t].on("retry-all",function(e){n.uppy.getFile(t)&&r()})},n.onCancelAll=function(e,t){var r=this;this.uploaderEvents[e].on("cancel-all",function(){r.uppy.getFile(e)&&t()})},n.handleUpload=function(e){var t=this;if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts.__queue||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");var r=e.map(function(e){return t.uppy.getFile(e)});if(this.opts.bundle){if(r.some(function(e){return e.isRemote}))throw new Error("Can’t upload remote files when bundle: true option is set");return this.uploadBundle(r)}return this.uploadFiles(r).then(function(){return null})},n.install=function(){var e;this.opts.bundle&&(e=this.uppy.getState().capabilities,this.uppy.setState({capabilities:___extends_230({},e,{individualCancellation:!1})})),this.uppy.addUploader(this.handleUpload)},n.uninstall=function(){var e;this.opts.bundle&&(e=this.uppy.getState().capabilities,this.uppy.setState({capabilities:___extends_230({},e,{individualCancellation:!0})})),this.uppy.removeUploader(this.handleUpload)},r}(__Plugin_230),___class_230.VERSION="1.6.0",___temp_230),_$lib_37={__esModule:!0};_$lib_37.default=getFormData,_$lib_37.getFieldData=getFieldData;var NODE_LIST_CLASSES={"[object HTMLCollection]":!0,"[object NodeList]":!0,"[object RadioNodeList]":!0},IGNORED_ELEMENT_TYPES={button:!0,fieldset:!0,reset:!0,submit:!0},CHECKED_INPUT_TYPES={checkbox:!0,radio:!0},TRIM_RE=/^\s+|\s+$/g,__slice_37=Array.prototype.slice,__toString_37=Object.prototype.toString,___class_135,___temp_135;function getFormData(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{trim:!1};if(!e)throw new Error("A form is required by getFormData, was given form="+e);for(var r={},n=void 0,i=[],o={},s=0,a=e.elements.length;s<a;s++){var u=e.elements[s];IGNORED_ELEMENT_TYPES[u.type]||u.disabled||(n=u.name||u.id)&&!o[n]&&(i.push(n),o[n]=!0)}for(var l=0,c=i.length;l<c;l++){var p=getFieldData(e,n=i[l],t);null!=p&&(r[n]=p)}return r}function getFieldData(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{trim:!1};if(!e)throw new Error("A form is required by getFieldData, was given form="+e);if(!t&&"[object String]"!==__toString_37.call(t))throw new Error("A field name is required by getFieldData, was given fieldName="+t);var n=e.elements[t];if(!n||n.disabled)return null;if(!NODE_LIST_CLASSES[__toString_37.call(n)])return getFormElementValue(n,r.trim);for(var i,o=[],s=!0,a=0,u=n.length;a<u;a++){n[a].disabled||(s&&"radio"!==n[a].type&&(s=!1),null!=(i=getFormElementValue(n[a],r.trim))&&(o=o.concat(i)))}return s&&1===o.length?o[0]:0<o.length?o:null}function getFormElementValue(e,t){var r=null,n=e.type;if("select-one"===n)return e.options.length&&(r=e.options[e.selectedIndex].value),r;if("select-multiple"!==n)return"file"===n&&"files"in e?e.multiple?0===(r=__slice_37.call(e.files)).length&&(r=null):r=e.files[0]:CHECKED_INPUT_TYPES[n]?e.checked&&(r=e.value):r=t?e.value.replace(TRIM_RE,""):e.value,r;r=[];for(var i=0,o=e.options.length;i<o;i++)e.options[i].selected&&r.push(e.options[i].value);return 0===r.length&&(r=null),r}function ___extends_135(){return(___extends_135=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_135(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}getFormData.getFieldData=getFieldData;var __Plugin_135=_$lib_104.Plugin,__getFormData_135=_$lib_37.default||_$lib_37,_$lib_135=(___temp_135=___class_135=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).type="acquirer",r.id=r.opts.id||"Form",r.title="Form",r.opts=___extends_135({},{target:null,resultName:"uppyResult",getMetaFromForm:!0,addResultToForm:!0,multipleResults:!1,submitOnSuccess:!1,triggerUploadOnSubmit:!1},{},t),r.handleFormSubmit=r.handleFormSubmit.bind(___assertThisInitialized_135(r)),r.handleUploadStart=r.handleUploadStart.bind(___assertThisInitialized_135(r)),r.handleSuccess=r.handleSuccess.bind(___assertThisInitialized_135(r)),r.addResultToForm=r.addResultToForm.bind(___assertThisInitialized_135(r)),r.getMetaFromForm=r.getMetaFromForm.bind(___assertThisInitialized_135(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.handleUploadStart=function(){this.opts.getMetaFromForm&&this.getMetaFromForm()},i.handleSuccess=function(e){this.opts.addResultToForm&&this.addResultToForm(e),this.opts.submitOnSuccess&&this.form.submit()},i.handleFormSubmit=function(e){var t,r,n=this;this.opts.triggerUploadOnSubmit&&(e.preventDefault(),t=_$toArray_220(e.target.elements),r=[],t.forEach(function(e){"BUTTON"!==e.tagName&&("INPUT"!==e.tagName||"submit"!==e.type)||e.disabled||(e.disabled=!0,r.push(e))}),this.uppy.upload().then(function(){r.forEach(function(e){e.disabled=!1})},function(e){return r.forEach(function(e){e.disabled=!1}),Promise.reject(e)}).catch(function(e){n.uppy.log(e.stack||e.message||e)}))},i.addResultToForm=function(e){this.uppy.log("[Form] Adding result to the original form:"),this.uppy.log(e);var t,r=this.form.querySelector('[name="'+this.opts.resultName+'"]');if(r)if(this.opts.multipleResults){try{t=JSON.parse(r.value)}catch(e){}Array.isArray(t)||(t=[]),t.push(e),r.value=JSON.stringify(t)}else r.value=JSON.stringify(e);else(r=document.createElement("input")).name=this.opts.resultName,r.type="hidden",this.opts.multipleResults?r.value=JSON.stringify([e]):r.value=JSON.stringify(e),this.form.appendChild(r)},i.getMetaFromForm=function(){var e=__getFormData_135(this.form);delete e[this.opts.resultName],this.uppy.setMeta(e)},i.install=function(){this.form=_$findDOMElement_196(this.opts.target),this.form&&"FORM"===this.form.nodeName?(this.form.addEventListener("submit",this.handleFormSubmit),this.uppy.on("upload",this.handleUploadStart),this.uppy.on("complete",this.handleSuccess)):this.uppy.log("Form plugin requires a <form> target element passed in options to operate, none was found","error")},i.uninstall=function(){this.form.removeEventListener("submit",this.handleFormSubmit),this.uppy.off("upload",this.handleUploadStart),this.uppy.off("complete",this.handleSuccess)},r}(__Plugin_135),___class_135.VERSION="1.3.16",___temp_135),_$ServiceWorkerStore_138={},isSupported="undefined"!=typeof navigator&&"serviceWorker"in navigator,ServiceWorkerStore=(z2a=y2a.prototype,z2a.list=function(){var t=this,r={},e=new Promise(function(e,t){r.resolve=e,r.reject=t});function n(e){if(e.data.store===t.name)switch(e.data.type){case"uppy/ALL_FILES":r.resolve(e.data.files),navigator.serviceWorker.removeEventListener("message",n)}}return console.log("Loading stored blobs from Service Worker"),this.ready.then(function(){navigator.serviceWorker.addEventListener("message",n),navigator.serviceWorker.controller.postMessage({type:"uppy/GET_FILES",store:t.name})}),e},z2a.put=function(e){var t=this;return this.ready.then(function(){navigator.serviceWorker.controller.postMessage({type:"uppy/ADD_FILE",store:t.name,file:e})})},z2a.delete=function(e){var t=this;return this.ready.then(function(){navigator.serviceWorker.controller.postMessage({type:"uppy/REMOVE_FILE",store:t.name,fileID:e})})},y2a),z2a;function y2a(e){this.ready=new Promise(function(e,t){isSupported?navigator.serviceWorker.controller?e():navigator.serviceWorker.addEventListener("controllerchange",function(){e()}):t(new Error("Unsupported"))}),this.name=e.storeName}ServiceWorkerStore.isSupported=isSupported,_$ServiceWorkerStore_138=ServiceWorkerStore;var _$prettierBytes_140=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return 10<=e||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i},_$IndexedDBStore_136={};function ___extends_136(){return(___extends_136=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var indexedDB="undefined"!=typeof window&&(window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB),__isSupported_136=!!indexedDB,DB_NAME="uppy-blobs",STORE_NAME="files",DEFAULT_EXPIRY=864e5,DB_VERSION=3;function connect(e){var t=indexedDB.open(e,DB_VERSION);return new Promise(function(i,e){t.onupgradeneeded=function(e){var t,r=e.target.result,n=e.currentTarget.transaction;e.oldVersion<2&&r.createObjectStore(STORE_NAME,{keyPath:"id"}).createIndex("store","store",{unique:!1}),e.oldVersion<3&&((t=n.objectStore(STORE_NAME)).createIndex("expires","expires",{unique:!1}),t.openCursor().onsuccess=function(e){var t,r=e.target.result;r&&((t=r.value).expires=Date.now()+DEFAULT_EXPIRY,r.update(t))}),n.oncomplete=function(){i(r)}},t.onsuccess=function(e){i(e.target.result)},t.onerror=e})}function waitForRequest(r){return new Promise(function(t,e){r.onsuccess=function(e){t(e.target.result)},r.onerror=e})}var cleanedUp=!1,IndexedDBStore=(n3a=m3a.prototype,n3a.key=function(e){return this.name+"!"+e},n3a.list=function(){var t=this;return this.ready.then(function(e){return waitForRequest(e.transaction([STORE_NAME],"readonly").objectStore(STORE_NAME).index("store").getAll(IDBKeyRange.only(t.name)))}).then(function(e){var t={};return e.forEach(function(e){t[e.fileID]=e.data}),t})},n3a.get=function(t){var r=this;return this.ready.then(function(e){return waitForRequest(e.transaction([STORE_NAME],"readonly").objectStore(STORE_NAME).get(r.key(t)))}).then(function(e){return{id:e.data.fileID,data:e.data.data}})},n3a.getSize=function(){var r=this;return this.ready.then(function(e){var t=e.transaction([STORE_NAME],"readonly").objectStore(STORE_NAME).index("store").openCursor(IDBKeyRange.only(r.name));return new Promise(function(r,e){var n=0;t.onsuccess=function(e){var t=e.target.result;t?(n+=t.value.data.size,t.continue()):r(n)},t.onerror=function(){e(new Error("Could not retrieve stored blobs size"))}})})},n3a.put=function(t){var r=this;return t.data.size>this.opts.maxFileSize?Promise.reject(new Error("File is too big to store.")):this.getSize().then(function(e){return e>r.opts.maxTotalSize?Promise.reject(new Error("No space left")):r.ready}).then(function(e){return waitForRequest(e.transaction([STORE_NAME],"readwrite").objectStore(STORE_NAME).add({id:r.key(t.id),fileID:t.id,store:r.name,expires:Date.now()+r.opts.expires,data:t.data}))})},n3a.delete=function(t){var r=this;return this.ready.then(function(e){return waitForRequest(e.transaction([STORE_NAME],"readwrite").objectStore(STORE_NAME).delete(r.key(t)))})},m3a.cleanup=function(){return connect(DB_NAME).then(function(i){var t=i.transaction([STORE_NAME],"readwrite").objectStore(STORE_NAME).index("expires").openCursor(IDBKeyRange.upperBound(Date.now()));return new Promise(function(n,e){t.onsuccess=function(e){var t,r=e.target.result;r?(t=r.value,console.log("[IndexedDBStore] Deleting record",t.fileID,"of size",_$prettierBytes_140(t.data.size),"- expired on",new Date(t.expires)),r.delete(),r.continue()):n(i)},t.onerror=e})}).then(function(e){e.close()})},m3a),n3a;function m3a(e){var t=this;this.opts=___extends_136({dbName:DB_NAME,storeName:"default",expires:DEFAULT_EXPIRY,maxFileSize:10485760,maxTotalSize:314572800},e),this.name=this.opts.storeName;function r(){return connect(t.opts.dbName)}cleanedUp?this.ready=r():(cleanedUp=!0,this.ready=m3a.cleanup().then(r,r))}function ___extends_137(){return(___extends_137=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function maybeParse(e){try{return JSON.parse(e)}catch(e){return null}}IndexedDBStore.isSupported=__isSupported_136,_$IndexedDBStore_136=IndexedDBStore;var __cleanedUp_137=!1,_$MetaDataStore_137=(d4a=c4a.prototype,d4a.load=function(){var e=localStorage.getItem(this.name);if(!e)return null;var t=maybeParse(e);return t?t.metadata?t.metadata:(this.save(t),t):null},d4a.save=function(e){var t=Date.now()+this.opts.expires,r=JSON.stringify({metadata:e,expires:t});localStorage.setItem(this.name,r)},c4a.cleanup=function(){var e=function(){for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);/^uppyState:/.test(r)&&e.push(r.slice("uppyState:".length))}return e}(),n=Date.now();e.forEach(function(e){var t=localStorage.getItem("uppyState:"+e);if(!t)return null;var r=maybeParse(t);if(!r)return null;r.expires&&r.expires<n&&localStorage.removeItem("uppyState:"+e)})},c4a),___class_139,___temp_139,d4a;function c4a(e){this.opts=___extends_137({expires:864e5},e),this.name="uppyState:"+e.storeName,__cleanedUp_137||(__cleanedUp_137=!0,c4a.cleanup())}function ___extends_139(){return(___extends_139=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_139(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_139=_$lib_104.Plugin,_$lib_139=(___temp_139=___class_139=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).type="debugger",r.id=r.opts.id||"GoldenRetriever",r.title="Golden Retriever",r.opts=___extends_139({},{expires:864e5,serviceWorker:!1},t),r.MetaDataStore=new _$MetaDataStore_137({expires:r.opts.expires,storeName:e.getID()}),r.ServiceWorkerStore=null,r.opts.serviceWorker&&(r.ServiceWorkerStore=new _$ServiceWorkerStore_138({storeName:e.getID()})),r.IndexedDBStore=new _$IndexedDBStore_136(___extends_139({expires:r.opts.expires},r.opts.indexedDB||{},{storeName:e.getID()})),r.saveFilesStateToLocalStorage=r.saveFilesStateToLocalStorage.bind(___assertThisInitialized_139(r)),r.loadFilesStateFromLocalStorage=r.loadFilesStateFromLocalStorage.bind(___assertThisInitialized_139(r)),r.loadFileBlobsFromServiceWorker=r.loadFileBlobsFromServiceWorker.bind(___assertThisInitialized_139(r)),r.loadFileBlobsFromIndexedDB=r.loadFileBlobsFromIndexedDB.bind(___assertThisInitialized_139(r)),r.onBlobsLoaded=r.onBlobsLoaded.bind(___assertThisInitialized_139(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.loadFilesStateFromLocalStorage=function(){var e=this.MetaDataStore.load();e&&(this.uppy.log("[GoldenRetriever] Recovered some state from Local Storage"),this.uppy.setState({currentUploads:e.currentUploads||{},files:e.files||{}}),this.savedPluginData=e.pluginData)},i.getWaitingFiles=function(){var t={};return this.uppy.getFiles().forEach(function(e){e.progress&&e.progress.uploadStarted||(t[e.id]=e)}),t},i.getUploadingFiles=function(){var t=this,r={},n=this.uppy.getState().currentUploads;return n&&Object.keys(n).forEach(function(e){n[e].fileIDs.forEach(function(e){r[e]=t.uppy.getFile(e)})}),r},i.saveFilesStateToLocalStorage=function(){var e=___extends_139(this.getWaitingFiles(),this.getUploadingFiles()),t={};this.uppy.emit("restore:get-data",function(e){___extends_139(t,e)});var r=this.uppy.getState().currentUploads;this.MetaDataStore.save({currentUploads:r,files:e,pluginData:t})},i.loadFileBlobsFromServiceWorker=function(){var r=this;this.ServiceWorkerStore.list().then(function(e){var t=Object.keys(e).length;return t===r.uppy.getFiles().length?(r.uppy.log("[GoldenRetriever] Successfully recovered "+t+" blobs from Service Worker!"),r.uppy.info("Successfully recovered "+t+" files","success",3e3),r.onBlobsLoaded(e)):(r.uppy.log("[GoldenRetriever] No blobs found in Service Worker, trying IndexedDB now..."),r.loadFileBlobsFromIndexedDB())}).catch(function(e){r.uppy.log("[GoldenRetriever] Failed to recover blobs from Service Worker","warning"),r.uppy.log(e)})},i.loadFileBlobsFromIndexedDB=function(){var r=this;this.IndexedDBStore.list().then(function(e){var t=Object.keys(e).length;if(0<t)return r.uppy.log("[GoldenRetriever] Successfully recovered "+t+" blobs from IndexedDB!"),r.uppy.info("Successfully recovered "+t+" files","success",3e3),r.onBlobsLoaded(e);r.uppy.log("[GoldenRetriever] No blobs found in IndexedDB")}).catch(function(e){r.uppy.log("[GoldenRetriever] Failed to recover blobs from IndexedDB","warning"),r.uppy.log(e)})},i.onBlobsLoaded=function(n){var i=this,o=[],s=___extends_139({},this.uppy.getState().files);Object.keys(n).forEach(function(e){var t,r=i.uppy.getFile(e);r?(t=___extends_139({},r,{data:n[e],isRestored:!0}),s[e]=t):o.push(e)}),this.uppy.setState({files:s}),this.uppy.emit("restored",this.savedPluginData),o.length&&this.deleteBlobs(o).then(function(){i.uppy.log("[GoldenRetriever] Cleaned up "+o.length+" old files")}).catch(function(e){i.uppy.log("[GoldenRetriever] Could not clean up "+o.length+" old files","warning"),i.uppy.log(e)})},i.deleteBlobs=function(e){var t=this,r=[];return e.forEach(function(e){t.ServiceWorkerStore&&r.push(t.ServiceWorkerStore.delete(e)),t.IndexedDBStore&&r.push(t.IndexedDBStore.delete(e))}),Promise.all(r)},i.install=function(){var n=this;this.loadFilesStateFromLocalStorage(),0<this.uppy.getFiles().length?this.ServiceWorkerStore?(this.uppy.log("[GoldenRetriever] Attempting to load files from Service Worker..."),this.loadFileBlobsFromServiceWorker()):(this.uppy.log("[GoldenRetriever] Attempting to load files from Indexed DB..."),this.loadFileBlobsFromIndexedDB()):(this.uppy.log("[GoldenRetriever] No files need to be loaded, only restoring processing state..."),this.onBlobsLoaded([])),this.uppy.on("file-added",function(e){e.isRemote||(n.ServiceWorkerStore&&n.ServiceWorkerStore.put(e).catch(function(e){n.uppy.log("[GoldenRetriever] Could not store file","warning"),n.uppy.log(e)}),n.IndexedDBStore.put(e).catch(function(e){n.uppy.log("[GoldenRetriever] Could not store file","warning"),n.uppy.log(e)}))}),this.uppy.on("file-removed",function(e){n.ServiceWorkerStore&&n.ServiceWorkerStore.delete(e.id).catch(function(e){n.uppy.log("[GoldenRetriever] Failed to remove file","warning"),n.uppy.log(e)}),n.IndexedDBStore.delete(e.id).catch(function(e){n.uppy.log("[GoldenRetriever] Failed to remove file","warning"),n.uppy.log(e)})}),this.uppy.on("complete",function(e){var t=e.successful,r=t.map(function(e){return e.id});n.deleteBlobs(r).then(function(){n.uppy.log("[GoldenRetriever] Removed "+t.length+" files that finished uploading")}).catch(function(e){n.uppy.log("[GoldenRetriever] Could not remove "+t.length+" files that finished uploading","warning"),n.uppy.log(e)})}),this.uppy.on("state-update",this.saveFilesStateToLocalStorage),this.uppy.on("restored",function(){var t=n.uppy.getState().currentUploads;t&&Object.keys(t).forEach(function(e){n.uppy.restore(e,t[e])})})},r}(__Plugin_139),___class_139.VERSION="1.3.15",___temp_139),___class_159,___temp_159;function ___extends_159(){return(___extends_159=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ___assertThisInitialized_159(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var __Plugin_159=_$lib_104.Plugin,_$lib_159=(___temp_159=___class_159=function(n){var e,t;function r(e,t){var r;return(r=n.call(this,e,t)||this).type="debugger",r.id=r.opts.id||"ReduxDevTools",r.title="Redux DevTools",r.opts=___extends_159({},{},t),r.handleStateChange=r.handleStateChange.bind(___assertThisInitialized_159(r)),r.initDevTools=r.initDevTools.bind(___assertThisInitialized_159(r)),r}t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=r.prototype;return i.handleStateChange=function(e,t,r){this.devTools.send("UPPY_STATE_UPDATE",t)},i.initDevTools=function(){var r=this;this.devTools=window.devToolsExtension.connect(),this.devToolsUnsubscribe=this.devTools.subscribe(function(e){if("DISPATCH"===e.type)switch(console.log(e.payload.type),e.payload.type){case"RESET":return void r.uppy.reset();case"IMPORT_STATE":var t=e.payload.nextLiftedState.computedStates;return r.uppy.store.state=___extends_159({},r.uppy.getState(),t[t.length-1].state),void r.uppy.updateAll(r.uppy.getState());case"JUMP_TO_STATE":case"JUMP_TO_ACTION":r.uppy.store.state=___extends_159({},r.uppy.getState(),JSON.parse(e.state)),r.uppy.updateAll(r.uppy.getState())}})},i.install=function(){this.withDevTools="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__,this.withDevTools&&(this.initDevTools(),this.uppy.on("state-update",this.handleStateChange))},i.uninstall=function(){this.withDevTools&&(this.devToolsUnsubscribe(),this.uppy.off("state-update",this.handleStateUpdate))},r}(__Plugin_159),___class_159.VERSION="1.3.2",___temp_159),_$uppy_232={};_$uppy_232.Core=_$lib_104,_$uppy_232.debugLogger=_$uppy_232.Core.debugLogger,_$uppy_232.server=_$lib_101,_$uppy_232.views={ProviderView:_$lib_158},_$uppy_232.DefaultStore=_$lib_171,_$uppy_232.ReduxStore=_$lib_172,_$uppy_232.Dashboard=_$lib_122,_$uppy_232.DragDrop=_$lib_131,_$uppy_232.FileInput=_$lib_134,_$uppy_232.Informer=_$lib_143,_$uppy_232.ProgressBar=_$lib_146,_$uppy_232.StatusBar=_$lib_169,_$uppy_232.Dropbox=_$lib_132,_$uppy_232.GoogleDrive=_$lib_142,_$uppy_232.Instagram=_$lib_144,_$uppy_232.OneDrive=_$lib_145,_$uppy_232.Facebook=_$lib_133,_$uppy_232.Url=_$lib_183,_$uppy_232.Webcam=_$lib_228,_$uppy_232.ScreenCapture=_$lib_166,_$uppy_232.AwsS3=_$lib_96,_$uppy_232.AwsS3Multipart=_$lib_94,_$uppy_232.Transloadit=_$lib_178,_$uppy_232.Tus=_$lib_181,_$uppy_232.XHRUpload=_$lib_230,_$uppy_232.Form=_$lib_135,_$uppy_232.GoldenRetriever=_$lib_139,_$uppy_232.ReduxDevTools=_$lib_159,_$uppy_232.ThumbnailGenerator=_$lib_173,_$uppy_232.locales={};var _$bundle_231={},_$bundle_231=_$uppy_232;return _$bundle_231}); |