text: !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Uppy=e()}}((function(){var e,t,r,n=function(e){var t;return function(r){return t||e(t={exports:{},parent:r},t.exports),t.exports}},i=n((function(e,t){var r=$c("socket.io-client");e.exports=t=i;var n=t.managers={};function i(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,o=Qc(e),s=o.source,a=o.id,u=o.path,l=n[a]&&u in n[a].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||l?(r("ignoring socket cache for %s",s),i=Wh(s,t)):(n[a]||(r("new io instance for %s",s),n[a]=Wh(s,t)),i=n[a]),o.query&&!t.query&&(t.query=o.query),i.socket(o.path,t)}t.protocol=up.protocol,t.connect=i,t.Manager=Wh,t.Socket=Mh})),o=n((function(e,t){})),s=n((function(e,t){(function(e){(function(){"use strict";t.Buffer=r,t.INSPECT_MAX_BYTES=50;function e(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=r.prototype,t}function r(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return o(e)}return n(e,t,r)}function n(t,n,i){if("string"==typeof t)return function(t,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=0|u(t,n),o=e(i),s=o.write(t,n);return s!==i&&(o=o.slice(0,s)),o}(t,n);if(ArrayBuffer.isView(t))return s(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(D(t,ArrayBuffer)||t&&D(t.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var i;return(i=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n)).__proto__=r.prototype,i}(t,n,i);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return r.from(o,n,i);var l=function(t){if(r.isBuffer(t)){var n=0|a(t.length),i=e(n);return 0===i.length||t.copy(i,0,0,n),i}return void 0!==t.length?"number"!=typeof t.length||B(t.length)?e(0):s(t):"Buffer"===t.type&&Array.isArray(t.data)?s(t.data):void 0}(t);if(l)return l;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return r.from(t[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function i(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 o(t){return i(t),e(t<0?0:0|a(t))}function s(t){for(var r=t.length<0?0:0|a(t.length),n=e(r),i=0;i<r;i+=1)n[i]=255&t[i];return n}function a(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function u(e,t){if(r.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(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 n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return x(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(o)return i?-1:x(e).length;t=(""+t).toLowerCase(),o=!0}}function l(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function c(e,t,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=r.from(t,i)),r.isBuffer(t))return 0===t.length?-1:p(e,t,n,i,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):p(e,[t],n,i,o);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,n,i){var o,s=1,a=e.length,u=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=2,a/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;o<a;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var p=!0,h=0;h<u;h++)if(l(e,o+h)!==l(t,h)){p=!1;break}if(p)return o}return-1}function h(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(B(a))return s;e[r+s]=a}return s}function d(e,t,r,n){return T(x(t,e.length-r),e,r,n)}function f(e,t,r,n){return T(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function g(e,t,r,n){return f(e,t,r,n)}function m(e,t,r,n){return T(U(t),e,r,n)}function v(e,t,r,n){return T(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}(t,e.length-r),e,r,n)}function y(e,t,r){return 0===t&&r===e.length?Qn.fromByteArray(e):Qn.fromByteArray(e.slice(t,r))}function b(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=l>239?4:l>223?3:l>191?2:1;if(i+p<=r)switch(p){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(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)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,p=1):c>65535&&(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<=w)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=w));return r}(n)}r.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}(),r.TYPED_ARRAY_SUPPORT||"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(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),r.poolSize=8192,r.from=function(e,t,r){return n(e,t,r)},r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,r.alloc=function(t,r,n){return function(t,r,n){return i(t),t<=0?e(t):void 0!==r?"string"==typeof n?e(t).fill(r,n):e(t).fill(r):e(t)}(t,r,n)},r.allocUnsafe=function(e){return o(e)},r.allocUnsafeSlow=function(e){return o(e)},r.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==r.prototype},r.compare=function(e,t){if(D(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),D(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),!r.isBuffer(e)||!r.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==t[o]){n=e[o],i=t[o];break}return n<i?-1:i<n?1:0},r.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}},r.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return r.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=r.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(D(s,Uint8Array)&&(s=r.from(s)),!r.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i},r.byteLength=u,r.prototype._isBuffer=!0,r.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)l(this,t,t+1);return this},r.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)l(this,t,t+3),l(this,t+1,t+2);return this},r.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)l(this,t,t+7),l(this,t+1,t+6),l(this,t+2,t+5),l(this,t+3,t+4);return this},r.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?b(this,0,e):function(e,t,r){var n=!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 P(this,t,r);case"utf8":case"utf-8":return b(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return _(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(e){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===r.compare(this,e)},r.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},r.prototype.compare=function(e,t,n,i,o){if(D(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),!r.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===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0),u=Math.min(s,a),l=this.slice(i,o),c=e.slice(t,n),p=0;p<u;++p)if(l[p]!==c[p]){s=l[p],a=c[p];break}return s<a?-1:a<s?1:0},r.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},r.prototype.indexOf=function(e,t,r){return c(this,e,t,r,!0)},r.prototype.lastIndexOf=function(e,t,r){return c(this,e,t,r,!1)},r.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||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return h(this,e,t,r);case"utf8":case"utf-8":return d(this,e,t,r);case"ascii":return f(this,e,t,r);case"latin1":case"binary":return g(this,e,t,r);case"base64":return m(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function S(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}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}function P(e,t,r){var n,i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var o="",s=t;s<r;++s)o+=(n=e[s])<16?"0"+n.toString(16):n.toString(16);return o}function k(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}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,i,o,s){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function E(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function A(e,t,r,n,i){return t=+t,r>>>=0,i||E(e,0,r,4),li.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,i){return t=+t,r>>>=0,i||E(e,0,r,8),li.write(e,t,r,n,52,8),r+8}r.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var i=this.subarray(e,t);return i.__proto__=r.prototype,i},r.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},r.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},r.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(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},r.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},r.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),li.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),li.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),li.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),li.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(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},r.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},r.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},r.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},r.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},r.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(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},r.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(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},r.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-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},r.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},r.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},r.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},r.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},r.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(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},r.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(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},r.prototype.writeFloatLE=function(e,t,r){return A(this,e,t,!0,r)},r.prototype.writeFloatBE=function(e,t,r){return A(this,e,t,!1,r)},r.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},r.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},r.prototype.copy=function(e,t,n,i){if(!r.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var o=i-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,i);else if(this===e&&n<t&&t<i)for(var s=o-1;s>=0;--s)e[s+t]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),t);return o},r.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!r.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var o=e.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(e=o)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var a=r.isBuffer(e)?e:r.from(e,i),u=a.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<n-t;++s)this[s+t]=a[s%u]}return this};var R=/[^+/0-9A-Za-z-_]/g;function x(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<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 U(e){return Qn.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(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 D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function B(e){return e!=e}}).call(this)}).call(this,s({}).Buffer)})),a=e={};function u(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===u||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:u}catch(e){t=u}try{r="function"==typeof clearTimeout?clearTimeout:l}catch(e){r=l}}();var p,h=[],d=!1,f=-1;function g(){d&&p&&(d=!1,p.length?h=p.concat(h):f=-1,h.length&&m())}function m(){if(!d){var e=c(g);d=!0;for(var t=h.length;t;){for(p=h,h=[];++f<t;)p&&p[f].run();f=-1,t=h.length}p=null,d=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===l||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function v(e,t){this.fun=e,this.array=t}function y(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new v(e,t)),1!==h.length||d||c(m)},v.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=y,a.addListener=y,a.once=y,a.off=y,a.removeListener=y,a.removeAllListeners=y,a.emit=y,a.prependListener=y,a.prependOnceListener=y,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0};var b={exports:{}};(function(e,t){(function(){!function(e,t){"object"==typeof b.exports?b.exports=t():e.ES6Promise=t()}(this,(function(){"use strict";function r(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,o=void 0,s=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(s?s(g):w())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var e=setTimeout;return function(){return e(g,1)}}var f=new Array(1e3);function g(){for(var e=0;e<i;e+=2)(0,f[e])(f[e+1]),f[e]=void 0,f[e+1]=void 0;i=0}var m,v,y,b,w=void 0;function S(e,t){var r=this,n=new this.constructor(k);void 0===n[P]&&D(n);var i=r._state;if(i){var o=arguments[i-1];a((function(){return U(i,n,o,r._result)}))}else R(r,n,e,t);return n}function _(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(k);return O(t,e),t}p?w=function(){return e.nextTick(g)}:c?(v=0,y=new c(g),b=document.createTextNode(""),y.observe(b,{characterData:!0}),w=function(){b.data=v=++v%2}):h?((m=new MessageChannel).port1.onmessage=g,w=function(){return m.port2.postMessage(0)}):w=void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(o=e.runOnLoop||e.runOnContext)?function(){o(g)}:d()}catch(t){return d()}}():d();var P=Math.random().toString(36).substring(2);function k(){}function C(e,t,n){t.constructor===e.constructor&&n===S&&t.constructor.resolve===_?function(e,t){1===t._state?A(e,t._result):2===t._state?F(e,t._result):R(t,void 0,(function(t){return O(e,t)}),(function(t){return F(e,t)}))}(e,t):void 0===n?A(e,t):r(n)?function(e,t,r){a((function(e){var n=!1,i=function(r,i,o,s){try{r.call(i,(function(r){n||(n=!0,t!==r?O(e,r):A(e,r))}),(function(t){n||(n=!0,F(e,t))}))}catch(a){return a}}(r,t,0,0,e._label);!n&&i&&(n=!0,F(e,i))}),e)}(e,t,n):A(e,t)}function O(e,t){if(e===t)F(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(n=t),null===n||"object"!==i&&"function"!==i)A(e,t);else{var r=void 0;try{r=t.then}catch(gp){return void F(e,gp)}C(e,t,r)}var n,i}function E(e){e._onerror&&e._onerror(e._result),x(e)}function A(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&a(x,e))}function F(e,t){void 0===e._state&&(e._state=2,e._result=t,a(E,e))}function R(e,t,r,n){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+1]=r,i[o+2]=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=void 0,i=void 0,o=e._result,s=0;s<t.length;s+=3)n=t[s],i=t[s+r],n?U(r,n,i,o):i(o);e._subscribers.length=0}}function U(e,t,n,i){var o=r(n),s=void 0,a=void 0,u=!0;if(o){try{s=n(i)}catch(l){u=!1,a=l}if(t===s)return void F(t,new TypeError("A promises callback cannot return that same promise."))}else s=i;void 0!==t._state||(o&&u?O(t,s):!1===u?F(t,a):1===e?A(t,s):2===e&&F(t,s))}var T=0;function D(e){e[P]=T++,e._state=void 0,e._result=void 0,e._subscribers=[]}var B=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(k),this.promise[P]||D(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&A(this.promise,this._result))):F(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===_){var i=void 0,o=void 0,s=!1;try{i=e.then}catch(u){s=!0,o=u}if(i===S&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(r===I){var a=new r(k);s?F(a,o):C(a,e,i),this._willSettleAt(a,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;void 0===n._state&&(this._remaining--,2===e?F(n,r):this._result[t]=r),0===this._remaining&&A(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;R(e,void 0,(function(e){return r._settledAt(1,t,e)}),(function(e){return r._settledAt(2,t,e)}))},e}(),I=function(){function e(t){this[P]=T++,this._result=this._state=void 0,this._subscribers=[],k!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(e,t){try{t((function(t){O(e,t)}),(function(t){F(e,t)}))}catch(r){F(e,r)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var t=this.constructor;return r(e)?this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){throw r}))})):this.then(e,e)},e}();return I.prototype.then=S,I.all=function(e){return new B(this,e).promise},I.race=function(e){var t=this;return n(e)?new t((function(r,n){for(var i=e.length,o=0;o<i;o++)t.resolve(e[o]).then(r,n)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},I.resolve=_,I.reject=function(e){var t=new this(k);return F(t,e),t},I._setScheduler=function(e){s=e},I._setAsap=function(e){a=e},I._asap=a,I.polyfill=function(){var e=void 0;if(void 0!==t)e=t;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(i){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=e.Promise;if(r){var n=null;try{n=Object.prototype.toString.call(r.resolve())}catch(i){}if("[object Promise]"===n&&!r.cast)return}e.Promise=I},I.Promise=I,I}))}).call(this)}).call(this,e,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});(b=b.exports).polyfill();var w,S={exports:{}};w=function(e){"use strict";var t="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t&&t,r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in t,s="ArrayBuffer"in t;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(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):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(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)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(g)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(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(w)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=l(e),t=c(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},h.prototype.delete=function(e){delete this.map[l(e)]},h.prototype.get=function(e){return e=l(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(l(e))},h.prototype.set=function(e,t){this.map[l(e)]=c(t)},h.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},h.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),p(e)},h.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},h.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),p(e)},n&&(h.prototype[Symbol.iterator]=h.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(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 h(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),y.indexOf(n)>-1?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");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];S.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(th){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function P(r,n){return new Promise((function(o,a){var u=new b(r,n);if(u.signal&&u.signal.aborted)return a(new e.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function p(){l.abort()}l.onload=function(){var e,t,r={status:l.status,statusText:l.statusText,headers:(e=l.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in l?l.responseURL:r.headers.get("X-Request-URL");var n="response"in l?l.response:l.responseText;setTimeout((function(){o(new S(n,r))}),0)},l.onerror=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},l.ontimeout=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},l.onabort=function(){setTimeout((function(){a(new e.DOMException("Aborted","AbortError"))}),0)},l.open(u.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(r){return e}}(u.url),!0),"include"===u.credentials?l.withCredentials=!0:"omit"===u.credentials&&(l.withCredentials=!1),"responseType"in l&&(i?l.responseType="blob":s&&u.headers.get("Content-Type")&&-1!==u.headers.get("Content-Type").indexOf("application/octet-stream")&&(l.responseType="arraybuffer")),!n||"object"!=typeof n.headers||n.headers instanceof h?u.headers.forEach((function(e,t){l.setRequestHeader(t,e)})):Object.getOwnPropertyNames(n.headers).forEach((function(e){l.setRequestHeader(e,c(n.headers[e]))})),u.signal&&(u.signal.addEventListener("abort",p),l.onreadystatechange=function(){4===l.readyState&&u.signal.removeEventListener("abort",p)}),l.send(void 0===u._bodyInit?null:u._bodyInit)}))}P.polyfill=!0,t.fetch||(t.fetch=P,t.Headers=h,t.Request=b,t.Response=S),e.Headers=h,e.Request=b,e.Response=S,e.fetch=P,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof S.exports?w(S.exports):w(this.WHATWGFetch={}),S=S.exports;var _=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function P(){return(P=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 k,C=function(){function e(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)}var t=e.prototype;return t._apply=function(e){if(e&&e.strings){var t=this.locale;this.locale=P({},t,{strings:P({},t.strings,e.strings)}),this.locale.pluralize=e.pluralize||t.pluralize}},t.interpolate=function(e,t){var r=String.prototype,n=r.split,i=r.replace,o=/\$/g,s=[e];for(var a in t)if("_"!==a&&_(t,a)){var u=t[a];"string"==typeof u&&(u=i.call(t[a],o,"$$$$")),s=l(s,new RegExp("%\\{"+a+"\\}","g"),u)}return s;function l(e,t,r){var i=[];return e.forEach((function(e){if("string"!=typeof e)return i.push(e);n.call(e,t).forEach((function(e,t,n){""!==e&&i.push(e),t<n.length-1&&i.push(r)}))})),i}},t.translate=function(e,t){return this.translateArray(e,t).join("")},t.translateArray=function(e,t){if(!_(this.locale.strings,e))throw new Error("missing string: "+e);var r=this.locale.strings[e];if("object"==typeof r){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}")}return this.interpolate(r,t)},e}(),O=function(){var e={},t=e._fns={};return e.emit=function(e,r,n,i,o,s,a){var u=function(e){for(var r=t[e]?t[e]:[],n=e.indexOf(":"),i=-1===n?[e]:[e.substring(0,n),e.substring(n+1)],o=Object.keys(t),s=0,a=o.length;s<a;s++){var u=o[s];if("*"===u&&(r=r.concat(t[u])),2===i.length&&i[0]===u){r=r.concat(t[u]);break}}return r}(e);u.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,u,[r,n,i,o,s,a])},e.on=function(e,r){t[e]||(t[e]=[]),t[e].push(r)},e.once=function(t,r){this.on(t,(function n(){r.apply(this,arguments),e.off(t,n)}))},e.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]},e},E=function(e,t){var r="000000000"+e;return r.substr(r.length-t)},A="object"==typeof window?window:self,F=Object.keys(A).length,R=E(((navigator.mimeTypes?navigator.mimeTypes.length:0)+navigator.userAgent.length).toString(36)+F.toString(36),4),x=function(){return R},U="undefined"!=typeof window&&(window.crypto||window.msCrypto)||"undefined"!=typeof self&&self.crypto;if(U){var T=Math.pow(2,32)-1;k=function(){return Math.abs(U.getRandomValues(new Uint32Array(1))[0]/T)}}else k=Math.random;var D=k,B={},I=0,N=Math.pow(36,4);function M(){return E((D()*N<<0).toString(36),4)}function j(){return I=I<N?I:0,++I-1}function L(){return"c"+(new Date).getTime().toString(36)+E(j().toString(36),4)+x()+(M()+M())}L.slug=function(){var e=(new Date).getTime().toString(36),t=j().toString(36).slice(-4),r=x().slice(0,1)+x().slice(-1),n=M().slice(-2);return e.slice(-2)+t+r+n},L.isCuid=function(e){return"string"==typeof e&&!!e.startsWith("c")},L.isSlug=function(e){if("string"!=typeof e)return!1;var t=e.length;return t>=7&&t<=10},L.fingerprint=x,B=L;var z={};(function(e){(function(){var t=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt,s="object"==typeof e&&e&&e.Object===Object&&e,a="object"==typeof self&&self&&self.Object===Object&&self,u=s||a||Function("return this")(),l=Object.prototype.toString,c=Math.max,p=Math.min,h=function(){return u.Date.now()};function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(d(e)){var s="function"==typeof e.valueOf?e.valueOf():e;e=d(s)?s+"":s}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var a=n.test(e);return a||i.test(e)?o(e.slice(2),a?2:8):r.test(e)?NaN:+e}z=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return d(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),function(e,t,r){var n,i,o,s,a,u,l=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var r=n,o=i;return n=i=void 0,l=t,s=e.apply(o,r)}function b(e){var r=e-u;return void 0===u||r>=t||r<0||m&&e-l>=o}function w(){var e=h();if(b(e))return S(e);a=setTimeout(w,function(e){var r=t-(e-u);return m?p(r,o-(e-l)):r}(e))}function S(e){return a=void 0,v&&n?y(e):(n=i=void 0,s)}function _(){var e=h(),r=b(e);if(n=arguments,i=this,u=e,r){if(void 0===a)return function(e){return l=e,a=setTimeout(w,t),g?y(e):s}(u);if(m)return a=setTimeout(w,t),y(u)}return void 0===a&&(a=setTimeout(w,t)),s}return t=f(t)||0,d(r)&&(g=!!r.leading,o=(m="maxWait"in r)?c(f(r.maxWait)||0,t):o,v="trailing"in r?!!r.trailing:v),_.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=u=i=a=void 0},_.flush=function(){return void 0===a?s:S(h())},_}(e,t,{leading:n,maxWait:t,trailing:i})}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var H,q=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 e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i};function V(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}V.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},H=function(e,t,r){var n=new V(e,r||/[\/\.]/);return void 0!==t?n.match(t):n};var W,X=/[\/\+\.]/;function Y(){return(Y=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 G=function(){function e(){this.state={},this.callbacks=[]}var t=e.prototype;return t.getState=function(){return this.state},t.setState=function(e){var t=Y({},this.state),r=Y({},this.state,e);this.state=r,this._publish(t,r,e)},t.subscribe=function(e){var t=this;return this.callbacks.push(e),function(){t.callbacks.splice(t.callbacks.indexOf(e),1)}},t._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)}))},e}();G.VERSION="1.2.7",W=function(){return new G};var K=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)}},$={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",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"},J=function(e){var t=e.name?K(e.name).extension:null;return t=t?t.toLowerCase():null,e.type?e.type:t&&$[t]?$[t]:"application/octet-stream"};function Q(e){var t="";return e.replace(/[^A-Z0-9]/gi,(function(e){return t+="-"+function(e){return e.charCodeAt(0).toString(32)}(e),"/"}))+t}var Z=function(e){var t="uppy";return"string"==typeof e.name&&(t+="-"+Q(e.name.toLowerCase())),void 0!==e.type&&(t+="-"+e.type),e.meta&&"string"==typeof e.meta.relativePath&&(t+="-"+Q(e.meta.relativePath.toLowerCase())),void 0!==e.data.size&&(t+="-"+e.data.size),void 0!==e.data.lastModified&&(t+="-"+e.data.lastModified),t},ee=function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r;return-1},te=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];return n=parseInt(n,10),i=parseInt(i,10),n<15||15===n&&i<15063||n>18||18===n&&i>=18218};function re(e){return 2!==e.length?0+e:e}var ne=function(){var e=new Date;return re(e.getHours().toString())+":"+re(e.getMinutes().toString())+":"+re(e.getSeconds().toString())},ie={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] ["+ne()+"]"].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] ["+ne()+"]"].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] ["+ne()+"]"].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] ["+ne()+"]"].concat(r))}}},oe={exports:{}};!function(){"use strict";function e(){}function t(t,r){var n,i,o,s,a=_;for(s=arguments.length;s-- >2;)S.push(arguments[s]);for(r&&null!=r.children&&(S.length||S.push(r.children),delete r.children);S.length;)if((i=S.pop())&&void 0!==i.pop)for(s=i.length;s--;)S.push(i[s]);else"boolean"==typeof i&&(i=null),(o="function"!=typeof t)&&(null==i?i="":"number"==typeof i?i=String(i):"string"!=typeof i&&(o=!1)),o&&n?a[a.length-1]+=i:a===_?a=[i]:a.push(i),n=o;var u=new e;return u.nodeName=t,u.children=a,u.attributes=null==r?void 0:r,u.key=null==r?void 0:r.key,void 0!==w.vnode&&w.vnode(u),u}function r(e,t){for(var r in t)e[r]=t[r];return e}function n(e){!e.__d&&(e.__d=!0)&&1==C.push(e)&&(w.debounceRendering||P)(i)}function i(){var e,t=C;for(C=[];e=t.pop();)e.__d&&v(e)}function o(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function s(e){var t=r({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var i in n)void 0===t[i]&&(t[i]=n[i]);return t}function a(e){var t=e.parentNode;t&&t.removeChild(e)}function u(e,t,r,n,i){if("className"===t&&(t="class"),"key"===t);else 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===k.test(o)?n[o]+"px":n[o]}}else if("dangerouslySetInnerHTML"===t)n&&(e.innerHTML=n.__html||"");else if("o"==t[0]&&"n"==t[1]){var 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}else if("list"!==t&&"type"!==t&&!i&&t in e)!function(e,t,r){try{e[t]=r}catch(n){}}(e,t,null==n?"":n),null!=n&&!1!==n||e.removeAttribute(t);else{var 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](w.event&&w.event(e)||e)}function c(){for(var e;e=O.pop();)w.afterMount&&w.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,r,n,i,l){E++||(A=null!=i&&void 0!==i.ownerSVGElement,F=null!=e&&!("__preactattr_"in e));var p=function e(t,r,n,i,l){var c=t,p=A;if(null!=r&&"boolean"!=typeof r||(r=""),"string"==typeof r||"number"==typeof r)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||l)?t.nodeValue!=r&&(t.nodeValue=r):(c=document.createTextNode(r),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),h(t,!0))),c.__preactattr_=!0,c;var d,g,v=r.nodeName;if("function"==typeof v)return function(e,t,r,n){for(var i=e&&e._component,o=i,a=e,u=i&&e._componentConstructor===t.nodeName,l=u,c=s(t);i&&!l&&(i=i.__u);)l=i.constructor===t.nodeName;return i&&l&&(!n||i._component)?(m(i,c,3,r,n),e=i.base):(o&&!u&&(y(o),e=a=null),i=f(t.nodeName,c,r),e&&!i.__b&&(i.__b=e,a=null),m(i,c,1,r,n),e=i.base,a&&e!==a&&(a._component=null,h(a,!1))),e}(t,r,n,i);if(A="svg"===v||"foreignObject"!==v&&A,v=String(v),(!t||!o(t,v))&&(d=v,(g=A?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d)).__n=d,c=g,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),h(t,!0)}var b=c.firstChild,w=c.__preactattr_,S=r.children;if(null==w){w=c.__preactattr_={};for(var _=c.attributes,P=_.length;P--;)w[_[P].name]=_[P].value}return!F&&S&&1===S.length&&"string"==typeof S[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=S[0]&&(b.nodeValue=S[0]):(S&&S.length||null!=b)&&function(t,r,n,i,s){var u,l,c,p,d,f,g,m,v=t.childNodes,y=[],b={},w=0,S=0,_=v.length,P=0,k=r?r.length:0;if(0!==_)for(var C=0;C<_;C++){var O=v[C],E=O.__preactattr_;null!=(A=k&&E?O._component?O._component.__k:E.key:null)?(w++,b[A]=O):(E||(void 0!==O.splitText?!s||O.nodeValue.trim():s))&&(y[P++]=O)}if(0!==k)for(C=0;C<k;C++){var A;if(d=null,null!=(A=(p=r[C]).key))w&&void 0!==b[A]&&(d=b[A],b[A]=void 0,w--);else if(!d&&S<P)for(u=S;u<P;u++)if(void 0!==y[u]&&(f=l=y[u],m=s,"string"==typeof(g=p)||"number"==typeof g?void 0!==f.splitText:"string"==typeof g.nodeName?!f._componentConstructor&&o(f,g.nodeName):m||f._componentConstructor===g.nodeName)){d=l,y[u]=void 0,u===P-1&&P--,u===S&&S++;break}d=e(d,p,n,i),c=v[C],d&&d!==t&&d!==c&&(null==c?t.appendChild(d):d===c.nextSibling?a(c):t.insertBefore(d,c))}if(w)for(var C in b)void 0!==b[C]&&h(b[C],!1);for(;S<=P;)void 0!==(d=y[P--])&&h(d,!1)}(c,S,n,i,F||null!=w.dangerouslySetInnerHTML),function(e,t,r){var n;for(n in r)t&&null!=t[n]||null==r[n]||u(e,n,r[n],r[n]=void 0,A);for(n in t)"children"===n||"innerHTML"===n||n in r&&t[n]===("value"===n||"checked"===n?e[n]:r[n])||u(e,n,r[n],r[n]=t[n],A)}(c,r.attributes,w),A=p,c}(e,t,r,n,l);return i&&p.parentNode!==i&&i.appendChild(p),--E||(F=!1,l||c()),p}function h(e,t){var r=e._component;r?y(r):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||a(e),d(e))}function d(e){for(e=e.lastChild;e;){var t=e.previousSibling;h(e,!0),e=t}}function f(e,t,r){var n,i=R[e.name];if(e.prototype&&e.prototype.render?(n=new e(t,r),b.call(n,t,r)):((n=new b(t,r)).constructor=e,n.render=g),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 g(e,t,r){return this.constructor(e,r)}function m(e,t,r,i,o){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||o?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,i),i&&i!==e.context&&(e.__c||(e.__c=e.context),e.context=i),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==r&&(1!==r&&!1===w.syncComponentUpdates&&e.base?n(e):v(e,1,o)),e.__r&&e.__r(e))}function v(e,t,n,i){if(!e.__x){var o,a,u,l=e.props,d=e.state,g=e.context,b=e.__p||l,S=e.__s||d,_=e.__c||g,P=e.base,k=e.__b,C=P||k,A=e._component,F=!1;if(P&&(e.props=b,e.state=S,e.context=_,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(l,d,g)?F=!0:e.componentWillUpdate&&e.componentWillUpdate(l,d,g),e.props=l,e.state=d,e.context=g),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!F){o=e.render(l,d,g),e.getChildContext&&(g=r(r({},g),e.getChildContext()));var R,x,U=o&&o.nodeName;if("function"==typeof U){var T=s(o);(a=A)&&a.constructor===U&&T.key==a.__k?m(a,T,1,g,!1):(R=a,e._component=a=f(U,T,g),a.__b=a.__b||k,a.__u=e,m(a,T,0,g,!1),v(a,1,n,!0)),x=a.base}else u=C,(R=A)&&(u=e._component=null),(C||1===t)&&(u&&(u._component=null),x=p(u,o,g,n||!P,C&&C.parentNode,!0));if(C&&x!==C&&a!==A){var D=C.parentNode;D&&x!==D&&(D.replaceChild(x,C),R||(C._component=null,h(C,!1)))}if(R&&y(R),e.base=x,x&&!i){for(var B=e,I=e;I=I.__u;)(B=I).base=x;x._component=B,x._componentConstructor=B.constructor}}if(!P||n?O.unshift(e):F||(e.componentDidUpdate&&e.componentDidUpdate(b,S,_),w.afterUpdate&&w.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||i||c()}}function y(e){w.beforeUnmount&&w.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var r=e._component;r?y(r):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,a(t),function(e){var t=e.constructor.name;(R[t]||(R[t]=[])).push(e)}(e),d(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var w={},S=[],_=[],P="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,C=[],O=[],E=0,A=!1,F=!1,R={};r(b.prototype,{setState:function(e,t){var i=this.state;this.__s||(this.__s=r({},i)),r(i,"function"==typeof e?e(i,this.props):e),t&&(this.__h=this.__h||[]).push(t),n(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),v(this,2)},render:function(){}});var x={h:t,createElement:t,cloneElement:function(e,n){return t(e.nodeName,r(r({},e.attributes),n),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,r){return p(r,e,{},!1,t,!1)},rerender:i,options:w};oe.exports=x}(),oe=oe.exports;var se=function(e){return e&&"object"==typeof e&&e.nodeType===Node.ELEMENT_NODE},ae=function(e,t){return void 0===t&&(t=document),"string"==typeof e?t.querySelector(e):se(e)?e:void 0};function ue(){return(ue=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 le,ce=function(){function e(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)}var t=e.prototype;return t.getPluginState=function(){return this.uppy.getState().plugins[this.id]||{}},t.setPluginState=function(e){var t,r=this.uppy.getState().plugins;this.uppy.setState({plugins:ue({},r,(t={},t[this.id]=ue({},r[this.id],e),t))})},t.setOptions=function(e){this.opts=ue({},this.opts,e),this.setPluginState()},t.update=function(e){void 0!==this.el&&this._updateUI&&this._updateUI(e)},t.afterUpdate=function(){},t.onMount=function(){},t.mount=function(t,r){var n,i,o,s,a=this,u=r.id,l=ae(t);if(l)return this.isTargetDOMEl=!0,this.rerender=function(e){a.uppy.getPlugin(a.id)&&(a.el=oe.render(a.render(e),l,a.el),a.afterUpdate())},this._updateUI=(n=this.rerender,i=null,o=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)}))),i}),this.uppy.log("Installing "+u+" to a DOM element '"+t+"'"),this.opts.replaceTargetContent&&(l.innerHTML=""),this.el=oe.render(this.render(this.uppy.getState()),l),this.onMount(),this.el;if("object"==typeof t&&t instanceof e)s=t;else if("function"==typeof t){var c=t;this.uppy.iteratePlugins((function(e){if(e instanceof c)return s=e,!1}))}if(s)return this.uppy.log("Installing "+u+" to "+s.id),this.parent=s,this.el=s.addTarget(r),this.onMount(),this.el;this.uppy.log("Not installing "+u);var p="Invalid target option given to "+u+".";throw new Error(p+="function"==typeof t?" 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.")},t.render=function(e){throw new Error("Extend the render method to add your plugin to a DOM element")},t.addTarget=function(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")},t.unmount=function(){this.isTargetDOMEl&&this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},t.install=function(){},t.uninstall=function(){this.unmount()},e}();function pe(){return(pe=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 he(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 de(e){var t="function"==typeof Map?new Map:void 0;return(de=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return fe(e,arguments,me(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ge(n,e)})(e)}function fe(e,t,r){return(fe=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&ge(i,r.prototype),i}).apply(null,arguments)}function ge(e,t){return(ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function me(e){return(me=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ve=ie.justErrorsLogger,ye=ie.debugLogger,be=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).isRestriction=!0,t}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,ge(t,r),n}(de(Error)),we=function(){function e(e){var t=this;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",inferiorSize:"This file is smaller than the allowed size of %{size}",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}",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",backToSearch:"Back to Search",emptyFolderAdded:"No files were added from empty folder",folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}};var r={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,debug:!1,restrictions:{maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null},meta:{},onBeforeFileAdded:function(e,t){return e},onBeforeUpload:function(e){return e},store:W(),logger:ve,infoTimeout:5e3};if(this.opts=pe({},r,e,{restrictions:pe({},r.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=ye),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.validateRestrictions=this.validateRestrictions.bind(this),this._calculateProgress=z(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=O(),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:te(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:pe({},this.opts.meta),info:{isHidden:!0,type:"info",message:""},recoveredState:null}),this._storeUnsubscribe=this.store.subscribe((function(e,r,n){t.emit("state-update",e,r,n),t.updateAll(r)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),this._addListeners()}var t,r,n=e.prototype;return n.on=function(e,t){return this.emitter.on(e,t),this},n.off=function(e,t){return this.emitter.off(e,t),this},n.updateAll=function(e){this.iteratePlugins((function(t){t.update(e)}))},n.setState=function(e){this.store.setState(e)},n.getState=function(){return this.store.getState()},n.setFileState=function(e,t){var r;if(!this.getState().files[e])throw new Error("Can\u2019t set state for "+e+" (the file could have been removed)");this.setState({files:pe({},this.getState().files,(r={},r[e]=pe({},this.getState().files[e],t),r))})},n.i18nInit=function(){this.translator=new C([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)},n.setOptions=function(e){this.opts=pe({},this.opts,e,{restrictions:pe({},this.opts.restrictions,e&&e.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((function(e){e.setOptions()})),this.setState()},n.resetProgress=function(){var e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t=pe({},this.getState().files),r={};Object.keys(t).forEach((function(n){var i=pe({},t[n]);i.progress=pe({},i.progress,e),r[n]=i})),this.setState({files:r,totalProgress:0}),this.emit("reset-progress")},n.addPreProcessor=function(e){this.preProcessors.push(e)},n.removePreProcessor=function(e){var t=this.preProcessors.indexOf(e);-1!==t&&this.preProcessors.splice(t,1)},n.addPostProcessor=function(e){this.postProcessors.push(e)},n.removePostProcessor=function(e){var t=this.postProcessors.indexOf(e);-1!==t&&this.postProcessors.splice(t,1)},n.addUploader=function(e){this.uploaders.push(e)},n.removeUploader=function(e){var t=this.uploaders.indexOf(e);-1!==t&&this.uploaders.splice(t,1)},n.setMeta=function(e){var t=pe({},this.getState().meta,e),r=pe({},this.getState().files);Object.keys(r).forEach((function(t){r[t]=pe({},r[t],{meta:pe({},r[t].meta,e)})})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})},n.setFileMeta=function(e,t){var r=pe({},this.getState().files);if(r[e]){var n=pe({},r[e].meta,t);r[e]=pe({},r[e],{meta:n}),this.setState({files:r})}else this.log("Was trying to set metadata for a file that has been removed: ",e)},n.getFile=function(e){return this.getState().files[e]},n.getFiles=function(){var e=this.getState().files;return Object.keys(e).map((function(t){return e[t]}))},n.validateRestrictions=function(e,t){try{return this._checkRestrictions(e,t),{result:!0}}catch(th){return{result:!1,reason:th.message}}},n._checkRestrictions=function(e,t){void 0===t&&(t=this.getFiles());var r=this.opts.restrictions,n=r.maxFileSize,i=r.minFileSize,o=r.maxTotalFileSize,s=r.maxNumberOfFiles,a=r.allowedFileTypes;if(s&&t.length+1>s)throw new be(""+this.i18n("youCanOnlyUploadX",{smart_count:s}));if(a&&!a.some((function(t){return t.indexOf("/")>-1?!!e.type&&function(e,t){function r(t){var r=H(t,e,X);return r&&r.length>=2}return t?r(t.split(";")[0]):r}(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.substr(1).toLowerCase()}))){var u=a.join(", ");throw new be(this.i18n("youCanOnlyUploadFileTypes",{types:u}))}if(o&&null!=e.size){var l=0;if(l+=e.size,t.forEach((function(e){l+=e.size})),l>o)throw new be(this.i18n("exceedsSize2",{backwardsCompat:this.i18n("exceedsSize"),size:q(o)}))}if(n&&null!=e.size&&e.size>n)throw new be(this.i18n("exceedsSize2",{backwardsCompat:this.i18n("exceedsSize"),size:q(n)}));if(i&&null!=e.size&&e.size<i)throw new be(this.i18n("inferiorSize",{size:q(i)}))},n._checkMinNumberOfFiles=function(e){var t=this.opts.restrictions.minNumberOfFiles;if(Object.keys(e).length<t)throw new be(""+this.i18n("youHaveToAtLeastSelectX",{smart_count:t}))},n._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",this.opts.infoTimeout),u)throw"object"==typeof e?e:new Error(e)},n._assertNewUploadAllowed=function(e){!1===this.getState().allowNewUpload&&this._showOrLogErrorAndThrow(new be(this.i18n("noNewAlreadyUploading")),{file:e})},n._checkAndCreateFileStateObject=function(e,t){var r=J(t);t.type=r;var n,i=this.opts.onBeforeFileAdded(t,e);!1===i&&this._showOrLogErrorAndThrow(new be("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=K(n).extension,s=t.isRemote||!1,a=Z(t);e[a]&&!e[a].isGhost&&this._showOrLogErrorAndThrow(new be(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:pe({},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{var p=Object.keys(e).map((function(t){return e[t]}));this._checkRestrictions(c,p)}catch(th){this._showOrLogErrorAndThrow(th,{file:c})}return c},n._startIfAutoProceed=function(){var e=this;this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((function(){e.scheduledAutoProceed=null,e.upload().catch((function(t){t.isRestriction||e.log(t.stack||t.message||t)}))}),4))},n.addFile=function(e){var t;this._assertNewUploadAllowed(e);var r=this.getState().files,n=this._checkAndCreateFileStateObject(r,e);return r[n.id]&&r[n.id].isGhost&&(n=pe({},r[n.id],{data:e.data,isGhost:!1}),this.log("Replaced the blob in the restored ghost file: "+n.name+", "+n.id)),this.setState({files:pe({},r,(t={},t[n.id]=n,t))}),this.emit("file-added",n),this.emit("files-added",[n]),this.log("Added file: "+n.name+", "+n.id+", mime type: "+n.type),this._startIfAutoProceed(),n.id},n.addFiles=function(e){var t=this;this._assertNewUploadAllowed();for(var r=pe({},this.getState().files),n=[],i=[],o=0;o<e.length;o++)try{var s=this._checkAndCreateFileStateObject(r,e[o]);r[s.id]&&r[s.id].isGhost&&(s=pe({},r[s.id],{data:e[o].data,isGhost:!1}),this.log("Replaced blob in a ghost file: "+s.name+", "+s.id)),r[s.id]=s,n.push(s)}catch(u){u.isRestriction||i.push(u)}if(this.setState({files:r}),n.forEach((function(e){t.emit("file-added",e)})),this.emit("files-added",n),n.length>5?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)})),n.length>0&&this._startIfAutoProceed(),i.length>0){var a="Multiple errors occurred while adding files:\n";if(i.forEach((function(e){a+="\n * "+e.message})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:i.length}),details:a},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(i,a);var u=new Error(a);throw u.errors=i,u}},n.removeFiles=function(e,t){var r=this,n=this.getState(),i=n.files,o=n.currentUploads,s=pe({},i),a=pe({},o),u=Object.create(null);function l(e){return void 0===u[e]}e.forEach((function(e){i[e]&&(u[e]=i[e],delete s[e])})),Object.keys(a).forEach((function(e){var t=o[e].fileIDs.filter(l);0!==t.length?a[e]=pe({},o[e],{fileIDs:t}):delete a[e]}));var c={currentUploads:a,files:s};0===Object.keys(s).length&&(c.allowNewUpload=!0,c.error=null,c.recoveredState=null),this.setState(c),this._calculateTotalProgress();var p=Object.keys(u);p.forEach((function(e){r.emit("file-removed",u[e],t)})),p.length>5?this.log("Removed "+p.length+" files"):this.log("Removed files: "+p.join(", "))},n.removeFile=function(e,t){void 0===t&&(t=null),this.removeFiles([e],t)},n.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}},n.pauseAll=function(){var e=pe({},this.getState().files);Object.keys(e).filter((function(t){return!e[t].progress.uploadComplete&&e[t].progress.uploadStarted})).forEach((function(t){var r=pe({},e[t],{isPaused:!0});e[t]=r})),this.setState({files:e}),this.emit("pause-all")},n.resumeAll=function(){var e=pe({},this.getState().files);Object.keys(e).filter((function(t){return!e[t].progress.uploadComplete&&e[t].progress.uploadStarted})).forEach((function(t){var r=pe({},e[t],{isPaused:!1,error:null});e[t]=r})),this.setState({files:e}),this.emit("resume-all")},n.retryAll=function(){var e=pe({},this.getState().files),t=Object.keys(e).filter((function(t){return e[t].error}));if(t.forEach((function(t){var r=pe({},e[t],{isPaused:!1,error:null});e[t]=r})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});var r=this._createUpload(t,{forceAllowNewUpload:!0});return this._runUpload(r)},n.cancelAll=function(){this.emit("cancel-all");var e=this.getState().files,t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})},n.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)},n.reset=function(){this.cancelAll()},n.logout=function(){this.iteratePlugins((function(e){e.provider&&e.provider.logout&&e.provider.logout()}))},n._calculateProgress=function(e,t){if(this.getFile(e.id)){var r=isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:pe({},this.getFile(e.id).progress,{bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:r?Math.round(t.bytesUploaded/t.bytesTotal*100):0})}),this._calculateTotalProgress()}else this.log("Not setting progress for a file that has been removed: "+e.id)},n._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=e.filter((function(e){return null!=e.progress.bytesTotal})),r=e.filter((function(e){return null==e.progress.bytesTotal}));if(0!==t.length){var n=t.reduce((function(e,t){return e+t.progress.bytesTotal}),0),i=n/t.length;n+=i*r.length;var o=0;t.forEach((function(e){o+=e.progress.bytesUploaded})),r.forEach((function(e){o+=i*(e.progress.percentage||0)/100}));var s=0===n?0:Math.round(o/n*100);s>100&&(s=100),this.setState({totalProgress:s}),this.emit("progress",s)}else{var a=100*e.length,u=r.reduce((function(e,t){return e+t.progress.percentage}),0),l=Math.round(u/a*100);this.setState({totalProgress:l})}},n._addListeners=function(){var e=this;this.on("error",(function(t){var r="Unknown error";t.message&&(r=t.message),t.details&&(r+=" "+t.details),e.setState({error:r})})),this.on("upload-error",(function(t,r,n){var i="Unknown error";if(r.message&&(i=r.message),r.details&&(i+=" "+r.details),e.setFileState(t.id,{error:i,response:n}),e.setState({error:r.message}),"object"==typeof r&&r.message){var o=new Error(r.message);o.details=r.message,r.details&&(o.details+=" "+r.details),o.message=e.i18n("failedToUpload",{file:t.name}),e._showOrLogErrorAndThrow(o,{throwErr:!1})}else e._showOrLogErrorAndThrow(r,{throwErr:!1})})),this.on("upload",(function(){e.setState({error:null})})),this.on("upload-started",(function(t,r){e.getFile(t.id)?e.setFileState(t.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:t.size}}):e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("upload-progress",this._calculateProgress),this.on("upload-success",(function(t,r){if(e.getFile(t.id)){var n=e.getFile(t.id).progress;e.setFileState(t.id,{progress:pe({},n,{postprocess:e.postProcessors.length>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),e._calculateTotalProgress()}else e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("preprocess-progress",(function(t,r){e.getFile(t.id)?e.setFileState(t.id,{progress:pe({},e.getFile(t.id).progress,{preprocess:r})}):e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("preprocess-complete",(function(t){if(e.getFile(t.id)){var r=pe({},e.getState().files);r[t.id]=pe({},r[t.id],{progress:pe({},r[t.id].progress)}),delete r[t.id].progress.preprocess,e.setState({files:r})}else e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("postprocess-progress",(function(t,r){e.getFile(t.id)?e.setFileState(t.id,{progress:pe({},e.getState().files[t.id].progress,{postprocess:r})}):e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("postprocess-complete",(function(t){if(e.getFile(t.id)){var r=pe({},e.getState().files);r[t.id]=pe({},r[t.id],{progress:pe({},r[t.id].progress)}),delete r[t.id].progress.postprocess,e.setState({files:r})}else e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("restored",(function(){e._calculateTotalProgress()})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",(function(){return e.updateOnlineStatus()})),window.addEventListener("offline",(function(){return e.updateOnlineStatus()})),setTimeout((function(){return e.updateOnlineStatus()}),3e3))},n.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)},n.getID=function(){return this.opts.id},n.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},n.getPlugin=function(e){var t=null;return this.iteratePlugins((function(r){if(r.id===e)return t=r,!1})),t},n.iteratePlugins=function(e){var t=this;Object.keys(this.plugins).forEach((function(r){t.plugins[r].forEach(e)}))},n.removePlugin=function(e){var t;this.log("Removing plugin "+e.id),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();var r=this.plugins[e.type].slice(),n=ee(r,(function(t){return t.id===e.id}));-1!==n&&(r.splice(n,1),this.plugins[e.type]=r);var i={plugins:pe({},this.getState().plugins,(t={},t[e.id]=void 0,t))};this.setState(i)},n.close=function(){var e=this;this.log("Closing Uppy instance "+this.opts.id+": removing all files and uninstalling plugins"),this.reset(),this._storeUnsubscribe(),this.iteratePlugins((function(t){e.removePlugin(t)}))},n.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},n.hideInfo=function(){var e=pe({},this.getState().info,{isHidden:!0});this.setState({info:e}),this.emit("info-hidden")},n.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)}},n.run=function(){return this.log("Calling run() is no longer necessary.","warning"),this},n.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")))},n._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=B();return this.emit("upload",{id:u,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploads,currentUploads:pe({},a,(r={},r[u]={fileIDs:e,step:0,result:{}},r))}),u},n._getUpload=function(e){return this.getState().currentUploads[e]},n.addResultData=function(e,t){var r;if(this._getUpload(e)){var n=this.getState().currentUploads,i=pe({},n[e],{result:pe({},n[e].result,t)});this.setState({currentUploads:pe({},n,(r={},r[e]=i,r))})}else this.log("Not setting result for an upload that has been removed: "+e)},n._removeUpload=function(e){var t=pe({},this.getState().currentUploads);delete t[e],this.setState({currentUploads:t})},n._runUpload=function(e){var t=this,r=this.getState().currentUploads[e].step,n=[].concat(this.preProcessors,this.uploaders,this.postProcessors),i=Promise.resolve();return n.forEach((function(n,o){o<r||(i=i.then((function(){var r,i=t.getState().currentUploads,s=i[e];if(s){var a=pe({},s,{step:o});return t.setState({currentUploads:pe({},i,(r={},r[e]=a,r))}),n(a.fileIDs,e)}})).then((function(e){return null})))})),i.catch((function(r){t.emit("error",r,e),t._removeUpload(e)})),i.then((function(){var r=t.getState().currentUploads[e];if(r){r.fileIDs.forEach((function(e){var r=t.getFile(e);r&&r.progress.postprocess&&t.emit("postprocess-complete",r)}));var n=r.fileIDs.map((function(e){return t.getFile(e)})),i=n.filter((function(e){return!e.error})),o=n.filter((function(e){return e.error}));t.addResultData(e,{successful:i,failed:o,uploadID:e})}})).then((function(){var r=t.getState().currentUploads;if(r[e]){var n=r[e].result;return t.emit("complete",n),t._removeUpload(e),n}})).then((function(r){return null==r&&t.log("Not setting result for an upload that has been removed: "+e),r}))},n.upload=function(){var e=this;this.plugins.uploader||this.log("No uploader type plugins are used","warning");var t=this.getState().files,r=this.opts.onBeforeUpload(t);return!1===r?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&"object"==typeof r&&(t=r,this.setState({files:t})),Promise.resolve().then((function(){return e._checkMinNumberOfFiles(t)})).catch((function(t){e._showOrLogErrorAndThrow(t)})).then((function(){var r=e.getState().currentUploads,n=Object.keys(r).reduce((function(e,t){return e.concat(r[t].fileIDs)}),[]),i=[];Object.keys(t).forEach((function(t){var r=e.getFile(t);r.progress.uploadStarted||-1!==n.indexOf(t)||i.push(r.id)}));var o=e._createUpload(i);return e._runUpload(o)})).catch((function(t){e._showOrLogErrorAndThrow(t,{showInformer:!1})})))},t=e,(r=[{key:"state",get:function(){return this.getState()}}])&&he(t.prototype,r),e}();function Se(e){var t="function"==typeof Map?new Map:void 0;return(Se=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _e(e,arguments,ke(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Pe(n,e)})(e)}function _e(e,t,r){return(_e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Pe(i,r.prototype),i}).apply(null,arguments)}function Pe(e,t){return(Pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ke(e){return(ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}we.VERSION="1.19.1",(le=function(e){return new we(e)}).Uppy=we,le.Plugin=ce,le.debugLogger=ye;var Ce=function(e){var t,r;function n(){var t;return(t=e.call(this,"Authorization required")||this).name="AuthError",t.isAuthError=!0,t}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Pe(t,r),n}(Se(Error));function Oe(e){var t="function"==typeof Map?new Map:void 0;return(Oe=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Ee(e,arguments,Fe(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ae(n,e)})(e)}function Ee(e,t,r){return(Ee=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Ae(i,r.prototype),i}).apply(null,arguments)}function Ae(e,t){return(Ae=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fe(e){return(Fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Re,xe,Ue=function(e){var t,r;function n(t,r){var n;return void 0===r&&(r=null),(n=e.call(this,"This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.\n\nSource error: ["+t+"]")||this).isNetworkError=!0,n.request=r,n}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ae(t,r),n}(Oe(Error)),Te=function(){return fetch.apply(void 0,arguments).catch((function(e){throw"AbortError"===e.name?e:new Ue(e)}))};function De(){return(De=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 Be(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 Ie=(xe=Re=function(){function e(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}var t,r,n=e.prototype;return n.headers=function(){var e=this.opts.companionHeaders||this.opts.serverHeaders||{};return Promise.resolve(De({},this.defaultHeaders,e))},n._getPostResponseFunc=function(e){var t=this;return function(r){return e?r:t.onReceiveResponse(r)}},n.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:De({},r,(t={},t[n]=i.get("i-am"),t))}),e},n._getUrl=function(e){return/^(https?:|)\/\//.test(e)?e:this.hostname+"/"+e},n._json=function(e){if(401===e.status)throw new Ce;if(e.status<200||e.status>300){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()},n.preflight=function(e){var t=this;return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(this._getUrl(e),{method:"OPTIONS"}).then((function(e){return e.headers.has("access-control-allow-headers")&&(t.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map((function(e){return e.trim().toLowerCase()}))),t.preflightDone=!0,t.allowedHeaders.slice()})).catch((function(e){return t.uppy.log("[CompanionClient] unable to make preflight request "+e,"warning"),t.preflightDone=!0,t.allowedHeaders.slice()}))},n.preflightAndHeaders=function(e){var t=this;return Promise.all([this.preflight(e),this.headers()]).then((function(e){var r=e[0],n=e[1];return Object.keys(n).forEach((function(e){-1===r.indexOf(e.toLowerCase())&&(t.uppy.log("[CompanionClient] excluding unallowed header "+e),delete n[e])})),n}))},n.get=function(e,t){var r=this;return this.preflightAndHeaders(e).then((function(t){return Te(r._getUrl(e),{method:"get",headers:t,credentials:r.opts.companionCookiesRule||"same-origin"})})).then(this._getPostResponseFunc(t)).then((function(e){return r._json(e)})).catch((function(t){return t.isAuthError||(t.message="Could not get "+r._getUrl(e)+". "+t.message),Promise.reject(t)}))},n.post=function(e,t,r){var n=this;return this.preflightAndHeaders(e).then((function(r){return Te(n._getUrl(e),{method:"post",headers:r,credentials:n.opts.companionCookiesRule||"same-origin",body:JSON.stringify(t)})})).then(this._getPostResponseFunc(r)).then((function(e){return n._json(e)})).catch((function(t){return t.isAuthError||(t.message="Could not post "+n._getUrl(e)+". "+t.message),Promise.reject(t)}))},n.delete=function(e,t,r){var n=this;return this.preflightAndHeaders(e).then((function(r){return Te(n.hostname+"/"+e,{method:"delete",headers:r,credentials:n.opts.companionCookiesRule||"same-origin",body:t?JSON.stringify(t):null})})).then(this._getPostResponseFunc(r)).then((function(e){return n._json(e)})).catch((function(t){return t.isAuthError||(t.message="Could not delete "+n._getUrl(e)+". "+t.message),Promise.reject(t)}))},t=e,(r=[{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="+e.VERSION}}}])&&Be(t.prototype,r),e}(),Re.VERSION="1.10.1",xe),Ne=Object.prototype.hasOwnProperty,Me=function e(t,r){var n=[];for(var i in t)if(Ne.call(t,i)){var o,s=t[i],a=encodeURIComponent(i);o="object"==typeof s?e(s,r?r+"["+a+"]":a):(r?r+"["+a+"]":a)+"="+encodeURIComponent(s),n.push(o)}return n.join("&")},je=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},Le={},ze=Object.prototype.hasOwnProperty;function He(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function qe(e){try{return encodeURIComponent(e)}catch(t){return null}}Le.stringify=function(e,t){t=t||"";var r,n,i=[];for(n in"string"!=typeof t&&(t="?"),e)if(ze.call(e,n)){if((r=e[n])||null!=r&&!isNaN(r)||(r=""),n=qe(n),r=qe(r),null===n||null===r)continue;i.push(n+"="+r)}return i.length?t+i.join("&"):""},Le.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,n={};t=r.exec(e);){var i=He(t[1]),o=He(t[2]);null===i||null===o||i in n||(n[i]=o)}return n};var Ve={};(function(e){(function(){"use strict";var t=/^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/,r=/^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i,n=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 i(e){return(e||"").toString().replace(n,"")}var o=[["#","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]],s={hash:1,query:1};function a(r){var n,i=("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).location||{},o={},a=typeof(r=r||i);if("blob:"===r.protocol)o=new l(unescape(r.pathname),{});else if("string"===a)for(n in o=new l(r,{}),s)delete o[n];else if("object"===a){for(n in r)n in s||(o[n]=r[n]);void 0===o.slashes&&(o.slashes=t.test(r.href))}return o}function u(e){e=i(e);var t=r.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!(t[2]&&t[2].length>=2),rest:t[2]&&1===t[2].length?"/"+t[3]:t[3]}}function l(e,t,r){if(e=i(e),!(this instanceof l))return new l(e,t,r);var n,s,c,p,h,d,f=o.slice(),g=typeof t,m=this,v=0;for("object"!==g&&"string"!==g&&(r=t,t=null),r&&"function"!=typeof r&&(r=Le.parse),t=a(t),n=!(s=u(e||"")).protocol&&!s.slashes,m.slashes=s.slashes||n&&t.slashes,m.protocol=s.protocol||t.protocol||"",e=s.rest,s.slashes||(f[3]=[/(.*)/,"pathname"]);v<f.length;v++)"function"!=typeof(p=f[v])?(c=p[0],d=p[1],c!=c?m[d]=e:"string"==typeof c?~(h=e.indexOf(c))&&("number"==typeof p[2]?(m[d]=e.slice(0,h),e=e.slice(h+p[2])):(m[d]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(m[d]=h[1],e=e.slice(0,h.index)),m[d]=m[d]||n&&p[3]&&t[d]||"",p[4]&&(m[d]=m[d].toLowerCase())):e=p(e);r&&(m.query=r(m.query)),n&&t.slashes&&"/"!==m.pathname.charAt(0)&&(""!==m.pathname||""!==t.pathname)&&(m.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("/")}(m.pathname,t.pathname)),"/"!==m.pathname.charAt(0)&&m.hostname&&(m.pathname="/"+m.pathname),je(m.port,m.protocol)||(m.host=m.hostname,m.port=""),m.username=m.password="",m.auth&&(p=m.auth.split(":"),m.username=p[0]||"",m.password=p[1]||""),m.origin=m.protocol&&m.host&&"file:"!==m.protocol?m.protocol+"//"+m.host:"null",m.href=m.toString()}l.prototype={set:function(e,t,r){var n=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||Le.parse)(t)),n[e]=t;break;case"port":n[e]=t,je(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";n[e]=t.charAt(0)!==i?i+t:t}else n[e]=t;break;default:n[e]=t}for(var s=0;s<o.length;s++){var a=o[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.origin=n.protocol&&n.host&&"file:"!==n.protocol?n.protocol+"//"+n.host:"null",n.href=n.toString(),n},toString:function(e){e&&"function"==typeof e||(e=Le.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}},l.extractProtocol=u,l.location=a,l.trimLeft=i,l.qs=Le,Ve=l}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var We={};function Xe(){return(Xe=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 Ye(e,t){return(Ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}We.setItem=function(e,t){return new Promise((function(r){localStorage.setItem(e,t),r()}))},We.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},We.removeItem=function(e){return new Promise((function(t){localStorage.removeItem(e),t()}))};var Ge=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).provider=r.provider,n.id=n.provider,n.name=n.opts.name||n.id.split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" "),n.pluginId=n.opts.pluginId,n.tokenKey="companion-"+n.pluginId+"-auth-token",n.companionKeysParams=n.opts.companionKeysParams,n.preAuthToken=null,n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ye(t,r);var i=n.prototype;return i.headers=function(){var t=this;return Promise.all([e.prototype.headers.call(this),this.getAuthToken()]).then((function(e){var r=e[0],n=e[1],i={};return n&&(i["uppy-auth-token"]=n),t.companionKeysParams&&(i["uppy-credentials-params"]=btoa(JSON.stringify({params:t.companionKeysParams}))),Xe({},r,i)}))},i.onReceiveResponse=function(t){t=e.prototype.onReceiveResponse.call(this,t);var r=this.uppy.getPlugin(this.pluginId),n=r.getPluginState().authenticated?401!==t.status:t.status<400;return r.setPluginState({authenticated:n}),t},i.setAuthToken=function(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)},i.getAuthToken=function(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)},i.authUrl=function(e){void 0===e&&(e={}),this.preAuthToken&&(e.uppyPreAuthToken=this.preAuthToken);var t=Me(e);return t=t?"?"+t:t,this.hostname+"/"+this.id+"/connect"+t},i.fileUrl=function(e){return this.hostname+"/"+this.id+"/get/"+e},i.fetchPreAuthToken=function(){var e=this;return this.companionKeysParams?this.post(this.id+"/preauth/",{params:this.companionKeysParams}).then((function(t){e.preAuthToken=t.token})).catch((function(t){e.uppy.log("[CompanionClient] unable to fetch preAuthToken "+t,"warning")})):Promise.resolve()},i.list=function(e){return this.get(this.id+"/list/"+(e||""))},i.logout=function(){var e=this;return this.get(this.id+"/logout").then((function(t){return Promise.all([t,e.uppy.getPlugin(e.pluginId).storage.removeItem(e.tokenKey)])})).then((function(e){return e[0]}))},n.initPlugin=function(e,t,r){if(e.type="acquirer",e.files=[],r&&(e.opts=Xe({},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=new Ve(t.companionUrl).origin;e.storage=e.opts.storage||We},n}(Ie);function Ke(e,t){return(Ke=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $e={RequestClient:Ie,Provider:Ge,SearchProvider:function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).provider=r.provider,n.id=n.provider,n.name=n.opts.name||n.id.split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" "),n.pluginId=n.opts.pluginId,n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ke(t,r);var i=n.prototype;return i.fileUrl=function(e){return this.hostname+"/search/"+this.id+"/get/"+e},i.search=function(e,t){return t=t?"&"+t:"",this.get("search/"+this.id+"/list?q="+encodeURIComponent(e)+t)},n}(Ie),Socket:function(){function e(e){this.opts=e,this._queued=[],this.isOpen=!1,this.emitter=O(),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()}var t=e.prototype;return t.open=function(){var e=this;this.socket=new WebSocket(this.opts.target),this.socket.onopen=function(t){for(e.isOpen=!0;e._queued.length>0&&e.isOpen;){var r=e._queued[0];e.send(r.action,r.payload),e._queued=e._queued.slice(1)}},this.socket.onclose=function(t){e.isOpen=!1},this.socket.onmessage=this._handleMessage},t.close=function(){this.socket&&this.socket.close()},t.send=function(e,t){this.isOpen?this.socket.send(JSON.stringify({action:e,payload:t})):this._queued.push({action:e,payload:t})},t.on=function(e,t){this.emitter.on(e,t)},t.emit=function(e,t){this.emitter.emit(e,t)},t.once=function(e,t){this.emitter.once(e,t)},t._handleMessage=function(e){try{var t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(th){console.log(th)}},e}()};function Je(e,t){return(Je=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qe=oe.h,Ze=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Je(t,r),n.prototype.render=function(){var e=Qe("span",{className:"uppy-Provider-authTitleName"},this.props.pluginName,Qe("br",null));return Qe("div",{className:"uppy-Provider-auth"},Qe("div",{className:"uppy-Provider-authIcon"},this.props.pluginIcon()),Qe("div",{className:"uppy-Provider-authTitle"},this.props.i18nArray("authenticateWithTitle",{pluginName:e})),Qe("button",{type:"button",className:"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})))},n}(oe.Component),et=oe.h,tt=oe.h,rt=function(e){return tt("span",null,tt("button",{type:"button",className:"uppy-u-reset",onClick:e.getFolder},e.title),e.isLast?"":" / ")},nt=function(e){var t=[];return e.showBreadcrumbs&&t.push(function(e){return tt("div",{className:"uppy-Provider-breadcrumbs"},tt("div",{className:"uppy-Provider-breadcrumbsIcon"},e.breadcrumbsIcon),e.directories.map((function(t,r){return tt(rt,{key:t.id,getFolder:function(){return e.getFolder(t.id)},title:0===r?e.title:t.title,isLast:r+1===e.directories.length})})))}({getFolder:e.getFolder,directories:e.directories,breadcrumbsIcon:e.pluginIcon&&e.pluginIcon(),title:e.title})),t.push(function(e){return[et("span",{className:"uppy-ProviderBrowser-user",key:"username"},e.username),et("button",{type:"button",onClick:e.logout,className:"uppy-u-reset uppy-ProviderBrowser-userLogout",key:"logout"},e.i18n("logOut"))]}({logout:e.logout,username:e.username,i18n:e.i18n})),t},it={exports:{}};function ot(e,t){return(ot=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";var e={}.hasOwnProperty;function t(){for(var r=[],n=0;n<arguments.length;n++){var i=arguments[n];if(i){var o=typeof i;if("string"===o||"number"===o)r.push(i);else if(Array.isArray(i)&&i.length){var s=t.apply(null,i);s&&r.push(s)}else if("object"===o)for(var a in i)e.call(i,a)&&i[a]&&r.push(a)}}return r.join(" ")}it.exports?(t.default=t,it.exports=t):window.classNames=t}(),it=it.exports;var st=oe.h,at=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).preventEnterPress=r.preventEnterPress.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r)),r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,ot(t,r);var i=n.prototype;return i.preventEnterPress=function(e){13===e.keyCode&&(e.stopPropagation(),e.preventDefault())},i.render=function(){var e=this;return st("div",{className:"uppy-ProviderBrowser-search"},st("input",{className:"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(t){return e.props.filterQuery(t)},value:this.props.filterInput}),st("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchIcon",width:"12",height:"12",viewBox:"0 0 12 12"},st("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&&st("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchClose",type:"button","aria-label":this.props.i18n("resetFilter"),title:this.props.i18n("resetFilter"),onClick:this.props.filterQuery},st("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},st("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}(oe.Component);function ut(){return(ut=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 lt=function(e){return ut({},e,{type:e.mimeType,extension:e.name?K(e.name).extension:null})},ct=oe.h;function pt(){return ct("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},ct("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 ht(){return ct("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},ct("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 dt(){return ct("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},ct("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"}),ct("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 ft=function(e){if(null!==e.itemIconString)switch(e.itemIconString){case"file":return ct(pt,null);case"folder":return ct(ht,null);case"video":return ct(dt,null);default:return ct("img",{src:e.itemIconString})}},gt=oe.h,mt=function(e){return gt("li",{className:e.className,title:e.isDisabled?e.restrictionReason:null},gt("div",{"aria-hidden":!0,className:"uppy-ProviderBrowserItem-fakeCheckbox "+(e.isChecked?"uppy-ProviderBrowserItem-fakeCheckbox--is-checked":"")}),gt("button",{type:"button",className:"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,disabled:e.isDisabled,"data-uppy-super-focusable":!0},e.itemIconEl,e.showTitles&&e.title))},vt=oe.h,yt=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})},bt=function(e){return vt("li",{className:e.className,title:e.isDisabled?e.restrictionReason:null},e.isCheckboxDisabled?null:vt("button",{type:"button",className:"uppy-u-reset uppy-ProviderBrowserItem-fakeCheckbox "+(e.isChecked?"uppy-ProviderBrowserItem-fakeCheckbox--is-checked":""),onClick:e.toggleCheckbox,id:e.id,role:"option","aria-label":yt(e),"aria-selected":e.isChecked,"aria-disabled":e.isDisabled,disabled:e.isDisabled,"data-uppy-super-focusable":!0}),"file"===e.type?vt("label",{htmlFor:e.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},vt("div",{className:"uppy-ProviderBrowserItem-iconWrap"},e.itemIconEl),e.showTitles&&e.title):vt("button",{type:"button",className:"uppy-u-reset uppy-ProviderBrowserItem-inner",onClick:e.handleFolderClick,"aria-label":e.i18n("openFolderNamed",{name:e.title})},vt("div",{className:"uppy-ProviderBrowserItem-iconWrap"},e.itemIconEl),e.showTitles&&vt("span",null,e.title)))};function wt(){return(wt=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 St=oe.h,_t=function(e){var t=e.getItemIcon(),r=it("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--selected":e.isChecked},{"uppy-ProviderBrowserItem--disabled":e.isDisabled},{"uppy-ProviderBrowserItem--noPreview":"video"===t}),n=St(ft,{itemIconString:t});switch(e.viewType){case"grid":return St(mt,wt({},e,{className:r,itemIconEl:n}));case"list":return St(bt,wt({},e,{className:r,itemIconEl:n}));default:throw new Error("There is no such type "+e.viewType)}};function Pt(){return(Pt=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 kt=oe.h,Ct=function(e,t){return{id:e.id,title:e.name,getItemIcon:function(){return e.icon},isChecked:t.isChecked(e),toggleCheckbox:function(r){return t.toggleCheckbox(r,e)},columns:t.columns,showTitles:t.showTitles,viewType:t.viewType,i18n:t.i18n}},Ot=function(e){var t=e.folders,r=e.files,n=e.handleScroll,i=e.isChecked;return t.length||r.length?kt("div",{className:"uppy-ProviderBrowser-body"},kt("ul",{className:"uppy-ProviderBrowser-list",onScroll:n,role:"listbox",tabIndex:"-1"},t.map((function(t){return _t(Pt({},Ct(t,e),{type:"folder",isDisabled:!!i(t)&&i(t).loading,isCheckboxDisabled:"shared-with-me"===t.id,handleFolderClick:function(){return e.handleFolderClick(t)}}))})),r.map((function(t){var r=e.validateRestrictions(lt(t),[].concat(e.uppyFiles,e.currentSelection)),n=Ct(t,e),i=r.reason;return _t(Pt({},n,{type:"file",isDisabled:!r.result&&!n.isChecked,restrictionReason:i}))})))):kt("div",{className:"uppy-Provider-empty"},e.i18n("noFilesFound"))},Et=oe.h,At=function(e){return Et("div",{className:"uppy-ProviderBrowser-footer"},Et("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",onClick:e.done},e.i18n("selectX",{smart_count:e.selected})),Et("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e.cancel},e.i18n("cancel")))};function Ft(){return(Ft=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 Rt=oe.h,xt=function(e){var t=e.currentSelection,r=e.folders,n=e.files,i=e.uppyFiles,o=e.filterItems,s=r,a=n;""!==e.filterInput&&(s=o(r),a=o(n));var u=t.length;return Rt("div",{className:it("uppy-ProviderBrowser","uppy-ProviderBrowser-viewType--"+e.viewType)},Rt("div",{className:"uppy-ProviderBrowser-header"},Rt("div",{className:it("uppy-ProviderBrowser-headerBar",!e.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},e.headerComponent)),e.showFilter&&Rt(at,e),Rt(Ot,{columns:[{name:"Name",key:"title"}],folders:s,files:a,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,validateRestrictions:e.validateRestrictions,uppyFiles:i,currentSelection:t}),u>0&&Rt(At,Ft({selected:u},e)))},Ut=oe.h,Tt=function(e){return Ut("div",{className:"uppy-Provider-loading"},Ut("span",null,e.i18n("loading")))},Dt=function(e){if(!e)return!1;var t=e.split("/")[1];return!!/^(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(t)},Bt=function(){function e(e){this.plugin=e,this.filterItems=this.filterItems.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.isChecked=this.isChecked.bind(this),this.loaderWrapper=this.loaderWrapper.bind(this)}var t=e.prototype;return t.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},t.toggleCheckbox=function(e,t){var r=this;e.stopPropagation(),e.preventDefault(),e.currentTarget.focus();var n=this.plugin.getPluginState(),i=n.folders,o=n.files,s=this.filterItems(i.concat(o));if(this.lastCheckbox&&e.shiftKey){var a,u=s.indexOf(this.lastCheckbox),l=s.indexOf(t);return a=(a=u<l?s.slice(u,l+1):s.slice(l,u+1)).reduce((function(e,t){var n=r.plugin.uppy,i=n.validateRestrictions(lt(t),[].concat(n.getFiles(),e));return i.result?[].concat(e,[t]):(n.info({message:i.reason},"error",n.opts.infoTimeout),e)})),void this.plugin.setPluginState({currentSelection:a})}this.lastCheckbox=t;var c=this.plugin.getPluginState().currentSelection;this.isChecked(t)?this.plugin.setPluginState({currentSelection:c.filter((function(e){return e.id!==t.id}))}):this.plugin.setPluginState({currentSelection:c.concat([t])})},t.isChecked=function(e){return this.plugin.getPluginState().currentSelection.some((function(t){return t.id===e.id}))},t.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})},e}();function It(e,t){return(It=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Nt,Mt,jt=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,It(t,r);var i=n.prototype;return i.componentWillUnmount=function(){this.props.onUnmount()},i.render=function(){return this.props.children[0]},n}(oe.Component);function Lt(){return(Lt=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 zt,Ht,qt=oe.h,Vt=(Mt=Nt=function(){function e(e,t){this.plugin=e,this.provider=t.provider,this._sharedHandler=new Bt(e),this.opts=Lt({},{viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0},t),this.addFile=this.addFile.bind(this),this.filterQuery=this.filterQuery.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.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:[],filterInput:"",isSearchVisible:!1})}var t=e.prototype;return t.tearDown=function(){},t._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})},t.preFirstRender=function(){this.plugin.setPluginState({didFirstRender:!0}),this.plugin.onFirstRender()},t.getFolder=function(e,t){var r=this;return this._sharedHandler.loaderWrapper(this.provider.list(e),(function(n){var i,o=r.plugin.getPluginState(),s=ee(o.directories,(function(t){return e===t.id}));i=-1!==s?o.directories.slice(0,s+1):o.directories.concat([{id:e,title:t}]),r.username=n.username||r.username,r._updateFilesAndFolders(n,[],[]),r.plugin.setPluginState({directories:i})}),this.handleError)},t.getNextFolder=function(e){this.getFolder(e.requestPath,e.name),this.lastCheckbox=void 0},t.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=J(t);r&&Dt(r)&&(t.preview=e.thumbnail),this.plugin.uppy.log("Adding remote file");try{return this.plugin.uppy.addFile(t),!0}catch(th){return th.isRestriction||this.plugin.uppy.log(th),!1}},t.logout=function(){var e=this;this.provider.logout().then((function(t){if(t.ok){if(!t.revoked){var r=e.plugin.uppy.i18n("companionUnauthorizeHint",{provider:e.plugin.title,url:t.manual_revoke_url});e.plugin.uppy.info(r,"info",7e3)}e.plugin.setPluginState({authenticated:!1,files:[],folders:[],directories:[]})}})).catch(this.handleError)},t.filterQuery=function(e){var t=this.plugin.getPluginState();this.plugin.setPluginState(Lt({},t,{filterInput:e?e.target.value:""}))},t.sortByTitle=function(){var e=Lt({},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(Lt({},e,{files:i,folders:o,sorting:"titleDescending"===n?"titleAscending":"titleDescending"}))},t.sortByDate=function(){var e=Lt({},this.plugin.getPluginState()),t=e.files,r=e.folders,n=e.sorting,i=t.sort((function(e,t){var r=new Date(e.modifiedDate),i=new Date(t.modifiedDate);return"dateDescending"===n?r>i?-1:r<i?1:0:r>i?1:r<i?-1:0})),o=r.sort((function(e,t){var r=new Date(e.modifiedDate),i=new Date(t.modifiedDate);return"dateDescending"===n?r>i?-1:r<i?1:0:r>i?1:r<i?-1:0}));this.plugin.setPluginState(Lt({},e,{files:i,folders:o,sorting:"dateDescending"===n?"dateAscending":"dateDescending"}))},t.sortBySize=function(){var e=Lt({},this.plugin.getPluginState()),t=e.files,r=e.sorting;if(t.length&&this.plugin.getItemData(t[0]).size){var n=t.sort((function(e,t){var n=e.size,i=t.size;return"sizeDescending"===r?n>i?-1:n<i?1:0:n>i?1:n<i?-1:0}));this.plugin.setPluginState(Lt({},e,{files:n,sorting:"sizeDescending"===r?"sizeAscending":"sizeDescending"}))}},t.addFolder=function(e){var t=this,r=this.providerFileToId(e),n=Lt({},this.plugin.getPluginState().selectedFolders);if(!(r in n)||!n[r].loading)return n[r]={loading:!0,files:[]},this.plugin.setPluginState({selectedFolders:Lt({},n)}),this.listAllFiles(e.requestPath).then((function(i){var o=0;i.forEach((function(e){t.addFile(e)&&o++}));var s,a=i.map(t.providerFileToId);n[r]={loading:!1,files:a},t.plugin.setPluginState({selectedFolders:n}),s=i.length?t.plugin.uppy.i18n("folderAdded",{smart_count:o,folder:e.name}):t.plugin.uppy.i18n("emptyFolderAdded"),t.plugin.uppy.info(s)})).catch((function(e){var n=Lt({},t.plugin.getPluginState().selectedFolders);delete n[r],t.plugin.setPluginState({selectedFolders:n}),t.handleError(e)}))},t.providerFileToId=function(e){return Z({data:e,name:e.name||e.id,type:e.mimeType})},t.handleAuth=function(){var t=this,r=btoa(JSON.stringify({origin:"origin"in location?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")})),n="@uppy/provider-views="+e.VERSION,i=this.provider.authUrl({state:r,uppyVersions:n}),o=window.open(i,"_blank");window.addEventListener("message",(function e(r){if(t._isOriginAllowed(r.origin,t.plugin.opts.companionAllowedHosts)&&r.source===o){var n="string"==typeof r.data?JSON.parse(r.data):r.data;n.token?(o.close(),window.removeEventListener("message",e),t.provider.setAuthToken(n.token),t.preFirstRender()):t.plugin.uppy.log("did not receive token from auth window")}else t.plugin.uppy.log("rejecting event from "+r.origin+" vs allowed pattern "+t.plugin.opts.companionAllowedHosts)}))},t._isOriginAllowed=function(e,t){var r=function(e){return"string"==typeof e?new RegExp("^"+e+"$"):e instanceof RegExp?e:void 0};return(Array.isArray(t)?t.map(r):[r(t)]).filter((function(e){return null!=e})).some((function(t){return t.test(e)||t.test(e+"/")}))},t.handleError=function(e){var t=this.plugin.uppy;if(t.log(e.toString()),!e.isAuthError){var r=t.i18n("companionError");t.info({message:r,details:e.toString()},"error",5e3)}},t.handleScroll=function(e){var t=this,r=e.target.scrollHeight-(e.target.scrollTop+e.target.offsetHeight),n=this.nextPagePath||null;r<50&&n&&!this._isHandlingScroll&&(this.provider.list(n).then((function(e){var r=t.plugin.getPluginState(),n=r.files,i=r.folders;t._updateFilesAndFolders(e,n,i)})).catch(this.handleError).then((function(){t._isHandlingScroll=!1})),this._isHandlingScroll=!0)},t.listAllFiles=function(e,t){var r=this;return void 0===t&&(t=null),t=t||[],new Promise((function(n,i){r.provider.list(e).then((function(e){e.items.forEach((function(e){e.isFolder?r.addFolder(e):t.push(e)}));var o=e.nextPagePath||null;return o?r.listAllFiles(o,t).then((function(e){return n(e)})).catch((function(e){return i(e)})):n(t)})).catch((function(e){return i(e)}))}))},t.donePicking=function(){var e=this,t=this.plugin.getPluginState().currentSelection.map((function(t){return t.isFolder?e.addFolder(t):e.addFile(t)}));this._sharedHandler.loaderWrapper(Promise.all(t),(function(){e.clearSelection()}),(function(){}))},t.cancelPicking=function(){this.clearSelection();var e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()},t.clearSelection=function(){this.plugin.setPluginState({currentSelection:[]})},t.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 qt(jt,{onUnmount:this.clearSelection},qt(Tt,{i18n:this.plugin.uppy.i18n}));if(!n)return qt(jt,{onUnmount:this.clearSelection},qt(Ze,{pluginName:this.plugin.title,pluginIcon:this.plugin.icon,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,i18nArray:this.plugin.uppy.i18nArray}));var i=Lt({},this.opts,t),o={showBreadcrumbs:i.showBreadcrumbs,getFolder:this.getFolder,directories:this.plugin.getPluginState().directories,pluginIcon:this.plugin.icon,title:this.plugin.title,logout:this.logout,username:this.username,i18n:this.plugin.uppy.i18n},s=Lt({},this.plugin.getPluginState(),{username:this.username,getNextFolder:this.getNextFolder,getFolder:this.getFolder,filterItems:this._sharedHandler.filterItems,filterQuery:this.filterQuery,sortByTitle:this.sortByTitle,sortByDate:this.sortByDate,logout:this.logout,isChecked:this._sharedHandler.isChecked,toggleCheckbox:this._sharedHandler.toggleCheckbox,handleScroll:this.handleScroll,listAllFiles:this.listAllFiles,done:this.donePicking,cancel:this.cancelPicking,headerComponent:nt(o),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,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:this.plugin.uppy.validateRestrictions});return qt(jt,{onUnmount:this.clearSelection},qt(xt,s))},e}(),Nt.VERSION="1.12.2",Mt),Wt=oe.h,Xt=function(e){var t,r=function(){t.value&&e.search(t.value)};return Wt("div",{className:"uppy-SearchProvider"},Wt("input",{className:"uppy-u-reset uppy-c-textInput uppy-SearchProvider-input",type:"text","aria-label":e.i18n("enterTextToSearch"),placeholder:e.i18n("enterTextToSearch"),onKeyUp:function(e){13===e.keyCode&&r()},ref:function(e){t=e},"data-uppy-super-focusable":!0}),Wt("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-SearchProvider-searchButton",type:"button",onClick:r},e.i18n("searchImages")))},Yt=oe.h;function Gt(){return(Gt=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 Kt,$t=oe.h,Jt={ProviderViews:Vt,SearchProviderViews:(Ht=zt=function(){function e(e,t){this.plugin=e,this.provider=t.provider,this._sharedHandler=new Bt(e),this.opts=Gt({},{viewType:"grid",showTitles:!1,showFilter:!1,showBreadcrumbs:!1},t),this.search=this.search.bind(this),this.triggerSearchInput=this.triggerSearchInput.bind(this),this.addFile=this.addFile.bind(this),this.preFirstRender=this.preFirstRender.bind(this),this.handleError=this.handleError.bind(this),this.handleScroll=this.handleScroll.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({isInputMode:!0,files:[],folders:[],directories:[],filterInput:"",isSearchVisible:!1})}var t=e.prototype;return t.tearDown=function(){},t._updateFilesAndInputMode=function(e,t){this.nextPageQuery=e.nextPageQuery,this._searchTerm=e.searchedFor,e.items.forEach((function(e){t.push(e)})),this.plugin.setPluginState({isInputMode:!1,files:t})},t.preFirstRender=function(){this.plugin.setPluginState({didFirstRender:!0}),this.plugin.onFirstRender()},t.search=function(e){var t=this;if(!e||e!==this._searchTerm)return this._sharedHandler.loaderWrapper(this.provider.search(e),(function(e){t._updateFilesAndInputMode(e,[])}),this.handleError);this.plugin.setPluginState({isInputMode:!1})},t.triggerSearchInput=function(){this.plugin.setPluginState({isInputMode:!0})},t.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:Gt({},this.provider.opts,{provider:null})}},r=J(t);r&&Dt(r)&&(t.preview=e.thumbnail),this.plugin.uppy.log("Adding remote file");try{this.plugin.uppy.addFile(t)}catch(th){th.isRestriction||this.plugin.uppy.log(th)}},t.providerFileToId=function(e){return Z({data:e,name:e.name||e.id,type:e.mimeType})},t.handleError=function(e){var t=this.plugin.uppy;t.log(e.toString());var r=t.i18n("companionError");t.info({message:r,details:e.toString()},"error",5e3)},t.handleScroll=function(e){var t=this,r=e.target.scrollHeight-(e.target.scrollTop+e.target.offsetHeight),n=this.nextPageQuery||null;r<50&&n&&!this._isHandlingScroll&&(this.provider.search(this._searchTerm,n).then((function(e){var r=t.plugin.getPluginState().files;t._updateFilesAndInputMode(e,r)})).catch(this.handleError).then((function(){t._isHandlingScroll=!1})),this._isHandlingScroll=!0)},t.donePicking=function(){var e=this,t=this.plugin.getPluginState().currentSelection.map((function(t){return e.addFile(t)}));this._sharedHandler.loaderWrapper(Promise.all(t),(function(){e.clearSelection()}),(function(){}))},t.cancelPicking=function(){this.clearSelection();var e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()},t.clearSelection=function(){this.plugin.setPluginState({currentSelection:[]})},t.render=function(e,t){void 0===t&&(t={});var r=this.plugin.getPluginState(),n=r.didFirstRender,i=r.isInputMode;if(n||this.preFirstRender(),this.plugin.getPluginState().loading)return $t(jt,{onUnmount:this.clearSelection},$t(Tt,{i18n:this.plugin.uppy.i18n}));if(i)return $t(jt,{onUnmount:this.clearSelection},$t(Xt,{search:this.search,i18n:this.plugin.uppy.i18n}));var o,s=Gt({},this.opts,t),a=Gt({},this.plugin.getPluginState(),{isChecked:this._sharedHandler.isChecked,toggleCheckbox:this._sharedHandler.toggleCheckbox,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,headerComponent:(o={triggerSearchInput:this.triggerSearchInput,i18n:this.plugin.uppy.i18n},Yt("button",{type:"button",onClick:o.triggerSearchInput,className:"uppy-u-reset uppy-ProviderBrowser-userLogout"},o.i18n("backToSearch"))),title:this.plugin.title,viewType:s.viewType,showTitles:s.showTitles,showFilter:s.showFilter,showBreadcrumbs:s.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:this.plugin.uppy.i18n,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:this.plugin.uppy.validateRestrictions});return $t(jt,{onUnmount:this.clearSelection},$t(xt,a))},e}(),zt.VERSION="1.12.2",Ht)};function Qt(){return(Qt=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 Zt=function(){function e(e){var t;this._store=e.store,this._id=e.id||B(),this._selector=e.selector||(t=this._id,function(e){return e.uppy[t]}),this.setState({})}var t=e.prototype;return t.setState=function(e){this._store.dispatch({type:"uppy/STATE_UPDATE",id:this._id,payload:e})},t.getState=function(){return this._selector(this._store.getState())},t.subscribe=function(e){var t=this,r=this.getState();return this._store.subscribe((function(){var n=t.getState();if(r!==n){var i=function(e,t){var r=Object.keys(t),n={};return r.forEach((function(r){e[r]!==t[r]&&(n[r]=t[r])})),n}(r,n);e(r,n,i),r=n}}))},e}();Zt.VERSION="1.2.7",(Kt=function(e){return new Zt(e)}).STATE_UPDATE="uppy/STATE_UPDATE",Kt.reducer=function(e,t){if(void 0===e&&(e={}),"uppy/STATE_UPDATE"===t.type){var r,n=Qt({},e[t.id],t.payload);return Qt({},e,((r={})[t.id]=n,r))}return e},Kt.middleware=function(){return function(){return function(e){return function(t){e(t)}}}};var er=oe.h,tr=function(e){var t={color:"#838999",icon:er("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},er("g",{fill:"#A7AFB7",fillRule:"nonzero"},er("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"}),er("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:er("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},er("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",fillRule:"nonzero"}))}:"image"===r?{color:"#686de0",icon:er("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},er("g",{fill:"#686DE0",fillRule:"evenodd"},er("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",fillRule:"nonzero"}),er("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",fillRule:"nonzero"}),er("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}:"audio"===r?{color:"#068dbb",icon:er("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},er("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",fillRule:"nonzero"}))}:"video"===r?{color:"#19af67",icon:er("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},er("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",fillRule:"nonzero"}))}:"application"===r&&"pdf"===n?{color:"#e25149",icon:er("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},er("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",fillRule:"nonzero"}))}:"application"===r&&-1!==["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(n)?{color:"#00C469",icon:er("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},er("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",fillRule:"nonzero"}))}:t},rr=oe.h,nr=function(e){var t=e.file;if(t.preview)return rr("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});var r=tr(t.type),n=r.color,i=r.icon;return rr("div",{className:"uppy-Dashboard-Item-previewIconWrap"},rr("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:n}},i),rr("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},rr("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))},ir=oe.h,or=function(e){return ir("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:tr(e.file.type).color}},e.showLinkToFileUploadResult&&e.file.uploadURL&&ir("a",{className:"uppy-Dashboard-Item-previewLink",href:e.file.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.file.meta.name}),ir(nr,{file:e.file}))},sr=oe.h;function ar(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 ur(e){return sr("div",{className:"uppy-Dashboard-Item-progress"},sr("button",{className:"uppy-u-reset uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":ar(e),title:ar(e),onClick:function(){return function(e){e.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))}(e)}},e.children))}function lr(e){var t=e.children;return sr("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function cr(e){var t=e.progress,r=2*Math.PI*15;return sr("g",null,sr("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),sr("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":r,"stroke-dashoffset":r-r/100*t}))}var pr=function(e){return e.file.progress.uploadStarted?e.isUploaded?sr("div",{className:"uppy-Dashboard-Item-progress"},sr("div",{className:"uppy-Dashboard-Item-progressIndicator"},sr(lr,null,sr("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),sr("polygon",{className:"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.recoveredState?void 0:e.error&&!e.hideRetryButton?sr(ur,e,sr("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},sr("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),sr("path",{d:"M7.9 3H10v2H7.9z"}),sr("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),sr("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):e.resumableUploads&&!e.hidePauseResumeButton?sr(ur,e,sr(lr,null,sr(cr,{progress:e.file.progress.percentage}),e.file.isPaused?sr("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):sr("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},sr("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),sr("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?sr("div",{className:"uppy-Dashboard-Item-progress"},sr("div",{className:"uppy-Dashboard-Item-progressIndicator"},sr(lr,null,sr(cr,{progress:e.file.progress.percentage})))):sr(ur,e,sr(lr,null,sr(cr,{progress:e.file.progress.percentage}),sr("polygon",{className:"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},hr=oe.h,dr=function(e){var t=e.file,r=e.onClick;return t.error?hr("span",{className:"uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",role:"tooltip",onClick:r},"?"):null},fr=function(e){return hr("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.file.source},function(e){var t;return t=e.containerWidth<=352?35:e.containerWidth<=576?60:30,hr("div",{className:"uppy-Dashboard-Item-name",title:e.file.meta.name},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)}(e.file.meta.name,t))}(e),hr("div",{className:"uppy-Dashboard-Item-status"},function(e){return e.file.size&&hr("div",{className:"uppy-Dashboard-Item-statusSize"},q(e.file.size))}(e),function(e){return e.file.isGhost&&hr("span",null," \u2022 ",hr("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:e.toggleAddFilesPanel},e.i18n("reSelect")))}(e),hr(dr,{file:e.file,onClick:function(){alert(e.file.error)}})))},gr=oe.h;function mr(e){var t=e.file,r=e.uploadInProgressOrComplete,n=e.metaFields,i=e.canEditFile,o=e.i18n,s=e.onClick;return!r&&n&&n.length>0||!r&&i(t)?gr("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFile")+" "+t.meta.name,title:o("editFile"),onClick:function(){return s()}},gr("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},gr("g",{fillRule:"evenodd"},gr("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",fillRule:"nonzero"}),gr("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),gr("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function vr(e){var t=e.i18n,r=e.onClick;return gr("button",{className:"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()}},gr("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},gr("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"}),gr("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 yr=function(e,t){var r,n;(r=t.file.uploadURL,n=t.i18n("copyLinkToClipboardFallback"),n=n||"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=r,document.body.appendChild(t),t.select();var i=function(){document.body.removeChild(t),window.prompt(n,r),e()};try{return document.execCommand("copy")?(document.body.removeChild(t),e()):i()}catch(th){return document.body.removeChild(t),i()}}))).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 br(e){return gr("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":e.i18n("copyLink"),title:e.i18n("copyLink"),onClick:function(t){return yr(t,e)}},gr("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},gr("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 wr=function(e){var t=e.file,r=e.uploadInProgressOrComplete,n=e.canEditFile,i=e.metaFields,o=e.showLinkToFileUploadResult,s=e.showRemoveButton,a=e.i18n,u=e.removeFile,l=e.toggleFileCard,c=e.openFileEditor,p=e.log,h=e.info;return gr("div",{className:"uppy-Dashboard-Item-actionWrapper"},gr(mr,{i18n:a,file:t,uploadInProgressOrComplete:r,canEditFile:n,metaFields:i,onClick:function(){i&&i.length>0?l(!0,t.id):c(t)}}),o&&t.uploadURL?gr(br,{file:t,i18n:a,info:h,log:p}):null,s?gr(vr,{i18n:a,info:e.info,log:e.log,onClick:function(){return u(t.id,"removed-by-user")}}):null)};function Sr(e,t){return(Sr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var _r=oe.h,Pr=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,Sr(t,r);var i=n.prototype;return i.shouldComponentUpdate=function(e){return!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}(this.props,e)},i.componentDidMount=function(){var e=this.props.file;e.preview||this.props.handleRequestThumbnail(e)},i.componentDidUpdate=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=e.isGhost,a=(this.props.individualCancellation||!i)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(a=!0);var u=it({"uppy-Dashboard-Item":!0,"is-inprogress":i&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return _r("div",{className:u,id:"uppy_"+e.id,role:this.props.role},_r("div",{className:"uppy-Dashboard-Item-preview"},_r(or,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult}),_r(pr,{file:e,error:o,isUploaded:r,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,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})),_r("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},_r(fr,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel}),_r(wr,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:a,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:n,removeFile:this.props.removeFile,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,i18n:this.props.i18n,log:this.props.log,info:this.props.info})))},n}(oe.Component);function kr(){return(kr=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 Cr(e,t){return(Cr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Or=oe.h,Er=oe.Component,Ar={position:"relative",width:"100%",minHeight:"100%"},Fr={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Rr=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).handleResize=function(){r.resize()},r.handleScroll=function(){r.setState({offset:r.base.scrollTop}),r.props.sync&&r.forceUpdate()},r.focusElement=null,r.state={offset:0,height:0},r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Cr(t,r);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{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(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 h=c+p+4,d=t.slice(c,h),f=kr({},Ar,{height:t.length*r}),g=kr({},Fr,{top:c*r});return Or("div",kr({onScroll:this.handleScroll},s),Or("div",{role:"presentation",style:f},Or("div",{role:"presentation",style:g},d.map(n))))},n}(Er);function xr(){return(xr=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 Ur=oe.h,Tr=function(e){var t=0===e.totalFileCount,r=it("uppy-Dashboard-files",{"uppy-Dashboard-files--noFiles":t}),n=1===e.itemsPerRow?71:200,i={id:e.id,error:e.error,i18n:e.i18n,log:e.log,info:e.info,acquirers:e.acquirers,resumableUploads:e.resumableUploads,individualCancellation:e.individualCancellation,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,isWide:e.isWide,metaFields:e.metaFields,recoveredState:e.recoveredState,retryUpload:e.retryUpload,pauseUpload:e.pauseUpload,cancelUpload:e.cancelUpload,toggleFileCard:e.toggleFileCard,removeFile:e.removeFile,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail},o=Object.keys(e.files);e.recoveredState&&o.sort((function(t,r){return e.files[r].isGhost-e.files[t].isGhost}));var s,a,u,l,c=(s=o,a=e.itemsPerRow,u=[],l=[],s.forEach((function(e,t){l.length<a?l.push(e):(u.push(l),l=[e])})),l.length&&u.push(l),u);return Ur(Rr,{class:r,role:"list",data:c,renderRow:function(t){return Ur("div",{role:"presentation",key:t[0]},t.map((function(t){return Ur(Pr,xr({key:t},i,{role:"listitem",openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,file:e.files[t]}))})))},rowHeight:n})};function Dr(e,t){return(Dr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Br=oe.h,Ir=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).triggerFileInputClick=function(){t.fileInput.click()},t.triggerFolderInputClick=function(){t.folderInput.click()},t.onFileInputChange=function(e){t.props.handleInputChange(e),e.target.value=null},t.renderHiddenInput=function(e,r){return Br("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==t.props.maxNumberOfFiles,onChange:t.onFileInputChange,accept:t.props.allowedFileTypes,ref:r})},t.renderMyDeviceAcquirer=function(){return Br("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},Br("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:t.triggerFileInputClick},Br("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Br("g",{fill:"none",fillRule:"evenodd"},Br("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16",fill:"#2275D7"}),Br("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"}))),Br("div",{className:"uppy-DashboardTab-name"},t.props.i18n("myDevice"))))},t.renderBrowseButton=function(e,r){var n=t.props.acquirers.length;return Br("button",{type:"button",className:"uppy-u-reset uppy-Dashboard-browse",onClick:r,"data-uppy-super-focusable":0===n},e)},t.renderDropPasteBrowseTagline=function(){var e=t.props.acquirers.length,r=t.props.fileManagerSelectionType,n=r.charAt(0).toUpperCase()+r.slice(1),i="browse",o="browse",s="browse";if("files"===r)try{i=t.props.i18n("browse"),o=t.props.i18n("browse"),s=t.props.i18n("browse")}catch(p){}try{o=t.props.i18n("browseFiles"),s=t.props.i18n("browseFolders")}catch(h){}var a,u=t.renderBrowseButton(i,t.triggerFileInputClick),l=t.renderBrowseButton(o,t.triggerFileInputClick),c=t.renderBrowseButton(s,t.triggerFolderInputClick);if(a=e>0?t.props.i18nArray("dropPasteImport"+n,{browseFiles:l,browseFolders:c,browse:u}):t.props.i18nArray("dropPaste"+n,{browseFiles:l,browseFolders:c,browse:u}),"files"===r)try{a=e>0?t.props.i18nArray("dropPasteImport",{browse:u}):t.props.i18nArray("dropPaste",{browse:u})}catch(d){}return t.props.disableLocalFiles&&(a=t.props.i18n("importFiles")),Br("div",{className:"uppy-Dashboard-AddFiles-title"},a)},t.renderAcquirer=function(e){return Br("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},Br("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"aria-controls":"uppy-DashboardContent-panel--"+e.id,"aria-selected":t.props.activePickerPanel.id===e.id,"data-uppy-super-focusable":!0,onClick:function(){return t.props.showPanel(e.id)}},e.icon(),Br("div",{className:"uppy-DashboardTab-name"},e.name)))},t.renderAcquirers=function(e,r){var n=[].concat(e),i=n.splice(e.length-2,e.length);return Br("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},!r&&t.renderMyDeviceAcquirer(),n.map((function(e){return t.renderAcquirer(e)})),Br("span",{role:"presentation",style:"white-space: nowrap;"},i.map((function(e){return t.renderAcquirer(e)}))))},t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Dr(t,r);var i=n.prototype;return i.renderPoweredByUppy=function(){var e=Br("span",null,Br("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},Br("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),Br("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),t=this.props.i18nArray("poweredBy2",{backwardsCompat:this.props.i18n("poweredBy"),uppy:e});return Br("a",{tabIndex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},t)},i.render=function(){var e=this;return Br("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,(function(t){e.fileInput=t})),this.renderHiddenInput(!0,(function(t){e.folderInput=t})),this.renderDropPasteBrowseTagline(),this.props.acquirers.length>0&&this.renderAcquirers(this.props.acquirers,this.props.disableLocalFiles),Br("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&Br("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))},n}(oe.Component),Nr=oe.h,Mr=function(e){return Nr("div",{className:it("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":e.showAddFilesPanel},Nr("div",{className:"uppy-DashboardContent-bar"},Nr("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),Nr("button",{className:"uppy-DashboardContent-back",type:"button",onClick:function(t){return e.toggleAddFilesPanel(!1)}},e.i18n("back"))),Nr(Ir,e))},jr=function(e){var t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()},Lr=oe.h,zr=function(e){return Lr("div",{className:it("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:"uppy-DashboardContent-panel--"+e.activePickerPanel.id,onDragOver:jr,onDragLeave:jr,onDrop:jr,onPaste:jr},Lr("div",{className:"uppy-DashboardContent-bar"},Lr("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("importFrom",{name:e.activePickerPanel.name})),Lr("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.hideAllPanels},e.i18n("done"))),Lr("div",{className:"uppy-DashboardContent-panelBody"},e.getPlugin(e.activePickerPanel.id).render(e.state)))},Hr=oe.h,qr=function(e){var t=this.props.files[this.props.fileCardFor];return Hr("div",{className:it("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},Hr("div",{className:"uppy-DashboardContent-bar"},Hr("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:Hr("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),Hr("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.hideAllPanels},e.i18n("done"))),Hr("div",{className:"uppy-DashboardContent-panelBody"},e.editors.map((function(t){return e.getPlugin(t.id).render(e.state)}))))},Vr=oe.h,Wr="error",Xr="waiting",Yr="preprocessing",Gr="uploading",Kr="postprocessing",$r="complete",Jr="paused";function Qr(e){switch(function(e,t,r,n){if(void 0===n&&(n={}),e)return Wr;if(t)return $r;if(r)return Jr;for(var i=Xr,o=Object.keys(n),s=0;s<o.length;s++){var a=n[o[s]].progress;if(a.uploadStarted&&!a.uploadComplete)return Gr;a.preprocess&&i!==Gr&&(i=Yr),a.postprocess&&i!==Gr&&i!==Yr&&(i=Kr)}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 Zr=function(e){var t=e.allowNewUpload;return t&&e.maxNumberOfFiles&&(t=e.totalFileCount<e.maxNumberOfFiles),Vr("div",{className:"uppy-DashboardContent-bar"},e.isAllComplete||e.hideCancelButton?Vr("div",null):Vr("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.cancelAll},e.i18n("cancel")),Vr("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},Vr(Qr,e)),t?Vr("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e.i18n("addMoreFiles"),title:e.i18n("addMoreFiles"),onClick:function(){return e.toggleAddFilesPanel(!0)}},Vr("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},Vr("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"})),Vr("span",{className:"uppy-DashboardContent-addMoreCaption"},e.i18n("addMore"))):Vr("div",null))};function en(){return(en=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 tn(e,t){return(tn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var rn=oe.h,nn=function(e){var t,r;function n(t){var r;(r=e.call(this,t)||this).saveOnEnter=function(e){if(13===e.keyCode){e.stopPropagation(),e.preventDefault();var t=r.props.files[r.props.fileCardFor];r.props.saveFileCard(r.state.formState,t.id)}},r.updateMeta=function(e,t){var n;r.setState({formState:en({},r.state.formState,(n={},n[t]=e,n))})},r.handleSave=function(){var e=r.props.fileCardFor;r.props.saveFileCard(r.state.formState,e)},r.handleCancel=function(){r.props.toggleFileCard(!1)},r.renderMetaFields=function(){var e=r.getMetaFields()||[],t={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map((function(e){var n="uppy-Dashboard-FileCard-input-"+e.id;return rn("fieldset",{key:e.id,className:"uppy-Dashboard-FileCard-fieldset"},rn("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:n},e.name),void 0!==e.render?e.render({value:r.state.formState[e.id],onChange:function(t){return r.updateMeta(t,e.id)},fieldCSSClasses:t},rn):rn("input",{className:t.text,id:n,type:e.type||"text",value:r.state.formState[e.id],placeholder:e.placeholder,onKeyUp:r.saveOnEnter,onKeyDown:r.saveOnEnter,onKeyPress:r.saveOnEnter,onInput:function(t){return r.updateMeta(t.target.value,e.id)},"data-uppy-super-focusable":!0}))}))};var n=r.props.files[r.props.fileCardFor],i=r.getMetaFields()||[],o={};return i.forEach((function(e){o[e.id]=n.meta[e.id]||""})),r.state={formState:o},r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,tn(t,r);var i=n.prototype;return i.getMetaFields=function(){return"function"==typeof this.props.metaFields?this.props.metaFields(this.props.files[this.props.fileCardFor]):this.props.metaFields},i.render=function(){var e=this,t=this.props.files[this.props.fileCardFor],r=this.props.canEditFile(t);return rn("div",{className:it("uppy-Dashboard-FileCard",this.props.className),"data-uppy-panelType":"FileCard",onDragOver:jr,onDragLeave:jr,onDrop:jr,onPaste:jr},rn("div",{className:"uppy-DashboardContent-bar"},rn("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},this.props.i18nArray("editing",{file:rn("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),rn("button",{className:"uppy-DashboardContent-back",type:"button",title:this.props.i18n("finishEditingFile"),onClick:this.handleSave},this.props.i18n("done"))),rn("div",{className:"uppy-Dashboard-FileCard-inner"},rn("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:tr(t.type).color}},rn(nr,{file:t}),r&&rn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:function(){return e.props.openFileEditor(t)}},this.props.i18n("editFile"))),rn("div",{className:"uppy-Dashboard-FileCard-info"},this.renderMetaFields()),rn("div",{className:"uppy-Dashboard-FileCard-actions"},rn("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:this.handleSave},this.props.i18n("saveChanges")),rn("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:this.handleCancel},this.props.i18n("cancel")))))},n}(oe.Component);function on(e,t){return(on=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var sn=oe.cloneElement,an=oe.Component,un="uppy-transition-slideDownUp",ln=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).state={cachedChildren:null,className:""},r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,on(t,r);var i=n.prototype;return i.componentWillUpdate=function(e){var t=this,r=this.state.cachedChildren,n=e.children[0];if(r!==n){var i={cachedChildren:n};n&&!r&&(i.className=un+"-enter",cancelAnimationFrame(this.animationFrame),clearTimeout(this.leaveTimeout),this.leaveTimeout=void 0,this.animationFrame=requestAnimationFrame((function(){t.base.getBoundingClientRect(),t.setState({className:un+"-enter "+un+"-enter-active"}),t.enterTimeout=setTimeout((function(){t.setState({className:""})}),250)}))),r&&!n&&void 0===this.leaveTimeout&&(i.cachedChildren=r,i.className=un+"-leave",cancelAnimationFrame(this.animationFrame),clearTimeout(this.enterTimeout),this.enterTimeout=void 0,this.animationFrame=requestAnimationFrame((function(){t.setState({className:un+"-leave "+un+"-leave-active"}),t.leaveTimeout=setTimeout((function(){t.setState({cachedChildren:null,className:""})}),250)}))),this.setState(i)}},i.render=function(){var e=this.state,t=e.cachedChildren,r=e.className;return t?sn(t,{className:it(r,t.attributes.className)}):null},n}(an),cn=function(){var e=document.createElement("div");return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window};function pn(){return(pn=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 hn=oe.h,dn="error",fn="waiting",gn="preprocessing",mn="uploading",vn="postprocessing",yn="complete",bn=function(e){var t,r=(t=e,{hours:Math.floor(t/3600)%24,minutes:Math.floor(t/60)%60,seconds:Math.floor(t%60)}),n=r.hours?r.hours+"h ":"",i=r.hours?("0"+r.minutes).substr(-2):r.minutes,o=i?i+"m":"",s=i?("0"+r.seconds).substr(-2):r.seconds;return""+n+o+(r.hours?"":i?" "+s+"s":s+"s")};function wn(){return(wn=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 Sn,_n,Pn=oe.h,kn=function(e){var t=it("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":e.uploadState===fn},{"uppy-StatusBar-actionBtn--disabled":e.isSomeGhost}),r=e.newFiles&&e.isUploadStarted&&!e.recoveredState?e.i18n("uploadXNewFiles",{smart_count:e.newFiles}):e.i18n("uploadXFiles",{smart_count:e.newFiles});return Pn("button",{type:"button",className:t,"aria-label":e.i18n("uploadXFiles",{smart_count:e.newFiles}),onClick:e.startUpload,disabled:e.isSomeGhost,"data-uppy-super-focusable":!0},r)},Cn=function(e){return Pn("button",{type:"button",className:"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},Pn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},Pn("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"))},On=function(e){return Pn("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e.i18n("cancel"),"aria-label":e.i18n("cancel"),onClick:e.cancelAll,"data-uppy-super-focusable":!0},Pn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},Pn("g",{fill:"none",fillRule:"evenodd"},Pn("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Pn("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"}))))},En=function(e){var t=e.isAllPaused,r=(0,e.i18n)(t?"resume":"pause");return Pn("button",{title:r,"aria-label":r,className:"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},Pn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},Pn("g",{fill:"none",fillRule:"evenodd"},Pn("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Pn("path",t?{fill:"#FFF",d:"M6 4.25L11.5 8 6 11.75z"}:{d:"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z",fill:"#FFF"}))))},An=function(e){var t=e.i18n;return Pn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:e.doneButtonHandler,"data-uppy-super-focusable":!0},t("done"))},Fn=function(){return Pn("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},Pn("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",fillRule:"evenodd"}))},Rn=function(e){var t=Math.round(100*e.value);return Pn("div",{className:"uppy-StatusBar-content"},Pn(Fn,null),"determinate"===e.mode?t+"% \xb7 ":"",e.message)},xn=function(e){return Pn("div",{className:"uppy-StatusBar-statusSecondary"},e.i18n("filesUploadedOfTotal",{complete:e.complete,smart_count:e.numUploads}))},Un=function(e){var t=it("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return Pn("div",{className:"uppy-StatusBar-statusSecondary"},Pn("div",{className:"uppy-StatusBar-statusSecondaryHint"},e.i18n("xMoreFilesAdded",{smart_count:e.newFiles})),Pn("button",{type:"button",className:t,"aria-label":e.i18n("uploadXFiles",{smart_count:e.newFiles}),onClick:e.startUpload},e.i18n("upload")))},Tn=z((function(e){var t=e.numUploads>1;return Pn("div",{className:"uppy-StatusBar-statusSecondary"},t&&e.i18n("filesUploadedOfTotal",{complete:e.complete,smart_count:e.numUploads}),Pn("span",{className:"uppy-StatusBar-additionalInfo"},t&&" \xb7 ",e.i18n("dataUploadedOfTotal",{complete:q(e.totalUploadedSize),total:q(e.totalSize)})," \xb7 ",e.i18n("xTimeLeft",{time:bn(e.totalETA)})))}),500,{leading:!0,trailing:!0}),Dn=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 Pn("div",{className:"uppy-StatusBar-content","aria-label":t,title:t},e.isAllPaused?null:Pn(Fn,null),Pn("div",{className:"uppy-StatusBar-status"},Pn("div",{className:"uppy-StatusBar-statusPrimary"},e.supportsUploadProgress?t+": "+e.totalProgress+"%":t),e.isAllPaused||r||!e.showProgressDetails?null:e.supportsUploadProgress?Pn(Tn,e):Pn(xn,e),r?Pn(Un,e):null))},Bn=function(e){e.totalProgress;var t=e.i18n;return Pn("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},Pn("div",{className:"uppy-StatusBar-status"},Pn("div",{className:"uppy-StatusBar-statusPrimary"},Pn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},Pn("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))},In=function(e){var t=e.error,r=(e.retryAll,e.hideRetryButton,e.i18n);return Pn("div",{className:"uppy-StatusBar-content",role:"alert",title:r("uploadFailed")},Pn("div",{className:"uppy-StatusBar-status"},Pn("div",{className:"uppy-StatusBar-statusPrimary"},Pn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},Pn("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"))),Pn("span",{className:"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)}},"?"))},Nn=function(e){for(;e&&!e.dir;)e=e.parentNode;return e?e.dir:void 0};function Mn(){return(Mn=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 jn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ln(e,t){return(Ln=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var zn,Hn,qn=(_n=Sn=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).startUpload=function(){if(!n.uppy.getState().recoveredState)return n.uppy.upload().catch((function(){}));n.uppy.emit("restore-confirmed")},n.id=n.opts.id||"StatusBar",n.title="StatusBar",n.type="progressindicator",n.defaultLocale={strings:{uploading:"Uploading",upload:"Upload",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",retryUpload:"Retry upload",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",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"}}},n.opts=Mn({},{target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},r),n.i18nInit(),n.render=n.render.bind(jn(n)),n.install=n.install.bind(jn(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ln(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([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+=function(e){if(!e.bytesUploaded)return 0;var t=new Date-e.uploadStarted;return e.bytesUploaded/(t/1e3)}(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+((r=t.progress).bytesTotal-r.bytesUploaded);var r}),0);return Math.round(r/t*10)/10},i.getUploadingState=function(e,t,r,n){if(e)return dn;if(t)return yn;if(r)return fn;for(var i=fn,o=Object.keys(n),s=0;s<o.length;s++){var a=n[o[s]].progress;if(a.uploadStarted&&!a.uploadComplete)return mn;a.preprocess&&i!==mn&&(i=gn),a.postprocess&&i!==mn&&i!==gn&&(i=vn)}return i},i.render=function(e){var t=e.capabilities,r=e.files,n=e.allowNewUpload,i=e.totalProgress,o=e.error,s=e.recoveredState,a=Object.keys(r).map((function(e){return r[e]})),u=a.filter((function(e){return!e.progress.uploadStarted&&!e.progress.preprocess&&!e.progress.postprocess}));s&&(u=a);var l=a.filter((function(e){return e.progress.uploadStarted})).filter((function(e){return e.isPaused})),c=a.filter((function(e){return e.progress.uploadComplete})),p=a.filter((function(e){return e.error})),h=a.filter((function(e){return!e.progress.uploadComplete&&e.progress.uploadStarted})),d=h.filter((function(e){return!e.isPaused})),f=a.filter((function(e){return e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess})),g=a.filter((function(e){return e.progress.preprocess||e.progress.postprocess})),m=this.getTotalETA(d),v=0,y=0;f.forEach((function(e){v+=e.progress.bytesTotal||0,y+=e.progress.bytesUploaded||0}));var b=f.length>0,w=100===i&&c.length===Object.keys(r).length&&0===g.length,S=o&&p.length===a.length,_=0!==h.length&&l.length===h.length,P=h.length>0,k=t.resumableUploads||!1,C=!1!==t.uploadProgress,O=a.some((function(e){return e.isGhost}));return function(e){var t,r,n=e=e||{},i=n.newFiles,o=n.allowNewUpload,s=n.isUploadInProgress,a=n.isAllPaused,u=n.resumableUploads,l=n.error,c=n.hideUploadButton,p=n.hidePauseResumeButton,h=n.hideCancelButton,d=n.hideRetryButton,f=n.recoveredState,g=e.uploadState,m=e.totalProgress;if(g===gn||g===vn){var v=function(e){var t=[];Object.keys(e).forEach((function(r){var n=e[r].progress;n.preprocess&&t.push(n.preprocess),n.postprocess&&t.push(n.postprocess)}));var r=t[0];return{mode:r.mode,message:r.message,value:t.filter((function(e){return"determinate"===e.mode})).reduce((function(e,t,r,n){return e+t.value/n.length}),0)}}(e.files);"determinate"===(t=v.mode)&&(m=100*v.value),r=Rn(v)}else g===yn?r=Bn(e):g===mn?(e.supportsUploadProgress||(t="indeterminate",m=null),r=Dn(e)):g===dn&&(m=void 0,r=In(e));var y="number"==typeof m?m:100,b=g===fn&&e.hideUploadButton||g===fn&&!e.newFiles>0||g===yn&&e.hideAfterFinish,w=!l&&i&&!s&&!a&&o&&!c;f&&(b=!1,w=!0);var S=!h&&g!==fn&&g!==yn,_=u&&!p&&g===mn,P=l&&!d,k=e.doneButtonHandler&&g===yn,C="uppy-StatusBar-progress\n                           "+(t?"is-"+t:""),O=it({"uppy-Root":e.isTargetDOMEl},"uppy-StatusBar","is-"+g,{"has-ghosts":e.isSomeGhost});return Pn("div",{className:O,"aria-hidden":b},Pn("div",{className:C,style:{width:y+"%"},role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":m}),r,Pn("div",{className:"uppy-StatusBar-actions"},w?Pn(kn,wn({},e,{uploadState:g})):null,P?Pn(Cn,e):null,_?Pn(En,e):null,S?Pn(On,e):null,k?Pn(An,e):null))}({error:o,uploadState:this.getUploadingState(S,w,s,e.files||{}),allowNewUpload:n,totalProgress:i,totalSize:v,totalUploadedSize:y,isAllComplete:w,isAllPaused:_,isAllErrored:S,isUploadStarted:b,isUploadInProgress:P,isSomeGhost:O,recoveredState:s,complete:c.length,newFiles:u.length,numUploads:f.length,totalETA:m,files:r,i18n:this.i18n,pauseAll:this.uppy.pauseAll,resumeAll:this.uppy.resumeAll,retryAll:this.uppy.retryAll,cancelAll:this.uppy.cancelAll,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:k,supportsUploadProgress:C,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.onMount=function(){var e=this.el;Nn(e)||(e.dir="ltr")},i.install=function(){var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},n}(le.Plugin),Sn.VERSION="1.9.5",_n);function Vn(){return(Vn=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 Wn(e,t){return(Wn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}for(var Xn=le.Plugin,Yn=oe.h,Gn=(Hn=zn=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).render=function(e){var t=e.info,r=t.isHidden,i=t.message,o=t.details;return Yn("div",{className:"uppy uppy-Informer","aria-hidden":r},Yn("p",{role:"alert"},i," ",o&&Yn("span",{"aria-label":o,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:function(){alert(i+" \n\n "+o)},onMouseOver:function(){clearTimeout(n.uppy.infoTimeoutID)},onMouseLeave:function(){n.uppy.infoTimeoutID=setTimeout(n.uppy.hideInfo,2e3)}},"?")))},n.type="progressindicator",n.id=n.opts.id||"Informer",n.title="Informer",n.opts=Vn({},{},r),n}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Wn(t,r),n.prototype.install=function(){var e=this.opts.target;e&&this.mount(e,this)},n}(Xn),zn.VERSION="1.6.5",Hn),Kn=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(th){return null}return r?new File([o],t.name||"",{type:i}):new Blob([o],{type:i})},$n=function(e){return 0===e.indexOf("blob:")},Jn=Math.log2||function(e){return Math.log(e)*Math.LOG2E},Qn={toByteArray:function(e){var t,r,n=oi(e),i=n[0],o=n[1],s=new ti(function(e,t,r){return 3*(t+r)/4-r}(0,i,o)),a=0,u=o>0?i-4:i;for(r=0;r<u;r+=4)t=ei[e.charCodeAt(r)]<<18|ei[e.charCodeAt(r+1)]<<12|ei[e.charCodeAt(r+2)]<<6|ei[e.charCodeAt(r+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===o&&(t=ei[e.charCodeAt(r)]<<2|ei[e.charCodeAt(r+1)]>>4,s[a++]=255&t),1===o&&(t=ei[e.charCodeAt(r)]<<10|ei[e.charCodeAt(r+1)]<<4|ei[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s},fromByteArray:function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;o<s;o+=16383)i.push(si(e,o,o+16383>s?s:o+16383));return 1===n?(t=e[r-1],i.push(Zn[t>>2]+Zn[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(Zn[t>>10]+Zn[t>>4&63]+Zn[t<<2&63]+"=")),i.join("")}},Zn=[],ei=[],ti="undefined"!=typeof Uint8Array?Uint8Array:Array,ri="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ni=0,ii=ri.length;ni<ii;++ni)Zn[ni]=ri[ni],ei[ri.charCodeAt(ni)]=ni;function oi(e){var t=e.length;if(t%4>0)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 si(e,t,r){for(var n,i,o=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(Zn[(i=n)>>18&63]+Zn[i>>12&63]+Zn[i>>6&63]+Zn[63&i]);return o.join("")}ei["-".charCodeAt(0)]=62,ei["_".charCodeAt(0)]=63;var ai,ui,li={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,h=r?-1:1,d=e[t+p];for(p+=h,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+p],p+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=l}return(d?-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,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,g=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),(t+=s+p>=1?h/u:h*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=c?(a=0,s=c):s+p>=1?(a=(t*u-1)*Math.pow(2,i),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=f,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+d]=255&s,d+=f,s/=256,l-=8);e[r+d-f]|=128*g}},ci={exports:{}};function pi(){return(pi=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 hi(e,t){return(hi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(function(e,t,r){(function(){var n,i;n=this,i=function(n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 s(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});var r=["prototype","__proto__","caller","arguments","length","name"];Object.getOwnPropertyNames(t).forEach((function(n){-1===r.indexOf(n)&&e[n]!==t[n]&&(e[n]=t[n])})),t&&c(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(n){return!1}}function h(e,t,r){return(h=p()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&c(i,r.prototype),i}).apply(null,arguments)}function d(e){var t="function"==typeof Map?new Map:void 0;return(d=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return h(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){var t=p();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?f(e):t}(this,r)}}function m(e,t,r){return(m="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=l(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 v=Object.values||function(e){var t=[];for(var r in e)t.push(e[r]);return t},y=Object.entries||function(e){var t=[];for(var r in e)t.push([r,e[r]]);return t},b=Object.assign||function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.forEach((function(t){for(var r in t)e[r]=t[r]})),e},w=Object.fromEntries||function(e){var t={};return S(e).forEach((function(e){var r=e[0],n=e[1];t[r]=n})),t},S=Array.from||function(e){if(e instanceof E){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t}return Array.prototype.slice.call(e)};function _(e){return-1!==this.indexOf(e)}Array.prototype.includes||(Array.prototype.includes=_),String.prototype.includes||(String.prototype.includes=_),String.prototype.startsWith||(String.prototype.startsWith=function(e){var t=arguments.length>1&&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=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return this.substring(t-e.length,t)===e});var P="undefined"!=typeof self?self:t,k=P.fetch||function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var i=new XMLHttpRequest;if(i.open("get",e,!0),i.responseType="arraybuffer",i.onerror=n,t.headers)for(var o in t.headers)i.setRequestHeader(o,t.headers[o]);i.onload=function(){r({ok:i.status>=200&&i.status<300,status:i.status,arrayBuffer:function(){return Promise.resolve(i.response)}})},i.send(null)}))},C=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){if(this.has(e)){var 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},O=function(e){return new E(e)},E=void 0!==P.Map&&void 0!==P.Map.prototype.keys?P.Map:function(){function e(t){if(i(this,e),this.clear(),t)for(var r=0;r<t.length;r++)this.set(t[r][0],t[r][1])}return s(e,[{key:"clear",value:function(){this._map={},this._keys=[]}},{key:"size",get:function(){return this._keys.length}},{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 this._keys.indexOf(e)>=0}},{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 e=this;return this._keys.map((function(t){return e.get(t)}))}},{key:"entries",value:function(){var e=this;return this._keys.map((function(t){return[t,e.get(t)]}))}},{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)}}]),e}(),A="undefined"!=typeof self?self:t,F="undefined"!=typeof navigator,R=F&&"undefined"==typeof HTMLImageElement,x=!(void 0===t||void 0===e||!e.versions||!e.versions.node),U=A.Buffer,T=!!U,D=function(e){return void 0!==e};function B(e){return void 0===e||(e instanceof E?0===e.size:0===v(e).filter(D).length)}function I(e){var t=new Error(e);throw delete t.stack,t}function N(e){var t=function(e){var t=0;return 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}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}var M=function(e){return String.fromCharCode.apply(null,e)},j="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0,L=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;if(i(this,e),"boolean"==typeof o&&(this.le=o),Array.isArray(t)&&(t=new Uint8Array(t)),0===t)this.byteOffset=0,this.byteLength=0;else if(t instanceof ArrayBuffer){void 0===n&&(n=t.byteLength-r);var s=new DataView(t,r,n);this._swapDataView(s)}else if(t instanceof Uint8Array||t instanceof DataView||t instanceof e){void 0===n&&(n=t.byteLength-r),(r+=t.byteOffset)+n>t.byteOffset+t.byteLength&&I("Creating view outside of available memory in ArrayBuffer");var a=new DataView(t.buffer,r,n);this._swapDataView(a)}else if("number"==typeof t){var u=new DataView(new ArrayBuffer(t));this._swapDataView(u)}else I("Invalid input argument for BufferView: "+t)}return s(e,[{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(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return t instanceof DataView||t instanceof e?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Uint8Array||I("BufferView.set(): Invalid data argument."),this.toUint8().set(t,r),new n(this,r,t.byteLength)}},{key:"subarray",value:function(t,r){return new e(this,t,r=r||this._lengthToEnd(t))}},{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=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.byteLength;return function(e){return j?j.decode(e):T?r.from(e).toString("utf8"):decodeURIComponent(escape(M(e)))}(this.getUint8Array(e,t))}},{key:"getLatin1String",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.byteLength,r=this.getUint8Array(e,t);return M(r)}},{key:"getUnicodeString",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&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 M(r)}},{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=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getInt16(e,t)}},{key:"getInt32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getInt32(e,t)}},{key:"getUint16",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getUint16(e,t)}},{key:"getUint32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getUint32(e,t)}},{key:"getFloat32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat32(e,t)}},{key:"getFloat64",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat64(e,t)}},{key:"getFloat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat32(e,t)}},{key:"getDouble",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat64(e,t)}},{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&&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&&this.getUint64(e,r)}}},{key:"toString",value:function(e){return this.dataView.toString(e,this.constructor.name)}},{key:"ensureChunk",value:function(){}}],[{key:"from",value:function(t,r){return t instanceof this&&t.le===r?t:new e(t,void 0,void 0,r)}}]),e}();function z(e,t){I("".concat(e," '").concat(t,"' was not loaded, try using full build of exifr."))}var H=function(e){u(r,d(E));var t=g(r);function r(e){var n;return i(this,r),(n=t.call(this)).kind=e,n}return s(r,[{key:"get",value:function(e,t){return this.has(e)||z(this.kind,e),t&&(e in t||function(e,t){I("Unknown ".concat(e," '").concat(t,"'."))}(this.kind,e),t[e].enabled||z(this.kind,e)),m(l(r.prototype),"get",this).call(this,e)}},{key:"keyList",value:function(){return S(this.keys())}}]),r}(),q=new H("file parser"),V=new H("segment parser"),W=new H("file reader");function X(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function Y(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var G=X((function(e){return new Promise((function(t,r){var n=new FileReader;n.onloadend=function(){return t(n.result||new ArrayBuffer)},n.onerror=r,n.readAsArrayBuffer(e)}))})),K=X((function(e){return k(e).then((function(e){return e.arrayBuffer()}))})),$=X((function(e,t){return Y(t(e),(function(e){return new L(e)}))})),J=X((function(e,t,r){var n=new(W.get(r))(e,t);return Y(n.read(),(function(){return n}))})),Q=X((function(e,t,r,n){return W.has(r)?J(e,t,r):n?$(e,n):(I("Parser ".concat(r," is not loaded")),Y())})),Z="Invalid input argument";function ee(e,t){return(r=e).startsWith("data:")||r.length>1e4?J(e,t,"base64"):F?Q(e,t,"url",K):x?J(e,t,"fs"):void I(Z);var r}var te=function(e){u(r,d(E));var t=g(r);function r(){return i(this,r),t.apply(this,arguments)}return s(r,[{key:"tagKeys",get:function(){return this.allKeys||(this.allKeys=S(this.keys())),this.allKeys}},{key:"tagValues",get:function(){return this.allValues||(this.allValues=S(this.values())),this.allValues}}]),r}();function re(e,t,r){var n=new te,i=r;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=S(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=S(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 ne(e,t,r){var n,i=e.get(t),o=r;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=S(o));for(var s=0;s<o.length;s++)n=o[s],i.set(n[0],n[1])}var ie=O(),oe=O(),se=O(),ae=37500,ue=37510,le=40965,ce=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],pe=["jfif","xmp","icc","iptc","ihdr"],he=["tiff"].concat(pe),de=["ifd0","ifd1","exif","gps","interop"],fe=[].concat(he,de),ge=["makerNote","userComment"],me=["translateKeys","translateValues","reviveValues","multiSegment"],ve=[].concat(me,["sanitize","mergeOutput","silentErrors"]),ye=function(){function e(){i(this,e)}return s(e,[{key:"translate",get:function(){return this.translateKeys||this.translateValues||this.reviveValues}}]),e}(),be=function(e){u(r,ye);var t=g(r);function r(e,n,o,s){var u;if(i(this,r),a(f(u=t.call(this)),"enabled",!1),a(f(u),"skip",C()),a(f(u),"pick",C()),a(f(u),"deps",C()),a(f(u),"translateKeys",!1),a(f(u),"translateValues",!1),a(f(u),"reviveValues",!1),u.key=e,u.enabled=n,u.parse=u.enabled,u.applyInheritables(s),u.canBeFiltered=de.includes(e),u.canBeFiltered&&(u.dict=ie.get(e)),void 0!==o)if(Array.isArray(o))u.parse=u.enabled=!0,u.canBeFiltered&&o.length>0&&u.translateTagSet(o,u.pick);else if("object"==typeof o){if(u.enabled=!0,u.parse=!1!==o.parse,u.canBeFiltered){var l=o.pick,c=o.skip;l&&l.length>0&&u.translateTagSet(l,u.pick),c&&c.length>0&&u.translateTagSet(c,u.skip)}u.applyInheritables(o)}else!0===o||!1===o?u.parse=u.enabled=o:I("Invalid options argument: ".concat(o));return u}return s(r,[{key:"needed",get:function(){return this.enabled||this.deps.size>0}},{key:"applyInheritables",value:function(e){var t,r,n=me;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=S(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=S(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=S(l));for(var c=0;c<l.length;c++){var p=l[c];t.add(p)}}}},{key:"finalizeFilters",value:function(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ce(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ce(this.pick,this.deps)}}]),r}(),we={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,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},Se=O(),_e=function(e){u(r,ye);var t=g(r);function r(e){var n;return i(this,r),n=t.call(this),!0===e?n.setupFromTrue():void 0===e?n.setupFromUndefined():Array.isArray(e)?n.setupFromArray(e):"object"==typeof e?n.setupFromObject(e):I("Invalid options argument ".concat(e)),void 0===n.firstChunkSize&&(n.firstChunkSize=F?n.firstChunkSizeBrowser:n.firstChunkSizeNode),n.mergeOutput&&(n.ifd1.enabled=!1),n.filterNestedSegmentTags(),n.traverseTiffDependencyTree(),n.checkLoadedPlugins(),n}return s(r,[{key:"setupFromUndefined",value:function(){var e,t=ce;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=S(t));for(var r=0;r<t.length;r++)this[e=t[r]]=we[e];var n=ve;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=S(n));for(var i=0;i<n.length;i++)this[e=n[i]]=we[e];var o=ge;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=S(o));for(var s=0;s<o.length;s++)this[e=o[s]]=we[e];var a=fe;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=S(a));for(var u=0;u<a.length;u++)this[e=a[u]]=new be(e,we[e],void 0,this)}},{key:"setupFromTrue",value:function(){var e,t=ce;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=S(t));for(var r=0;r<t.length;r++)this[e=t[r]]=we[e];var n=ve;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=S(n));for(var i=0;i<n.length;i++)this[e=n[i]]=we[e];var o=ge;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=S(o));for(var s=0;s<o.length;s++)this[e=o[s]]=!0;var a=fe;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=S(a));for(var u=0;u<a.length;u++)this[e=a[u]]=new be(e,!0,void 0,this)}},{key:"setupFromArray",value:function(e){var t,r=ce;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=S(r));for(var n=0;n<r.length;n++)this[t=r[n]]=we[t];var i=ve;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=S(i));for(var o=0;o<i.length;o++)this[t=i[o]]=we[t];var s=ge;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=S(s));for(var a=0;a<s.length;a++)this[t=s[a]]=we[t];var u=fe;Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=S(u));for(var l=0;l<u.length;l++)this[t=u[l]]=new be(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,de)}},{key:"setupFromObject",value:function(e){var t;de.ifd0=de.ifd0||de.image,de.ifd1=de.ifd1||de.thumbnail,b(this,e);var r=ce;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=S(r));for(var n=0;n<r.length;n++)this[t=r[n]]=ke(e[t],we[t]);var i=ve;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=S(i));for(var o=0;o<i.length;o++)this[t=i[o]]=ke(e[t],we[t]);var s=ge;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=S(s));for(var a=0;a<s.length;a++)this[t=s[a]]=ke(e[t],we[t]);var u=he;Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=S(u));for(var l=0;l<u.length;l++)this[t=u[l]]=new be(t,we[t],e[t],this);var c=de;Array.isArray(c)||("function"==typeof c.entries&&(c=c.entries()),c=S(c));for(var p=0;p<c.length;p++)this[t=c[p]]=new be(t,we[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,de,fe),!0===e.tiff?this.batchEnableWithBool(de,!0):!1===e.tiff?this.batchEnableWithUserValue(de,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,de):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,de)}},{key:"batchEnableWithBool",value:function(e,t){var r=e;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=S(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=S(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=arguments.length>3&&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=S(i));for(var o=0;o<i.length;o++)this[i[o]].enabled=!1;var s=Pe(e,r);Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=S(s));for(var a=0;a<s.length;a++){var u=s[a],l=u[0],c=u[1];Ce(this[l].pick,c),this[l].enabled=!0}}else if(t&&t.length){var p=Pe(t,r);Array.isArray(p)||("function"==typeof p.entries&&(p=p.entries()),p=S(p));for(var h=0;h<p.length;h++){var d=p[h],f=d[0],g=d[1];Ce(this[f].skip,g)}}}},{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(ae):t.skip.add(ae),this.userComment?t.deps.add(ue):t.skip.add(ue),r.enabled||e.skip.add(700),n.enabled||e.skip.add(33723),i.enabled||e.skip.add(34675)}},{key:"traverseTiffDependencyTree",value:function(){var e=this,t=this.ifd0,r=this.exif,n=this.gps;this.interop.needed&&(r.deps.add(le),t.deps.add(le)),r.needed&&t.deps.add(34665),n.needed&&t.deps.add(34853),this.tiff.enabled=de.some((function(t){return!0===e[t].enabled}))||this.makerNote||this.userComment;var i=de;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=S(i));for(var o=0;o<i.length;o++)this[i[o]].finalizeFilters()}},{key:"onlyTiff",get:function(){var e=this;return!pe.map((function(t){return e[t].enabled})).some((function(e){return!0===e}))&&this.tiff.enabled}},{key:"checkLoadedPlugins",value:function(){var e=he;Array.isArray(e)||("function"==typeof e.entries&&(e=e.entries()),e=S(e));for(var t=0;t<e.length;t++){var r=e[t];this[r].enabled&&!V.has(r)&&z("segment parser",r)}}}],[{key:"useCached",value:function(e){var t=Se.get(e);return void 0!==t||(t=new this(e),Se.set(e,t)),t}}]),r}();function Pe(e,t){var r,n,i,o=[],s=t;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=S(s));for(var a=0;a<s.length;a++){n=s[a],r=[];var u=ie.get(n);Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=S(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 Ce(e,t){var r=t;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=S(r));for(var n=0;n<r.length;n++){var i=r[n];e.add(i)}}function Oe(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Ee(){}function Ae(e,t){if(!t)return e&&e.then?e.then(Ee):Promise.resolve()}function Fe(e,t){var r=e();return r&&r.then?r.then(t):t(r)}a(_e,"default",we);var Re,xe=function(){function e(t){i(this,e),a(this,"parsers",{}),this.options=_e.useCached(t)}return s(e,[{key:"setup",value:function(){if(!this.fileParser){var e=this.file,t=e.getUint16(0),r=q;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=S(r));for(var n=0;n<r.length;n++){var i=r[n],o=i[0],s=i[1];if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[o]=!0}I("Unknown file format")}}},{key:"read",value:function(e){try{var t=this;return Oe(function(e,t){return"string"==typeof e?ee(e,t):F&&!R&&e instanceof HTMLImageElement?ee(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new L(e):F&&e instanceof Blob?Q(e,t,"blob",G):void I(Z)}(e,t.options),(function(e){t.file=e}))}catch(e){return Promise.reject(e)}}},{key:"parse",value:function(){try{var e=this;e.setup();var t={},r=[];return Fe((function(){return e.options.silentErrors?Oe(e.doParse(t,r).catch((function(e){return r.push(e)})),(function(){r.push.apply(r,e.fileParser.errors)})):Ae(e.doParse(t,r))}),(function(){return e.file.close&&e.file.close(),e.options.silentErrors&&r.length>0&&(t.errors=r),B(n=t)?void 0:n;var n}))}catch(e){return Promise.reject(e)}}},{key:"doParse",value:function(e,t){try{var r=this;return Oe(r.fileParser.parse(),(function(){var n,i=v(r.parsers).map((n=function(t){return Oe(t.parse(),(function(r){t.assignToOutput(e,r)}))},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)}}));if(r.options.silentErrors){var o=function(e){return t.push(e)};i=i.map((function(e){return e.catch(o)}))}return Ae(Promise.all(i))}))}catch(e){return Promise.reject(e)}}},{key:"extractThumbnail",value:function(){try{var e=this;e.setup();var t,r=e.options,n=e.file,i=V.get("tiff",r);return Fe((function(){if(!n.tiff)return function(e){var t=e();if(t&&t.then)return t.then(Ee)}((function(){if(n.jpeg)return Oe(e.fileParser.getOrFindSegment("tiff"),(function(e){t=e}))}));t={start:0,type:"tiff"}}),(function(){if(void 0!==t)return Oe(e.fileParser.ensureSegmentChunk(t),(function(t){return Oe((e.parsers.tiff=new i(t,r,n)).extractThumbnail(),(function(e){return n.close&&n.close(),e}))}))}))}catch(e){return Promise.reject(e)}}}]),e}(),Ue=(Re=function(e,t){var r,n,i=new xe(t);return n=function(){return i.parse()},(r=i.read(e))&&r.then||(r=Promise.resolve(r)),n?r.then(n):r},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(Re.apply(this,e))}catch(e){return Promise.reject(e)}}),Te=Object.freeze({__proto__:null,parse:Ue,Exifr:xe,fileParsers:q,segmentParsers:V,fileReaders:W,tagKeys:ie,tagValues:oe,tagRevivers:se,createDictionary:re,extendDictionary:ne,fetchUrlAsArrayBuffer:K,readBlobAsArrayBuffer:G,chunkedProps:ce,otherSegments:pe,segments:he,tiffBlocks:de,segmentsAndBlocks:fe,tiffExtractables:ge,inheritables:me,allFormatters:ve,Options:_e});function De(){}var Be=function(){function e(t,r,n){var o=this;i(this,e),a(this,"errors",[]),a(this,"ensureSegmentChunk",(function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(function(e){var t,r,n,i=e.start,s=e.size||65536;return t=function(){if(o.file.chunked)return function(e){var t=e();if(t&&t.then)return t.then(De)}((function(){if(!o.file.available(i,s))return function(e){if(e&&e.then)return e.then(De)}(function(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}((function(){return r=function(t){e.chunk=t},(t=o.file.readChunk(i,s))&&t.then||(t=Promise.resolve(t)),r?t.then(r):t;var t,r}),(function(t){I("Couldn't read segment: ".concat(JSON.stringify(e),". ").concat(t.message))})));e.chunk=o.file.subarray(i,s)}));o.file.byteLength>i+s?e.chunk=o.file.subarray(i,s):void 0===e.size?e.chunk=o.file.subarray(i):I("Segment unreachable: "+JSON.stringify(e))},r=function(){return e.chunk},(n=t())&&n.then?n.then(r):r()}.apply(this,t))}catch(e){return Promise.reject(e)}})),this.extendOptions&&this.extendOptions(t),this.options=t,this.file=r,this.parsers=n}return s(e,[{key:"injectSegment",value:function(e,t){this.options[e].enabled&&this.createParser(e,t)}},{key:"createParser",value:function(e,t){var r=new(V.get(e))(t,this.options,this.file);return this.parsers[e]=r}},{key:"createParsers",value:function(e){var t=e;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=S(t));for(var r=0;r<t.length;r++){var n=t[r],i=n.type,o=n.chunk,s=this.options[i];if(s&&s.enabled){var a=this.parsers[i];a&&a.append||a||this.createParser(i,o)}}}},{key:"readSegments",value:function(e){try{var t=e.map(this.ensureSegmentChunk);return function(e,t){return e&&e.then?e.then(De):Promise.resolve()}(Promise.all(t))}catch(e){return Promise.reject(e)}}}]),e}(),Ie=function(){function e(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;i(this,e),a(this,"errors",[]),a(this,"raw",O()),a(this,"handleError",(function(e){if(!r.options.silentErrors)throw e;r.errors.push(e.message)})),this.chunk=this.normalizeInput(t),this.file=o,this.type=this.constructor.type,this.globalOptions=this.options=n,this.localOptions=n[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}return s(e,[{key:"normalizeInput",value:function(e){return e instanceof L?e:new L(e)}},{key:"translate",value:function(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}},{key:"output",get:function(){return this.translated?this.translated:this.raw?w(this.raw):void 0}},{key:"translateBlock",value:function(e,t){var r=se.get(t),n=oe.get(t),i=ie.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=S(c));for(var p=0;p<c.length;p++){var h=c[p],d=h[0],f=h[1];s&&r.has(d)?f=r.get(d)(f):a&&n.has(d)&&(f=this.translateValue(f,n.get(d))),u&&i.has(d)&&(d=i.get(d)||d),l[d]=f}return l}},{key:"translateValue",value:function(e,t){return t[e]||t.DEFAULT||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 b(e,r);e[t]?b(e[t],r):e[t]=r}}],[{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=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new this(e,new _e(a({},this.type,t))).parse()}}]),e}();function Ne(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Me(){}function je(e,t){var r=e();return r&&r.then?r.then(t):t(r)}function Le(e,t,r){if(!e.s){if(r instanceof ze){if(!r.s)return void(r.o=Le.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(Le.bind(null,e,t),Le.bind(null,e,2));e.s=t,e.v=r;var n=e.o;n&&n(e)}}a(Ie,"headerLength",4),a(Ie,"type",void 0),a(Ie,"multiSegment",!1),a(Ie,"canHandle",(function(){return!1}));var ze=function(){function e(){}return e.prototype.then=function(t,r){var n=new e,i=this.s;if(i){var o=1&i?t:r;if(o){try{Le(n,1,o(this.v))}catch(e){Le(n,2,e)}return n}return this}return this.o=function(e){try{var i=e.v;1&e.s?Le(n,1,t?t(i):i):r?Le(n,1,r(i)):Le(n,2,i)}catch(e){Le(n,2,e)}},n},e}();function He(e){return e instanceof ze&&1&e.s}function qe(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function Ve(e){return e>=224&&e<=239}function We(e,t,r){var n=V;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=S(n));for(var i=0;i<n.length;i++){var o=n[i],s=o[0];if(o[1].canHandle(e,t,r))return s}}var Xe=function(e){u(r,Be);var t=g(r);function r(){var e;i(this,r);for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return a(f(e=t.call.apply(t,[this].concat(o))),"appSegments",[]),a(f(e),"jpegSegments",[]),a(f(e),"unknownSegments",[]),e}return s(r,[{key:"parse",value:function(){try{var e=this;return Ne(e.findAppSegments(),(function(){return Ne(e.readSegments(e.appSegments),(function(){e.mergeMultiSegments(),e.createParsers(e.mergedAppSegments||e.appSegments)}))}))}catch(e){return Promise.reject(e)}}},{key:"setupSegmentFinderArgs",value:function(e){var t=this;!0===e?(this.findAll=!0,this.wanted=C(V.keyList())):(e=void 0===e?V.keyList().filter((function(e){return t.options[e].enabled})):e.filter((function(e){return t.options[e].enabled&&V.has(e)})),this.findAll=!1,this.remaining=C(e),this.wanted=C(e)),this.unfinishedMultiSegment=!1}},{key:"findAppSegments",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;try{var r=this;r.setupSegmentFinderArgs(t);var n=r.file,i=r.findAll,o=r.wanted,s=r.remaining;return je((function(){if(!i&&r.file.chunked)return i=S(o).some((function(e){var t=V.get(e),n=r.options[e];return t.multiSegment&&n.multiSegment})),function(e){var t=function(){if(i)return function(e,t){return e&&e.then?e.then(Me):Promise.resolve()}(r.file.readWhole())}();if(t&&t.then)return t.then(Me)}()}),(function(){var t=!1;if(e=r.findAppSegmentsInRange(e,n.byteLength),!r.options.onlyTiff)return function(){if(n.chunked){var i=!1;return function(e,t,r){for(var n;;){var i=e();if(He(i)&&(i=i.v),!i)return s;if(i.then){n=0;break}var o,s=r();if(s&&s.then){if(!He(s)){n=1;break}s=s.s}}var a=new ze,u=Le.bind(null,a,2);return(0===n?i.then(c):1===n?s.then(l):o.then(p)).then(void 0,u),a;function l(t){s=t;do{if(!(i=e())||He(i)&&!i.v)return void Le(a,1,s);if(i.then)return void i.then(c).then(void 0,u);He(s=r())&&(s=s.v)}while(!s||!s.then);s.then(l).then(void 0,u)}function c(e){e?(s=r())&&s.then?s.then(l).then(void 0,u):l(s):Le(a,1,s)}function p(){(i=e())?i.then?i.then(c).then(void 0,u):c(i):Le(a,1,s)}}((function(){return!t&&s.size>0&&!i&&(!!n.canReadNextChunk||!!r.unfinishedMultiSegment)}),0,(function(){var o=n.nextChunkOffset,s=r.appSegments.some((function(e){return!r.file.available(e.offset||e.start,e.length||e.size)}));return je((function(){return Ne(e>o&&!s?n.readNextChunk(e):n.readNextChunk(o),(function(e){i=!e}))}),(function(){void 0===(e=r.findAppSegmentsInRange(e,n.byteLength))&&(t=!0)}))}))}}()}))}catch(e){return Promise.reject(e)}}},{key:"findAppSegmentsInRange",value:function(e,t){t-=2;for(var r,n,i,o,s,a,u=this.file,l=this.findAll,c=this.wanted,p=this.remaining,h=this.options;e<t;e++)if(255===u.getUint8(e))if(Ve(r=u.getUint8(e+1))){if(n=u.getUint16(e+2),(i=We(u,e,n))&&c.has(i)&&(s=(o=V.get(i)).findPosition(u,e),a=h[i],s.type=i,this.appSegments.push(s),!l&&(o.multiSegment&&a.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||p.delete(i)):p.delete(i),0===p.size)))break;h.recordUnknownSegments&&((s=Ie.findPosition(u,e)).marker=r,this.unknownSegments.push(s)),e+=n+1}else if(qe(r)){if(n=u.getUint16(e+2),218===r&&!1!==h.stopAfterSos)return;h.recordJpegSegments&&this.jpegSegments.push({offset:e,length:n,marker:r}),e+=n+1}return e}},{key:"mergeMultiSegments",value:function(){var e=this;if(this.appSegments.some((function(e){return e.multiSegment}))){var t=function(e,t){for(var r,n,i,o=O(),s=0;s<e.length;s++)n=(r=e[s]).type,o.has(n)?i=o.get(n):o.set(n,i=[]),i.push(r);return S(o)}(this.appSegments);this.mergedAppSegments=t.map((function(t){var r=t[0],n=t[1],i=V.get(r,e.options);return i.handleMultiSegments?{type:r,chunk:i.handleMultiSegments(n)}:n[0]}))}}},{key:"getSegment",value:function(e){return this.appSegments.find((function(t){return t.type===e}))}},{key:"getOrFindSegment",value:function(e){try{var t=this,r=t.getSegment(e);return je((function(){if(void 0===r)return Ne(t.findAppSegments(0,[e]),(function(){r=t.getSegment(e)}))}),(function(){return r}))}catch(e){return Promise.reject(e)}}}],[{key:"canHandle",value:function(e,t){return 65496===t}}]),r}();function Ye(){}function Ge(e,t){if(!t)return e&&e.then?e.then(Ye):Promise.resolve()}function Ke(e,t){var r=e();return r&&r.then?r.then(t):t(r)}a(Xe,"type","jpeg"),q.set("jpeg",Xe);var $e=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Je=function(e){u(r,e);var t=g(r);function r(){return i(this,r),t.apply(this,arguments)}return s(r,[{key:"parse",value:function(){try{var e=this;e.parseHeader();var t=e.options;return Ke((function(){if(t.ifd0.enabled)return Ge(e.parseIfd0Block())}),(function(){return Ke((function(){if(t.exif.enabled)return Ge(e.safeParse("parseExifBlock"))}),(function(){return Ke((function(){if(t.gps.enabled)return Ge(e.safeParse("parseGpsBlock"))}),(function(){return Ke((function(){if(t.interop.enabled)return Ge(e.safeParse("parseInteropBlock"))}),(function(){return Ke((function(){if(t.ifd1.enabled)return Ge(e.safeParse("parseThumbnailBlock"))}),(function(){return e.createOutput()}))}))}))}))}))}catch(e){return Promise.reject(e)}}},{key:"safeParse",value:function(e){var t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}},{key:"findIfd0Offset",value:function(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}},{key:"findIfd1Offset",value:function(){if(void 0===this.ifd1Offset){this.findIfd0Offset();var 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=O();return this[t]=r,this.parseTags(e,t,r),r}},{key:"parseIfd0Block",value:function(){try{var e=this;if(e.ifd0)return;var t=e.file;return e.findIfd0Offset(),e.ifd0Offset<8&&I("Malformed EXIF data"),!t.chunked&&e.ifd0Offset>t.byteLength&&I("IFD0 offset points to outside of file.\nthis.ifd0Offset: ".concat(e.ifd0Offset,", file.byteLength: ").concat(t.byteLength)),Ke((function(){if(t.tiff)return Ge(t.ensureChunk(e.ifd0Offset,N(e.options)))}),(function(){var t=e.parseBlock(e.ifd0Offset,"ifd0");if(0!==t.size)return e.exifOffset=t.get(34665),e.interopOffset=t.get(le),e.gpsOffset=t.get(34853),e.xmp=t.get(700),e.iptc=t.get(33723),e.icc=t.get(34675),e.options.sanitize&&(t.delete(34665),t.delete(le),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t}))}catch(e){return Promise.reject(e)}}},{key:"parseExifBlock",value:function(){try{var e=this;if(e.exif)return;return Ke((function(){if(!e.ifd0)return Ge(e.parseIfd0Block())}),(function(){if(void 0!==e.exifOffset)return Ke((function(){if(e.file.tiff)return Ge(e.file.ensureChunk(e.exifOffset,N(e.options)))}),(function(){var t=e.parseBlock(e.exifOffset,"exif");return e.interopOffset||(e.interopOffset=t.get(le)),e.makerNote=t.get(ae),e.userComment=t.get(ue),e.options.sanitize&&(t.delete(le),t.delete(ae),t.delete(ue)),e.unpack(t,41728),e.unpack(t,41729),t}))}))}catch(e){return Promise.reject(e)}}},{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 e=this;if(e.gps)return;return Ke((function(){if(!e.ifd0)return Ge(e.parseIfd0Block())}),(function(){if(void 0!==e.gpsOffset){var t=e.parseBlock(e.gpsOffset,"gps");return t&&t.has(2)&&t.has(4)&&(t.set("latitude",Qe.apply(void 0,t.get(2).concat([t.get(1)]))),t.set("longitude",Qe.apply(void 0,t.get(4).concat([t.get(3)])))),t}}))}catch(e){return Promise.reject(e)}}},{key:"parseInteropBlock",value:function(){try{var e=this;if(e.interop)return;return Ke((function(){if(!e.ifd0)return Ge(e.parseIfd0Block())}),(function(){return Ke((function(){if(void 0===e.interopOffset&&!e.exif)return Ge(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=arguments.length>0&&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(),t.ifd1Offset>0&&(t.parseBlock(t.ifd1Offset,"ifd1"),t.ifd1Parsed=!0),t.ifd1}catch(e){return Promise.reject(e)}}},{key:"extractThumbnail",value:function(){try{var e=this;return e.headerParsed||e.parseHeader(),Ke((function(){if(!e.ifd1Parsed)return Ge(e.parseThumbnailBlock(!0))}),(function(){if(void 0!==e.ifd1){var t=e.ifd1.get(513),r=e.ifd1.get(514);return e.chunk.getUint8Array(t,r)}}))}catch(e){return Promise.reject(e)}}},{key:"image",get:function(){return this.ifd0}},{key:"thumbnail",get:function(){return this.ifd1}},{key:"createOutput",value:function(){var e,t,r,n={},i=de;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=S(i));for(var o=0;o<i.length;o++)if(!B(e=this[t=i[o]]))if(r=this.canTranslate?this.translateBlock(e,t):w(e),this.options.mergeOutput){if("ifd1"===t)continue;b(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)b(e,t);else{var r=y(t);Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=S(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:"canHandle",value:function(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}}]),r}(function(e){u(r,Ie);var t=g(r);function r(){return i(this,r),t.apply(this,arguments)}return s(r,[{key:"parseHeader",value:function(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}},{key:"parseTags",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O(),n=this.options[t],i=n.pick,o=n.skip,s=(i=C(i)).size>0,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,o=i.getUint16(e+2),s=i.getUint32(e+4),a=$e[o];if(a*s<=4?e+=8:e=i.getUint32(e+8),(o<1||o>13)&&I("Invalid TIFF value type. block: ".concat(r.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(o,", offset ").concat(e)),e>i.byteLength&&I("Invalid TIFF value offset. block: ".concat(r.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(o,", offset ").concat(e," is outside of chunk size ").concat(i.byteLength)),1===o)return i.getUint8Array(e,s);if(2===o)return""===(n=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(n=i.getString(e,s)).trim())?void 0:n;if(7===o)return i.getUint8Array(e,s);if(1===s)return this.parseTagValue(o,e);for(var u=new(function(e){switch(o){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}}())(s),l=a,c=0;c<s;c++)u[c]=this.parseTagValue(o,e),e+=l;return u}},{key:"parseTagValue",value:function(e,t){var r=this.chunk;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:I("Invalid tiff type ".concat(e))}}}]),r}());function Qe(e,t,r,n){var i=e+t/60+r/3600;return"S"!==n&&"W"!==n||(i*=-1),i}a(Je,"type","tiff"),a(Je,"headerLength",10),V.set("tiff",Je);var Ze=Object.freeze({__proto__:null,default:Te,Exifr:xe,fileParsers:q,segmentParsers:V,fileReaders:W,tagKeys:ie,tagValues:oe,tagRevivers:se,createDictionary:re,extendDictionary:ne,fetchUrlAsArrayBuffer:K,readBlobAsArrayBuffer:G,chunkedProps:ce,otherSegments:pe,segments:he,tiffBlocks:de,segmentsAndBlocks:fe,tiffExtractables:ge,inheritables:me,allFormatters:ve,Options:_e,parse:Ue});function et(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function tt(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}var rt=tt((function(e){var t=new xe(ut);return et(t.read(e),(function(){return et(t.parse(),(function(e){if(e&&e.ifd0)return e.ifd0[274]}))}))})),nt=tt((function(e){var t=new xe(at);return et(t.read(e),(function(){return et(t.parse(),(function(e){if(e&&e.gps){var t=e.gps;return{latitude:t.latitude,longitude:t.longitude}}}))}))})),it=tt((function(e){return et(this.thumbnail(e),(function(e){if(void 0!==e){var t=new Blob([e]);return URL.createObjectURL(t)}}))})),ot=tt((function(e){var t=new xe(lt);return et(t.read(e),(function(){return et(t.extractThumbnail(),(function(e){return e&&T?U.from(e):e}))}))})),st={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},at=b({},st,{firstChunkSize:4e4,gps:[1,2,3,4]}),ut=b({},st,{firstChunkSize:4e4,ifd0:[274]}),lt=b({},st,{tiff:!1,ifd1:!0,mergeOutput:!1}),ct=Object.freeze({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}});if(n.rotateCanvas=!0,n.rotateCss=!0,"object"==typeof navigator){var pt=navigator.userAgent;if(pt.includes("iPad")||pt.includes("iPhone")){var ht=pt.match(/OS (\d+)_(\d+)/);if(ht){var dt=ht[1],ft=ht[2],gt=Number(dt)+.1*Number(ft);n.rotateCanvas=gt<13.4,n.rotateCss=!1}}else if(pt.includes("OS X 10")){var mt=pt.match(/OS X 10[_.](\d+)/)[1];n.rotateCanvas=n.rotateCss=Number(mt)<15}if(pt.includes("Chrome/")){var vt=pt.match(/Chrome\/(\d+)/)[1];n.rotateCanvas=n.rotateCss=Number(vt)<81}else if(pt.includes("Firefox/")){var yt=pt.match(/Firefox\/(\d+)/)[1];n.rotateCanvas=n.rotateCss=Number(yt)<77}}function bt(){}var wt=function(e){u(r,L);var t=g(r);function r(){var e;i(this,r);for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return a(f(e=t.call.apply(t,[this].concat(o))),"ranges",new St),0!==e.byteLength&&e.ranges.add(0,e.byteLength),e}return s(r,[{key:"_tryExtend",value:function(e,t,r){if(0===e&&0===this.byteLength&&r){var n=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(n)}else{var i=e+t;if(i>this.byteLength){var o=this._extend(i).dataView;this._swapDataView(o)}}}},{key:"_extend",value:function(e){var t;t=T?U.allocUnsafe(e):new Uint8Array(e);var 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 n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),m(l(r.prototype),"subarray",this).call(this,e,t)}},{key:"set",value:function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&this._tryExtend(t,e.byteLength,e);var n=m(l(r.prototype),"set",this).call(this,e,t);return this.ranges.add(t,n.byteLength),n}},{key:"ensureChunk",value:function(e,t){try{var r=this;if(!r.chunked)return;if(r.ranges.available(e,t))return;return function(e,t){return e&&e.then?e.then(bt):Promise.resolve()}(r.readChunk(e,t))}catch(e){return Promise.reject(e)}}},{key:"available",value:function(e,t){return this.ranges.available(e,t)}}]),r}(),St=function(){function e(){i(this,e),a(this,"list",[])}return s(e,[{key:"length",get:function(){return this.list.length}},{key:"add",value:function(e,t){var r=e+t,n=this.list.filter((function(t){return _t(e,t.offset,r)||_t(e,t.end,r)}));if(n.length>0){e=Math.min.apply(Math,[e].concat(n.map((function(e){return e.offset})))),t=(r=Math.max.apply(Math,[r].concat(n.map((function(e){return e.end})))))-e;var i=n.shift();i.offset=e,i.length=t,i.end=r,this.list=this.list.filter((function(e){return!n.includes(e)}))}else this.list.push({offset:e,length:t,end:r})}},{key:"available",value:function(e,t){var r=e+t;return this.list.some((function(t){return t.offset<=e&&r<=t.end}))}}]),e}();function _t(e,t,r){return e<=t&&t<=r}function Pt(){}function kt(e,t){if(!t)return e&&e.then?e.then(Pt):Promise.resolve()}function Ct(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var Ot=function(e){u(r,e);var t=g(r);function r(){return i(this,r),t.apply(this,arguments)}return s(r,[{key:"readWhole",value:function(){try{var e=this;return e.chunked=!1,Ct(G(e.input),(function(t){e._swapArrayBuffer(t)}))}catch(e){return Promise.reject(e)}}},{key:"readChunked",value:function(){return this.chunked=!0,this.size=this.input.size,m(l(r.prototype),"readChunked",this).call(this)}},{key:"_readChunk",value:function(e,t){try{var r=this,n=t?e+t:void 0,i=r.input.slice(e,n);return Ct(G(i),(function(t){return r.set(t,e,!0)}))}catch(e){return Promise.reject(e)}}}]),r}(function(e){u(r,wt);var t=g(r);function r(e,n){var o;return i(this,r),a(f(o=t.call(this,0)),"chunksRead",0),o.input=e,o.options=n,o}return s(r,[{key:"readWhole",value:function(){try{var e=this;return e.chunked=!1,kt(e.readChunk(e.nextChunkOffset))}catch(e){return Promise.reject(e)}}},{key:"readChunked",value:function(){try{var e=this;return e.chunked=!0,kt(e.readChunk(0,e.options.firstChunkSize))}catch(e){return Promise.reject(e)}}},{key:"readNextChunk",value:function(e){try{var t=this;if(void 0===e&&(e=t.nextChunkOffset),t.fullyRead)return t.chunksRead++,!1;var r=t.options.chunkSize;return n=t.readChunk(e,r),i=function(e){return!!e&&e.byteLength===r},n&&n.then||(n=Promise.resolve(n)),i?n.then(i):n}catch(e){return Promise.reject(e)}var n,i}},{key:"readChunk",value:function(e,t){try{var r=this;if(r.chunksRead++,0===(t=r.safeWrapAddress(e,t)))return;return r._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:"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}},{key:"read",value:function(){return this.options.chunked?this.readChunked():this.readWhole()}},{key:"close",value:function(){}}]),r}());W.set("blob",Ot),n.Exifr=xe,n.Options=_e,n.allFormatters=ve,n.chunkedProps=ce,n.createDictionary=re,n.default=Ze,n.disableAllOptions=st,n.extendDictionary=ne,n.fetchUrlAsArrayBuffer=K,n.fileParsers=q,n.fileReaders=W,n.gps=nt,n.gpsOnlyOptions=at,n.inheritables=me,n.orientation=rt,n.orientationOnlyOptions=ut,n.otherSegments=pe,n.parse=Ue,n.readBlobAsArrayBuffer=G,n.rotation=function(e){return et(rt(e),(function(e){return b({canvas:n.rotateCanvas,css:n.rotateCss},ct[e])}))},n.rotations=ct,n.segmentParsers=V,n.segments=he,n.segmentsAndBlocks=fe,n.tagKeys=ie,n.tagRevivers=se,n.tagValues=oe,n.thumbnail=ot,n.thumbnailOnlyOptions=lt,n.thumbnailUrl=it,n.tiffBlocks=de,n.tiffExtractables=ge,Object.defineProperty(n,"__esModule",{value:!0})},"object"==typeof ci.exports?i(ci.exports):i((n="undefined"!=typeof globalThis?globalThis:n||self).exifr={})}).call(this)}).call(this,e,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s({}).Buffer),ci=ci.exports;var di=(ui=ai=function(e){var t,r;function n(t,r){var n;if((n=e.call(this,t,r)||this).onFileAdded=function(e){!e.preview&&e.data&&Dt(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&&$n(e.preview)&&URL.revokeObjectURL(e.preview)},n.onRestored=function(){n.uppy.getFiles().filter((function(e){return e.isRestored})).forEach((function(e){e.preview&&!$n(e.preview)||n.addToQueue(e.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")})}));var t=function(){e.forEach((function(e){var t=n.uppy.getFile(e);n.uppy.emit("preprocess-complete",t)}))};return new Promise((function(e,r){n.queueProcessing?n.uppy.once("thumbnail:all-generated",(function(){t(),e()})):(t(),e())}))},n.type="modifier",n.id=n.opts.id||"ThumbnailGenerator",n.title="Thumbnail Generator",n.queue=[],n.queueProcessing=!1,n.defaultThumbnailDimension=200,n.thumbnailType=n.opts.thumbnailType||"image/jpeg",n.defaultLocale={strings:{generatingThumbnails:"Generating thumbnails..."}},n.opts=pi({},{thumbnailWidth:null,thumbnailHeight:null,waitForThumbnailsBeforeUpload:!1,lazy:!1},r),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}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,hi(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},i.createThumbnail=function(e,t,r){var n=this,i=URL.createObjectURL(e.data),o=new Promise((function(e,t){var r=new Image;r.src=i,r.addEventListener("load",(function(){URL.revokeObjectURL(i),e(r)})),r.addEventListener("error",(function(e){URL.revokeObjectURL(i),t(e.error||new Error("Could not create thumbnail"))}))})),s=ci.rotation(e.data).catch((function(e){return 1}));return Promise.all([o,s]).then((function(e){var i=e[0],o=e[1],s=n.getProportionalDimensions(i,t,r,o.deg),a=n.rotateImage(i,o),u=n.resizeImage(a,s.width,s.height);return n.canvasToBlob(u,n.thumbnailType,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=e.width/e.height,r=Math.floor(Math.sqrt(5e6*t)),n=Math.floor(5e6/Math.sqrt(5e6*t));if(r>4096&&(r=4096,n=Math.round(r/t)),n>4096&&(n=4096,r=Math.round(t*n)),e.width>r){var i=document.createElement("canvas");i.width=r,i.height=n,i.getContext("2d").drawImage(e,0,0,r,n),e=i}return e},i.resizeImage=function(e,t,r){e=this.protect(e);var n=Math.ceil(Jn(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(e,t,r){try{e.getContext("2d").getImageData(0,0,1,1)}catch(th){if(18===th.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise((function(n){e.toBlob(n,t,r)})).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 Kn(e.toDataURL(t,r),{})})).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,this.queue.length>0){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(e){var t=this;return Dt(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then((function(r){t.setPreviewURL(e.id,r),t.uppy.log("[ThumbnailGenerator] Generated thumbnail for "+e.id),t.uppy.emit("thumbnail:generated",t.uppy.getFile(e.id),r)})).catch((function(r){t.uppy.log("[ThumbnailGenerator] Failed thumbnail for "+e.id+":","warning"),t.uppy.log(r,"warning"),t.uppy.emit("thumbnail:error",t.uppy.getFile(e.id),r)})):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}(le.Plugin),ai.VERSION="1.7.10",ui),fi=function(e){if("string"==typeof e){var t=[].slice.call(document.querySelectorAll(e));return t.length>0?t:null}if("object"==typeof e&&se(e))return[e]},gi=function(e){return Array.prototype.slice.call(e||[],0)},mi=function(e,t){var r=[],n=[];return gi(e.items).forEach((function(e){var i=e.webkitGetAsEntry();i&&n.push(function e(n){return new Promise((function(i){if(n.isFile)n.file((function(e){var t;e.relativePath=(t=n).fullPath&&t.fullPath!=="/"+t.name?t.fullPath:null,r.push(e),i()}),(function(e){t(e),i()}));else if(n.isDirectory){!function e(t,r,n,i){var o=i.onSuccess;t.readEntries((function(i){var s=[].concat(r,i);i.length?setTimeout((function(){e(t,s,n,{onSuccess:o})}),0):o(s)}),(function(e){n(e),o(r)}))}(n.createReader(),[],t,{onSuccess:function(t){var r=t.map((function(t){return e(t)}));Promise.all(r).then((function(){return i()}))}})}}))}(i))})),Promise.all(n).then((function(){return r}))},vi=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]?mi(e,n):function(e){var t=gi(e.files);return Promise.resolve(t)}(e)},yi=function(e,t){if(t){var r=e.querySelector('[data-uppy-paneltype="'+t+'"]');if(r)return r}return e},bi=['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 wi(e,t){var r=t[0];r&&(r.focus(),e.preventDefault())}function Si(e,t,r){var n=yi(r,t),i=gi(n.querySelectorAll(bi)),o=i.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(n)?wi(e,i):e.shiftKey&&0===o?function(e,t){var r=t[t.length-1];r&&(r.focus(),e.preventDefault())}(e,i):e.shiftKey||o!==i.length-1||wi(e,i)}var _i=function(e,t,r){Si(e,t,r)},Pi=function(e,t,r){null===t||Si(e,t,r)},ki={exports:{}};(function(e){(function(){!function(e,t){"object"==typeof ki.exports?ki.exports=t():e.ResizeObserver=t()}(this,(function(){"use strict";var t=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var r=-1;return e.some((function(e,n){return e[0]===t&&(r=n,!0)})),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=e(this.__entries__,t),n=this.__entries__[r];return n&&n[1]},t.prototype.set=function(t,r){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=r:this.__entries__.push([t,r])},t.prototype.delete=function(t){var r=this.__entries__,n=e(r,t);~n&&r.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.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])}},t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,n=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),i="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(n):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},o=["top","right","bottom","left","width","height","size","weight"],s="undefined"!=typeof MutationObserver,a=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var r=!1,n=!1,o=0;function s(){r&&(r=!1,e()),n&&u()}function a(){i(s)}function u(){var e=Date.now();if(r){if(e-o<2)return;n=!0}else r=!0,n=!1,setTimeout(a,20);o=e}return u}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(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)},e.prototype.disconnect_=function(){r&&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)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;o.some((function(e){return!!~r.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),u=function(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},l=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||n},c=g(0,0,0,0);function p(e){return parseFloat(e)||0}function h(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(t,r){return t+p(e["border-"+r+"-width"])}),0)}var d="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof l(e).SVGGraphicsElement}:function(e){return e instanceof l(e).SVGElement&&"function"==typeof e.getBBox};function f(e){return r?d(e)?function(e){var t=e.getBBox();return g(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return c;var n=l(e).getComputedStyle(e),i=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]=p(o)}return t}(n),o=i.left+i.right,s=i.top+i.bottom,a=p(n.width),u=p(n.height);if("border-box"===n.boxSizing&&(Math.round(a+o)!==t&&(a-=h(n,"left","right")+o),Math.round(u+s)!==r&&(u-=h(n,"top","bottom")+s)),!function(e){return e===l(e).document.documentElement}(e)){var d=Math.round(a+o)-t,f=Math.round(u+s)-r;1!==Math.abs(d)&&(a-=d),1!==Math.abs(f)&&(u-=f)}return g(i.left,i.top,a,u)}(e):c}function g(e,t,r,n){return{x:e,y:t,width:r,height:n}}var m=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=g(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=f(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),v=function(e,t){var r,n,i,o,s,a,l,c=(n=(r=t).x,i=r.y,o=r.width,s=r.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(a.prototype),u(l,{x:n,y:i,width:o,height:s,top:i,right:n+o,bottom:s+i,left:n}),l);u(this,{target:e,contentRect:c})},y=function(){function e(e,r,n){if(this.activeObservations_=[],this.observations_=new t,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=r,this.callbackCtx_=n}return e.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 l(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new m(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.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 l(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))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new v(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),b="undefined"!=typeof WeakMap?new WeakMap:new t,w=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=a.getInstance(),n=new y(t,r,this);b.set(this,n)};return["observe","unobserve","disconnect"].forEach((function(e){w.prototype[e]=function(){var t;return(t=b.get(this))[e].apply(t,arguments)}})),void 0!==n.ResizeObserver?n.ResizeObserver:w}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),ki=ki.exports;var Ci={};(function(e){(function(){var t=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt,s="object"==typeof e&&e&&e.Object===Object&&e,a="object"==typeof self&&self&&self.Object===Object&&self,u=s||a||Function("return this")(),l=Object.prototype.toString,c=Math.max,p=Math.min,h=function(){return u.Date.now()};function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(d(e)){var s="function"==typeof e.valueOf?e.valueOf():e;e=d(s)?s+"":s}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var a=n.test(e);return a||i.test(e)?o(e.slice(2),a?2:8):r.test(e)?NaN:+e}Ci=function(e,t,r){var n,i,o,s,a,u,l=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var r=n,o=i;return n=i=void 0,l=t,s=e.apply(o,r)}function b(e){var r=e-u;return void 0===u||r>=t||r<0||m&&e-l>=o}function w(){var e=h();if(b(e))return S(e);a=setTimeout(w,function(e){var r=t-(e-u);return m?p(r,o-(e-l)):r}(e))}function S(e){return a=void 0,v&&n?y(e):(n=i=void 0,s)}function _(){var e=h(),r=b(e);if(n=arguments,i=this,u=e,r){if(void 0===a)return function(e){return l=e,a=setTimeout(w,t),g?y(e):s}(u);if(m)return a=setTimeout(w,t),y(u)}return void 0===a&&(a=setTimeout(w,t)),s}return t=f(t)||0,d(r)&&(g=!!r.leading,o=(m="maxWait"in r)?c(f(r.maxWait)||0,t):o,v="trailing"in r?!!r.trailing:v),_.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=u=i=a=void 0},_.flush=function(){return void 0===a?s:S(h())},_}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});function Oi(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 Ei,Ai,Fi=function(e,t){var r;void 0===t&&(t=Oi);var n,i=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&r===this&&t(s,i)||(n=e.apply(this,s),o=!0,r=this,i=s),n}};function Ri(){return(Ri=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 xi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ui(e,t){return(Ui=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ti=oe.h,Di=le.Plugin,Bi=ki.default||ki,Ii=Fi.default||Fi;function Ni(){var e={};return e.promise=new Promise((function(t,r){e.resolve=t,e.reject=r})),e}function Mi(){return Ti("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},Ti("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 ji,Li,zi=(Ai=Ei=function(e){var t,r;function n(t,r){var n;(n=e.call(this,t,r)||this).setOptions=function(t){e.prototype.setOptions.call(xi(n),t),n.i18nInit()},n.i18nInit=function(){n.translator=new C([n.defaultLocale,n.uppy.locale,n.opts.locale]),n.i18n=n.translator.translate.bind(n.translator),n.i18nArray=n.translator.translateArray.bind(n.translator),n.setPluginState()},n.removeTarget=function(e){var t=n.getPluginState().targets.filter((function(t){return t.id!==e.id}));n.setPluginState({targets:t})},n.addTarget=function(e){var t=e.id||e.constructor.name,r=e.title||t,i=e.type;if("acquirer"===i||"progressindicator"===i||"editor"===i){var o={id:t,name:r,type:i},s=n.getPluginState().targets.slice();return s.push(o),n.setPluginState({targets:s}),n.el}n.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error")},n.hideAllPanels=function(){var e={activePickerPanel:!1,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1},t=n.getPluginState();t.activePickerPanel===e.activePickerPanel&&t.showAddFilesPanel===e.showAddFilesPanel&&t.showFileEditor===e.showFileEditor&&t.activeOverlayType===e.activeOverlayType||n.setPluginState(e)},n.showPanel=function(e){var t=n.getPluginState().targets.filter((function(t){return"acquirer"===t.type&&t.id===e}))[0];n.setPluginState({activePickerPanel:t,activeOverlayType:"PickerPanel"})},n.canEditFile=function(e){var t=n.getPluginState().targets;return n._getEditors(t).some((function(t){return n.uppy.getPlugin(t.id).canEditFile(e)}))},n.openFileEditor=function(e){var t=n.getPluginState().targets,r=n._getEditors(t);n.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),r.forEach((function(t){n.uppy.getPlugin(t.id).selectFile(e)}))},n.openModal=function(){var e=Ni(),t=e.promise,r=e.resolve;return n.savedScrollPosition=window.pageYOffset,n.savedActiveElement=document.activeElement,n.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),n.opts.animateOpenClose&&n.getPluginState().isClosing?n.el.addEventListener("animationend",(function e(){n.setPluginState({isHidden:!1}),n.el.removeEventListener("animationend",e,!1),r()}),!1):(n.setPluginState({isHidden:!1}),r()),n.opts.browserBackButtonClose&&n.updateBrowserHistory(),document.addEventListener("keydown",n.handleKeyDownInModal),n.uppy.emit("dashboard:modal-open"),t},n.closeModal=function(e){void 0===e&&(e={});var t=e.manualClose,r=void 0===t||t,i=n.getPluginState(),o=i.isHidden,s=i.isClosing;if(!o&&!s){var a=Ni(),u=a.promise,l=a.resolve;return n.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),n.opts.animateOpenClose?(n.setPluginState({isClosing:!0}),n.el.addEventListener("animationend",(function e(){n.setPluginState({isHidden:!0,isClosing:!1}),n.superFocus.cancel(),n.savedActiveElement.focus(),n.el.removeEventListener("animationend",e,!1),l()}),!1)):(n.setPluginState({isHidden:!0}),n.superFocus.cancel(),n.savedActiveElement.focus(),l()),document.removeEventListener("keydown",n.handleKeyDownInModal),r&&n.opts.browserBackButtonClose&&history.state&&history.state[n.modalName]&&history.go(-1),n.uppy.emit("dashboard:modal-closed"),u}},n.isModalOpen=function(){return!n.getPluginState().isHidden||!1},n.requestCloseModal=function(){return n.opts.onRequestCloseModal?n.opts.onRequestCloseModal():n.closeModal()},n.setDarkModeCapability=function(e){var t=n.uppy.getState().capabilities;n.uppy.setState({capabilities:Ri({},t,{darkMode:e})})},n.handleSystemDarkModeChange=function(e){var t=e.matches;n.uppy.log("[Dashboard] Dark mode is "+(t?"on":"off")),n.setDarkModeCapability(t)},n.toggleFileCard=function(e,t){var r=n.uppy.getFile(t);e?n.uppy.emit("dashboard:file-edit-start",r):n.uppy.emit("dashboard:file-edit-complete",r),n.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})},n.toggleAddFilesPanel=function(e){n.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})},n.addFiles=function(e){var t=e.map((function(e){return{source:n.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}}));try{n.uppy.addFiles(t)}catch(th){n.uppy.log(th)}},n.startListeningToResize=function(){n.resizeObserver=new Bi((function(e,t){var r=e[0].contentRect,i=r.width,o=r.height;n.uppy.log("[Dashboard] resized: "+i+" / "+o,"debug"),n.setPluginState({containerWidth:i,containerHeight:o,areInsidesReadyToBeVisible:!0})})),n.resizeObserver.observe(n.el.querySelector(".uppy-Dashboard-inner")),n.makeDashboardInsidesVisibleAnywayTimeout=setTimeout((function(){var e=n.getPluginState(),t=!n.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(n.uppy.log("[Dashboard] resize event didn't fire on time: defaulted to mobile layout","debug"),n.setPluginState({areInsidesReadyToBeVisible:!0}))}),1e3)},n.stopListeningToResize=function(){n.resizeObserver.disconnect(),clearTimeout(n.makeDashboardInsidesVisibleAnywayTimeout)},n.recordIfFocusedOnUppyRecently=function(e){n.el.contains(e.target)?n.ifFocusedOnUppyRecently=!0:(n.ifFocusedOnUppyRecently=!1,n.superFocus.cancel())},n.disableAllFocusableElements=function(e){var t=gi(n.el.querySelectorAll(bi));e?t.forEach((function(e){var t=e.getAttribute("tabindex");t&&(e.dataset.inertTabindex=t),e.setAttribute("tabindex","-1")})):t.forEach((function(e){"inertTabindex"in e.dataset?e.setAttribute("tabindex",e.dataset.inertTabindex):e.removeAttribute("tabindex")})),n.dashboardIsDisabled=e},n.updateBrowserHistory=function(){var e;history.state&&history.state[n.modalName]||history.pushState(Ri({},history.state,((e={})[n.modalName]=!0,e)),""),window.addEventListener("popstate",n.handlePopState,!1)},n.handlePopState=function(e){!n.isModalOpen()||e.state&&e.state[n.modalName]||n.closeModal({manualClose:!1}),!n.isModalOpen()&&e.state&&e.state[n.modalName]&&history.go(-1)},n.handleKeyDownInModal=function(e){27===e.keyCode&&n.requestCloseModal(e),9===e.keyCode&&_i(e,n.getPluginState().activeOverlayType,n.el)},n.handleClickOutside=function(){n.opts.closeModalOnClickOutside&&n.requestCloseModal()},n.handlePaste=function(e){n.uppy.iteratePlugins((function(t){"acquirer"===t.type&&t.handleRootPaste&&t.handleRootPaste(e)}));var t=gi(e.clipboardData.files);n.addFiles(t)},n.handleInputChange=function(e){e.preventDefault();var t=gi(e.target.files);n.addFiles(t)},n.handleDragOver=function(e){e.preventDefault(),e.stopPropagation(),n.opts.disabled||n.opts.disableLocalFiles||(e.dataTransfer.dropEffect="copy",clearTimeout(n.removeDragOverClassTimeout),n.setPluginState({isDraggingOver:!0}))},n.handleDragLeave=function(e){e.preventDefault(),e.stopPropagation(),n.opts.disabled||n.opts.disableLocalFiles||(clearTimeout(n.removeDragOverClassTimeout),n.removeDragOverClassTimeout=setTimeout((function(){n.setPluginState({isDraggingOver:!1})}),50))},n.handleDrop=function(e,t){if(e.preventDefault(),e.stopPropagation(),!n.opts.disabled&&!n.opts.disableLocalFiles){clearTimeout(n.removeDragOverClassTimeout),n.setPluginState({isDraggingOver:!1}),n.uppy.iteratePlugins((function(t){"acquirer"===t.type&&t.handleRootDrop&&t.handleRootDrop(e)}));var r=!1;vi(e.dataTransfer,{logDropError:function(e){n.uppy.log(e,"error"),r||(n.uppy.info(e.message,"error"),r=!0)}}).then((function(e){e.length>0&&(n.uppy.log("[Dashboard] Files were dropped"),n.addFiles(e))}))}},n.handleRequestThumbnail=function(e){n.opts.waitForThumbnailsBeforeUpload||n.uppy.emit("thumbnail:request",e)},n.handleCancelThumbnail=function(e){n.opts.waitForThumbnailsBeforeUpload||n.uppy.emit("thumbnail:cancel",e)},n.handleKeyDownInInline=function(e){9===e.keyCode&&Pi(e,n.getPluginState().activeOverlayType,n.el)},n.handlePasteOnBody=function(e){n.el.contains(document.activeElement)&&n.handlePaste(e)},n.handleComplete=function(e){var t=e.failed;n.opts.closeAfterFinish&&0===t.length&&n.requestCloseModal()},n.handleCancelRestore=function(){n.uppy.emit("restore-canceled")},n._openFileEditorWhenFilesAdded=function(e){var t=e[0];n.canEditFile(t)&&n.openFileEditor(t)},n.initEvents=function(){if(n.opts.trigger&&!n.opts.inline){var e=fi(n.opts.trigger);e?e.forEach((function(e){return e.addEventListener("click",n.openModal)})):n.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")}n.startListeningToResize(),document.addEventListener("paste",n.handlePasteOnBody),n.uppy.on("plugin-remove",n.removeTarget),n.uppy.on("file-added",n.hideAllPanels),n.uppy.on("dashboard:modal-closed",n.hideAllPanels),n.uppy.on("file-editor:complete",n.hideAllPanels),n.uppy.on("complete",n.handleComplete),document.addEventListener("focus",n.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",n.recordIfFocusedOnUppyRecently,!0),n.opts.inline&&n.el.addEventListener("keydown",n.handleKeyDownInInline),n.opts.autoOpenFileEditor&&n.uppy.on("files-added",n._openFileEditorWhenFilesAdded)},n.removeEvents=function(){var e=fi(n.opts.trigger);!n.opts.inline&&e&&e.forEach((function(e){return e.removeEventListener("click",n.openModal)})),n.stopListeningToResize(),document.removeEventListener("paste",n.handlePasteOnBody),window.removeEventListener("popstate",n.handlePopState,!1),n.uppy.off("plugin-remove",n.removeTarget),n.uppy.off("file-added",n.hideAllPanels),n.uppy.off("dashboard:modal-closed",n.hideAllPanels),n.uppy.off("file-editor:complete",n.hideAllPanels),n.uppy.off("complete",n.handleComplete),document.removeEventListener("focus",n.recordIfFocusedOnUppyRecently),document.removeEventListener("click",n.recordIfFocusedOnUppyRecently),n.opts.inline&&n.el.removeEventListener("keydown",n.handleKeyDownInInline),n.opts.autoOpenFileEditor&&n.uppy.off("files-added",n._openFileEditorWhenFilesAdded)},n.superFocusOnEachUpdate=function(){var e=n.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,r=n.uppy.getState().info.isHidden,i=!n.opts.inline;r&&(i||e||t&&n.ifFocusedOnUppyRecently)?n.superFocus(n.el,n.getPluginState().activeOverlayType):n.superFocus.cancel()},n.afterUpdate=function(){!n.opts.disabled||n.dashboardIsDisabled?(!n.opts.disabled&&n.dashboardIsDisabled&&n.disableAllFocusableElements(!1),n.superFocusOnEachUpdate()):n.disableAllFocusableElements(!0)},n.cancelUpload=function(e){n.uppy.removeFile(e)},n.saveFileCard=function(e,t){n.uppy.setFileMeta(t,e),n.toggleFileCard(!1,t)},n._attachRenderFunctionToTarget=function(e){var t=n.uppy.getPlugin(e.id);return Ri({},e,{icon:t.icon||n.opts.defaultPickerIcon,render:t.render})},n._isTargetSupported=function(e){var t=n.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()},n._getAcquirers=Ii((function(e){return e.filter((function(e){return"acquirer"===e.type&&n._isTargetSupported(e)})).map(n._attachRenderFunctionToTarget)})),n._getProgressIndicators=Ii((function(e){return e.filter((function(e){return"progressindicator"===e.type})).map(n._attachRenderFunctionToTarget)})),n._getEditors=Ii((function(e){return e.filter((function(e){return"editor"===e.type})).map(n._attachRenderFunctionToTarget)})),n.render=function(e){var t,r=n.getPluginState(),i=e.files,o=e.capabilities,s=e.allowNewUpload,a=Object.keys(i).filter((function(e){return!i[e].progress.uploadStarted})),u=Object.keys(i).filter((function(e){return i[e].progress.uploadStarted})),l=Object.keys(i).filter((function(e){return i[e].isPaused})),c=Object.keys(i).filter((function(e){return i[e].progress.uploadComplete})),p=Object.keys(i).filter((function(e){return i[e].error})),h=Object.keys(i).filter((function(e){return!i[e].progress.uploadComplete&&i[e].progress.uploadStarted})),d=h.filter((function(e){return!i[e].isPaused})),f=Object.keys(i).filter((function(e){return i[e].progress.preprocess||i[e].progress.postprocess})),g=u.length>0,m=100===e.totalProgress&&c.length===Object.keys(i).length&&0===f.length,v=g&&p.length===u.length,y=0!==h.length&&l.length===h.length,b=n._getAcquirers(r.targets),w=n._getProgressIndicators(r.targets),S=n._getEditors(r.targets);return t="auto"===n.opts.theme?o.darkMode?"dark":"light":n.opts.theme,["files","folders","both"].indexOf(n.opts.fileManagerSelectionType)<0&&(n.opts.fileManagerSelectionType="files",console.error('Unsupported option for "fileManagerSelectionType". Using default of "'+n.opts.fileManagerSelectionType+'".')),function(e){var t=0===e.totalFileCount,r=e.containerWidth>576,n=it({"uppy-Root":e.isTargetDOMEl}),i=it({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>400,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible}),o=1;e.containerWidth>900?o=5:e.containerWidth>700?o=4:e.containerWidth>576&&(o=3);var s=e.showSelectedFiles&&!t,a=e.recoveredState?Object.keys(e.recoveredState.files).length:null,u=e.files?Object.keys(e.files).filter((function(t){return e.files[t].isGhost})).length:null,l=hn("div",{className:i,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&cn(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop},hn("div",{className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),hn("div",{className:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:!e.inline&&"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},e.inline?null:hn("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal},hn("span",{"aria-hidden":"true"},"\xd7")),hn("div",{className:"uppy-Dashboard-innerWrap"},hn("div",{className:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),s&&hn(Zr,e),a&&hn("div",{className:"uppy-Dashboard-serviceMsg"},hn("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},hn("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},hn("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),hn("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),hn("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),hn("strong",{className:"uppy-Dashboard-serviceMsg-title"},e.i18n("sessionRestored")),hn("div",{class:"uppy-Dashboard-serviceMsg-text"},u>0?e.i18n("recoveredXFiles",{smart_count:u}):e.i18n("recoveredAllFiles"))),s?hn(Tr,pn({},e,{itemsPerRow:o})):hn(Ir,pn({},e,{isSizeMD:r})),hn(ln,null,e.showAddFilesPanel?hn(Mr,pn({key:"AddFiles"},e,{isSizeMD:r})):null),hn(ln,null,e.fileCardFor?hn(nn,pn({key:"FileCard"},e)):null),hn(ln,null,e.activePickerPanel?hn(zr,pn({key:"Picker"},e)):null),hn(ln,null,e.showFileEditor?hn(qr,pn({key:"Editor"},e)):null),hn("div",{className:"uppy-Dashboard-progressindicators"},e.progressindicators.map((function(t){return e.getPlugin(t.id).render(e.state)}))))));return hn("div",{className:n,dir:e.direction},l)}({state:e,isHidden:r.isHidden,files:i,newFiles:a,uploadStartedFiles:u,completeFiles:c,erroredFiles:p,inProgressFiles:h,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:g,isAllComplete:m,isAllErrored:v,isAllPaused:y,totalFileCount:Object.keys(i).length,totalProgress:e.totalProgress,allowNewUpload:s,acquirers:b,theme:t,disabled:n.opts.disabled,disableLocalFiles:n.opts.disableLocalFiles,direction:n.opts.direction,activePickerPanel:r.activePickerPanel,showFileEditor:r.showFileEditor,disableAllFocusableElements:n.disableAllFocusableElements,animateOpenClose:n.opts.animateOpenClose,isClosing:r.isClosing,getPlugin:n.uppy.getPlugin,progressindicators:w,editors:S,autoProceed:n.uppy.opts.autoProceed,id:n.id,closeModal:n.requestCloseModal,handleClickOutside:n.handleClickOutside,handleInputChange:n.handleInputChange,handlePaste:n.handlePaste,inline:n.opts.inline,showPanel:n.showPanel,hideAllPanels:n.hideAllPanels,log:n.uppy.log,i18n:n.i18n,i18nArray:n.i18nArray,removeFile:n.uppy.removeFile,uppy:n.uppy,info:n.uppy.info,note:n.opts.note,recoveredState:e.recoveredState,metaFields:r.metaFields,resumableUploads:o.resumableUploads||!1,individualCancellation:o.individualCancellation,isMobileDevice:o.isMobileDevice,pauseUpload:n.uppy.pauseResume,retryUpload:n.uppy.retryUpload,cancelUpload:n.cancelUpload,cancelAll:n.uppy.cancelAll,fileCardFor:r.fileCardFor,toggleFileCard:n.toggleFileCard,toggleAddFilesPanel:n.toggleAddFilesPanel,showAddFilesPanel:r.showAddFilesPanel,saveFileCard:n.saveFileCard,openFileEditor:n.openFileEditor,canEditFile:n.canEditFile,width:n.opts.width,height:n.opts.height,showLinkToFileUploadResult:n.opts.showLinkToFileUploadResult,fileManagerSelectionType:n.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:n.opts.proudlyDisplayPoweredByUppy,hideCancelButton:n.opts.hideCancelButton,hideRetryButton:n.opts.hideRetryButton,hidePauseResumeButton:n.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:n.opts.showRemoveButtonAfterComplete,containerWidth:r.containerWidth,containerHeight:r.containerHeight,areInsidesReadyToBeVisible:r.areInsidesReadyToBeVisible,isTargetDOMEl:n.isTargetDOMEl,parentElement:n.el,allowedFileTypes:n.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:n.uppy.opts.restrictions.maxNumberOfFiles,showSelectedFiles:n.opts.showSelectedFiles,handleCancelRestore:n.handleCancelRestore,handleRequestThumbnail:n.handleRequestThumbnail,handleCancelThumbnail:n.handleCancelThumbnail,isDraggingOver:r.isDraggingOver,handleDragOver:n.handleDragOver,handleDragLeave:n.handleDragLeave,handleDrop:n.handleDrop})},n.discoverProviderPlugins=function(){n.uppy.iteratePlugins((function(e){e&&!e.target&&e.opts&&e.opts.target===n.constructor&&n.addTarget(e)}))},n.install=function(){n.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:!1,showFileEditor:!1,metaFields:n.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});var e=n.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.");n.uppy.opts.allowMultipleUploads&&r&&n.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 i=n.opts.target;i&&n.mount(i,xi(n)),(n.opts.plugins||[]).forEach((function(e){var t=n.uppy.getPlugin(e);t&&t.mount(xi(n),t)})),n.opts.disableStatusBar||n.uppy.use(qn,{id:n.id+":StatusBar",target:xi(n),hideUploadButton:n.opts.hideUploadButton,hideRetryButton:n.opts.hideRetryButton,hidePauseResumeButton:n.opts.hidePauseResumeButton,hideCancelButton:n.opts.hideCancelButton,showProgressDetails:n.opts.showProgressDetails,hideAfterFinish:n.opts.hideProgressAfterFinish,locale:n.opts.locale,doneButtonHandler:n.opts.doneButtonHandler}),n.opts.disableInformer||n.uppy.use(Gn,{id:n.id+":Informer",target:xi(n)}),n.opts.disableThumbnailGenerator||n.uppy.use(di,{id:n.id+":ThumbnailGenerator",thumbnailWidth:n.opts.thumbnailWidth,thumbnailType:n.opts.thumbnailType,waitForThumbnailsBeforeUpload:n.opts.waitForThumbnailsBeforeUpload,lazy:!n.opts.waitForThumbnailsBeforeUpload}),n.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;var o=!!n.darkModeMediaQuery&&n.darkModeMediaQuery.matches;n.uppy.log("[Dashboard] Dark mode is "+(o?"on":"off")),n.setDarkModeCapability(o),"auto"===n.opts.theme&&n.darkModeMediaQuery.addListener(n.handleSystemDarkModeChange),n.discoverProviderPlugins(),n.initEvents()},n.uninstall=function(){if(!n.opts.disableInformer){var e=n.uppy.getPlugin(n.id+":Informer");e&&n.uppy.removePlugin(e)}if(!n.opts.disableStatusBar){var t=n.uppy.getPlugin(n.id+":StatusBar");t&&n.uppy.removePlugin(t)}if(!n.opts.disableThumbnailGenerator){var r=n.uppy.getPlugin(n.id+":ThumbnailGenerator");r&&n.uppy.removePlugin(r)}(n.opts.plugins||[]).forEach((function(e){var t=n.uppy.getPlugin(e);t&&t.unmount()})),"auto"===n.opts.theme&&n.darkModeMediaQuery.removeListener(n.handleSystemDarkModeChange),n.unmount(),n.removeEvents()},n.id=n.opts.id||"Dashboard",n.title="Dashboard",n.type="orchestrator",n.modalName="uppy-Dashboard-"+B(),n.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",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",dropHint:"Drop your files here",browseFiles:"browse files",browseFolders:"browse folders",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"},recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",poweredBy2:"%{backwardsCompat} %{uppy}",poweredBy:"Powered by"}};var i,o={target:"body",metaFields:[],trigger:"#uppy-select-files",inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Mi,showLinkToFileUploadResult:!0,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,doneButtonHandler:function(){n.uppy.reset(),n.requestCloseModal()},note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:function(){return n.closeModal()},showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,theme:"light",autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1};return n.opts=Ri({},o,r),n.i18nInit(),n.superFocus=(i=!1,Ci((function(e,t){var r=yi(e,t),n=r.contains(document.activeElement);if(!n||!i){var o=r.querySelector("[data-uppy-super-focusable]");if(!n||o)if(o)o.focus({preventScroll:!0}),i=!0;else{var s=r.querySelector(bi);s&&s.focus({preventScroll:!0}),i=!1}}}),260)),n.ifFocusedOnUppyRecently=!1,n.makeDashboardInsidesVisibleAnywayTimeout=null,n.removeDragOverClassTimeout=null,n}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ui(t,r),n.prototype.onMount=function(){var e=this.el;Nn(e)||(e.dir="ltr")},n}(Di),Ei.VERSION="1.20.1",Ai);function Hi(){return(Hi=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 qi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vi(e,t){return(Vi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Wi,Xi,Yi=le.Plugin,Gi=oe.h,Ki=(Li=ji=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).type="acquirer",n.id=n.opts.id||"DragDrop",n.title="Drag & Drop",n.defaultLocale={strings:{dropHereOr:"Drop files here or %{browse}",browse:"browse"}},n.opts=Hi({},{target:null,inputName:"files[]",width:"100%",height:"100%",note:null},r),n.isDragDropSupported=cn(),n.removeDragOverClassTimeout=null,n.i18nInit(),n.onInputChange=n.onInputChange.bind(qi(n)),n.handleDragOver=n.handleDragOver.bind(qi(n)),n.handleDragLeave=n.handleDragLeave.bind(qi(n)),n.handleDrop=n.handleDrop.bind(qi(n)),n.addFiles=n.addFiles.bind(qi(n)),n.render=n.render.bind(qi(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Vi(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([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(th){this.uppy.log(th)}},i.onInputChange=function(e){this.uppy.log("[DragDrop] Files selected through input");var t=gi(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"),vi(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 e=this,t=this.uppy.opts.restrictions;return Gi("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:function(t){e.fileInputRef=t},name:this.opts.inputName,multiple:1!==t.maxNumberOfFiles,accept:t.allowedFileTypes,onChange:this.onInputChange})},i.renderArrowSvg=function(){return Gi("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},Gi("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))},i.renderLabel=function(){return Gi("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:Gi("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))},i.renderNote=function(){return Gi("span",{className:"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 Gi("button",{type:"button",className:r,style:n,onClick:function(){return t.fileInputRef.click()},onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),Gi("div",{className:"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()},n}(Yi),ji.VERSION="1.4.29",Li);function $i(){return($i=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 Ji(e,t){return(Ji=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qi,Zi,eo=(Xi=Wi=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).addFiles=function(e){var t=e.map((function(e){return{source:n.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}}));try{n.uppy.addFiles(t)}catch(th){n.uppy.log(th)}},n.handleDrop=function(e){e.preventDefault(),e.stopPropagation(),clearTimeout(n.removeDragOverClassTimeout),e.currentTarget.classList.remove("uppy-is-drag-over"),n.setPluginState({isDraggingOver:!1}),n.uppy.log("[DropTarget] Files were dropped"),vi(e.dataTransfer,{logDropError:function(e){n.uppy.log(e,"error")}}).then((function(e){return n.addFiles(e)}))},n.handleDragOver=function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",clearTimeout(n.removeDragOverClassTimeout),e.currentTarget.classList.add("uppy-is-drag-over"),n.setPluginState({isDraggingOver:!0})},n.handleDragLeave=function(e){e.preventDefault(),e.stopPropagation();var t=e.currentTarget;clearTimeout(n.removeDragOverClassTimeout),n.removeDragOverClassTimeout=setTimeout((function(){t.classList.remove("uppy-is-drag-over"),n.setPluginState({isDraggingOver:!1})}),50)},n.addListeners=function(){var e=n.opts.target;if(e instanceof Element?n.nodes=[e]:"string"==typeof e&&(n.nodes=gi(document.querySelectorAll(e))),!n.nodes&&!n.nodes.length>0)throw new Error('"'+e+'" does not match any HTML elements');n.nodes.forEach((function(e){e.addEventListener("dragover",n.handleDragOver,!1),e.addEventListener("dragleave",n.handleDragLeave,!1),e.addEventListener("drop",n.handleDrop,!1)}))},n.removeListeners=function(){n.nodes&&n.nodes.forEach((function(e){e.removeEventListener("dragover",n.handleDragOver,!1),e.removeEventListener("dragleave",n.handleDragLeave,!1),e.removeEventListener("drop",n.handleDrop,!1)}))},n.type="acquirer",n.id=n.opts.id||"DropTarget",n.title="Drop Target",n.opts=$i({},{target:null},r),n.removeDragOverClassTimeout=null,n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ji(t,r);var i=n.prototype;return i.install=function(){this.setPluginState({isDraggingOver:!1}),this.addListeners()},i.uninstall=function(){this.removeListeners()},n}(le.Plugin),Wi.VERSION="0.2.3",Xi);function to(){return(to=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 ro(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function no(e,t){return(no=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var io,oo,so=le.Plugin,ao=oe.h,uo=(Zi=Qi=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).id=n.opts.id||"FileInput",n.title="File Input",n.type="acquirer",n.defaultLocale={strings:{chooseFiles:"Choose files"}},n.opts=to({},{target:null,pretty:!0,inputName:"files[]"},r),n.i18nInit(),n.render=n.render.bind(ro(n)),n.handleInputChange=n.handleInputChange.bind(ro(n)),n.handleClick=n.handleClick.bind(ro(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,no(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([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(th){this.uppy.log(th)}},i.handleInputChange=function(e){this.uppy.log("[FileInput] Something selected through input...");var t=gi(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 ao("div",{className:"uppy-Root uppy-FileInput-container"},ao("input",{className:"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&&ao("button",{className:"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()},n}(so),Qi.VERSION="1.5.1",Zi);function lo(){return(lo=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 co(e,t){return(co=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var po,ho,fo=le.Plugin,go=oe.h,mo=(oo=io=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).id=n.opts.id||"ProgressBar",n.title="Progress Bar",n.type="progressindicator",n.opts=lo({},{target:"body",replaceTargetContent:!1,fixed:!1,hideAfterFinish:!0},r),n.render=n.render.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,co(t,r);var i=n.prototype;return i.render=function(e){var t=e.totalProgress||0,r=(0===t||100===t)&&this.opts.hideAfterFinish;return go("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":r},go("div",{className:"uppy-ProgressBar-inner",style:{width:t+"%"}}),go("div",{className:"uppy-ProgressBar-percentage"},t))},i.install=function(){var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},n}(fo),io.VERSION="1.3.29",oo),vo={exports:{}};function yo(e,t){return(yo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}po=this,ho=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){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 r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function o(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,void 0):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var a="undefined"!=typeof window&&void 0!==window.document,u=a?window:{},l=!(!a||!u.document.documentElement)&&"ontouchstart"in u.document.documentElement,c=!!a&&"PointerEvent"in u,p="".concat("cropper","-crop"),h="".concat("cropper","-disabled"),d="".concat("cropper","-hidden"),f="".concat("cropper","-hide"),g="".concat("cropper","-invisible"),m="".concat("cropper","-modal"),v="".concat("cropper","-move"),y="".concat("cropper","Action"),b="".concat("cropper","Preview"),w=c?"pointerdown":l?"touchstart":"mousedown",S=c?"pointermove":l?"touchmove":"mousemove",_=c?"pointerup pointercancel":l?"touchend touchcancel":"mouseup",P=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,k=/^data:/,C=/^data:image\/jpeg;base64,/,O=/^img|canvas$/i,E={viewMode:0,dragMode:"crop",initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},A=Number.isNaN||u.isNaN;function F(e){return"number"==typeof e&&!A(e)}var R=function(e){return e>0&&e<1/0};function x(e){return void 0===e}function U(t){return"object"===e(t)&&null!==t}var T=Object.prototype.hasOwnProperty;function D(e){if(!U(e))return!1;try{var t=e.constructor,r=t.prototype;return t&&r&&T.call(r,"isPrototypeOf")}catch(gp){return!1}}function B(e){return"function"==typeof e}var I=Array.prototype.slice;function N(e){return Array.from?Array.from(e):I.call(e)}function M(e,t){return e&&B(t)&&(Array.isArray(e)||F(e.length)?N(e).forEach((function(r,n){t.call(e,r,n,e)})):U(e)&&Object.keys(e).forEach((function(r){t.call(e,e[r],r,e)}))),e}var j=Object.assign||function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return U(e)&&r.length>0&&r.forEach((function(t){U(t)&&Object.keys(t).forEach((function(r){e[r]=t[r]}))})),e},L=/\.\d*(?:0|9){12}\d*$/;function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return L.test(e)?Math.round(e*t)/t:e}var H=/^width|height|left|top|marginLeft|marginTop$/;function q(e,t){var r=e.style;M(t,(function(e,t){H.test(t)&&F(e)&&(e="".concat(e,"px")),r[t]=e}))}function V(e,t){if(t)if(F(e.length))M(e,(function(e){V(e,t)}));else if(e.classList)e.classList.add(t);else{var r=e.className.trim();r?r.indexOf(t)<0&&(e.className="".concat(r," ").concat(t)):e.className=t}}function W(e,t){t&&(F(e.length)?M(e,(function(e){W(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function X(e,t,r){t&&(F(e.length)?M(e,(function(e){X(e,t,r)})):r?V(e,t):W(e,t))}var Y=/([a-z\d])([A-Z])/g;function G(e){return e.replace(Y,"$1-$2").toLowerCase()}function K(e,t){return U(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(G(t)))}function $(e,t,r){U(r)?e[t]=r:e.dataset?e.dataset[t]=r:e.setAttribute("data-".concat(G(t)),r)}var J=/\s\s*/,Q=function(){var e=!1;if(a){var t=!1,r=function(){},n=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});u.addEventListener("test",r,n),u.removeEventListener("test",r,n)}return e}();function Z(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r;t.trim().split(J).forEach((function(t){if(!Q){var o=e.listeners;o&&o[t]&&o[t][r]&&(i=o[t][r],delete o[t][r],0===Object.keys(o[t]).length&&delete o[t],0===Object.keys(o).length&&delete e.listeners)}e.removeEventListener(t,i,n)}))}function ee(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r;t.trim().split(J).forEach((function(t){if(n.once&&!Q){var o=e.listeners,s=void 0===o?{}:o;i=function(){delete s[t][r],e.removeEventListener(t,i,n);for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];r.apply(e,a)},s[t]||(s[t]={}),s[t][r]&&e.removeEventListener(t,s[t][r],n),s[t][r]=i,e.listeners=s}e.addEventListener(t,i,n)}))}function te(e,t,r){var n;return B(Event)&&B(CustomEvent)?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,r),e.dispatchEvent(n)}function re(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var ne=u.location,ie=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function oe(e){var t=e.match(ie);return null!==t&&(t[1]!==ne.protocol||t[2]!==ne.hostname||t[3]!==ne.port)}function se(e){var t="timestamp=".concat((new Date).getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function ae(e){var t=e.rotate,r=e.scaleX,n=e.scaleY,i=e.translateX,o=e.translateY,s=[];F(i)&&0!==i&&s.push("translateX(".concat(i,"px)")),F(o)&&0!==o&&s.push("translateY(".concat(o,"px)")),F(t)&&0!==t&&s.push("rotate(".concat(t,"deg)")),F(r)&&1!==r&&s.push("scaleX(".concat(r,")")),F(n)&&1!==n&&s.push("scaleY(".concat(n,")"));var a=s.length?s.join(" "):"none";return{WebkitTransform:a,msTransform:a,transform:a}}function ue(e,t){var r=e.pageX,n=e.pageY,o={endX:r,endY:n};return t?o:i({startX:r,startY:n},o)}function le(e){var t=e.aspectRatio,r=e.height,n=e.width,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",o=R(n),s=R(r);if(o&&s){var a=r*t;"contain"===i&&a>n||"cover"===i&&a<n?r=n/t:n=r*t}else o?r=n/t:s&&(n=r*t);return{width:n,height:r}}var ce=String.fromCharCode,pe=/^data:.*,/;var he={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,r=this.container,n=this.cropper;V(n,d),W(e,d);var i={width:Math.max(r.offsetWidth,Number(t.minContainerWidth)||200),height:Math.max(r.offsetHeight,Number(t.minContainerHeight)||100)};this.containerData=i,q(n,{width:i.width,height:i.height}),V(e,d),W(n,d)},initCanvas:function(){var e=this.containerData,t=this.imageData,r=this.options.viewMode,n=Math.abs(t.rotate)%180==90,i=n?t.naturalHeight:t.naturalWidth,o=n?t.naturalWidth:t.naturalHeight,s=i/o,a=e.width,u=e.height;e.height*s>e.width?3===r?a=e.height*s:u=e.width/s:3===r?u=e.width/s:a=e.height*s;var l={aspectRatio:s,naturalWidth:i,naturalHeight:o,width:a,height:u};l.left=(e.width-a)/2,l.top=(e.height-u)/2,l.oldLeft=l.left,l.oldTop=l.top,this.canvasData=l,this.limited=1===r||2===r,this.limitCanvas(!0,!0),this.initialImageData=j({},t),this.initialCanvasData=j({},l)},limitCanvas:function(e,t){var r=this.options,n=this.containerData,i=this.canvasData,o=this.cropBoxData,s=r.viewMode,a=i.aspectRatio,u=this.cropped&&o;if(e){var l=Number(r.minCanvasWidth)||0,c=Number(r.minCanvasHeight)||0;s>1?(l=Math.max(l,n.width),c=Math.max(c,n.height),3===s&&(c*a>l?l=c*a:c=l/a)):s>0&&(l?l=Math.max(l,u?o.width:0):c?c=Math.max(c,u?o.height:0):u&&(l=o.width,(c=o.height)*a>l?l=c*a:c=l/a));var p=le({aspectRatio:a,width:l,height:c});l=p.width,c=p.height,i.minWidth=l,i.minHeight=c,i.maxWidth=1/0,i.maxHeight=1/0}if(t)if(s>(u?0:1)){var h=n.width-i.width,d=n.height-i.height;i.minLeft=Math.min(0,h),i.minTop=Math.min(0,d),i.maxLeft=Math.max(0,h),i.maxTop=Math.max(0,d),u&&this.limited&&(i.minLeft=Math.min(o.left,o.left+(o.width-i.width)),i.minTop=Math.min(o.top,o.top+(o.height-i.height)),i.maxLeft=o.left,i.maxTop=o.top,2===s&&(i.width>=n.width&&(i.minLeft=Math.min(0,h),i.maxLeft=Math.max(0,h)),i.height>=n.height&&(i.minTop=Math.min(0,d),i.maxTop=Math.max(0,d))))}else i.minLeft=-i.width,i.minTop=-i.height,i.maxLeft=n.width,i.maxTop=n.height},renderCanvas:function(e,t){var r=this.canvasData,n=this.imageData;if(t){var i=function(e){var t=e.width,r=e.height,n=e.degree;if(90==(n=Math.abs(n)%180))return{width:r,height:t};var i=n%90*Math.PI/180,o=Math.sin(i),s=Math.cos(i),a=t*s+r*o,u=t*o+r*s;return n>90?{width:u,height:a}:{width:a,height:u}}({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),o=i.width,s=i.height,a=r.width*(o/r.naturalWidth),u=r.height*(s/r.naturalHeight);r.left-=(a-r.width)/2,r.top-=(u-r.height)/2,r.width=a,r.height=u,r.aspectRatio=o/s,r.naturalWidth=o,r.naturalHeight=s,this.limitCanvas(!0,!1)}(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCanvas(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,q(this.canvas,j({width:r.width,height:r.height},ae({translateX:r.left,translateY:r.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,r=this.imageData,n=r.naturalWidth*(t.width/t.naturalWidth),i=r.naturalHeight*(t.height/t.naturalHeight);j(r,{width:n,height:i,left:(t.width-n)/2,top:(t.height-i)/2}),q(this.image,j({width:r.width,height:r.height},ae(j({translateX:r.left,translateY:r.top},r)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,r=e.aspectRatio||e.initialAspectRatio,n=Number(e.autoCropArea)||.8,i={width:t.width,height:t.height};r&&(t.height*r>t.width?i.height=i.width/r:i.width=i.height*r),this.cropBoxData=i,this.limitCropBox(!0,!0),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),i.width=Math.max(i.minWidth,i.width*n),i.height=Math.max(i.minHeight,i.height*n),i.left=t.left+(t.width-i.width)/2,i.top=t.top+(t.height-i.height)/2,i.oldLeft=i.left,i.oldTop=i.top,this.initialCropBoxData=j({},i)},limitCropBox:function(e,t){var r=this.options,n=this.containerData,i=this.canvasData,o=this.cropBoxData,s=this.limited,a=r.aspectRatio;if(e){var u=Number(r.minCropBoxWidth)||0,l=Number(r.minCropBoxHeight)||0,c=s?Math.min(n.width,i.width,i.width+i.left,n.width-i.left):n.width,p=s?Math.min(n.height,i.height,i.height+i.top,n.height-i.top):n.height;u=Math.min(u,n.width),l=Math.min(l,n.height),a&&(u&&l?l*a>u?l=u/a:u=l*a:u?l=u/a:l&&(u=l*a),p*a>c?p=c/a:c=p*a),o.minWidth=Math.min(u,c),o.minHeight=Math.min(l,p),o.maxWidth=c,o.maxHeight=p}t&&(s?(o.minLeft=Math.max(0,i.left),o.minTop=Math.max(0,i.top),o.maxLeft=Math.min(n.width,i.left+i.width)-o.width,o.maxTop=Math.min(n.height,i.top+i.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=n.width-o.width,o.maxTop=n.height-o.height))},renderCropBox:function(){var e=this.options,t=this.containerData,r=this.cropBoxData;(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCropBox(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,e.movable&&e.cropBoxMovable&&$(this.face,y,r.width>=t.width&&r.height>=t.height?"move":"all"),q(this.cropBox,j({width:r.width,height:r.height},ae({translateX:r.left,translateY:r.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),te(this.element,"crop",this.getData())}},de={initPreview:function(){var e=this.element,t=this.crossOrigin,r=this.options.preview,n=t?this.crossOriginUrl:this.url,i=e.alt||"The image to preview",o=document.createElement("img");if(t&&(o.crossOrigin=t),o.src=n,o.alt=i,this.viewBox.appendChild(o),this.viewBoxImage=o,r){var s=r;"string"==typeof r?s=e.ownerDocument.querySelectorAll(r):r.querySelector&&(s=[r]),this.previews=s,M(s,(function(e){var r=document.createElement("img");$(e,b,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(r.crossOrigin=t),r.src=n,r.alt=i,r.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(r)}))}},resetPreview:function(){M(this.previews,(function(e){var t=K(e,b);q(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(U(e[t]))try{delete e[t]}catch(gp){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(gp){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(G(t)))}(e,b)}))},preview:function(){var e=this.imageData,t=this.canvasData,r=this.cropBoxData,n=r.width,i=r.height,o=e.width,s=e.height,a=r.left-t.left-e.left,u=r.top-t.top-e.top;this.cropped&&!this.disabled&&(q(this.viewBoxImage,j({width:o,height:s},ae(j({translateX:-a,translateY:-u},e)))),M(this.previews,(function(t){var r=K(t,b),l=r.width,c=r.height,p=l,h=c,d=1;n&&(h=i*(d=l/n)),i&&h>c&&(p=n*(d=c/i),h=c),q(t,{width:p,height:h}),q(t.getElementsByTagName("img")[0],j({width:o*d,height:s*d},ae(j({translateX:-a*d,translateY:-u*d},e))))})))}},fe={bind:function(){var e=this.element,t=this.options,r=this.cropper;B(t.cropstart)&&ee(e,"cropstart",t.cropstart),B(t.cropmove)&&ee(e,"cropmove",t.cropmove),B(t.cropend)&&ee(e,"cropend",t.cropend),B(t.crop)&&ee(e,"crop",t.crop),B(t.zoom)&&ee(e,"zoom",t.zoom),ee(r,w,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&ee(r,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&ee(r,"dblclick",this.onDblclick=this.dblclick.bind(this)),ee(e.ownerDocument,S,this.onCropMove=this.cropMove.bind(this)),ee(e.ownerDocument,_,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&ee(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,r=this.cropper;B(t.cropstart)&&Z(e,"cropstart",t.cropstart),B(t.cropmove)&&Z(e,"cropmove",t.cropmove),B(t.cropend)&&Z(e,"cropend",t.cropend),B(t.crop)&&Z(e,"crop",t.crop),B(t.zoom)&&Z(e,"zoom",t.zoom),Z(r,w,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Z(r,"wheel",this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Z(r,"dblclick",this.onDblclick),Z(e.ownerDocument,S,this.onCropMove),Z(e.ownerDocument,_,this.onCropEnd),t.responsive&&Z(window,"resize",this.onResize)}},ge={resize:function(){if(!this.disabled){var e,t,r=this.options,n=this.container,i=this.containerData,o=n.offsetWidth/i.width;1===o&&n.offsetHeight===i.height||(r.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),r.restore&&(this.setCanvasData(M(e,(function(t,r){e[r]=t*o}))),this.setCropBoxData(M(t,(function(e,r){t[r]=e*o})))))}},dblclick:function(){var e,t;this.disabled||"none"===this.options.dragMode||this.setDragMode((e=this.dragBox,t=p,(e.classList?e.classList.contains(t):e.className.indexOf(t)>-1)?"move":"crop"))},wheel:function(e){var t=this,r=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?n=e.deltaY>0?1:-1:e.wheelDelta?n=-e.wheelDelta/120:e.detail&&(n=e.detail>0?1:-1),this.zoom(-n*r,e)))},cropStart:function(e){var t=e.buttons,r=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(F(t)&&1!==t||F(r)&&0!==r||e.ctrlKey))){var n,i=this.options,o=this.pointers;e.changedTouches?M(e.changedTouches,(function(e){o[e.identifier]=ue(e)})):o[e.pointerId||0]=ue(e),n=Object.keys(o).length>1&&i.zoomable&&i.zoomOnTouch?"zoom":K(e.target,y),P.test(n)&&!1!==te(this.element,"cropstart",{originalEvent:e,action:n})&&(e.preventDefault(),this.action=n,this.cropping=!1,"crop"===n&&(this.cropping=!0,V(this.dragBox,m)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var r=this.pointers;e.preventDefault(),!1!==te(this.element,"cropmove",{originalEvent:e,action:t})&&(e.changedTouches?M(e.changedTouches,(function(e){j(r[e.identifier]||{},ue(e,!0))})):j(r[e.pointerId||0]||{},ue(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,r=this.pointers;e.changedTouches?M(e.changedTouches,(function(e){delete r[e.identifier]})):delete r[e.pointerId||0],t&&(e.preventDefault(),Object.keys(r).length||(this.action=""),this.cropping&&(this.cropping=!1,X(this.dragBox,m,this.cropped&&this.options.modal)),te(this.element,"cropend",{originalEvent:e,action:t}))}}},me={change:function(e){var t,r=this.options,n=this.canvasData,o=this.containerData,s=this.cropBoxData,a=this.pointers,u=this.action,l=r.aspectRatio,c=s.left,p=s.top,h=s.width,f=s.height,g=c+h,m=p+f,v=0,y=0,b=o.width,w=o.height,S=!0;!l&&e.shiftKey&&(l=h&&f?h/f:1),this.limited&&(v=s.minLeft,y=s.minTop,b=v+Math.min(o.width,n.width,n.left+n.width),w=y+Math.min(o.height,n.height,n.top+n.height));var _=a[Object.keys(a)[0]],P={x:_.endX-_.startX,y:_.endY-_.startY},k=function(e){switch(e){case"e":g+P.x>b&&(P.x=b-g);break;case"w":c+P.x<v&&(P.x=v-c);break;case"n":p+P.y<y&&(P.y=y-p);break;case"s":m+P.y>w&&(P.y=w-m)}};switch(u){case"all":c+=P.x,p+=P.y;break;case"e":if(P.x>=0&&(g>=b||l&&(p<=y||m>=w))){S=!1;break}k("e"),(h+=P.x)<0&&(u="w",c-=h=-h),l&&(f=h/l,p+=(s.height-f)/2);break;case"n":if(P.y<=0&&(p<=y||l&&(c<=v||g>=b))){S=!1;break}k("n"),f-=P.y,p+=P.y,f<0&&(u="s",p-=f=-f),l&&(h=f*l,c+=(s.width-h)/2);break;case"w":if(P.x<=0&&(c<=v||l&&(p<=y||m>=w))){S=!1;break}k("w"),h-=P.x,c+=P.x,h<0&&(u="e",c-=h=-h),l&&(f=h/l,p+=(s.height-f)/2);break;case"s":if(P.y>=0&&(m>=w||l&&(c<=v||g>=b))){S=!1;break}k("s"),(f+=P.y)<0&&(u="n",p-=f=-f),l&&(h=f*l,c+=(s.width-h)/2);break;case"ne":if(l){if(P.y<=0&&(p<=y||g>=b)){S=!1;break}k("n"),f-=P.y,p+=P.y,h=f*l}else k("n"),k("e"),P.x>=0?g<b?h+=P.x:P.y<=0&&p<=y&&(S=!1):h+=P.x,P.y<=0?p>y&&(f-=P.y,p+=P.y):(f-=P.y,p+=P.y);h<0&&f<0?(u="sw",p-=f=-f,c-=h=-h):h<0?(u="nw",c-=h=-h):f<0&&(u="se",p-=f=-f);break;case"nw":if(l){if(P.y<=0&&(p<=y||c<=v)){S=!1;break}k("n"),f-=P.y,p+=P.y,h=f*l,c+=s.width-h}else k("n"),k("w"),P.x<=0?c>v?(h-=P.x,c+=P.x):P.y<=0&&p<=y&&(S=!1):(h-=P.x,c+=P.x),P.y<=0?p>y&&(f-=P.y,p+=P.y):(f-=P.y,p+=P.y);h<0&&f<0?(u="se",p-=f=-f,c-=h=-h):h<0?(u="ne",c-=h=-h):f<0&&(u="sw",p-=f=-f);break;case"sw":if(l){if(P.x<=0&&(c<=v||m>=w)){S=!1;break}k("w"),h-=P.x,c+=P.x,f=h/l}else k("s"),k("w"),P.x<=0?c>v?(h-=P.x,c+=P.x):P.y>=0&&m>=w&&(S=!1):(h-=P.x,c+=P.x),P.y>=0?m<w&&(f+=P.y):f+=P.y;h<0&&f<0?(u="ne",p-=f=-f,c-=h=-h):h<0?(u="se",c-=h=-h):f<0&&(u="nw",p-=f=-f);break;case"se":if(l){if(P.x>=0&&(g>=b||m>=w)){S=!1;break}k("e"),f=(h+=P.x)/l}else k("s"),k("e"),P.x>=0?g<b?h+=P.x:P.y>=0&&m>=w&&(S=!1):h+=P.x,P.y>=0?m<w&&(f+=P.y):f+=P.y;h<0&&f<0?(u="nw",p-=f=-f,c-=h=-h):h<0?(u="sw",c-=h=-h):f<0&&(u="ne",p-=f=-f);break;case"move":this.move(P.x,P.y),S=!1;break;case"zoom":this.zoom(function(e){var t=i({},e),r=[];return M(e,(function(e,n){delete t[n],M(t,(function(t){var n=Math.abs(e.startX-t.startX),i=Math.abs(e.startY-t.startY),o=Math.abs(e.endX-t.endX),s=Math.abs(e.endY-t.endY),a=Math.sqrt(n*n+i*i),u=(Math.sqrt(o*o+s*s)-a)/a;r.push(u)}))})),r.sort((function(e,t){return Math.abs(e)<Math.abs(t)})),r[0]}(a),e),S=!1;break;case"crop":if(!P.x||!P.y){S=!1;break}t=re(this.cropper),c=_.startX-t.left,p=_.startY-t.top,h=s.minWidth,f=s.minHeight,P.x>0?u=P.y>0?"se":"ne":P.x<0&&(c-=h,u=P.y>0?"sw":"nw"),P.y<0&&(p-=f),this.cropped||(W(this.cropBox,d),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}S&&(s.width=h,s.height=f,s.left=c,s.top=p,this.action=u,this.renderCropBox()),M(a,(function(e){e.startX=e.endX,e.startY=e.endY}))}},ve={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&V(this.dragBox,m),W(this.cropBox,d),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=j({},this.initialImageData),this.canvasData=j({},this.initialCanvasData),this.cropBoxData=j({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(j(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),W(this.dragBox,m),V(this.cropBox,d)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,M(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,W(this.cropper,h)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,V(this.cropper,h)),this},destroy:function(){var e=this.element;return e.cropper?(e.cropper=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=this.canvasData,n=r.left,i=r.top;return this.moveTo(x(e)?e:n+Number(e),x(t)?t:i+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=this.canvasData,n=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(F(e)&&(r.left=e,n=!0),F(t)&&(r.top=t,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(e,t){var r=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(r.width*e/r.naturalWidth,null,t)},zoomTo:function(e,t,r){var n=this.options,i=this.canvasData,o=i.width,s=i.height,a=i.naturalWidth,u=i.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&n.zoomable){var l=a*e,c=u*e;if(!1===te(this.element,"zoom",{ratio:e,oldRatio:o/a,originalEvent:r}))return this;if(r){var p=this.pointers,h=re(this.cropper),d=p&&Object.keys(p).length?function(e){var t=0,r=0,n=0;return M(e,(function(e){var i=e.startX,o=e.startY;t+=i,r+=o,n+=1})),{pageX:t/=n,pageY:r/=n}}(p):{pageX:r.pageX,pageY:r.pageY};i.left-=(l-o)*((d.pageX-h.left-i.left)/o),i.top-=(c-s)*((d.pageY-h.top-i.top)/s)}else D(t)&&F(t.x)&&F(t.y)?(i.left-=(l-o)*((t.x-i.left)/o),i.top-=(c-s)*((t.y-i.top)/s)):(i.left-=(l-o)/2,i.top-=(c-s)/2);i.width=l,i.height=c,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return F(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,F(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(F(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=this.imageData,n=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(F(e)&&(r.scaleX=e,n=!0),F(t)&&(r.scaleY=t,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=this.options,n=this.imageData,i=this.canvasData,o=this.cropBoxData;if(this.ready&&this.cropped){e={x:o.left-i.left,y:o.top-i.top,width:o.width,height:o.height};var s=n.width/n.naturalWidth;if(M(e,(function(t,r){e[r]=t/s})),t){var a=Math.round(e.y+e.height),u=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=u-e.x,e.height=a-e.y}}else e={x:0,y:0,width:0,height:0};return r.rotatable&&(e.rotate=n.rotate||0),r.scalable&&(e.scaleX=n.scaleX||1,e.scaleY=n.scaleY||1),e},setData:function(e){var t=this.options,r=this.imageData,n=this.canvasData,i={};if(this.ready&&!this.disabled&&D(e)){var o=!1;t.rotatable&&F(e.rotate)&&e.rotate!==r.rotate&&(r.rotate=e.rotate,o=!0),t.scalable&&(F(e.scaleX)&&e.scaleX!==r.scaleX&&(r.scaleX=e.scaleX,o=!0),F(e.scaleY)&&e.scaleY!==r.scaleY&&(r.scaleY=e.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var s=r.width/r.naturalWidth;F(e.x)&&(i.left=e.x*s+n.left),F(e.y)&&(i.top=e.y*s+n.top),F(e.width)&&(i.width=e.width*s),F(e.height)&&(i.height=e.height*s),this.setCropBoxData(i)}return this},getContainerData:function(){return this.ready?j({},this.containerData):{}},getImageData:function(){return this.sized?j({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&M(["left","top","width","height","naturalWidth","naturalHeight"],(function(r){t[r]=e[r]})),t},setCanvasData:function(e){var t=this.canvasData,r=t.aspectRatio;return this.ready&&!this.disabled&&D(e)&&(F(e.left)&&(t.left=e.left),F(e.top)&&(t.top=e.top),F(e.width)?(t.width=e.width,t.height=e.width/r):F(e.height)&&(t.height=e.height,t.width=e.height*r),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,r,n=this.cropBoxData,i=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&D(e)&&(F(e.left)&&(n.left=e.left),F(e.top)&&(n.top=e.top),F(e.width)&&e.width!==n.width&&(t=!0,n.width=e.width),F(e.height)&&e.height!==n.height&&(r=!0,n.height=e.height),i&&(t?n.height=n.width/i:r&&(n.width=n.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,r=function(e,t,r,n){var i=t.aspectRatio,s=t.naturalWidth,a=t.naturalHeight,u=t.rotate,l=void 0===u?0:u,c=t.scaleX,p=void 0===c?1:c,h=t.scaleY,d=void 0===h?1:h,f=r.aspectRatio,g=r.naturalWidth,m=r.naturalHeight,v=n.fillColor,y=void 0===v?"transparent":v,b=n.imageSmoothingEnabled,w=void 0===b||b,S=n.imageSmoothingQuality,_=void 0===S?"low":S,P=n.maxWidth,k=void 0===P?1/0:P,C=n.maxHeight,O=void 0===C?1/0:C,E=n.minWidth,A=void 0===E?0:E,F=n.minHeight,R=void 0===F?0:F,x=document.createElement("canvas"),U=x.getContext("2d"),T=le({aspectRatio:f,width:k,height:O}),D=le({aspectRatio:f,width:A,height:R},"cover"),B=Math.min(T.width,Math.max(D.width,g)),I=Math.min(T.height,Math.max(D.height,m)),N=le({aspectRatio:i,width:k,height:O}),M=le({aspectRatio:i,width:A,height:R},"cover"),j=Math.min(N.width,Math.max(M.width,s)),L=Math.min(N.height,Math.max(M.height,a)),H=[-j/2,-L/2,j,L];return x.width=z(B),x.height=z(I),U.fillStyle=y,U.fillRect(0,0,B,I),U.save(),U.translate(B/2,I/2),U.rotate(l*Math.PI/180),U.scale(p,d),U.imageSmoothingEnabled=w,U.imageSmoothingQuality=_,U.drawImage.apply(U,[e].concat(o(H.map((function(e){return Math.floor(z(e))}))))),U.restore(),x}(this.image,this.imageData,t,e);if(!this.cropped)return r;var n=this.getData(),i=n.x,s=n.y,a=n.width,u=n.height,l=r.width/Math.floor(t.naturalWidth);1!==l&&(i*=l,s*=l,a*=l,u*=l);var c=a/u,p=le({aspectRatio:c,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),h=le({aspectRatio:c,width:e.minWidth||0,height:e.minHeight||0},"cover"),d=le({aspectRatio:c,width:e.width||(1!==l?r.width:a),height:e.height||(1!==l?r.height:u)}),f=d.width,g=d.height;f=Math.min(p.width,Math.max(h.width,f)),g=Math.min(p.height,Math.max(h.height,g));var m=document.createElement("canvas"),v=m.getContext("2d");m.width=z(f),m.height=z(g),v.fillStyle=e.fillColor||"transparent",v.fillRect(0,0,f,g);var y=e.imageSmoothingEnabled,b=void 0===y||y,w=e.imageSmoothingQuality;v.imageSmoothingEnabled=b,w&&(v.imageSmoothingQuality=w);var S,_,P,k,C,O,E=r.width,A=r.height,F=i,R=s;F<=-a||F>E?(F=0,S=0,P=0,C=0):F<=0?(P=-F,F=0,C=S=Math.min(E,a+F)):F<=E&&(P=0,C=S=Math.min(a,E-F)),S<=0||R<=-u||R>A?(R=0,_=0,k=0,O=0):R<=0?(k=-R,R=0,O=_=Math.min(A,u+R)):R<=A&&(k=0,O=_=Math.min(u,A-R));var x=[F,R,S,_];if(C>0&&O>0){var U=f/a;x.push(P*U,k*U,C*U,O*U)}return v.drawImage.apply(v,[r].concat(o(x.map((function(e){return Math.floor(z(e))}))))),m},setAspectRatio:function(e){var t=this.options;return this.disabled||x(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,r=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var i="crop"===e,o=t.movable&&"move"===e;e=i||o?e:"none",t.dragMode=e,$(r,y,e),X(r,p,i),X(r,v,o),t.cropBoxMovable||($(n,y,e),X(n,p,i),X(n,v,o))}return this}},ye=u.Cropper,be=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t||!O.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=j({},E,D(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var r,n,i;return r=e,i=[{key:"noConflict",value:function(){return window.Cropper=ye,e}},{key:"setDefaults",value:function(e){j(E,D(e)&&e)}}],(n=[{key:"init",value:function(){var e,t=this.element,r=t.tagName.toLowerCase();if(!t.cropper){if(t.cropper=this,"img"===r){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===r&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var r=this.element,n=this.options;if(n.rotatable||n.scalable||(n.checkOrientation=!1),n.checkOrientation&&window.ArrayBuffer)if(k.test(e))C.test(e)?this.read((i=e.replace(pe,""),o=atob(i),s=new ArrayBuffer(o.length),M(a=new Uint8Array(s),(function(e,t){a[t]=o.charCodeAt(t)})),s)):this.clone();else{var i,o,s,a,u=new XMLHttpRequest,l=this.clone.bind(this);this.reloading=!0,this.xhr=u,u.onabort=l,u.onerror=l,u.ontimeout=l,u.onprogress=function(){"image/jpeg"!==u.getResponseHeader("content-type")&&u.abort()},u.onload=function(){t.read(u.response)},u.onloadend=function(){t.reloading=!1,t.xhr=null},n.checkCrossOrigin&&oe(e)&&r.crossOrigin&&(e=se(e)),u.open("GET",e),u.responseType="arraybuffer",u.withCredentials="use-credentials"===r.crossOrigin,u.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,r=this.imageData,n=function(e){var t,r=new DataView(e);try{var n,i,o;if(255===r.getUint8(0)&&216===r.getUint8(1))for(var s=r.byteLength,a=2;a+1<s;){if(255===r.getUint8(a)&&225===r.getUint8(a+1)){i=a;break}a+=1}if(i){var u=i+10;if("Exif"===function(e,t,r){var n="";r+=t;for(var i=t;i<r;i+=1)n+=ce(e.getUint8(i));return n}(r,i+4,4)){var l=r.getUint16(u);if(((n=18761===l)||19789===l)&&42===r.getUint16(u+2,n)){var c=r.getUint32(u+4,n);c>=8&&(o=u+c)}}}if(o){var p,h,d=r.getUint16(o,n);for(h=0;h<d;h+=1)if(p=o+12*h+2,274===r.getUint16(p,n)){p+=8,t=r.getUint16(p,n),r.setUint16(p,1,n);break}}}catch(gp){t=1}return t}(e),i=0,o=1,s=1;if(n>1){this.url=function(e,t){for(var r=[],n=new Uint8Array(e);n.length>0;)r.push(ce.apply(null,N(n.subarray(0,8192)))),n=n.subarray(8192);return"data:".concat("image/jpeg",";base64,").concat(btoa(r.join("")))}(e);var a=function(e){var t=0,r=1,n=1;switch(e){case 2:r=-1;break;case 3:t=-180;break;case 4:n=-1;break;case 5:t=90,n=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90}return{rotate:t,scaleX:r,scaleY:n}}(n);i=a.rotate,o=a.scaleX,s=a.scaleY}t.rotatable&&(r.rotate=i),t.scalable&&(r.scaleX=o,r.scaleY=s),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,r=e.crossOrigin,n=t;this.options.checkCrossOrigin&&oe(t)&&(r||(r="anonymous"),n=se(t)),this.crossOrigin=r,this.crossOriginUrl=n;var i=document.createElement("img");r&&(i.crossOrigin=r),i.src=n||t,i.alt=e.alt||"The image to crop",this.image=i,i.onload=this.start.bind(this),i.onerror=this.stop.bind(this),V(i,f),e.parentNode.insertBefore(i,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var r=u.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(u.navigator.userAgent),n=function(t,r){j(e.imageData,{naturalWidth:t,naturalHeight:r,aspectRatio:t/r}),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||r){var i=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=i,i.onload=function(){n(i.width,i.height),r||o.removeChild(i)},i.src=t.src,r||(i.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(i))}else n(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,r=this.image,n=e.parentNode,i=document.createElement("div");i.innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';var o=i.querySelector(".".concat("cropper","-container")),s=o.querySelector(".".concat("cropper","-canvas")),a=o.querySelector(".".concat("cropper","-drag-box")),u=o.querySelector(".".concat("cropper","-crop-box")),l=u.querySelector(".".concat("cropper","-face"));this.container=n,this.cropper=o,this.canvas=s,this.dragBox=a,this.cropBox=u,this.viewBox=o.querySelector(".".concat("cropper","-view-box")),this.face=l,s.appendChild(r),V(e,d),n.insertBefore(o,e.nextSibling),this.isImg||W(r,f),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,V(u,d),t.guides||V(u.getElementsByClassName("".concat("cropper","-dashed")),d),t.center||V(u.getElementsByClassName("".concat("cropper","-center")),d),t.background&&V(o,"".concat("cropper","-bg")),t.highlight||V(l,g),t.cropBoxMovable&&(V(l,v),$(l,y,"all")),t.cropBoxResizable||(V(u.getElementsByClassName("".concat("cropper","-line")),d),V(u.getElementsByClassName("".concat("cropper","-point")),d)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),B(t.ready)&&ee(e,"ready",t.ready,{once:!0}),te(e,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),W(this.element,d))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&t(r.prototype,n),i&&t(r,i),e}();return j(be.prototype,he,de,fe,ge,me,ve),be},"object"==typeof vo.exports?vo.exports=ho():(po=po||self).Cropper=ho(),vo=vo.exports;var bo,wo,So=oe.h,_o=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).save=function(){t.cropper.getCroppedCanvas().toBlob((function(e){return t.props.save(e)}),t.props.currentImage.type,t.props.opts.quality)},t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,yo(t,r);var i=n.prototype;return i.componentDidMount=function(){this.cropper=new vo(this.imgElement,this.props.opts.cropperOptions)},i.componentWillUnmount=function(){this.cropper.destroy()},i.renderRevert=function(){var e=this;return So("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("revert"),"data-microtip-position":"top",role:"tooltip",onClick:function(){e.cropper.reset(),e.cropper.setAspectRatio(0)}},So("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},So("path",{d:"M0 0h24v24H0z",fill:"none"}),So("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))},i.renderRotate=function(){var e=this;return So("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:function(){return e.cropper.rotate(90)},"aria-label":this.props.i18n("rotate"),"data-microtip-position":"top",role:"tooltip"},So("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},So("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),So("path",{d:"M7.47 21.49C4.2 19.93 1.86 16.76 1.5 13H0c.51 6.16 5.66 11 11.95 11 .23 0 .44-.02.66-.03L8.8 20.15l-1.33 1.34zM12.05 0c-.23 0-.44.02-.66.04l3.81 3.81 1.33-1.33C19.8 4.07 22.14 7.24 22.5 11H24c-.51-6.16-5.66-11-11.95-11zM16 14h2V8c0-1.11-.9-2-2-2h-6v2h6v6zm-8 2V4H6v2H4v2h2v8c0 1.1.89 2 2 2h8v2h2v-2h2v-2H8z"})))},i.renderFlip=function(){var e=this;return So("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("flipHorizontal"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.scaleX(-e.cropper.getData().scaleX||-1)}},So("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},So("path",{d:"M0 0h24v24H0z",fill:"none"}),So("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))},i.renderZoomIn=function(){var e=this;return So("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("zoomIn"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.zoom(.1)}},So("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},So("path",{d:"M0 0h24v24H0V0z",fill:"none"}),So("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),So("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))},i.renderZoomOut=function(){var e=this;return So("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("zoomOut"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.zoom(-.1)}},So("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},So("path",{d:"M0 0h24v24H0V0z",fill:"none"}),So("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))},i.renderCropSquare=function(){var e=this;return So("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("aspectRatioSquare"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.setAspectRatio(1)}},So("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},So("path",{d:"M0 0h24v24H0z",fill:"none"}),So("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))},i.renderCropWidescreen=function(){var e=this;return So("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("aspectRatioLandscape"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.setAspectRatio(16/9)}},So("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},So("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),So("path",{fill:"none",d:"M0 0h24v24H0z"})))},i.renderCropWidescreenVertical=function(){var e=this;return So("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("aspectRatioPortrait"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.setAspectRatio(9/16)}},So("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},So("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),So("path",{d:"M0 0h24v24H0z",fill:"none"})))},i.render=function(){var e=this,t=this.props,r=t.currentImage,n=t.i18n,i=t.opts.actions,o=URL.createObjectURL(r.data);return So("div",{className:"uppy-ImageCropper"},So("div",{className:"uppy-ImageCropper-container"},So("img",{className:"uppy-ImageCropper-image",alt:r.name,src:o,ref:function(t){e.imgElement=t}})),So("div",{className:"uppy-ImageCropper-controls"},So("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":n("save"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.save()}},So("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},So("path",{d:"M0 0h24v24H0z",fill:"none"}),So("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}))),i.revert&&this.renderRevert(),i.rotate&&this.renderRotate(),i.flip&&this.renderFlip(),i.zoomIn&&this.renderZoomIn(),i.zoomOut&&this.renderZoomOut(),i.cropSquare&&this.renderCropSquare(),i.cropWidescreen&&this.renderCropWidescreen(),i.cropWidescreenVertical&&this.renderCropWidescreenVertical()))},n}(oe.Component);function Po(){return(Po=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 ko(e,t){return(ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Co,Oo,Eo=le.Plugin,Ao=oe.h,Fo=(wo=bo=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).save=function(e){var t=n.getPluginState().currentImage;n.uppy.setFileState(t.id,{data:e,size:e.size,preview:null});var r=n.uppy.getFile(t.id);n.uppy.emit("thumbnail:request",r),n.setPluginState({currentImage:r}),n.uppy.emit("file-editor:complete",r)},n.selectFile=function(e){n.uppy.emit("file-editor:start",e),n.setPluginState({currentImage:e})},n.id=n.opts.id||"ImageEditor",n.title="Image Editor",n.type="editor",n.defaultLocale={strings:{save:"Save",revert:"Revert",rotate:"Rotate",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontal",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}},n.opts=Po({},{quality:.8},r,{actions:Po({},{revert:!0,rotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},r.actions),cropperOptions:Po({},{viewMode:1,background:!1,autoCropArea:1,responsive:!0},r.cropperOptions)}),n.i18nInit(),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,ko(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},i.canEditFile=function(e){if(!e.type||e.isRemote)return!1;var t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)},i.install=function(){this.setPluginState({currentImage:null});var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},i.render=function(){var e=this.getPluginState().currentImage;if(null!==e&&!e.isRemote)return Ao(_o,{currentImage:e,save:this.save,opts:this.opts,i18n:this.i18n})},n}(Eo),bo.VERSION="0.2.6",wo);function Ro(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xo(e,t){return(xo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Uo=le.Plugin,To=$e.Provider,Do=Jt.ProviderViews,Bo=oe.h,Io=(Oo=Co=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).id=n.opts.id||"Dropbox",To.initPlugin(Ro(n),r),n.title=n.opts.title||"Dropbox",n.icon=function(){return Bo("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Bo("g",{fill:"none",fillRule:"evenodd"},Bo("rect",{className:"uppy-ProviderIconBg",fill:"#0D2481",width:"32",height:"32",rx:"16"}),Bo("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",fillRule:"nonzero"})))},n.provider=new To(t,{companionUrl:n.opts.companionUrl,companionHeaders:n.opts.companionHeaders||n.opts.serverHeaders,companionKeysParams:n.opts.companionKeysParams,companionCookiesRule:n.opts.companionCookiesRule,provider:"dropbox",pluginId:n.id}),n.onFirstRender=n.onFirstRender.bind(Ro(n)),n.render=n.render.bind(Ro(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,xo(t,r);var i=n.prototype;return i.install=function(){this.view=new Do(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 Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])},i.render=function(e){return this.view.render(e)},n}(Uo),Co.VERSION="1.5.1",Oo);function No(e,t){return(No=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Mo,jo,Lo=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,No(t,r),n.prototype.toggleCheckbox=function(t,r){t.stopPropagation(),t.preventDefault(),r.custom.isTeamDrive||r.custom.isSharedDrive||e.prototype.toggleCheckbox.call(this,t,r)},n}(Jt.ProviderViews);function zo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ho(e,t){return(Ho=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var qo,Vo,Wo=le.Plugin,Xo=$e.Provider,Yo=oe.h,Go=(jo=Mo=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).id=n.opts.id||"GoogleDrive",n.title=n.opts.title||"Google Drive",Xo.initPlugin(zo(n),r),n.title=n.opts.title||"Google Drive",n.icon=function(){return Yo("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Yo("g",{fill:"none",fillRule:"evenodd"},Yo("rect",{className:"uppy-ProviderIconBg",fill:"#4285F4",width:"32",height:"32",rx:"16"}),Yo("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"})))},n.provider=new Xo(t,{companionUrl:n.opts.companionUrl,companionHeaders:n.opts.companionHeaders||n.opts.serverHeaders,companionKeysParams:n.opts.companionKeysParams,companionCookiesRule:n.opts.companionCookiesRule,provider:"drive",pluginId:n.id}),n.onFirstRender=n.onFirstRender.bind(zo(n)),n.render=n.render.bind(zo(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ho(t,r);var i=n.prototype;return i.install=function(){this.view=new Lo(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 Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder("root","/")])},i.render=function(e){return this.view.render(e)},n}(Wo),Mo.VERSION="1.7.1",jo);function Ko(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $o(e,t){return($o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Jo,Qo,Zo=le.Plugin,es=$e.Provider,ts=Jt.ProviderViews,rs=oe.h,ns=(Vo=qo=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).id=n.opts.id||"Instagram",es.initPlugin(Ko(n),r),n.title=n.opts.title||"Instagram",n.icon=function(){return rs("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},rs("g",{fill:"none",fillRule:"evenodd"},rs("rect",{className:"uppy-ProviderIconBg",fill:"#E1306C",width:"32",height:"32",rx:"16"}),rs("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"})))},n.provider=new es(t,{companionUrl:n.opts.companionUrl,companionHeaders:n.opts.companionHeaders||n.opts.serverHeaders,companionKeysParams:n.opts.companionKeysParams,companionCookiesRule:n.opts.companionCookiesRule,provider:"instagram",pluginId:n.id}),n.onFirstRender=n.onFirstRender.bind(Ko(n)),n.render=n.render.bind(Ko(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,$o(t,r);var i=n.prototype;return i.install=function(){this.view=new ts(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(){return Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder("recent")])},i.render=function(e){return this.view.render(e)},n}(Zo),qo.VERSION="1.5.1",Vo);function is(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function os(e,t){return(os=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ss,as,us=le.Plugin,ls=$e.Provider,cs=Jt.ProviderViews,ps=oe.h,hs=(Qo=Jo=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).id=n.opts.id||"OneDrive",ls.initPlugin(is(n),r),n.title=n.opts.title||"OneDrive",n.icon=function(){return ps("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},ps("g",{fill:"none",fillRule:"evenodd"},ps("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16",fill:"#0262C0"}),ps("g",{fill:"#FFF",fillRule:"nonzero"},ps("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"}),ps("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"}))))},n.provider=new ls(t,{companionUrl:n.opts.companionUrl,companionHeaders:n.opts.companionHeaders||n.opts.serverHeaders,companionCookiesRule:n.opts.companionCookiesRule,provider:"onedrive",pluginId:n.id}),n.onFirstRender=n.onFirstRender.bind(is(n)),n.render=n.render.bind(is(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,os(t,r);var i=n.prototype;return i.install=function(){this.view=new cs(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 Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])},i.render=function(e){return this.view.render(e)},n}(us),Jo.VERSION="1.2.1",Qo);function ds(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fs(e,t){return(fs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var gs,ms,vs=le.Plugin,ys=$e.Provider,bs=Jt.ProviderViews,ws=oe.h,Ss=(as=ss=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).id=n.opts.id||"Box",ys.initPlugin(ds(n),r),n.title=n.opts.title||"Box",n.icon=function(){return ws("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},ws("g",{fill:"none",fillRule:"evenodd"},ws("rect",{className:"uppy-ProviderIconBg",fill:"#0061D5",width:"32",height:"32",rx:"16"}),ws("g",{fill:"#fff",fillRule:"nonzero"},ws("path",{d:"m16.4 13.5c-1.6 0-3 0.9-3.7 2.2-0.7-1.3-2.1-2.2-3.7-2.2-1 0-1.8 0.3-2.5 0.8v-3.6c-0.1-0.3-0.5-0.7-1-0.7s-0.8 0.4-0.8 0.8v7c0 2.3 1.9 4.2 4.2 4.2 1.6 0 3-0.9 3.7-2.2 0.7 1.3 2.1 2.2 3.7 2.2 2.3 0 4.2-1.9 4.2-4.2 0.1-2.4-1.8-4.3-4.1-4.3m-7.5 6.8c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5m7.5 0c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5"}),ws("path",{d:"m27.2 20.6l-2.3-2.8 2.3-2.8c0.3-0.4 0.2-0.9-0.2-1.2s-1-0.2-1.3 0.2l-2 2.4-2-2.4c-0.3-0.4-0.9-0.4-1.3-0.2-0.4 0.3-0.5 0.8-0.2 1.2l2.3 2.8-2.3 2.8c-0.3 0.4-0.2 0.9 0.2 1.2s1 0.2 1.3-0.2l2-2.4 2 2.4c0.3 0.4 0.9 0.4 1.3 0.2 0.4-0.3 0.4-0.8 0.2-1.2"}))))},n.provider=new ys(t,{companionUrl:n.opts.companionUrl,companionHeaders:n.opts.companionHeaders||n.opts.serverHeaders,companionKeysParams:n.opts.companionKeysParams,companionCookiesRule:n.opts.companionCookiesRule,provider:"box",pluginId:n.id}),n.onFirstRender=n.onFirstRender.bind(ds(n)),n.render=n.render.bind(ds(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,fs(t,r);var i=n.prototype;return i.install=function(){this.view=new bs(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)},n}(vs),ss.VERSION="0.3.11",as);function _s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ps(e,t){return(Ps=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ks,Cs,Os=le.Plugin,Es=$e.Provider,As=Jt.ProviderViews,Fs=oe.h,Rs=(ms=gs=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).id=n.opts.id||"Facebook",Es.initPlugin(_s(n),r),n.title=n.opts.title||"Facebook",n.icon=function(){return Fs("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Fs("g",{fill:"none",fillRule:"evenodd"},Fs("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16",fill:"#3C5A99"}),Fs("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",fillRule:"nonzero"})))},n.provider=new Es(t,{companionUrl:n.opts.companionUrl,companionHeaders:n.opts.companionHeaders||n.opts.serverHeaders,companionKeysParams:n.opts.companionKeysParams,companionCookiesRule:n.opts.companionCookiesRule,provider:"facebook",pluginId:n.id}),n.onFirstRender=n.onFirstRender.bind(_s(n)),n.render=n.render.bind(_s(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ps(t,r);var i=n.prototype;return i.install=function(){this.view=new As(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 Promise.all([this.provider.fetchPreAuthToken(),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)},n}(Os),gs.VERSION="1.2.1",ms);function xs(){return(xs=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 Us(e,t){return(Us=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ts=le.Plugin,Ds=oe.h,Bs=$e.SearchProvider,Is=Jt.SearchProviderViews,Ns=(Cs=ks=function(e){var t,r;function n(t,r){var n;if((n=e.call(this,t,r)||this).id=n.opts.id||"Unsplash",n.title=n.opts.title||"Unsplash",n.type="acquirer",n.icon=function(){return Ds("svg",{viewBox:"0 0 32 32",height:"32",width:"32","aria-hidden":"true"},Ds("path",{d:"M46.575 10.883v-9h12v9zm12 5h10v18h-32v-18h10v9h12z",fill:"#fff"}),Ds("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16"}),Ds("path",{d:"M13 12.5V8h6v4.5zm6 2.5h5v9H8v-9h5v4.5h6z",fill:"#fff"}))},n.opts=xs({},{},r),n.hostname=n.opts.companionUrl,!n.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");return n.provider=new Bs(t,{companionUrl:n.opts.companionUrl,companionHeaders:n.opts.companionHeaders,companionCookiesRule:n.opts.companionCookiesRule,provider:"unsplash",pluginId:n.id}),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Us(t,r);var i=n.prototype;return i.install=function(){this.view=new Is(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},i.onFirstRender=function(){},i.render=function(e){return this.view.render(e)},i.uninstall=function(){this.unmount()},n}(Ts),ks.VERSION="0.1.12",Cs);function Ms(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function js(e,t){return(js=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ls,zs,Hs=oe.h,qs=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).handleKeyPress=r.handleKeyPress.bind(Ms(r)),r.handleClick=r.handleClick.bind(Ms(r)),r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,js(t,r);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 e=this;return Hs("div",{className:"uppy-Url"},Hs("input",{className:"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(t){e.input=t},"data-uppy-super-focusable":!0}),Hs("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Url-importButton",type:"button",onClick:this.handleClick},this.props.i18n("import")))},n}(oe.Component),Vs=function(e,t,r){var n,i=gi(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)}))}))};function Ws(){return(Ws=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 Xs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ys(e,t){return(Ys=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Gs=le.Plugin,Ks=oe.h,$s=$e.RequestClient;function Js(){return Ks("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Ks("g",{fill:"none",fillRule:"evenodd"},Ks("rect",{className:"uppy-ProviderIconBg",fill:"#FF753E",width:"32",height:"32",rx:"16"}),Ks("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",fillRule:"nonzero"})))}var Qs=(zs=Ls=function(e){var t,r;function n(t,r){var n;if((n=e.call(this,t,r)||this).id=n.opts.id||"Url",n.title=n.opts.title||"Link",n.type="acquirer",n.icon=function(){return Ks(Js,null)},n.defaultLocale={strings:{import:"Import",enterUrlToImport:"Enter URL to import a file",failedToFetch:"Companion failed to fetch this URL, please make sure it\u2019s correct",enterCorrectUrl:"Incorrect URL: Please make sure you are entering a direct link to a file"}},n.opts=Ws({},{},r),n.i18nInit(),n.hostname=n.opts.companionUrl,!n.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");return n.getMeta=n.getMeta.bind(Xs(n)),n.addFile=n.addFile.bind(Xs(n)),n.handleRootDrop=n.handleRootDrop.bind(Xs(n)),n.handleRootPaste=n.handleRootPaste.bind(Xs(n)),n.client=new $s(t,{companionUrl:n.opts.companionUrl,companionHeaders:n.opts.companionHeaders||n.opts.serverHeaders,companionCookiesRule:n.opts.companionCookiesRule}),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ys(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([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(e){var t=this;return e=this.addProtocolToURL(e),this.checkIfCorrectURL(e)?this.getMeta(e).then((function(r){return{source:t.id,name:t.getFileNameFromUrl(e),type:r.type,data:{size:r.size},isRemote:!0,body:{url:e},remote:{companionUrl:t.opts.companionUrl,url:t.hostname+"/url/get",body:{fileId:e,url:e},providerOptions:t.client.opts}}})).then((function(e){t.uppy.log("[Url] Adding remote file");try{t.uppy.addFile(e)}catch(th){th.isRestriction||t.uppy.log(th)}})).catch((function(e){t.uppy.log(e),t.uppy.info({message:t.i18n("failedToFetch"),details:e},"error",4e3)})):(this.uppy.log("[URL] Incorrect URL entered: "+e),void this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3))},i.handleRootDrop=function(e){var t=this;Vs(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;Vs(e.clipboardData,"paste",(function(e){t.uppy.log("[URL] Adding file from pasted url: "+e),t.addFile(e)}))},i.render=function(e){return Ks(qs,{i18n:this.i18n,addFile:this.addFile})},i.install=function(){var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},n}(Gs),Ls.VERSION="1.5.22",zs),Zs={"audio/mp3":"mp3","audio/mp4":"mp4","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"},ea=function(e){return e=e.replace(/;.*$/,""),Zs[e]||null},ta=oe.h,ra=function(e){return ta("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},ta("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",fillRule:"evenodd"}))},na=oe.h,ia=function(e){var t=e.onSnapshot,r=e.i18n;return na("button",{className:"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},ra())},oa=oe.h,sa=function(e){var t=e.recording,r=e.onStartRecording,n=e.onStopRecording,i=e.i18n;return t?oa("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:i("stopRecording"),"aria-label":i("stopRecording"),onClick:n,"data-uppy-super-focusable":!0},oa("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},oa("rect",{x:"15",y:"15",width:"70",height:"70"}))):oa("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:i("startRecording"),"aria-label":i("startRecording"),onClick:r,"data-uppy-super-focusable":!0},oa("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},oa("circle",{cx:"50",cy:"50",r:"40"})))},aa=oe.h,ua=function(e){var t,r=e.recordingLengthSeconds,n=e.i18n,i=(t=r,Math.floor(t/60)+":"+String(t%60).padStart(2,0));return aa("span",{"aria-label":n("recordingLength",{recording_length:i})},i)},la=oe.h,ca=oe.h,pa=function(e){var t=e.onSubmit,r=e.i18n;return ca("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:r("submitRecordedFile"),"aria-label":r("submitRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},ca("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},ca("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))},ha=oe.h,da=function(e){var t=e.onDiscard,r=e.i18n;return ha("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:r("discardRecordedFile"),"aria-label":r("discardRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},ha("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},ha("g",{fill:"#FFF",fillRule:"evenodd"},ha("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),ha("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))};function fa(){return(fa=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 ga(e,t){return(ga=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ma=oe.h;function va(e,t){return-1!==e.indexOf(t)}var ya,ba,wa=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,ga(t,r);var i=n.prototype;return i.componentDidMount=function(){(0,this.props.onFocus)()},i.componentWillUnmount=function(){(0,this.props.onStop)()},i.render=function(){var e=this,t=this.props,r=t.src,n=t.recordedVideo,i=t.recording,o=t.modes,s=t.supportsRecording,a=t.videoSources,u=t.showVideoSourceDropdown,l=t.showRecordingLength,c=t.onSubmit,p=t.i18n,h=t.mirror,d=t.onSnapshot,f=t.onStartRecording,g=t.onStopRecording,m=t.onDiscardRecordedVideo,v=t.recordingLengthSeconds,y=!!n,b=!y&&s&&(va(o,"video-only")||va(o,"audio-only")||va(o,"video-audio")),w=!y&&va(o,"picture"),S=s&&l,_=u&&a&&a.length>1,P={playsinline:!0};return n?(P.muted=!1,P.controls=!0,P.src=n,this.videoElement&&(this.videoElement.srcObject=void 0)):(P.muted=!0,P.autoplay=!0,P.srcObject=r),ma("div",{className:"uppy uppy-Webcam-container"},ma("div",{className:"uppy-Webcam-videoContainer"},ma("video",fa({ref:function(t){return e.videoElement=t},className:"uppy-Webcam-video  "+(h?"uppy-Webcam-video--mirrored":"")},P))),ma("div",{className:"uppy-Webcam-footer"},ma("div",{className:"uppy-Webcam-videoSourceContainer"},_?function(e){var t=e.currentDeviceId,r=e.videoSources,n=e.onChangeVideoSource;return la("div",{className:"uppy-Webcam-videoSource"},la("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:function(e){n(e.target.value)}},r.map((function(e){return la("option",{key:e.deviceId,value:e.deviceId,selected:e.deviceId===t},e.label)}))))}(this.props):null),ma("div",{className:"uppy-Webcam-buttonContainer"},w&&ma(ia,{onSnapshot:d,i18n:p}),b&&ma(sa,{recording:i,onStartRecording:f,onStopRecording:g,i18n:p}),y&&ma(pa,{onSubmit:c,i18n:p}),y&&ma(da,{onDiscard:m,i18n:p})),S&&ma("div",{className:"uppy-Webcam-recordingLength"},ma(ua,{recordingLengthSeconds:v,i18n:p}))))},n}(oe.Component),Sa=oe.h,_a=function(e){return Sa("div",{className:"uppy-Webcam-permissons"},Sa("div",{className:"uppy-Webcam-permissonsIcon"},e.icon()),Sa("h1",{className:"uppy-Webcam-title"},e.hasCamera?e.i18n("allowAccessTitle"):e.i18n("noCameraTitle")),Sa("p",null,e.hasCamera?e.i18n("allowAccessDescription"):e.i18n("noCameraDescription")))};function Pa(){return(Pa=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 ka(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ca(e,t){return(Ca=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Oa=oe.h;function Ea(e){return"."===e[0]?$[e.slice(1)]:e}function Aa(e){return/^video\/[^*]+$/.test(e)}function Fa(e){return/^image\/[^*]+$/.test(e)}var Ra=(ba=ya=function(e){var t,r;function n(t,r){var n;(n=e.call(this,t,r)||this).mediaDevices=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(r,n){e.call(navigator,t,r,n)}))}}:null}(),n.supportsUserMedia=!!n.mediaDevices,n.protocol=location.protocol.match(/https/i)?"https":"http",n.id=n.opts.id||"Webcam",n.title=n.opts.title||"Camera",n.type="acquirer",n.capturedMediaFile=null,n.icon=function(){return Oa("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Oa("g",{fill:"none",fillRule:"evenodd"},Oa("rect",{className:"uppy-ProviderIconBg",fill:"#03BFEF",width:"32",height:"32",rx:"16"}),Oa("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",fillRule:"nonzero"})))},n.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}",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file"}};var i={onBeforeSnapshot:function(){return Promise.resolve()},countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,facingMode:"user",preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1};return n.opts=Pa({},i,r),n.i18nInit(),n.install=n.install.bind(ka(n)),n.setPluginState=n.setPluginState.bind(ka(n)),n.render=n.render.bind(ka(n)),n.start=n.start.bind(ka(n)),n.stop=n.stop.bind(ka(n)),n.takeSnapshot=n.takeSnapshot.bind(ka(n)),n.startRecording=n.startRecording.bind(ka(n)),n.stopRecording=n.stopRecording.bind(ka(n)),n.discardRecordedVideo=n.discardRecordedVideo.bind(ka(n)),n.submit=n.submit.bind(ka(n)),n.oneTwoThreeSmile=n.oneTwoThreeSmile.bind(ka(n)),n.focus=n.focus.bind(ka(n)),n.changeVideoSource=n.changeVideoSource.bind(ka(n)),n.webcamActive=!1,n.opts.countdown&&(n.opts.onBeforeSnapshot=n.oneTwoThreeSmile),n.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null}),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ca(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,Pa({},t,{videoConstraints:Pa({},this.opts.videoConstraints,null==t?void 0:t.videoConstraints)})),this.i18nInit()},i.i18nInit=function(){this.translator=new C([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.hasCameraCheck=function(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then((function(e){return e.some((function(e){return"videoinput"===e.kind}))})):Promise.resolve(!1)},i.isAudioOnly=function(){return 1===this.opts.modes.length&&"audio-only"===this.opts.modes[0]},i.getConstraints=function(e){var t;void 0===e&&(e=null);var r=-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),n=!this.isAudioOnly()&&(-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("video-only")||-1!==this.opts.modes.indexOf("picture")),i=Pa({},null!=(t=this.opts.videoConstraints)?t:{facingMode:this.opts.facingMode},e?{deviceId:e,facingMode:null}:{});return{audio:r,video:!!n&&i}},i.start=function(e){var t=this;if(void 0===e&&(e=null),!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror=!0;var r=this.getConstraints(e&&e.deviceId?e.deviceId:null);this.hasCameraCheck().then((function(n){return t.setPluginState({hasCamera:n}),t.mediaDevices.getUserMedia(r).then((function(r){t.stream=r;var n=null,i=t.isAudioOnly()?r.getAudioTracks():r.getVideoTracks();e&&e.deviceId?i.forEach((function(t){t.getSettings().deviceId===e.deviceId&&(n=t.getSettings().deviceId)})):n=i[0].getSettings().deviceId,t.updateVideoSources(),t.setPluginState({currentDeviceId:n,cameraReady:!0})})).catch((function(e){t.setPluginState({cameraReady:!1,cameraError:e}),t.uppy.info(e.message,"error")}))}))},i.getMediaRecorderOptions=function(){var e={};if(MediaRecorder.isTypeSupported){var t=this.uppy.opts.restrictions,r=[];this.opts.preferredVideoMimeType?r=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(r=t.allowedFileTypes.map(Ea).filter(Aa));var n=r.filter((function(e){return MediaRecorder.isTypeSupported(e)&&ea(e)}));n.length>0&&(e.mimeType=n[0])}return e},i.startRecording=function(){var e=this;this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];var t=!1;this.recorder.addEventListener("dataavailable",(function(r){e.recordingChunks.push(r.data);var n=e.uppy.opts.restrictions;if(e.recordingChunks.length>1&&null!=n.maxFileSize&&!t){var i=e.recordingChunks.reduce((function(e,t){return e+t.size}),0),o=(i-e.recordingChunks[0].size)/(e.recordingChunks.length-1)*3;i>Math.max(0,n.maxFileSize-o)&&(t=!0,e.uppy.info(e.i18n("recordingStoppedMaxSize"),"warning",4e3),e.stopRecording())}})),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval((function(){var t=e.getPluginState().recordingLengthSeconds;e.setPluginState({recordingLengthSeconds:t+1})}),1e3)),this.setPluginState({isRecording:!0})},i.stopRecording=function(){var e=this;return new Promise((function(t){e.recorder.addEventListener("stop",(function(){t()})),e.recorder.stop(),e.opts.showRecordingLength&&(clearInterval(e.recordingLengthTimer),e.setPluginState({recordingLengthSeconds:0}))})).then((function(){return e.setPluginState({isRecording:!1}),e.getVideo()})).then((function(t){try{e.capturedMediaFile=t,e.setPluginState({recordedVideo:URL.createObjectURL(t.data)}),e.opts.mirror=!1}catch(th){th.isRestriction||e.uppy.log(th)}})).then((function(){e.recordingChunks=null,e.recorder=null}),(function(t){throw e.recordingChunks=null,e.recorder=null,t}))},i.discardRecordedVideo=function(){this.setPluginState({recordedVideo:null}),this.opts.mirror=!0,this.capturedMediaFile=null},i.submit=function(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(th){th.isRestriction||this.uppy.log(th,"error")}},i.stop=function(){this.stream&&(this.stream.getAudioTracks().forEach((function(e){e.stop()})),this.stream.getVideoTracks().forEach((function(e){e.stop()}))),this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null})},i.getVideoElement=function(){return this.el.querySelector(".uppy-Webcam-video")},i.oneTwoThreeSmile=function(){var e=this;return new Promise((function(t,r){var n=e.opts.countdown,i=setInterval((function(){if(!e.webcamActive)return clearInterval(i),e.captureInProgress=!1,r(new Error("Webcam is not active"));n>0?(e.uppy.info(n+"...","warning",800),n--):(clearInterval(i),e.uppy.info(e.i18n("smile"),"success",1500),setTimeout((function(){return t()}),1500))}),1e3)}))},i.takeSnapshot=function(){var e=this;this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch((function(t){var r="object"==typeof t?t.message:t;return e.uppy.info(r,"error",5e3),Promise.reject(new Error("onBeforeSnapshot: "+r))})).then((function(){return e.getImage()})).then((function(t){e.captureInProgress=!1;try{e.uppy.addFile(t)}catch(th){th.isRestriction||e.uppy.log(th)}}),(function(t){throw e.captureInProgress=!1,t})))},i.getImage=function(){var e=this,t=this.getVideoElement();if(!t)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));var r=t.videoWidth,n=t.videoHeight,i=document.createElement("canvas");i.width=r,i.height=n,i.getContext("2d").drawImage(t,0,0);var o=this.uppy.opts.restrictions,s=[];this.opts.preferredImageMimeType?s=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(s=o.allowedFileTypes.map(Ea).filter(Fa));var a=s[0]||"image/jpeg",u=ea(a)||"jpg",l="cam-"+Date.now()+"."+u;return function(e,t,r){return e.toBlob?new Promise((function(n){e.toBlob(n,t,r)})):Promise.resolve().then((function(){return Kn(e.toDataURL(t,r),{})}))}(i,a).then((function(t){return{source:e.id,name:l,data:new Blob([t],{type:a}),type:a}}))},i.getVideo=function(){var e=this.recordingChunks.find((function(e){var t;return(null==(t=e.type)?void 0:t.length)>0})).type,t=ea(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)},i.focus=function(){var e=this;this.opts.countdown&&setTimeout((function(){e.uppy.info(e.i18n("smile"),"success",1500)}),1e3)},i.changeVideoSource=function(e){this.stop(),this.start({deviceId:e})},i.updateVideoSources=function(){var e=this;this.mediaDevices.enumerateDevices().then((function(t){e.setPluginState({videoSources:t.filter((function(e){return"videoinput"===e.kind}))})}))},i.render=function(){this.webcamActive||this.start();var e=this.getPluginState();return e.cameraReady&&e.hasCamera?Oa(wa,Pa({},e,{onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedVideo:this.discardRecordedVideo,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:"function"==typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"==typeof MediaRecorder.prototype.start,recording:e.isRecording,mirror:this.opts.mirror,src:this.stream})):Oa(_a,{icon:ra,i18n:this.i18n,hasCamera:e.hasCamera})},i.install=function(){var e=this;this.setPluginState({cameraReady:!1,recordingLengthSeconds:0});var t=this.opts.target;t&&this.mount(t,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=function(){if(e.updateVideoSources(),e.stream){var t=!0,r=e.getPluginState(),n=r.videoSources,i=r.currentDeviceId;n.forEach((function(e){i===e.deviceId&&(t=!1)})),t&&(e.stop(),e.start())}})},i.uninstall=function(){this.stream&&this.stop(),this.unmount()},n}(le.Plugin),ya.VERSION="1.8.11",ba),xa=oe.h,Ua=function(){return xa("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},xa("g",{fill:"none",fillRule:"evenodd"},xa("rect",{className:"uppy-ProviderIconBg",fill:"#2C3E50",width:"32",height:"32",rx:"16"}),xa("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",fillRule:"nonzero"}),xa("circle",{fill:"#FFF",cx:"16",cy:"16",r:"2"})))},Ta=oe.h,Da=function(e){var t=e.recording,r=e.onStartRecording,n=e.onStopRecording,i=e.i18n;return t?Ta("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video uppy-ScreenCapture-button--stop-rec",type:"button",title:i("stopCapturing"),"aria-label":i("stopCapturing"),onClick:n,"data-uppy-super-focusable":!0},Ta("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},Ta("rect",{x:"15",y:"15",width:"70",height:"70"}))):Ta("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video",type:"button",title:i("startCapturing"),"aria-label":i("startCapturing"),onClick:r,"data-uppy-super-focusable":!0},Ta("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},Ta("circle",{cx:"50",cy:"50",r:"40"})))},Ba=oe.h,Ia=function(e){var t=e.recording,r=e.recordedVideo,n=e.onSubmit,i=e.i18n;return r&&!t?Ba("button",{className:"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},Ba("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},Ba("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"}))):null};function Na(){return(Na=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 Ma(e,t){return(Ma=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ja=oe.h,La=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).state={elapsedTime:0},r.wrapperStyle={width:"100%",height:"100%",display:"flex"},r.overlayStyle={position:"absolute",width:"100%",height:"100%",background:"black",opacity:.7},r.infoContainerStyle={marginLeft:"auto",marginRight:"auto",marginTop:"auto",marginBottom:"auto",zIndex:1,color:"white"},r.infotextStyle={marginLeft:"auto",marginRight:"auto",marginBottom:"1rem",fontSize:"1.5rem"},r.timeStyle={display:"block",fontWeight:"bold",marginLeft:"auto",marginRight:"auto",fontSize:"3rem",fontFamily:"Courier New"},r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ma(t,r);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+(e>9?":":":0")+e},i.render=function(){var e=Na({},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?ja("div",{style:this.wrapperStyle},ja("div",{style:this.overlayStyle}),ja("div",{style:this.infoContainerStyle},ja("div",{style:this.infotextStyle},r("recording")),ja("div",{style:this.timeStyle},n))):null},n}(oe.Component),za=oe.h,Ha=function(e){var t=e.streamActive,r=e.i18n;return t?za("div",{title:r("streamActive"),"aria-label":r("streamActive"),className:"uppy-ScreenCapture-icon--stream uppy-ScreenCapture-icon--streamActive"},za("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},za("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),za("path",{d:"M0 0h24v24H0z",fill:"none"}),za("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"}))):za("div",{title:r("streamPassive"),"aria-label":r("streamPassive"),className:"uppy-ScreenCapture-icon--stream"},za("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},za("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),za("path",{d:"M0 0h24v24H0z",fill:"none"}),za("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 qa(){return(qa=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 Va(e,t){return(Va=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Wa,Xa,Ya=oe.h,Ga=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,Va(t,r);var i=n.prototype;return i.componentWillUnmount=function(){this.props.onStop()},i.render=function(){var e=this,t=this.props,r=t.recording,n=t.stream,i=t.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)),Ya("div",{className:"uppy uppy-ScreenCapture-container"},Ya("div",{className:"uppy-ScreenCapture-videoContainer"},Ya(Ha,this.props),Ya("video",qa({ref:function(t){return e.videoElement=t},className:"uppy-ScreenCapture-video"},o)),Ya(La,this.props)),Ya("div",{className:"uppy-ScreenCapture-buttonContainer"},Ya(Da,this.props),Ya(Ia,this.props)))},n}(oe.Component);function Ka(){return(Ka=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 $a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ja(e,t){return(Ja=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qa=oe.h,Za=(Xa=Wa=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).mediaDevices=navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&window&&window.MediaRecorder?navigator.mediaDevices:null,n.protocol=location.protocol.match(/https/i)?"https":"http",n.id=n.opts.id||"ScreenCapture",n.title=n.opts.title||"Screencast",n.type="acquirer",n.icon=Ua,n.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"}},n.opts=Ka({},{displayMediaConstraints:{video:{width:1280,height:720,frameRate:{ideal:3,max:5},cursor:"motion",displaySurface:"monitor"}},userMediaConstraints:{audio:!0},preferredVideoMimeType:"video/webm"},r),n.translator=new C([n.defaultLocale,n.uppy.locale,n.opts.locale]),n.i18n=n.translator.translate.bind(n.translator),n.i18nArray=n.translator.translateArray.bind(n.translator),n.install=n.install.bind($a(n)),n.setPluginState=n.setPluginState.bind($a(n)),n.render=n.render.bind($a(n)),n.start=n.start.bind($a(n)),n.stop=n.stop.bind($a(n)),n.startRecording=n.startRecording.bind($a(n)),n.stopRecording=n.stopRecording.bind($a(n)),n.submit=n.submit.bind($a(n)),n.streamInterrupted=n.streamInactivated.bind($a(n)),n.captureActive=!1,n.capturedMediaFile=null,n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ja(t,r);var i=n.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 e=this;if(!this.mediaDevices)return Promise.reject(new Error("Screen recorder access not supported"));this.captureActive=!0,this.selectAudioStreamSource(),this.selectVideoStreamSource().then((function(t){!1===t&&e.parent&&e.parent.hideAllPanels&&(e.parent.hideAllPanels(),e.captureActive=!1)}))},i.selectVideoStreamSource=function(){var e=this;return this.videoStream?new Promise((function(t){return t(e.videoStream)})):this.mediaDevices.getDisplayMedia(this.opts.displayMediaConstraints).then((function(t){return e.videoStream=t,e.videoStream.addEventListener("inactive",(function(t){e.streamInactivated()})),e.setPluginState({streamActive:!0}),t})).catch((function(t){return e.setPluginState({screenRecError:t}),e.userDenied=!0,setTimeout((function(){e.userDenied=!1}),1e3),!1}))},i.selectAudioStreamSource=function(){var e=this;return this.audioStream?new Promise((function(t){return t(e.audioStream)})):this.mediaDevices.getUserMedia(this.opts.userMediaConstraints).then((function(t){return e.audioStream=t,e.setPluginState({audioStreamActive:!0}),t})).catch((function(t){return"NotAllowedError"===t.name&&e.uppy.info(e.i18n("micDisabled"),"error",5e3),!1}))},i.startRecording=function(){var e=this,t={};this.capturedMediaFile=null,this.recordingChunks=[];var r=this.opts.preferredVideoMimeType;this.selectVideoStreamSource().then((function(n){r&&MediaRecorder.isTypeSupported(r)&&ea(r)&&(t.mimeType=r);var i=[n.getVideoTracks()[0]];e.audioStream&&i.push(e.audioStream.getAudioTracks()[0]),e.outputStream=new MediaStream(i),e.recorder=new MediaRecorder(e.outputStream,t),e.recorder.addEventListener("dataavailable",(function(t){e.recordingChunks.push(t.data)})),e.recorder.start(),e.setPluginState({recording:!0})})).catch((function(t){e.uppy.log(t,"error")}))},i.streamInactivated=function(){var e=Ka({},this.getPluginState()),t=e.recordedVideo,r=e.recording;t||r?r&&(this.uppy.log("Capture stream inactive \u2014 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 e=this;return new Promise((function(t,r){e.recorder.addEventListener("stop",(function(){t()})),e.recorder.stop()})).then((function(){return e.setPluginState({recording:!1}),e.getVideo()})).then((function(t){e.capturedMediaFile=t,e.setPluginState({recordedVideo:URL.createObjectURL(t.data)})})).then((function(){e.recordingChunks=null,e.recorder=null}),(function(t){throw e.recordingChunks=null,e.recorder=null,t}))},i.submit=function(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(th){th.isRestriction||this.uppy.log(th,"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=ea(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(),Qa(Ga,Ka({},t,{onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onStop:this.stop,onSubmit:this.submit,i18n:this.i18n,stream:this.videoStream}))},n}(le.Plugin),Wa.VERSION="1.0.20",Xa),eu=function(){function e(e){this.limit="number"!=typeof e||0===e?1/0:e,this.activeRequests=0,this.queuedHandlers=[]}var t=e.prototype;return t._call=function(e){var t=this;this.activeRequests+=1;var r,n=!1;try{r=e()}catch(th){throw this.activeRequests-=1,th}return{abort:function(){n||(n=!0,t.activeRequests-=1,r(),t._queueNext())},done:function(){n||(n=!0,t.activeRequests-=1,t._queueNext())}}},t._queueNext=function(){var e=this;Promise.resolve().then((function(){e._next()}))},t._next=function(){if(!(this.activeRequests>=this.limit)&&0!==this.queuedHandlers.length){var e=this.queuedHandlers.shift(),t=this._call(e.fn);e.abort=t.abort,e.done=t.done}},t._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=ee(this.queuedHandlers,(function(e){return n.priority>e.priority}));return-1===i?this.queuedHandlers.push(n):this.queuedHandlers.splice(i,0,n),n},t._dequeue=function(e){var t=this.queuedHandlers.indexOf(e);-1!==t&&this.queuedHandlers.splice(t,1)},t.run=function(e,t){return this.activeRequests<this.limit?this._call(e):this._queue(e,t)},t.wrapPromiseFunction=function(e,t){var r=this;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var s,a=new Promise((function(n,o){s=r.run((function(){var t,r;try{r=Promise.resolve(e.apply(void 0,i))}catch(th){r=Promise.reject(th)}return r.then((function(e){t?o(t):(s.done(),n(e))}),(function(e){t?o(t):(s.done(),o(e))})),function(){t=new Error("Cancelled")}}),t)}));return a.abort=function(){s.abort()},a}},e}(),tu=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}}))},ru=z((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}),nu=function(e){var t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return(/^http:\/\//i.test(e)?"ws":"wss")+"://"+t},iu=function(){function e(e){this._events=[],this._emitter=e}var t=e.prototype;return t.on=function(e,t){return this._events.push([e,t]),this._emitter.on(e,t)},t.remove=function(){var e=this;this._events.forEach((function(t){var r=t[0],n=t[1];e._emitter.off(r,n)}))},e}(),ou=function(){function e(e,t){this._timeout=e,this._onTimedOut=t,this._isDone=!1,this._aliveTimer=null,this._onTimedOut=this._onTimedOut.bind(this)}var t=e.prototype;return t.progress=function(){this._isDone||this._timeout>0&&(this._aliveTimer&&clearTimeout(this._aliveTimer),this._aliveTimer=setTimeout(this._onTimedOut,this._timeout))},t.done=function(){this._aliveTimer&&(clearTimeout(this._aliveTimer),this._aliveTimer=null),this._isDone=!0},e}(),su=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)};function au(){return(au=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 uu=$e.Provider,lu=$e.RequestClient,cu=$e.Socket;function pu(e,t){return t||(t=new Error("Upload error")),"string"==typeof t&&(t=new Error(t)),t instanceof Error||(t=au(new Error("Upload error"),{data:t})),su(e)?t=new Ue(t,e):(t.request=e,t)}var hu,du,fu=function(){function e(e,t){this.uppy=e,this.opts=au({validateStatus:function(e,t,r){return e>=200&&e<300}},t),this.requests=t.__queue,this.uploaderEvents=Object.create(null),this.i18n=t.i18n}var t=e.prototype;return t._getOptions=function(e){var t=this.uppy.getState().xhrUpload,r=au({},this.opts,t||{},e.xhrUpload||{},{headers:{}});return au(r.headers,this.opts.headers),t&&au(r.headers,t.headers),e.xhrUpload&&au(r.headers,e.xhrUpload.headers),r},t.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)},t._addMetadata=function(e,t,r){(Array.isArray(r.metaFields)?r.metaFields:Object.keys(t)).forEach((function(r){e.append(r,t[r])}))},t._createFormDataUpload=function(e,t){var r=new FormData;this._addMetadata(r,e.meta,t);var n=function(e){return e.data.slice(0,e.data.size,e.meta.type)}(e);return e.name?r.append(t.fieldName,n,e.meta.name):r.append(t.fieldName,n),r},t._createBareUpload=function(e,t){return e.data},t._onFileRemoved=function(e,t){this.uploaderEvents[e].on("file-removed",(function(r){e===r.id&&t(r.id)}))},t._onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",(function(r){e===r&&t()}))},t._onRetryAll=function(e,t){var r=this;this.uploaderEvents[e].on("retry-all",(function(n){r.uppy.getFile(e)&&t()}))},t._onCancelAll=function(e,t){var r=this;this.uploaderEvents[e].on("cancel-all",(function(){r.uppy.getFile(e)&&t()}))},t._uploadLocalFile=function(e,t,r){var n=this,i=this._getOptions(e);return this.uppy.log("uploading "+t+" of "+r),new Promise((function(t,r){var o=i.formData?n._createFormDataUpload(e,i):n._createBareUpload(e,i),s=new XMLHttpRequest;n.uploaderEvents[e.id]=new iu(n.uppy);var a=new ou(i.timeout,(function(){s.abort(),l.done();var t=new Error(n.i18n("timedOut",{seconds:Math.ceil(i.timeout/1e3)}));n.uppy.emit("upload-error",e,t),r(t)})),u=B();s.upload.addEventListener("loadstart",(function(e){n.uppy.log("[AwsS3/XHRUpload] "+u+" started")})),s.upload.addEventListener("progress",(function(t){n.uppy.log("[AwsS3/XHRUpload] "+u+" progress: "+t.loaded+" / "+t.total),a.progress(),t.lengthComputable&&n.uppy.emit("upload-progress",e,{uploader:n,bytesUploaded:t.loaded,bytesTotal:t.total})})),s.addEventListener("load",(function(o){if(n.uppy.log("[AwsS3/XHRUpload] "+u+" finished"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),i.validateStatus(o.target.status,s.responseText,s)){var c=i.getResponseData(s.responseText,s),p=c[i.responseUrlFieldName],h={status:o.target.status,body:c,uploadURL:p};return n.uppy.emit("upload-success",e,h),p&&n.uppy.log("Download "+e.name+" from "+p),t(e)}var d=i.getResponseData(s.responseText,s),f=pu(s,i.getResponseError(s.responseText,s)),g={status:o.target.status,body:d};return n.uppy.emit("upload-error",e,f,g),r(f)})),s.addEventListener("error",(function(t){n.uppy.log("[AwsS3/XHRUpload] "+u+" errored"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null);var o=pu(s,i.getResponseError(s.responseText,s));return n.uppy.emit("upload-error",e,o),r(o)})),s.open(i.method.toUpperCase(),i.endpoint,!0),s.withCredentials=i.withCredentials,""!==i.responseType&&(s.responseType=i.responseType),Object.keys(i.headers).forEach((function(e){s.setRequestHeader(e,i.headers[e])}));var l=n.requests.run((function(){return s.send(o),function(){a.done(),s.abort()}}),{priority:1});n._onFileRemoved(e.id,(function(){l.abort(),r(new Error("File removed"))})),n._onCancelAll(e.id,(function(){l.abort(),r(new Error("Upload cancelled"))}))}))},t._uploadRemoteFile=function(e,t,r){var n=this,i=this._getOptions(e);return new Promise((function(t,r){var o={};(Array.isArray(i.metaFields)?i.metaFields:Object.keys(e.meta)).forEach((function(t){o[t]=e.meta[t]})),new(e.remote.providerOptions.provider?uu:lu)(n.uppy,e.remote.providerOptions).post(e.remote.url,au({},e.remote.body,{endpoint:i.endpoint,size:e.data.size,fieldname:i.fieldName,metadata:o,httpMethod:i.method,useFormData:i.formData,headers:i.headers})).then((function(o){var s=o.token,a=nu(e.remote.companionUrl),u=new cu({target:a+"/api/"+s,autoOpen:!1});n.uploaderEvents[e.id]=new iu(n.uppy),n._onFileRemoved(e.id,(function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was removed")})),n._onCancelAll(e.id,(function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was canceled")})),n._onRetry(e.id,(function(){u.send("pause",{}),u.send("resume",{})})),n._onRetryAll(e.id,(function(){u.send("pause",{}),u.send("resume",{})})),u.on("progress",(function(t){return ru(n,t,e)})),u.on("success",(function(r){var o=i.getResponseData(r.response.responseText,r.response),s=o[i.responseUrlFieldName],a={status:r.response.status,body:o,uploadURL:s};return n.uppy.emit("upload-success",e,a),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),t()})),u.on("error",(function(t){var o=t.response,s=o?i.getResponseError(o.responseText,o):au(new Error(t.error.message),{cause:t.error});n.uppy.emit("upload-error",e,s),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),r(s)}));var l=n.requests.run((function(){return u.open(),e.isPaused&&u.send("pause",{}),function(){return u.close()}}))})).catch((function(t){n.uppy.emit("upload-error",e,t),r(t)}))}))},e}(),gu=function(e,t){var r,n=t.headers?t.headers["content-type"]:t.getResponseHeader("Content-Type");if("string"==typeof n){var i=(r=n,r.replace(/;.*$/,"")).toLowerCase();if("application/xml"===i||"text/xml"===i)return!0;if("text/html"===i&&/^<\?xml /.test(e))return!0}return!1};function mu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vu(e,t){return(vu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yu(){return(yu=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 bu="function"==typeof URL?URL:Ve,wu=$e.RequestClient;function Su(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 _u(e){if(e&&e.error){var t=new Error(e.message);throw yu(t,e.error),t}return e}var Pu=!1,ku=(du=hu=function(e){var t,r;function n(t,r){var n;(n=e.call(this,t,r)||this).type="uploader",n.id=n.opts.id||"AwsS3",n.title="AWS S3",n.defaultLocale={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}};var i={timeout:3e4,limit:0,metaFields:[],getUploadParameters:n.getUploadParameters.bind(mu(n))};return n.opts=yu({},i,r),n.i18nInit(),n.client=new wu(t,r),n.handleUpload=n.handleUpload.bind(mu(n)),n.requests=new eu(n.opts.limit),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,vu(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},i.getUploadParameters=function(e){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address.");var t=e.meta.name,r=e.meta.type,n={};this.opts.metaFields.forEach((function(t){null!=e.meta[t]&&(n[t]=e.meta[t].toString())}));var i=Me({filename:t,type:r,metadata:n});return this.client.get("s3/params?"+i).then(_u)},i.validateParameters=function(e,t){if("object"!=typeof t||!t||"string"!=typeof t.url||"object"!=typeof t.fields&&null!=t.fields){var r=new TypeError("AwsS3: got incorrect result from 'getUploadParameters()' for file '"+e.name+"', expected an object '{ url, method, fields, headers }' but got '"+JSON.stringify(t)+"' instead.\nSee https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.");throw console.error(r),r}if(null!=t.method&&!/^(put|post)$/i.test(t.method)){var n=new TypeError("AwsS3: got incorrect method from 'getUploadParameters()' for file '"+e.name+"', expected  'put' or 'post' but got '"+t.method+"' instead.\nSee https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.");throw console.error(n),n}},i.handleUpload=function(e){var t=this,r=Object.create(null);function n(e){var t=e.id;_(r,t)&&r[t].abort()}this.uppy.on("file-removed",n),e.forEach((function(e){var r=t.uppy.getFile(e);t.uppy.emit("upload-started",r)}));var i=this.requests.wrapPromiseFunction((function(e){return t.opts.getUploadParameters(e)})),o=e.length;return tu(e.map((function(e,n){return r[e]=i(t.uppy.getFile(e)),r[e].then((function(i){delete r[e];var s=t.uppy.getFile(e);t.validateParameters(s,i);var a=i.method,u=void 0===a?"post":a,l=i.url,c=i.fields,p=i.headers,h={method:u,formData:"post"===u.toLowerCase(),endpoint:l,metaFields:c?Object.keys(c):[]};return p&&(h.headers=p),t.uppy.setFileState(s.id,{meta:yu({},s.meta,c),xhrUpload:h}),t._uploader.uploadFile(s.id,n,o)})).catch((function(n){delete r[e];var i=t.uppy.getFile(e);t.uppy.emit("upload-error",i,n)}))}))).then((function(e){return t.uppy.off("file-removed",n),e}))},i.install=function(){var e=this.uppy;this.uppy.addUploader(this.handleUpload);var t={fieldName:"file",responseUrlFieldName:"location",timeout:this.opts.timeout,__queue:this.requests,responseType:"text",getResponseData:this.opts.getResponseData||function(t,r){var n,i;return gu(t,r)?{location:(n=r.responseURL,i=Su(t,"Location"),n?new bu(i,n).toString():new bu(i).toString()),bucket:Su(t,"Bucket"),key:Su(t,"Key"),etag:Su(t,"ETag")}:"POST"===this.method.toUpperCase()?(Pu||(e.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"),Pu=!0),{location:null}):r.responseURL?{location:r.responseURL.replace(/\?.*$/,"")}:{location:null}},getResponseError:function(e,t){if(gu(e,t)){var r=Su(e,"Message");return new Error(r)}}};t.i18n=this.i18n,this._uploader=new fu(this.uppy,t)},i.uninstall=function(){this.uppy.removeUploader(this.handleUpload)},n}(le.Plugin),hu.VERSION="1.7.11",du),Cu={};function Ou(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eu(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 Au(e,t,r){return t&&Eu(e.prototype,t),r&&Eu(e,r),e}function Fu(e){return(Fu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ru(e,t){return(Ru=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uu(e,t,r){return(Uu="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=Fu(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)}Object.defineProperty(Cu,"__esModule",{value:!0});var Tu=function(){function e(){Ou(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Au(e,[{key:"addEventListener",value:function(e,t,r){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:r})}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var r=this.listeners[e],n=0,i=r.length;n<i;n++)if(r[n].callback===t)return void r.splice(n,1)}},{key:"dispatchEvent",value:function(e){if(e.type in this.listeners){for(var t=this.listeners[e.type].slice(),r=0,n=t.length;r<n;r++){var i=t[r];try{i.callback.call(this,e)}catch(o){Promise.resolve().then((function(){throw o}))}i.options&&i.options.once&&this.removeEventListener(e.type,i.callback)}return!e.defaultPrevented}}}]),e}(),Du=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ru(e,t)}(i,Tu);var t,r,n=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n,i,o=Fu(t);if(r){var s=Fu(this).constructor;e=Reflect.construct(o,arguments,s)}else e=o.apply(this,arguments);return n=this,!(i=e)||"object"!=typeof i&&"function"!=typeof i?xu(n):i});function i(){var e;return Ou(this,i),(e=n.call(this)).listeners||Tu.call(xu(e)),Object.defineProperty(xu(e),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(xu(e),"onabort",{value:null,writable:!0,configurable:!0}),e}return Au(i,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),Uu(Fu(i.prototype),"dispatchEvent",this).call(this,e)}}]),i}(),Bu=function(){function e(){Ou(this,e),Object.defineProperty(this,"signal",{value:new Du,writable:!0,configurable:!0})}return Au(e,[{key:"abort",value:function(){var e;try{e=new Event("abort")}catch(t){"undefined"!=typeof document?document.createEvent?(e=document.createEvent("Event")).initEvent("abort",!1,!1):(e=document.createEventObject()).type="abort":e={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(e)}},{key:"toString",value:function(){return"[object AbortController]"}}]),e}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(Bu.prototype[Symbol.toStringTag]="AbortController",Du.prototype[Symbol.toStringTag]="AbortSignal"),Cu.AbortController=Bu,Cu.AbortSignal=Du;var Iu={},Nu=Cu.AbortController;Cu.AbortSignal;Iu.AbortController=Nu,Iu.createAbortError=function(e){void 0===e&&(e="Aborted");try{return new DOMException(e,"AbortError")}catch(r){var t=new Error(e);return t.name="AbortError",t}};var Mu=Iu.createAbortError;function ju(){return(ju=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 Lu=Iu.AbortController,zu=Iu.createAbortError,Hu={limit:1,retryDelays:[0,1e3,3e3,5e3],getChunkSize:function(e){return Math.ceil(e.size/1e4)},onStart:function(){},onProgress:function(){},onPartComplete:function(){},onSuccess:function(){},onError:function(e){throw e}};function qu(e){if("string"==typeof e)return parseInt(e,10);if("number"==typeof e)return e;throw new TypeError("Expected a number")}var Vu,Wu,Xu=function(){function e(e,t){this.options=ju({},Hu,t),this.options.getChunkSize||(this.options.getChunkSize=Hu.getChunkSize),this.file=e,this.abortController=new Lu,this.key=this.options.key||null,this.uploadId=this.options.uploadId||null,this.parts=[],this.createdPromise=Promise.reject(),this.isPaused=!1,this.partsInProgress=0,this.chunks=null,this.chunkState=null,this._initChunks(),this.createdPromise.catch((function(){}))}var t=e.prototype;return t._aborted=function(){return this.abortController.signal.aborted},t._initChunks=function(){var e=[],t=this.options.getChunkSize(this.file),r=Math.max(5242880,Math.ceil(this.file.size/1e4)),n=Math.max(t,r);if(0===this.file.size)e.push(this.file);else for(var 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}}))},t._createUpload=function(){var e=this;return this.createdPromise=Promise.resolve().then((function(){return e.options.createMultipartUpload()})),this.createdPromise.then((function(t){if(e._aborted())throw zu();if("object"!=typeof t||!t||"string"!=typeof t.uploadId||"string"!=typeof t.key)throw new TypeError("AwsS3/Multipart: Got incorrect result from `createMultipartUpload()`, expected an object `{ uploadId, key }`.");e.key=t.key,e.uploadId=t.uploadId,e.options.onStart(t),e._uploadParts()})).catch((function(t){e._onError(t)}))},t._resumeUpload=function(){var e=this;return Promise.resolve().then((function(){return e.options.listParts({uploadId:e.uploadId,key:e.key})})).then((function(t){if(e._aborted())throw zu();t.forEach((function(t){var r=t.PartNumber-1;e.chunkState[r]={uploaded:qu(t.Size),etag:t.ETag,done:!0},e.parts.some((function(e){return e.PartNumber===t.PartNumber}))||e.parts.push({PartNumber:t.PartNumber,ETag:t.ETag})})),e._uploadParts()})).catch((function(t){e._onError(t)}))},t._uploadParts=function(){var e=this;if(!this.isPaused){var t=this.options.limit-this.partsInProgress;if(0!==t)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>=t))break}r.forEach((function(t){e._uploadPartRetryable(t).then((function(){e._uploadParts()}),(function(t){e._onError(t)}))}))}}},t._retryable=function(e){var t=this,r=e.before,n=e.attempt,i=e.after,o=this.options.retryDelays,s=this.abortController.signal;return r&&r(),function e(r){return n().catch((function(n){if(t._aborted())throw zu();if(function(e){if(e.source&&"number"==typeof e.source.status){var t=e.source.status;return 0===t||409===t||423===t||t>=500&&t<600}return!1}(n)&&r<o.length)return(i=o[r],a={signal:s},new Promise((function(e,t){if(a&&a.signal&&a.signal.aborted)return t(Mu());function r(){clearTimeout(n),o(),t(Mu())}var n=setTimeout((function(){o(),e()}),i);function o(){a&&a.signal&&a.signal.removeEventListener("abort",r)}a&&a.signal&&a.signal.addEventListener("abort",r)}))).then((function(){return e(r+1)}));var i,a;throw n}))}(0).then((function(e){return i&&i(),e}),(function(e){throw i&&i(),e}))},t._uploadPartRetryable=function(e){var t=this;return this._retryable({before:function(){t.partsInProgress+=1},attempt:function(){return t._uploadPart(e)},after:function(){t.partsInProgress-=1}})},t._uploadPart=function(e){var t=this,r=this.chunks[e];return this.chunkState[e].busy=!0,Promise.resolve().then((function(){return t.options.prepareUploadPart({key:t.key,uploadId:t.uploadId,body:r,number:e+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(r){var n=r.url,i=r.headers;if(t._aborted())throw t.chunkState[e].busy=!1,zu();return t._uploadPartBytes(e,n,i)}))},t._onPartProgress=function(e,t,r){this.chunkState[e].uploaded=qu(t);var n=this.chunkState.reduce((function(e,t){return e+t.uploaded}),0);this.options.onProgress(n,this.file.size)},t._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)},t._uploadPartBytes=function(e,t,r){var n,i=this,o=this.chunks[e],s=this.abortController.signal,a=new Promise((function(e,t){n={resolve:e,reject:t}})),u=new XMLHttpRequest;function l(){s.removeEventListener("abort",c)}function c(){u.abort()}return u.open("PUT",t,!0),r&&Object.keys(r).map((function(e){u.setRequestHeader(e,r[e])})),u.responseType="text",s.addEventListener("abort",c),u.upload.addEventListener("progress",(function(t){t.lengthComputable&&i._onPartProgress(e,t.loaded,t.total)})),u.addEventListener("abort",(function(t){l(),i.chunkState[e].busy=!1,n.reject(zu())})),u.addEventListener("load",(function(t){if(l(),i.chunkState[e].busy=!1,t.target.status<200||t.target.status>=300){var r=new Error("Non 2xx");return r.source=t.target,void n.reject(r)}i._onPartProgress(e,o.size,o.size);var s=t.target.getResponseHeader("ETag");null!==s?(i._onPartComplete(e,s),n.resolve()):n.reject(new Error("AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions."))})),u.addEventListener("error",(function(t){l(),i.chunkState[e].busy=!1;var r=new Error("Unknown error");r.source=t.target,n.reject(r)})),u.send(o),a},t._completeUpload=function(){var e=this;return this.parts.sort((function(e,t){return e.PartNumber-t.PartNumber})),Promise.resolve().then((function(){return e.options.completeMultipartUpload({key:e.key,uploadId:e.uploadId,parts:e.parts})})).then((function(t){e.options.onSuccess(t)}),(function(t){e._onError(t)}))},t._abortUpload=function(){var e=this;this.abortController.abort(),this.createdPromise.then((function(){e.options.abortMultipartUpload({key:e.key,uploadId:e.uploadId})}),(function(){}))},t._onError=function(e){e&&"AbortError"===e.name||this.options.onError(e)},t.start=function(){this.isPaused=!1,this.uploadId?this._resumeUpload():this._createUpload()},t.pause=function(){this.abortController.abort(),this.abortController=new Lu,this.isPaused=!0},t.abort=function(e){if(void 0===e&&(e={}),!e.really)return this.pause();this._abortUpload()},e}();function Yu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gu(e,t){return(Gu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ku(){return(Ku=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 $u=$e.Socket,Ju=$e.Provider,Qu=$e.RequestClient;function Zu(e){if(e&&e.error){var t=new Error(e.message);throw Ku(t,e.error),t}return e}var el=(Wu=Vu=function(e){var t,r;function n(t,r){var n;(n=e.call(this,t,r)||this).type="uploader",n.id=n.opts.id||"AwsS3Multipart",n.title="AWS S3 Multipart",n.client=new Qu(t,r);var i={timeout:3e4,limit:0,retryDelays:[0,1e3,3e3,5e3],createMultipartUpload:n.createMultipartUpload.bind(Yu(n)),listParts:n.listParts.bind(Yu(n)),prepareUploadPart:n.prepareUploadPart.bind(Yu(n)),abortMultipartUpload:n.abortMultipartUpload.bind(Yu(n)),completeMultipartUpload:n.completeMultipartUpload.bind(Yu(n))};return n.opts=Ku({},i,r),n.upload=n.upload.bind(Yu(n)),n.requests=new eu(n.opts.limit),n.uploaders=Object.create(null),n.uploaderEvents=Object.create(null),n.uploaderSockets=Object.create(null),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Gu(t,r);var i=n.prototype;return i.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)},i.assertHost=function(e){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address, or if you are not using Companion, a custom `"+e+"` implementation.")},i.createMultipartUpload=function(e){this.assertHost("createMultipartUpload");var t={};return Object.keys(e.meta).map((function(r){null!=e.meta[r]&&(t[r]=e.meta[r].toString())})),this.client.post("s3/multipart",{filename:e.name,type:e.type,metadata:t}).then(Zu)},i.listParts=function(e,t){var r=t.key,n=t.uploadId;this.assertHost("listParts");var i=encodeURIComponent(r);return this.client.get("s3/multipart/"+n+"?key="+i).then(Zu)},i.prepareUploadPart=function(e,t){var r=t.key,n=t.uploadId,i=t.number;this.assertHost("prepareUploadPart");var o=encodeURIComponent(r);return this.client.get("s3/multipart/"+n+"/"+i+"?key="+o).then(Zu)},i.completeMultipartUpload=function(e,t){var r=t.key,n=t.uploadId,i=t.parts;this.assertHost("completeMultipartUpload");var o=encodeURIComponent(r),s=encodeURIComponent(n);return this.client.post("s3/multipart/"+s+"/complete?key="+o,{parts:i}).then(Zu)},i.abortMultipartUpload=function(e,t){var r=t.key,n=t.uploadId;this.assertHost("abortMultipartUpload");var i=encodeURIComponent(r),o=encodeURIComponent(n);return this.client.delete("s3/multipart/"+o+"?key="+i).then(Zu)},i.uploadFile=function(e){var t=this;return new Promise((function(r,n){var i=new Xu(e.data,Ku({createMultipartUpload:t.opts.createMultipartUpload.bind(t,e),listParts:t.opts.listParts.bind(t,e),prepareUploadPart:t.opts.prepareUploadPart.bind(t,e),completeMultipartUpload:t.opts.completeMultipartUpload.bind(t,e),abortMultipartUpload:t.opts.abortMultipartUpload.bind(t,e),getChunkSize:t.opts.getChunkSize?t.opts.getChunkSize.bind(t):null,onStart:function(r){var n=t.uppy.getFile(e.id);t.uppy.setFileState(e.id,{s3Multipart:Ku({},n.s3Multipart,{key:r.key,uploadId:r.uploadId})})},onProgress:function(r,n){t.uppy.emit("upload-progress",e,{uploader:t,bytesUploaded:r,bytesTotal:n})},onError:function(r){t.uppy.log(r),t.uppy.emit("upload-error",e,r),o.done(),t.resetUploaderReferences(e.id),n(r)},onSuccess:function(n){var s={body:Ku({},n),uploadURL:n.location};o.done(),t.resetUploaderReferences(e.id);var a=t.uppy.getFile(e.id);t.uppy.emit("upload-success",a||e,s),n.location&&t.uppy.log("Download "+i.file.name+" from "+n.location),r(i)},onPartComplete:function(r){var n=t.uppy.getFile(e.id);n&&t.uppy.emit("s3-multipart:part-uploaded",n,r)},limit:t.opts.limit||5,retryDelays:t.opts.retryDelays||[]},e.s3Multipart));t.uploaders[e.id]=i,t.uploaderEvents[e.id]=new iu(t.uppy);var o=t.requests.run((function(){return e.isPaused||i.start(),function(){}}));t.onFileRemove(e.id,(function(n){o.abort(),t.resetUploaderReferences(e.id,{abort:!0}),r("upload "+n.id+" was removed")})),t.onCancelAll(e.id,(function(){o.abort(),t.resetUploaderReferences(e.id,{abort:!0}),r("upload "+e.id+" was canceled")})),t.onFilePause(e.id,(function(e){e?(o.abort(),i.pause()):(o.abort(),o=t.requests.run((function(){return i.start(),function(){}})))})),t.onPauseAll(e.id,(function(){o.abort(),i.pause()})),t.onResumeAll(e.id,(function(){o.abort(),e.error&&i.abort(),o=t.requests.run((function(){return i.start(),function(){}}))})),e.progress.uploadStarted&&e.isRestored||t.uppy.emit("upload-started",e)}))},i.uploadRemote=function(e){var t=this;return this.resetUploaderReferences(e.id),e.progress.uploadStarted&&e.isRestored||this.uppy.emit("upload-started",e),e.serverToken?this.connectToServerSocket(e):new Promise((function(r,n){new(e.remote.providerOptions.provider?Ju:Qu)(t.uppy,e.remote.providerOptions).post(e.remote.url,Ku({},e.remote.body,{protocol:"s3-multipart",size:e.data.size,metadata:e.meta})).then((function(r){return t.uppy.setFileState(e.id,{serverToken:r.token}),e=t.uppy.getFile(e.id)})).then((function(e){return t.connectToServerSocket(e)})).then((function(){r()})).catch((function(r){t.uppy.emit("upload-error",e,r),n(r)}))}))},i.connectToServerSocket=function(e){var t=this;return new Promise((function(r,n){var i=e.serverToken,o=nu(e.remote.companionUrl),s=new $u({target:o+"/api/"+i,autoOpen:!1});t.uploaderSockets[e.id]=s,t.uploaderEvents[e.id]=new iu(t.uppy),t.onFileRemove(e.id,(function(n){a.abort(),s.send("pause",{}),t.resetUploaderReferences(e.id,{abort:!0}),r("upload "+e.id+" was removed")})),t.onFilePause(e.id,(function(e){e?(a.abort(),s.send("pause",{})):(a.abort(),a=t.requests.run((function(){return s.send("resume",{}),function(){}})))})),t.onPauseAll(e.id,(function(){a.abort(),s.send("pause",{})})),t.onCancelAll(e.id,(function(){a.abort(),s.send("pause",{}),t.resetUploaderReferences(e.id),r("upload "+e.id+" was canceled")})),t.onResumeAll(e.id,(function(){a.abort(),e.error&&s.send("pause",{}),a=t.requests.run((function(){s.send("resume",{})}))})),t.onRetry(e.id,(function(){s.isOpen&&(s.send("pause",{}),s.send("resume",{}))})),t.onRetryAll(e.id,(function(){s.isOpen&&(s.send("pause",{}),s.send("resume",{}))})),s.on("progress",(function(r){return ru(t,r,e)})),s.on("error",(function(r){t.uppy.emit("upload-error",e,new Error(r.error)),t.resetUploaderReferences(e.id),a.done(),n(new Error(r.error))})),s.on("success",(function(n){var i={uploadURL:n.url};t.uppy.emit("upload-success",e,i),t.resetUploaderReferences(e.id),a.done(),r()}));var a=t.requests.run((function(){return s.open(),e.isPaused&&s.send("pause",{}),function(){}}))}))},i.upload=function(e){var t=this;if(0===e.length)return Promise.resolve();var r=e.map((function(e){var r=t.uppy.getFile(e);return r.isRemote?t.uploadRemote(r):t.uploadFile(r)}));return Promise.all(r)},i.onFileRemove=function(e,t){this.uploaderEvents[e].on("file-removed",(function(r){e===r.id&&t(r.id)}))},i.onFilePause=function(e,t){this.uploaderEvents[e].on("upload-pause",(function(r,n){e===r&&t(n)}))},i.onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",(function(r){e===r&&t()}))},i.onRetryAll=function(e,t){var r=this;this.uploaderEvents[e].on("retry-all",(function(n){r.uppy.getFile(e)&&t()}))},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.install=function(){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Ku({},e,{resumableUploads:!0})}),this.uppy.addUploader(this.upload)},i.uninstall=function(){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Ku({},e,{resumableUploads:!1})}),this.uppy.removeUploader(this.upload)},n}(le.Plugin),Vu.VERSION="1.8.17",Wu),tl={};function rl(e){return(rl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nl(e){var t="function"==typeof Map?new Map:void 0;return(nl=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return il(e,arguments,al(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),sl(n,e)})(e)}function il(e,t,r){return(il=ol()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&sl(i,r.prototype),i}).apply(null,arguments)}function ol(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function sl(e,t){return(sl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function al(e){return(al=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(tl,"__esModule",{value:!0}),tl.default=void 0;var ul=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&sl(e,t)}(n,nl(Error));var t,r=(t=n,function(){var e,r=al(t);if(ol()){var n=al(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==rl(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(t=r.call(this,e)).originalRequest=o,t.originalResponse=s,t.causingError=i,null!=i&&(e+=", caused by ".concat(i.toString())),null!=o){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),l=o.getURL(),c=s?s.getStatus():"n/a",p=s?s.getBody()||"":"n/a";e+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(p,", request id: ").concat(a,")")}return t.message=e,t}return n}();tl.default=ul;var ll={};Object.defineProperty(ll,"__esModule",{value:!0}),ll.default=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))};var cl={exports:{}};(function(e){(function(){!function(e,t){"object"==typeof cl.exports?cl.exports=t(e):t(e)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:this,(function(e){"use strict";var t,r=(e=e||{}).Base64,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t={},r=0,n=e.length;r<n;r++)t[e.charAt(r)]=r;return t}(n),o=String.fromCharCode,s=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?o(192|t>>>6)+o(128|63&t):o(224|t>>>12&15)+o(128|t>>>6&63)+o(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|t>>>18&7)+o(128|t>>>12&63)+o(128|t>>>6&63)+o(128|63&t)},a=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(e){return e.replace(a,s)},l=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[n.charAt(r>>>18),n.charAt(r>>>12&63),t>=2?"=":n.charAt(r>>>6&63),t>=1?"=":n.charAt(63&r)].join("")},c=e.btoa&&"function"==typeof e.btoa?function(t){return e.btoa(t)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,l)},p=function(e){return c(u(String(e)))},h=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},d=function(e,t){return t?h(p(e)):p(e)};e.Uint8Array&&(t=function(e,t){for(var r="",i=0,o=e.length;i<o;i+=3){var s=e[i],a=e[i+1],u=e[i+2],l=s<<16|a<<8|u;r+=n.charAt(l>>>18)+n.charAt(l>>>12&63)+(void 0!==a?n.charAt(l>>>6&63):"=")+(void 0!==u?n.charAt(63&l):"=")}return t?h(r):r});var f,g=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,m=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 o(55296+(t>>>10))+o(56320+(1023&t));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},v=function(e){return e.replace(g,m)},y=function(e){var t=e.length,r=t%4,n=(t>0?i[e.charAt(0)]<<18:0)|(t>1?i[e.charAt(1)]<<12:0)|(t>2?i[e.charAt(2)]<<6:0)|(t>3?i[e.charAt(3)]:0),s=[o(n>>>16),o(n>>>8&255),o(255&n)];return s.length-=[0,0,2,1][r],s.join("")},b=e.atob&&"function"==typeof e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/\S{1,4}/g,y)},w=function(e){return b(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},S=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},_=function(e){return function(e){return v(b(e))}(S(e))};if(e.Uint8Array&&(f=function(e){return Uint8Array.from(w(S(e)),(function(e){return e.charCodeAt(0)}))}),e.Base64={VERSION:"2.6.4",atob:w,btoa:c,fromBase64:_,toBase64:d,utob:u,encode:d,encodeURI:function(e){return d(e,!0)},btou:v,decode:_,noConflict:function(){var t=e.Base64;return e.Base64=r,t},fromUint8Array:t,toUint8Array:f},"function"==typeof Object.defineProperty){var P=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};e.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",P((function(){return _(this)}))),Object.defineProperty(String.prototype,"toBase64",P((function(e){return d(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",P((function(){return d(this,!0)})))}}return e.Meteor&&(Base64=e.Base64),!!cl.exports&&(cl.exports.Base64=e.Base64),{Base64:e.Base64}}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),cl=cl.exports;var pl={};Object.defineProperty(pl,"__esModule",{value:!0}),pl.enableDebugLog=function(){hl=!0},pl.log=function(e){hl&&console.log(e)};var hl=!1,dl={};Object.defineProperty(dl,"__esModule",{value:!0}),dl.default=void 0;var fl=vl(tl),gl=vl(ll),ml=vl(Ve);function vl(e){return e&&e.__esModule?e:{default:e}}function yl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yl(Object(r),!0).forEach((function(t){wl(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sl(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 _l=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this._urlStorage=this.options.urlStorage,this.file=t,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}var t,r,n;return t=e,n=[{key:"terminate",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if("function"==typeof r||"function"==typeof n)throw new Error("tus: the terminate function does not accept a callback since v2 anymore; please use the returned Promise instead");var i=Cl("DELETE",t,r);return i.send().then((function(e){if(204!==e.getStatus())throw new fl.default("tus: unexpected response while terminating upload",null,i,e)})).catch((function(n){if(n instanceof fl.default||(n=new fl.default("tus: failed to terminate upload",n,i,null)),!Ol(n,0,r))throw n;var o=r.retryDelays[0],s=r.retryDelays.slice(1),a=bl({},r,{retryDelays:s});return new Promise((function(e){return setTimeout(e,o)})).then((function(){return e.terminate(t,a)}))}))}}],(r=[{key:"findPreviousUploads",value:function(){var e=this;return this.options.fingerprint(this.file,this.options).then((function(t){return e._urlStorage.findUploadsByFingerprint(t)}))}},{key:"resumeFromPreviousUpload",value:function(e){this.url=e.uploadUrl||null,this._parallelUploadUrls=e.parallelUploadUrls||null,this._urlStorageKey=e.urlStorageKey}},{key:"start",value:function(){var e=this,t=this.file;if(t)if(this.options.endpoint||this.options.uploadUrl){var r=this.options.retryDelays;null==r||"[object Array]"===Object.prototype.toString.call(r)?(this.options.parallelUploads>1&&["uploadUrl","uploadSize","uploadLengthDeferred"].forEach((function(t){e.options[t]&&e._emitError(new Error("tus: cannot use the ".concat(t," option when parallelUploads is enabled")))})),this.options.fingerprint(t,this.options).then((function(r){return null==r?(0,pl.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,pl.log)("Calculated fingerprint: ".concat(r)),e._fingerprint=r,e._source?e._source:e.options.fileReader.openFile(t,e.options.chunkSize)})).then((function(t){e._source=t,e.options.parallelUploads>1||null!=e._parallelUploadUrls?e._startParallelUpload():e._startSingleUpload()})).catch((function(t){e._emitError(t)}))):this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"))}else this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));else this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"_startParallelUpload",value:function(){var t=this,r=this._size=this._source.size,n=0;this._parallelUploads=[];var i=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,o=function(e,t,r){for(var n=Math.floor(e/t),i=[],o=0;o<t;o++)i.push({start:n*o,end:n*(o+1)});return i[t-1].end=e,r&&i.forEach((function(e,t){e.uploadUrl=r[t]||null})),i}(this._source.size,i,this._parallelUploadUrls);this._parallelUploadUrls=new Array(o.length);var s,a=o.map((function(i,s){var a=0;return t._source.slice(i.start,i.end).then((function(u){var l=u.value;return new Promise((function(u,c){var p=bl({},t.options,{uploadUrl:i.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,metadata:{},headers:bl({},t.options.headers,{"Upload-Concat":"partial"}),onSuccess:u,onError:c,onProgress:function(e){n=n-a+e,a=e,t._emitProgress(n,r)},_onUploadUrlAvailable:function(){t._parallelUploadUrls[s]=h.url,t._parallelUploadUrls.filter((function(e){return!!e})).length===o.length&&t._saveUploadInUrlStorage()}}),h=new e(l,p);h.start(),t._parallelUploads.push(h)}))}))}));Promise.all(a).then((function(){(s=t._openRequest("POST",t.options.endpoint)).setHeader("Upload-Concat","final;".concat(t._parallelUploadUrls.join(" ")));var e=Pl(t.options.metadata);return""!==e&&s.setHeader("Upload-Metadata",e),t._sendRequest(s,null)})).then((function(e){if(kl(e.getStatus(),200)){var r=e.getHeader("Location");null!=r?(t.url=El(t.options.endpoint,r),(0,pl.log)("Created upload at ".concat(t.url)),t._emitSuccess()):t._emitHttpError(s,e,"tus: invalid or missing Location header")}else t._emitHttpError(s,e,"tus: unexpected response while creating upload")})).catch((function(e){t._emitError(e)}))}},{key:"_startSingleUpload",value:function(){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=this._source.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"));return this._aborted=!1,null!=this.url?((0,pl.log)("Resuming upload from previous URL: ".concat(this.url)),void this._resumeUpload()):null!=this.options.uploadUrl?((0,pl.log)("Resuming upload from provided URL: ".concat(this.options.url)),this.url=this.options.uploadUrl,void this._resumeUpload()):((0,pl.log)("Creating a new upload"),void this._createUpload())}},{key:"abort",value:function(t,r){var n=this;if("function"==typeof r)throw new Error("tus: the abort function does not accept a callback since v2 anymore; please use the returned Promise instead");return null!=this._parallelUploads&&this._parallelUploads.forEach((function(e){e.abort(t)})),null!==this._req&&(this._req.abort(),this._source.close()),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),t&&null!=this.url?e.terminate(this.url,this.options).then((function(){return n._removeFromUrlStorage()})):Promise.resolve()}},{key:"_emitHttpError",value:function(e,t,r,n){this._emitError(new fl.default(r,n,e,t))}},{key:"_emitError",value:function(e){var t=this;if(!this._aborted){if(null!=this.options.retryDelays&&(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),Ol(e,this._retryAttempt,this.options))){var r=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout((function(){t.start()}),r))}if("function"!=typeof this.options.onError)throw e;this.options.onError(e)}}},{key:"_emitSuccess",value:function(){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"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:"_createUpload",value:function(){var e=this;if(this.options.endpoint){var t=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?t.setHeader("Upload-Defer-Length",1):t.setHeader("Upload-Length",this._size);var r,n=Pl(this.options.metadata);""!==n&&t.setHeader("Upload-Metadata",n),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,r=this._addChunkToRequest(t)):r=this._sendRequest(t,null),r.then((function(r){if(kl(r.getStatus(),200)){var n=r.getHeader("Location");if(null!=n){if(e.url=El(e.options.endpoint,n),(0,pl.log)("Created upload at ".concat(e.url)),"function"==typeof e.options._onUploadUrlAvailable&&e.options._onUploadUrlAvailable(),0===e._size)return e._emitSuccess(),void e._source.close();e._saveUploadInUrlStorage(),e.options.uploadDataDuringCreation?e._handleUploadResponse(t,r):(e._offset=0,e._performUpload())}else e._emitHttpError(t,r,"tus: invalid or missing Location header")}else e._emitHttpError(t,r,"tus: unexpected response while creating upload")})).catch((function(r){e._emitHttpError(t,null,"tus: failed to create upload",r)}))}else this._emitError(new Error("tus: unable to create upload because no endpoint is provided"))}},{key:"_resumeUpload",value:function(){var e=this,t=this._openRequest("HEAD",this.url);this._sendRequest(t,null).then((function(r){var n=r.getStatus();if(!kl(n,200))return kl(n,400)&&e._removeFromUrlStorage(),423===n?void e._emitHttpError(t,r,"tus: upload is currently locked; retry later"):e.options.endpoint?(e.url=null,void e._createUpload()):void e._emitHttpError(t,r,"tus: unable to resume upload (new upload cannot be created without an endpoint)");var i=parseInt(r.getHeader("Upload-Offset"),10);if(isNaN(i))e._emitHttpError(t,r,"tus: invalid or missing offset value");else{var o=parseInt(r.getHeader("Upload-Length"),10);if(!isNaN(o)||e.options.uploadLengthDeferred){if("function"==typeof e.options._onUploadUrlAvailable&&e.options._onUploadUrlAvailable(),i===o)return e._emitProgress(o,o),void e._emitSuccess();e._offset=i,e._performUpload()}else e._emitHttpError(t,r,"tus: invalid or missing length value")}})).catch((function(r){e._emitHttpError(t,null,"tus: failed to resume upload",r)}))}},{key:"_performUpload",value:function(){var e,t=this;this._aborted||(this.options.overridePatchMethod?(e=this._openRequest("POST",this.url)).setHeader("X-HTTP-Method-Override","PATCH"):e=this._openRequest("PATCH",this.url),e.setHeader("Upload-Offset",this._offset),this._addChunkToRequest(e).then((function(r){kl(r.getStatus(),200)?t._handleUploadResponse(e,r):t._emitHttpError(e,r,"tus: unexpected response while uploading chunk")})).catch((function(r){t._aborted||t._emitHttpError(e,null,"tus: failed to upload chunk at offset "+t._offset,r)})))}},{key:"_addChunkToRequest",value:function(e){var t=this,r=this._offset,n=this._offset+this.options.chunkSize;return e.setProgressHandler((function(e){t._emitProgress(r+e,t._size)})),e.setHeader("Content-Type","application/offset+octet-stream"),(n===1/0||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(r,n).then((function(r){var n=r.value,i=r.done;return t.options.uploadLengthDeferred&&i&&(t._size=t._offset+(n&&n.size?n.size:0),e.setHeader("Upload-Length",t._size)),null===n?t._sendRequest(e):(t._emitProgress(t._offset,t._size),t._sendRequest(e,n))}))}},{key:"_handleUploadResponse",value:function(e,t){var r=parseInt(t.getHeader("Upload-Offset"),10);if(isNaN(r))this._emitHttpError(e,t,"tus: invalid or missing offset value");else{if(this._emitProgress(r,this._size),this._emitChunkComplete(r-this._offset,r,this._size),this._offset=r,r==this._size)return this._emitSuccess(),void this._source.close();this._performUpload()}}},{key:"_openRequest",value:function(e,t){var r=Cl(e,t,this.options);return this._req=r,r}},{key:"_removeFromUrlStorage",value:function(){var e=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch((function(t){e._emitError(t)})),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var e=this;if(this.options.storeFingerprintForResuming&&this._fingerprint){var t={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};this._parallelUploads?t.parallelUploadUrls=this._parallelUploadUrls:t.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,t).then((function(t){return e._urlStorageKey=t})).catch((function(t){e._emitError(t)}))}}},{key:"_sendRequest",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"function"==typeof this.options.onBeforeRequest&&this.options.onBeforeRequest(e),e.send(r).then((function(r){return"function"==typeof t.options.onAfterResponse&&t.options.onAfterResponse(e,r),r}))}}])&&Sl(t.prototype,r),n&&Sl(t,n),e}();function Pl(e){var t=[];for(var r in e)t.push(r+" "+cl.Base64.encode(e[r]));return t.join(",")}function kl(e,t){return e>=t&&e<t+100}function Cl(e,t,r){var n=r.httpStack.createRequest(e,t);n.setHeader("Tus-Resumable","1.0.0");var i=r.headers||{};for(var o in i)n.setHeader(o,i[o]);if(r.addRequestId){var s=(0,gl.default)();n.setHeader("X-Request-ID",s)}return n}function Ol(e,t,r){var n,i=e.originalResponse?e.originalResponse.getStatus():0,o=!kl(i,400)||409===i||423===i;return null!=r.retryDelays&&t<r.retryDelays.length&&null!=e.originalRequest&&o&&(n=!0,"undefined"!=typeof window&&"navigator"in window&&!1===window.navigator.onLine&&(n=!1),n)}function El(e,t){return new ml.default(t,e).toString()}_l.defaultOptions={endpoint:null,uploadUrl:null,metadata:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,_onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null};var Al=_l;dl.default=Al;var Fl={};function Rl(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)}}Object.defineProperty(Fl,"__esModule",{value:!0}),Fl.default=void 0;var xl=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,(r=[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(e){return Promise.resolve([])}},{key:"removeUpload",value:function(e){return Promise.resolve()}},{key:"addUpload",value:function(e,t){return Promise.resolve(null)}}])&&Rl(t.prototype,r),e}();Fl.default=xl;var Ul={};function Tl(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)}}Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.WebStorageUrlStorage=Ul.canStoreURLs=void 0;var Dl=!1;try{Dl="localStorage"in window;var Bl="tusSupport";localStorage.setItem(Bl,localStorage.getItem(Bl))}catch(Sf){if(Sf.code!==Sf.SECURITY_ERR&&Sf.code!==Sf.QUOTA_EXCEEDED_ERR)throw Sf;Dl=!1}var Il=Dl;Ul.canStoreURLs=Il;var Nl=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,(r=[{key:"findAllUploads",value:function(){var e=this._findEntries("tus::");return Promise.resolve(e)}},{key:"findUploadsByFingerprint",value:function(e){var t=this._findEntries("tus::".concat(e,"::"));return Promise.resolve(t)}},{key:"removeUpload",value:function(e){return localStorage.removeItem(e),Promise.resolve()}},{key:"addUpload",value:function(e,t){var r=Math.round(1e12*Math.random()),n="tus::".concat(e,"::").concat(r);return localStorage.setItem(n,JSON.stringify(t)),Promise.resolve(n)}},{key:"_findEntries",value:function(e){for(var t=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);if(0===n.indexOf(e))try{var i=JSON.parse(localStorage.getItem(n));i.urlStorageKey=n,t.push(i)}catch(Sf){}}return t}}])&&Tl(t.prototype,r),e}();Ul.WebStorageUrlStorage=Nl;var Ml={};function jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ll(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 zl(e,t,r){return t&&Ll(e.prototype,t),r&&Ll(e,r),e}Object.defineProperty(Ml,"__esModule",{value:!0}),Ml.default=void 0;var Hl=function(){function e(){jl(this,e)}return zl(e,[{key:"createRequest",value:function(e,t){return new ql(e,t)}},{key:"getName",value:function(){return"XHRHttpStack"}}]),e}();Ml.default=Hl;var ql=function(){function e(t,r){jl(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,!0),this._method=t,this._url=r,this._headers={}}return zl(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(e,t){this._xhr.setRequestHeader(e,t),this._headers[e]=t}},{key:"getHeader",value:function(e){return this._headers[e]}},{key:"setProgressHandler",value:function(e){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(t){t.lengthComputable&&e(t.loaded)})}},{key:"send",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise((function(r,n){e._xhr.onload=function(){r(new Vl(e._xhr))},e._xhr.onerror=function(e){n(e)},e._xhr.send(t)}))}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),Vl=function(){function e(t){jl(this,e),this._xhr=t}return zl(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(e){return this._xhr.getResponseHeader(e)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),Wl={};Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.default=void 0;Wl.default=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};var Xl={};Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.default=function(e){return new Promise((function(t,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var e=n.response;t(e)},n.onerror=function(e){r(e)},n.open("GET",e),n.send()}))};var Yl={};Object.defineProperty(Yl,"__esModule",{value:!0}),Yl.default=void 0;Yl.default=function(){return"undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)};var Gl={};Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.default=function(e){return new Promise((function(t,r){var n=new FileReader;n.onload=function(){var e=new Uint8Array(n.result);t({value:e})},n.onerror=function(e){r(e)},n.readAsArrayBuffer(e)}))};var Kl={};Object.defineProperty(Kl,"__esModule",{value:!0}),Kl.default=void 0;var $l=ec(Wl),Jl=ec(Xl),Ql=ec(Yl),Zl=ec(Gl);function ec(e){return e&&e.__esModule?e:{default:e}}function tc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rc(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 nc(e,t,r){return t&&rc(e.prototype,t),r&&rc(e,r),e}var ic=function(){function e(t){tc(this,e),this._file=t,this.size=t.size}return nc(e,[{key:"slice",value:function(e,t){if((0,Ql.default)())return(0,Zl.default)(this._file.slice(e,t));var r=this._file.slice(e,t);return Promise.resolve({value:r})}},{key:"close",value:function(){}}]),e}(),oc=function(){function e(t,r){tc(this,e),this._chunkSize=r,this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=!1}return nc(e,[{key:"slice",value:function(e,t){return e<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(e,t)}},{key:"_readUntilEnoughDataOrDone",value:function(e,t){var r=this,n=t<=this._bufferOffset+sc(this._buffer);if(this._done||n){var i=this._getDataFromBuffer(e,t),o=null==i&&this._done;return Promise.resolve({value:i,done:o})}return this._reader.read().then((function(n){var i=n.value;return n.done?r._done=!0:void 0===r._buffer?r._buffer=i:r._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")}(r._buffer,i),r._readUntilEnoughDataOrDone(e,t)}))}},{key:"_getDataFromBuffer",value:function(e,t){e>this._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var r=0===sc(this._buffer);return this._done&&r?null:this._buffer.slice(0,t-e)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}]),e}();function sc(e){return void 0===e?0:void 0!==e.size?e.size:e.length}var ac=function(){function e(){tc(this,e)}return nc(e,[{key:"openFile",value:function(e,t){return(0,$l.default)()&&e&&void 0!==e.uri?(0,Jl.default)(e.uri).then((function(e){return new ic(e)})).catch((function(e){throw new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. "+e)})):"function"==typeof e.slice&&void 0!==e.size?Promise.resolve(new ic(e)):"function"==typeof e.read?(t=+t,isFinite(t)?Promise.resolve(new oc(e,t)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option"))):Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment"))}}]),e}();Kl.default=ac;var uc={};Object.defineProperty(uc,"__esModule",{value:!0}),uc.default=function(e,t){return(0,cc.default)()?Promise.resolve(function(e,t){var r=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(e.exif)):"noexif";return["tus-rn",e.name||"noname",e.size||"nosize",r,t.endpoint].join("/")}(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))};var lc,cc=(lc=Wl)&&lc.__esModule?lc:{default:lc},pc={};Object.defineProperty(pc,"__esModule",{value:!0}),Object.defineProperty(pc,"enableDebugLog",{enumerable:!0,get:function(){return pl.enableDebugLog}}),Object.defineProperty(pc,"canStoreURLs",{enumerable:!0,get:function(){return Ul.canStoreURLs}}),pc.defaultOptions=pc.Upload=void 0;var hc=vc(dl),dc=vc(Fl),fc=vc(Ml),gc=vc(Kl),mc=vc(uc);function vc(e){return e&&e.__esModule?e:{default:e}}function yc(e){return(yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bc(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 wc(e,t){return(wc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sc(e){return(Sc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_c(Object(r),!0).forEach((function(t){kc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Cc=Pc({},hc.default.defaultOptions,{httpStack:new fc.default,fileReader:new gc.default,urlStorage:Ul.canStoreURLs?new Ul.WebStorageUrlStorage:new dc.default,fingerprint:mc.default});pc.defaultOptions=Cc;var Oc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wc(e,t)}(o,hc.default);var t,r,n,i=(n=o,function(){var e,t=Sc(n);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(Sf){return!1}}()){var r=Sc(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==yc(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=Pc({},Cc,{},t),i.call(this,e,t)}return t=o,r=[{key:"terminate",value:function(e,t,r){return t=Pc({},Cc,{},t),hc.default.terminate(e,t,r)}}],null&&bc(t.prototype,null),r&&bc(t,r),o}();pc.Upload=Oc;var Ec,Ac,Fc=window,Rc=Fc.XMLHttpRequest,xc=Fc.Blob;Rc&&xc&&xc.prototype.slice;function Uc(){return(Uc=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 Tc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dc(e,t){return(Dc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Bc=$e.Provider,Ic=$e.RequestClient,Nc=$e.Socket,Mc={endpoint:"",uploadUrl:null,metadata:{},uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,overridePatchMethod:!1,headers:{},addRequestId:!1,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1},jc=(Ac=Ec=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).type="uploader",n.id=n.opts.id||"Tus",n.title="Tus",n.opts=Uc({},{autoRetry:!0,resume:!0,useFastRemoteRetry:!0,limit:0,retryDelays:[0,1e3,3e3,5e3],withCredentials:!1},r),n.requests=new eu(n.opts.limit),n.uploaders=Object.create(null),n.uploaderEvents=Object.create(null),n.uploaderSockets=Object.create(null),n.handleResetProgress=n.handleResetProgress.bind(Tc(n)),n.handleUpload=n.handleUpload.bind(Tc(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Dc(t,r);var i=n.prototype;return i.handleResetProgress=function(){var e=Uc({},this.uppy.getState().files);Object.keys(e).forEach((function(t){if(e[t].tus&&e[t].tus.uploadUrl){var r=Uc({},e[t].tus);delete r.uploadUrl,e[t]=Uc({},e[t],{tus:r})}})),this.uppy.setState({files:e})},i.resetUploaderReferences=function(e,t){if(void 0===t&&(t={}),this.uploaders[e]){var r=this.uploaders[e];r.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(e,t,r){var n=this;return this.resetUploaderReferences(e.id),new Promise((function(t,r){n.uppy.emit("upload-started",e);var i,o=Uc({},n.opts,e.tus||{}),s=Uc({},Mc,o);delete s.resume,o.resume&&(s.storeFingerprintForResuming=!0),s.fingerprint=(i=e,function(e,t){if("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())return pc.defaultOptions.fingerprint(e,t);var r=["tus",i.id,t.endpoint].join("-");return Promise.resolve(r)}),s.onBeforeRequest=function(e){e.getUnderlyingObject().withCredentials=!!o.withCredentials,"function"==typeof o.onBeforeRequest&&o.onBeforeRequest(e)},s.onError=function(t){n.uppy.log(t);var i=t.originalRequest?t.originalRequest.getUnderlyingObject():null;su(i)&&(t=new Ue(t,i)),n.resetUploaderReferences(e.id),c.done(),n.uppy.emit("upload-error",e,t),r(t)},s.onProgress=function(t,r){n.onReceiveUploadUrl(e,l.url),n.uppy.emit("upload-progress",e,{uploader:n,bytesUploaded:t,bytesTotal:r})},s.onSuccess=function(){var r={uploadURL:l.url};n.resetUploaderReferences(e.id),c.done(),n.uppy.emit("upload-success",e,r),l.url&&n.uppy.log("Download "+l.file.name+" from "+l.url),t(l)};var a=function(e,t,r){_(e,t)&&!_(e,r)&&(e[r]=e[t])},u={};(Array.isArray(o.metaFields)?o.metaFields:Object.keys(e.meta)).forEach((function(t){u[t]=e.meta[t]})),a(u,"type","filetype"),a(u,"name","filename"),s.metadata=u;var l=new pc.Upload(e.data,s);n.uploaders[e.id]=l,n.uploaderEvents[e.id]=new iu(n.uppy),o.resume&&l.findPreviousUploads().then((function(t){var r=t[0];r&&(n.uppy.log("[Tus] Resuming upload of "+e.id+" started at "+r.creationTime),l.resumeFromPreviousUpload(r))}));var c=n.requests.run((function(){return e.isPaused||Promise.resolve().then((function(){l.start()})),function(){}}));n.onFileRemove(e.id,(function(r){c.abort(),n.resetUploaderReferences(e.id,{abort:!!l.url}),t("upload "+r+" was removed")})),n.onPause(e.id,(function(e){e?(c.abort(),l.abort()):(c.abort(),c=n.requests.run((function(){return l.start(),function(){}})))})),n.onPauseAll(e.id,(function(){c.abort(),l.abort()})),n.onCancelAll(e.id,(function(){c.abort(),n.resetUploaderReferences(e.id,{abort:!!l.url}),t("upload "+e.id+" was canceled")})),n.onResumeAll(e.id,(function(){c.abort(),e.error&&l.abort(),c=n.requests.run((function(){return l.start(),function(){}}))}))})).catch((function(t){throw n.uppy.emit("upload-error",e,t),t}))},i.uploadRemote=function(e,t,r){var n=this;this.resetUploaderReferences(e.id);var i=Uc({},this.opts);return e.tus&&Uc(i,e.tus),this.uppy.emit("upload-started",e),this.uppy.log(e.remote.url),e.serverToken?this.connectToServerSocket(e):new Promise((function(t,r){new(e.remote.providerOptions.provider?Bc:Ic)(n.uppy,e.remote.providerOptions).post(e.remote.url,Uc({},e.remote.body,{endpoint:i.endpoint,uploadUrl:i.uploadUrl,protocol:"tus",size:e.data.size,headers:i.headers,metadata:e.meta})).then((function(t){return n.uppy.setFileState(e.id,{serverToken:t.token}),e=n.uppy.getFile(e.id),n.connectToServerSocket(e)})).then((function(){t()})).catch((function(t){n.uppy.emit("upload-error",e,t),r(t)}))}))},i.connectToServerSocket=function(e){var t=this;return new Promise((function(r,n){var i=e.serverToken,o=nu(e.remote.companionUrl),s=new Nc({target:o+"/api/"+i,autoOpen:!1});t.uploaderSockets[e.id]=s,t.uploaderEvents[e.id]=new iu(t.uppy),t.onFileRemove(e.id,(function(){a.abort(),s.send("pause",{}),s.send("cancel",{}),t.resetUploaderReferences(e.id),r("upload "+e.id+" was removed")})),t.onPause(e.id,(function(e){e?(a.abort(),s.send("pause",{})):(a.abort(),a=t.requests.run((function(){return s.send("resume",{}),function(){}})))})),t.onPauseAll(e.id,(function(){a.abort(),s.send("pause",{})})),t.onCancelAll(e.id,(function(){a.abort(),s.send("pause",{}),s.send("cancel",{}),t.resetUploaderReferences(e.id),r("upload "+e.id+" was canceled")})),t.onResumeAll(e.id,(function(){a.abort(),e.error&&s.send("pause",{}),a=t.requests.run((function(){return s.send("resume",{}),function(){}}))})),t.onRetry(e.id,(function(){s.isOpen&&(s.send("pause",{}),s.send("resume",{}))})),t.onRetryAll(e.id,(function(){s.isOpen&&(s.send("pause",{}),s.send("resume",{}))})),s.on("progress",(function(r){return ru(t,r,e)})),s.on("error",(function(r){var i=r.error.message,o=Uc(new Error(i),{cause:r.error});t.opts.useFastRemoteRetry?s.close():(t.resetUploaderReferences(e.id),t.uppy.setFileState(e.id,{serverToken:null})),t.uppy.emit("upload-error",e,o),a.done(),n(o)})),s.on("success",(function(n){var i={uploadURL:n.url};t.uppy.emit("upload-success",e,i),t.resetUploaderReferences(e.id),a.done(),r()}));var a=t.requests.run((function(){return s.open(),e.isPaused&&s.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:Uc({},r.tus,{uploadUrl:t})})))},i.onFileRemove=function(e,t){this.uploaderEvents[e].on("file-removed",(function(r){e===r.id&&t(r.id)}))},i.onPause=function(e,t){this.uploaderEvents[e].on("upload-pause",(function(r,n){e===r&&t(n)}))},i.onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",(function(r){e===r&&t()}))},i.onRetryAll=function(e,t){var r=this;this.uploaderEvents[e].on("retry-all",(function(n){r.uppy.getFile(e)&&t()}))},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(e){var t=this,r=e.map((function(r,n){var i=n+1,o=e.length;return"error"in r&&r.error?Promise.reject(new Error(r.error)):r.isRemote?(r.progress.uploadStarted&&r.isRestored||t.uppy.emit("upload-started",r),t.uploadRemote(r,i,o)):(r.progress.uploadStarted&&r.isRestored||t.uppy.emit("upload-started",r),t.upload(r,i,o))}));return tu(r)},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:Uc({},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:Uc({},this.uppy.getState().capabilities,{resumableUploads:!1})}),this.uppy.removeUploader(this.handleUpload),this.opts.autoRetry&&this.uppy.off("back-online",this.uppy.retryAll)},n}(le.Plugin),Ec.VERSION="1.9.1",Ac),Lc=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,zc=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Hc=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=Lc.exec(e||""),o={},s=14;s--;)o[zc[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},qc=1e3,Vc=6e4,Wc=864e5;function Xc(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var Yc={};function Gc(e){var t;function r(){if(r.enabled){var e=r,n=+new Date,i=n-(t||n);e.diff=i,e.prev=t,e.curr=n,t=n;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=Yc.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var a=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,(function(t,r){if("%%"===t)return t;a++;var n=Yc.formatters[r];if("function"==typeof n){var i=o[a];t=n.call(e,i),o.splice(a,1),a--}return t})),Yc.formatArgs.call(e,o),(r.log||Yc.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=Yc.enabled(e),r.useColors=Yc.useColors(),r.color=function(e){var t,r=0;for(t in e)r=(r<<5)-r+e.charCodeAt(t),r|=0;return Yc.colors[Math.abs(r)%Yc.colors.length]}(e),r.destroy=Kc,"function"==typeof Yc.init&&Yc.init(r),Yc.instances.push(r),r}function Kc(){var e=Yc.instances.indexOf(this);return-1!==e&&(Yc.instances.splice(e,1),!0)}(Yc=Yc=Gc.debug=Gc.default=Gc).coerce=function(e){return e instanceof Error?e.stack||e.message:e},Yc.disable=function(){Yc.enable("")},Yc.enable=function(e){var t;Yc.save(e),Yc.names=[],Yc.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length;for(t=0;t<n;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?Yc.skips.push(new RegExp("^"+e.substr(1)+"$")):Yc.names.push(new RegExp("^"+e+"$")));for(t=0;t<Yc.instances.length;t++){var i=Yc.instances[t];i.enabled=Yc.enabled(i.namespace)}},Yc.enabled=function(e){if("*"===e[e.length-1])return!0;var t,r;for(t=0,r=Yc.skips.length;t<r;t++)if(Yc.skips[t].test(e))return!1;for(t=0,r=Yc.names.length;t<r;t++)if(Yc.names[t].test(e))return!0;return!1},Yc.humanize=function(e,t){t=t||{};var r,n=typeof e;if("string"===n&&e.length>0)return function(e){if(!((e=String(e)).length>100)){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 315576e5*r;case"days":case"day":case"d":return r*Wc;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return r*Vc;case"seconds":case"second":case"secs":case"sec":case"s":return r*qc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===n&&!1===isNaN(e))return t.long?Xc(r=e,Wc,"day")||Xc(r,36e5,"hour")||Xc(r,Vc,"minute")||Xc(r,qc,"second")||r+" ms":function(e){return e>=Wc?Math.round(e/Wc)+"d":e>=36e5?Math.round(e/36e5)+"h":e>=Vc?Math.round(e/Vc)+"m":e>=qc?Math.round(e/qc)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},Yc.instances=[],Yc.names=[],Yc.skips=[],Yc.formatters={};var $c={};(function(e){(function(){function t(){var t;try{t=$c.storage.debug}catch(Sf){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),t}($c=$c=Yc).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},$c.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+$c.humanize(this.diff),t){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))})),e.splice(i,0,r)}},$c.save=function(e){try{null==e?$c.storage.removeItem("debug"):$c.storage.debug=e}catch(Sf){}},$c.load=t,$c.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+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},$c.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(Sf){}}(),$c.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"],$c.formatters.j=function(e){try{return JSON.stringify(e)}catch(th){return"[UnexpectedJSONParseError]: "+th.message}},$c.enable(t())}).call(this)}).call(this,e);var Jc=$c("socket.io-client:url"),Qc=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)||(Jc("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),Jc("parse %s",e),r=Hc(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},Zc={exports:{}};function ep(e){if(e)return function(e){for(var t in ep.prototype)e[t]=ep.prototype[t];return e}(e)}Zc.exports=ep,ep.prototype.on=ep.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},ep.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},ep.prototype.off=ep.prototype.removeListener=ep.prototype.removeAllListeners=ep.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},ep.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},ep.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},ep.prototype.hasListeners=function(e){return!!this.listeners(e).length},Zc=Zc.exports;var tp={}.toString,rp=Array.isArray||function(e){return"[object Array]"==tp.call(e)},np={};(function(e){(function(){np=function(i){return t&&e.isBuffer(i)||r&&(i instanceof ArrayBuffer||n(i))};var t="function"==typeof e&&"function"==typeof e.isBuffer,r="function"==typeof ArrayBuffer,n=function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}).call(this)}).call(this,s({}).Buffer);var ip={},op=Object.prototype.toString,sp="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===op.call(Blob),ap="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===op.call(File);ip.deconstructPacket=function(e){var t=[],r=e.data,n=e;return n.data=function e(t,r){if(!t)return t;if(np(t)){var n={_placeholder:!0,num:r.length};return r.push(t),n}if(rp(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)){i={};for(var s in t)i[s]=e(t[s],r);return i}return t}(r,t),n.attachments=t.length,{packet:n,buffers:t}},ip.reconstructPacket=function(e,t){return e.data=function e(t,r){if(!t)return t;if(t&&t._placeholder)return r[t.num];if(rp(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},ip.removeBlobs=function(e,t){var r=0,n=e;!function e(i,o,s){if(!i)return i;if(sp&&i instanceof Blob||ap&&i instanceof File){r++;var a=new FileReader;a.onload=function(){s?s[o]=this.result:n=this.result,--r||t(n)},a.readAsArrayBuffer(i)}else if(rp(i))for(var u=0;u<i.length;u++)e(i[u],u,i);else if("object"==typeof i&&!np(i))for(var l in i)e(i[l],l,i)}(n),r||t(n)};var up={},lp=$c("socket.io-parser");function cp(){}up.protocol=4,up.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],up.CONNECT=0,up.DISCONNECT=1,up.EVENT=2,up.ACK=3,up.ERROR=4,up.BINARY_EVENT=5,up.BINARY_ACK=6,up.Encoder=cp,up.Decoder=dp;var pp=up.ERROR+'"encode error"';function hp(e){var t=""+e.type;if(up.BINARY_EVENT!==e.type&&up.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(Sf){return!1}}(e.data);if(!1===r)return pp;t+=r}return lp("encoded %j as %s",e,t),t}function dp(){this.reconstructor=null}function fp(e){this.reconPack=e,this.buffers=[]}function gp(e){return{type:up.ERROR,data:"parser error: "+e}}cp.prototype.encode=function(e,t){lp("encoding packet %j",e),up.BINARY_EVENT===e.type||up.BINARY_ACK===e.type?function(e,t){ip.removeBlobs(e,(function(e){var r=ip.deconstructPacket(e),n=hp(r.packet),i=r.buffers;i.unshift(n),t(i)}))}(e,t):t([hp(e)])},Zc(dp.prototype),dp.prototype.add=function(e){var t;if("string"==typeof e)t=function(e){var t=0,r={type:Number(e.charAt(0))};if(null==up.types[r.type])return gp("unknown packet type "+r.type);if(up.BINARY_EVENT===r.type||up.BINARY_ACK===r.type){for(var n=t+1;"-"!==e.charAt(++t)&&t!=e.length;);var i=e.substring(n,t);if(i!=Number(i)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(i)}if("/"===e.charAt(t+1)){for(n=t+1;++t;){if(","===(s=e.charAt(t)))break;if(t===e.length)break}r.nsp=e.substring(n,t)}else r.nsp="/";var o=e.charAt(t+1);if(""!==o&&Number(o)==o){for(n=t+1;++t;){var s;if(null==(s=e.charAt(t))||Number(s)!=s){--t;break}if(t===e.length)break}r.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){var a=function(e){try{return JSON.parse(e)}catch(Sf){return!1}}(e.substr(t));if(!(!1!==a&&(r.type===up.ERROR||rp(a))))return gp("invalid payload");r.data=a}return lp("decoded %s as %j",e,r),r}(e),up.BINARY_EVENT===t.type||up.BINARY_ACK===t.type?(this.reconstructor=new fp(t),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",t)):this.emit("decoded",t);else{if(!np(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))}},dp.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},fp.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=ip.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},fp.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]};var mp={exports:{}};function vp(e){if(e)return function(e){for(var t in vp.prototype)e[t]=vp.prototype[t];return e}(e)}mp.exports=vp,vp.prototype.on=vp.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},vp.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},vp.prototype.off=vp.prototype.removeListener=vp.prototype.removeAllListeners=vp.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},vp.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},vp.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},vp.prototype.hasListeners=function(e){return!!this.listeners(e).length},mp=mp.exports;var yp=[].indexOf,bp=function(e,t){if(yp)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1},wp={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}},Sp=Object.keys||function(e){var t=[],r=Object.prototype.hasOwnProperty;for(var n in e)r.call(e,n)&&t.push(n);return t},_p={}.toString,Pp=Array.isArray||function(e){return"[object Array]"==_p.call(e)},kp={};(function(e){(function(){var t=Object.prototype.toString,r="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===t.call(Blob),n="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===t.call(File);kp=function t(i){if(!i||"object"!=typeof i)return!1;if(Pp(i)){for(var o=0,s=i.length;o<s;o++)if(t(i[o]))return!0;return!1}if("function"==typeof e&&e.isBuffer&&e.isBuffer(i)||"function"==typeof ArrayBuffer&&i instanceof ArrayBuffer||r&&i instanceof Blob||n&&i instanceof File)return!0;if(i.toJSON&&"function"==typeof i.toJSON&&1===arguments.length)return t(i.toJSON(),!0);for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&t(i[a]))return!0;return!1}}).call(this)}).call(this,s({}).Buffer);var Cp=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),r>n&&(r=n),t>=n||t>=r||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 Op(){}var Ep,Ap,Fp,Rp=String.fromCharCode;function xp(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&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 Up(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Tp(e,t){return Rp(e>>t&63|128)}function Dp(e,t){if(0==(4294967168&e))return Rp(e);var r="";return 0==(4294965248&e)?r=Rp(e>>6&31|192):0==(4294901760&e)?(Up(e,t)||(e=65533),r=Rp(e>>12&15|224),r+=Tp(e,6)):0==(4292870144&e)&&(r=Rp(e>>18&7|240),r+=Tp(e,12),r+=Tp(e,6)),r+Rp(63&e|128)}function Bp(){if(Fp>=Ap)throw Error("Invalid byte index");var e=255&Ep[Fp];if(Fp++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function Ip(e){var t,r;if(Fp>Ap)throw Error("Invalid byte index");if(Fp==Ap)return!1;if(t=255&Ep[Fp],Fp++,0==(128&t))return t;if(192==(224&t)){if((r=(31&t)<<6|Bp())>=128)return r;throw Error("Invalid continuation byte")}if(224==(240&t)){if((r=(15&t)<<12|Bp()<<6|Bp())>=2048)return Up(r,e)?r:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(r=(7&t)<<18|Bp()<<12|Bp()<<6|Bp())>=65536&&r<=1114111)return r;throw Error("Invalid UTF-8 detected")}var Np=function(e,t){for(var r=!1!==(t=t||{}).strict,n=xp(e),i=n.length,o=-1,s="";++o<i;)s+=Dp(n[o],r);return s},Mp=function(e,t){var r=!1!==(t=t||{}).strict;Ep=xp(e),Ap=Ep.length,Fp=0;for(var n,i=[];!1!==(n=Ip(r));)i.push(n);return function(e){for(var t,r=e.length,n=-1,i="";++n<r;)(t=e[n])>65535&&(i+=Rp((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=Rp(t);return i}(i)},jp={};!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),r=0;r<e.length;r++)t[e.charCodeAt(r)]=r;jp.encode=function(t){var r,n=new Uint8Array(t),i=n.length,o="";for(r=0;r<i;r+=3)o+=e[n[r]>>2],o+=e[(3&n[r])<<4|n[r+1]>>4],o+=e[(15&n[r+1])<<2|n[r+2]>>6],o+=e[63&n[r+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},jp.decode=function(e){var r,n,i,o,s,a=.75*e.length,u=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),p=new Uint8Array(c);for(r=0;r<u;r+=4)n=t[e.charCodeAt(r)],i=t[e.charCodeAt(r+1)],o=t[e.charCodeAt(r+2)],s=t[e.charCodeAt(r+3)],p[l++]=n<<2|i>>4,p[l++]=(15&i)<<4|o>>2,p[l++]=(3&o)<<6|63&s;return c}}();var Lp={},zp=void 0!==zp?zp:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,Hp=function(){try{return 2===new Blob(["hi"]).size}catch(Sf){return!1}}(),qp=Hp&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(Sf){return!1}}(),Vp=zp&&zp.prototype.append&&zp.prototype.getBlob;function Wp(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var r=new Uint8Array(e.byteLength);r.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=r.buffer}return t}return e}))}function Xp(e,t){t=t||{};var r=new zp;return Wp(e).forEach((function(e){r.append(e)})),t.type?r.getBlob(t.type):r.getBlob()}function Yp(e,t){return new Blob(Wp(e),t||{})}"undefined"!=typeof Blob&&(Xp.prototype=Blob.prototype,Yp.prototype=Blob.prototype),Lp=Hp?qp?Blob:Yp:Vp?Xp:void 0;var Gp,Kp={};"undefined"!=typeof ArrayBuffer&&(Gp=jp);var $p="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),Jp="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),Qp=$p||Jp;Kp.protocol=3;var Zp=Kp.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},eh=Sp(Zp),th={type:"error",data:"parser error"};function rh(e,t,r){for(var n=new Array(e.length),i=function(e,t,r){var n=!1;return r=r||Op,i.count=e,0===e?t():i;function i(e,o){if(i.count<=0)throw new Error("after called too many times");--i.count,e?(n=!0,t(e),t=r):0!==i.count||n||t(null,o)}}(e.length,r),o=function(e,r,i){t(r,(function(t,r){n[e]=r,i(t,n)}))},s=0;s<e.length;s++)o(s,e[s],i)}Kp.encodePacket=function(e,t,r,n){"function"==typeof t&&(n=t,t=!1),"function"==typeof r&&(n=r,r=null);var i=void 0===e.data?void 0:e.data.buffer||e.data;if("undefined"!=typeof ArrayBuffer&&i instanceof ArrayBuffer)return function(e,t,r){if(!t)return Kp.encodeBase64Packet(e,r);var n=e.data,i=new Uint8Array(n),o=new Uint8Array(1+n.byteLength);o[0]=Zp[e.type];for(var s=0;s<i.length;s++)o[s+1]=i[s];return r(o.buffer)}(e,t,n);if(void 0!==Lp&&i instanceof Lp)return function(e,t,r){if(!t)return Kp.encodeBase64Packet(e,r);if(Qp)return function(e,t,r){if(!t)return Kp.encodeBase64Packet(e,r);var n=new FileReader;return n.onload=function(){Kp.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]=Zp[e.type],r(new Lp([n.buffer,e.data]))}(e,t,n);if(i&&i.base64)return function(e,t){return t("b"+Kp.packets[e.type]+e.data.data)}(e,n);var o=Zp[e.type];return void 0!==e.data&&(o+=r?Np(String(e.data),{strict:!1}):String(e.data)),n(""+o)},Kp.encodeBase64Packet=function(e,t){var r,n="b"+Kp.packets[e.type];if(void 0!==Lp&&e.data instanceof Lp){var i=new FileReader;return i.onload=function(){var e=i.result.split(",")[1];t(n+e)},i.readAsDataURL(e.data)}try{r=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(Sf){for(var o=new Uint8Array(e.data),s=new Array(o.length),a=0;a<o.length;a++)s[a]=o[a];r=String.fromCharCode.apply(null,s)}return n+=btoa(r),t(n)},Kp.decodePacket=function(e,t,r){if(void 0===e)return th;if("string"==typeof e){if("b"===e.charAt(0))return Kp.decodeBase64Packet(e.substr(1),t);if(r&&!1===(e=function(e){try{e=Mp(e,{strict:!1})}catch(Sf){return!1}return e}(e)))return th;var n=e.charAt(0);return Number(n)==n&&eh[n]?e.length>1?{type:eh[n],data:e.substring(1)}:{type:eh[n]}:th}n=new Uint8Array(e)[0];var i=Cp(e,1);return Lp&&"blob"===t&&(i=new Lp([i])),{type:eh[n],data:i}},Kp.decodeBase64Packet=function(e,t){var r=eh[e.charAt(0)];if(!Gp)return{type:r,data:{base64:!0,data:e.substr(1)}};var n=Gp.decode(e.substr(1));return"blob"===t&&Lp&&(n=new Lp([n])),{type:r,data:n}},Kp.encodePayload=function(e,t,r){"function"==typeof t&&(r=t,t=null);var n=kp(e);return t&&n?Lp&&!Qp?Kp.encodePayloadAsBlob(e,r):Kp.encodePayloadAsArrayBuffer(e,r):e.length?void rh(e,(function(e,r){Kp.encodePacket(e,!!n&&t,!1,(function(e){r(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return r(t.join(""))})):r("0:")},Kp.decodePayload=function(e,t,r){if("string"!=typeof e)return Kp.decodePayloadAsBinary(e,t,r);var n;if("function"==typeof t&&(r=t,t=null),""===e)return r(th,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(th,0,1);if(s!=(o=e.substr(a+1,i)).length)return r(th,0,1);if(o.length){if(n=Kp.decodePacket(o,t,!1),th.type===n.type&&th.data===n.data)return r(th,0,1);if(!1===r(n,a+i,u))return}a+=i,s=""}else s+=l}return""!==s?r(th,0,1):void 0},Kp.encodePayloadAsArrayBuffer=function(e,t){if(!e.length)return t(new ArrayBuffer(0));rh(e,(function(e,t){Kp.encodePacket(e,!0,!0,(function(e){return t(null,e)}))}),(function(e,r){var n=r.reduce((function(e,t){var r;return e+(r="string"==typeof t?t.length:t.byteLength).toString().length+r+2}),0),i=new Uint8Array(n),o=0;return r.forEach((function(e){var t="string"==typeof e,r=e;if(t){for(var n=new Uint8Array(e.length),s=0;s<e.length;s++)n[s]=e.charCodeAt(s);r=n.buffer}i[o++]=t?0:1;var a=r.byteLength.toString();for(s=0;s<a.length;s++)i[o++]=parseInt(a[s]);for(i[o++]=255,n=new Uint8Array(r),s=0;s<n.length;s++)i[o++]=n[s]})),t(i.buffer)}))},Kp.encodePayloadAsBlob=function(e,t){rh(e,(function(e,t){Kp.encodePacket(e,!0,!0,(function(e){var r=new Uint8Array(1);if(r[0]=1,"string"==typeof e){for(var n=new Uint8Array(e.length),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);e=n.buffer,r[0]=0}var o=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),s=new Uint8Array(o.length+1);for(i=0;i<o.length;i++)s[i]=parseInt(o[i]);if(s[o.length]=255,Lp){var a=new Lp([r.buffer,s.buffer,e]);t(null,a)}}))}),(function(e,r){return t(new Lp(r))}))},Kp.decodePayloadAsBinary=function(e,t,r){"function"==typeof t&&(r=t,t=null);for(var n=e,i=[];n.byteLength>0;){for(var o=new Uint8Array(n),s=0===o[0],a="",u=1;255!==o[u];u++){if(a.length>310)return r(th,0,1);a+=o[u]}n=Cp(n,2+a.length),a=parseInt(a);var l=Cp(n,0,a);if(s)try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(Sf){var c=new Uint8Array(l);for(l="",u=0;u<c.length;u++)l+=String.fromCharCode(c[u])}i.push(l),n=Cp(n,a)}var p=i.length;i.forEach((function(e,n){r(Kp.decodePacket(e,t,!0),n,p)}))};var nh={};function ih(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}nh=ih,mp(ih.prototype),ih.prototype.onError=function(e,t){var r=new Error(e);return r.type="TransportError",r.description=t,this.emit("error",r),this},ih.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},ih.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},ih.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},ih.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},ih.prototype.onData=function(e){var t=Kp.decodePacket(e,this.socket.binaryType);this.onPacket(t)},ih.prototype.onPacket=function(e){this.emit("packet",e)},ih.prototype.onClose=function(){this.readyState="closed",this.emit("close")};var oh={};try{oh="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(th){oh=!1}var sh,ah=function(e){var t=e.xdomain,r=e.xscheme,n=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||oh))return new XMLHttpRequest}catch(Sf){}try{if("undefined"!=typeof XDomainRequest&&!r&&n)return new XDomainRequest}catch(Sf){}if(!t)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(Sf){}},uh=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},lh={},ch="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),ph={},hh=0,dh=0;function fh(e){var t="";do{t=ch[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function gh(){var e=fh(+new Date);return e!==sh?(hh=0,sh=e):e+"."+fh(hh++)}for(;dh<64;dh++)ph[ch[dh]]=dh;gh.encode=fh,gh.decode=function(e){var t=0;for(dh=0;dh<e.length;dh++)t=64*t+ph[e.charAt(dh)];return t},lh=gh;var mh=$c("engine.io-client:polling"),vh=bh,yh=null!=new ah({xdomain:!1}).responseType;function bh(e){var t=e&&e.forceBase64;yh&&!t||(this.supportsBinary=!1),nh.call(this,e)}uh(bh,nh),bh.prototype.name="polling",bh.prototype.doOpen=function(){this.poll()},bh.prototype.pause=function(e){var t=this;function r(){mh("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(mh("we are currently polling - waiting to pause"),n++,this.once("pollComplete",(function(){mh("pre-pause polling complete"),--n||r()}))),this.writable||(mh("we are currently writing - waiting to pause"),n++,this.once("drain",(function(){mh("pre-pause writing complete"),--n||r()})))}else r()},bh.prototype.poll=function(){mh("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},bh.prototype.onData=function(e){var t=this;mh("polling got data %s",e),Kp.decodePayload(e,this.socket.binaryType,(function(e,r,n){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():mh('ignoring poll - transport state "%s"',this.readyState))},bh.prototype.doClose=function(){var e=this;function t(){mh("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(mh("transport open - closing"),t()):(mh("transport not open - deferring close"),this.once("open",t))},bh.prototype.write=function(e){var t=this;this.writable=!1;var r=function(){t.writable=!0,t.emit("drain")};Kp.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,r)}))},bh.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(e[this.timestampParam]=lh()),this.supportsBinary||e.sid||(e.b64=1),e=wp.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 wh={},Sh=$c("engine.io-client:polling-xhr");function _h(){}function Ph(e){if(vh.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,"undefined"!=typeof location){var t="https:"===location.protocol,r=location.port;r||(r=t?443:80),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||r!==e.port,this.xs=e.secure!==t}}function kh(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()}if((wh=Ph).Request=kh,uh(Ph,vh),Ph.prototype.supportsBinary=!0,Ph.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 kh(e)},Ph.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},Ph.prototype.doPoll=function(){Sh("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},mp(kh.prototype),kh.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 ah(e),r=this;try{Sh("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(Sf){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(Sf){}try{t.setRequestHeader("Accept","*/*")}catch(Sf){}"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(Sf){}4===t.readyState&&(200===t.status||1223===t.status?r.onLoad():setTimeout((function(){r.onError(t.status)}),0))},Sh("xhr data %s",this.data),t.send(this.data)}catch(Sf){return void setTimeout((function(){r.onError(Sf)}),0)}"undefined"!=typeof document&&(this.index=kh.requestsCount++,kh.requests[this.index]=this)},kh.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},kh.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},kh.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},kh.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=_h:this.xhr.onreadystatechange=_h,e)try{this.xhr.abort()}catch(Sf){}"undefined"!=typeof document&&delete kh.requests[this.index],this.xhr=null}},kh.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(Sf){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(Sf){this.onError(Sf)}null!=e&&this.onData(e)},kh.prototype.hasXDR=function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR},kh.prototype.abort=function(){this.cleanup()},kh.requestsCount=0,kh.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Oh);else if("function"==typeof addEventListener){var Ch="onpagehide"in self?"pagehide":"unload";addEventListener(Ch,Oh,!1)}function Oh(){for(var e in kh.requests)kh.requests.hasOwnProperty(e)&&kh.requests[e].abort()}var Eh={};(function(e){(function(){Eh=s;var t,r=/\n/g,n=/\\n/g;function i(){}function o(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{}}function s(e){if(vh.call(this,e),this.query=this.query||{},!t){var r=o();t=r.___eio=r.___eio||[]}this.index=t.length;var n=this;t.push((function(e){n.onData(e)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){n.script&&(n.script.onerror=i)}),!1)}uh(s,vh),s.prototype.supportsBinary=!1,s.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),vh.prototype.doClose.call(this)},s.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(t,r):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},s.prototype.doWrite=function(e,t){var i=this;if(!this.form){var o,s=document.createElement("form"),a=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=u,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}function l(){c(),t()}function c(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(Sf){i.onError("jsonp polling iframe removal error",Sf)}try{var e='<iframe src="javascript:0" name="'+i.iframeId+'">';o=document.createElement(e)}catch(Sf){(o=document.createElement("iframe")).name=i.iframeId,o.src="javascript:0"}o.id=i.iframeId,i.form.appendChild(o),i.iframe=o}this.form.action=this.uri(),c(),e=e.replace(n,"\\\n"),this.area.value=e.replace(r,"\\n");try{this.form.submit()}catch(Sf){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===i.iframe.readyState&&l()}:this.iframe.onload=l}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Ah={};(function(e){(function(){var t,r,n=$c("engine.io-client:websocket");if("undefined"!=typeof WebSocket)t=WebSocket;else if("undefined"!=typeof self)t=self.WebSocket||self.MozWebSocket;else try{r=o({})}catch(Sf){}var i=t||r;function s(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=t&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(i=r),nh.call(this,e)}Ah=s,uh(s,nh),s.prototype.name="websocket",s.prototype.supportsBinary=!0,s.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 i(e,t):new i(e):new i(e,t,r)}catch(th){return this.emit("error",th)}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()}},s.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},s.prototype.write=function(t){var r=this;this.writable=!1;for(var i=t.length,o=0,s=i;o<s;o++)!function(t){Kp.encodePacket(t,r.supportsBinary,(function(o){if(!r.usingBrowserWebSocket){var s={};t.options&&(s.compress=t.options.compress),r.perMessageDeflate&&("string"==typeof o?e.byteLength(o):o.length)<r.perMessageDeflate.threshold&&(s.compress=!1)}try{r.usingBrowserWebSocket?r.ws.send(o):r.ws.send(o,s)}catch(Sf){n("websocket closed before onclose event")}--i||(r.emit("flush"),setTimeout((function(){r.writable=!0,r.emit("drain")}),0))}))}(t[o])},s.prototype.onClose=function(){nh.prototype.onClose.call(this)},s.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},s.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]=lh()),this.supportsBinary||(e.b64=1),(e=wp.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e},s.prototype.check=function(){return!(!i||"__initialize"in i&&this.name===s.prototype.name)}}).call(this)}).call(this,s({}).Buffer);var Fh={polling:function(e){var t=!1,r=!1,n=!1!==e.jsonp;if("undefined"!=typeof location){var i="https:"===location.protocol,o=location.port;o||(o=i?443:80),t=e.hostname!==location.hostname||o!==e.port,r=e.secure!==i}if(e.xdomain=t,e.xscheme=r,"open"in new ah(e)&&!e.forceJSONP)return new wh(e);if(!n)throw new Error("JSONP disabled");return new Eh(e)}};Fh.websocket=Ah;var Rh,xh=$c("engine.io-client:socket");function Uh(e,t){if(!(this instanceof Uh))return new Uh(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=Hc(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=Hc(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=wp.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&&Object.keys(t.extraHeaders).length>0&&(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()}Rh=Uh,Uh.priorWebsocketSuccess=!1,mp(Uh.prototype),Uh.protocol=Kp.protocol,Uh.Socket=Uh,Uh.Transport=nh,Uh.transports=Fh,Uh.parser=Kp,Uh.prototype.createTransport=function(e){xh('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=Kp.protocol,t.transport=e;var r=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new Fh[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})},Uh.prototype.open=function(){var e;if(this.rememberUpgrade&&Uh.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(Sf){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},Uh.prototype.setTransport=function(e){xh("setting transport %s",e.name);var t=this;this.transport&&(xh("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,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")}))},Uh.prototype.probe=function(e){xh('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),r=!1,n=this;function i(){if(n.onlyBinaryUpgrades){var i=!this.supportsBinary&&n.transport.supportsBinary;r=r||i}r||(xh('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(i){if(!r)if("pong"===i.type&&"probe"===i.data){if(xh('probe transport "%s" pong',e),n.upgrading=!0,n.emit("upgrading",t),!t)return;Uh.priorWebsocketSuccess="websocket"===t.name,xh('pausing current transport "%s"',n.transport.name),n.transport.pause((function(){r||"closed"!==n.readyState&&(xh("changing transport and sending upgrade packet"),c(),n.setTransport(t),t.send([{type:"upgrade"}]),n.emit("upgrade",t),t=null,n.upgrading=!1,n.flush())}))}else{xh('probe transport "%s" failed',e);var o=new Error("probe error");o.transport=t.name,n.emit("upgradeError",o)}})))}function o(){r||(r=!0,c(),t.close(),t=null)}function s(r){var i=new Error("probe error: "+r);i.transport=t.name,o(),xh('probe transport "%s" failed because of error: %s',e,r),n.emit("upgradeError",i)}function a(){s("transport closed")}function u(){s("socket closed")}function l(e){t&&e.name!==t.name&&(xh('"%s" works - aborting "%s"',e.name,t.name),o())}function c(){t.removeListener("open",i),t.removeListener("error",s),t.removeListener("close",a),n.removeListener("close",u),n.removeListener("upgrading",l)}Uh.priorWebsocketSuccess=!1,t.once("open",i),t.once("error",s),t.once("close",a),this.once("close",u),this.once("upgrading",l),t.open()},Uh.prototype.onOpen=function(){if(xh("socket open"),this.readyState="open",Uh.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){xh("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},Uh.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(xh('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 xh('packet received with socket readyState "%s"',this.readyState)},Uh.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))},Uh.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)},Uh.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){xh("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},Uh.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},Uh.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},Uh.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(xh("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},Uh.prototype.write=Uh.prototype.send=function(e,t,r){return this.sendPacket("message",e,t,r),this},Uh.prototype.sendPacket=function(e,t,r,n){if("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;var i={type:e,data:t,options:r};this.emit("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}},Uh.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?n():t()})):this.upgrading?n():t()}function t(){e.onClose("forced close"),xh("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 this},Uh.prototype.onError=function(e){xh("socket error %j",e),Uh.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},Uh.prototype.onClose=function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(xh('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)},Uh.prototype.filterUpgrades=function(e){for(var t=[],r=0,n=e.length;r<n;r++)~bp(this.transports,e[r])&&t.push(e[r]);return t};var Th={};(Th=Rh).parser=Kp;var Dh=function(e,t){for(var r=[],n=(t=t||0)||0;n<e.length;n++)r[n-t]=e[n];return r},Bh=function(e,t,r){return e.on(t,r),{destroy:function(){e.removeListener(t,r)}}},Ih=[].slice,Nh=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var r=Ih.call(arguments,2);return function(){return t.apply(e,r.concat(Ih.call(arguments)))}},Mh={},jh=$c("socket.io-client:socket");Mh=Mh=Hh;var Lh={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},zh=mp.prototype.emit;function Hh(e,t,r){this.io=e,this.nsp=t,this.json=this,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()}mp(Hh.prototype),Hh.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[Bh(e,"open",Nh(this,"onopen")),Bh(e,"packet",Nh(this,"onpacket")),Bh(e,"close",Nh(this,"onclose"))]}},Hh.prototype.open=Hh.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},Hh.prototype.send=function(){var e=Dh(arguments);return e.unshift("message"),this.emit.apply(this,e),this},Hh.prototype.emit=function(e){if(Lh.hasOwnProperty(e))return zh.apply(this,arguments),this;var t=Dh(arguments),r={type:(void 0!==this.flags.binary?this.flags.binary:kp(t))?up.BINARY_EVENT:up.EVENT,data:t,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(jh("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},Hh.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},Hh.prototype.onopen=function(){if(jh("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?wp.encode(this.query):this.query;jh("sending connect packet with query %s",e),this.packet({type:up.CONNECT,query:e})}else this.packet({type:up.CONNECT})},Hh.prototype.onclose=function(e){jh("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},Hh.prototype.onpacket=function(e){var t=e.nsp===this.nsp,r=e.type===up.ERROR&&"/"===e.nsp;if(t||r)switch(e.type){case up.CONNECT:this.onconnect();break;case up.EVENT:case up.BINARY_EVENT:this.onevent(e);break;case up.ACK:case up.BINARY_ACK:this.onack(e);break;case up.DISCONNECT:this.ondisconnect();break;case up.ERROR:this.emit("error",e.data)}},Hh.prototype.onevent=function(e){var t=e.data||[];jh("emitting event %j",t),null!=e.id&&(jh("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?zh.apply(this,t):this.receiveBuffer.push(t)},Hh.prototype.ack=function(e){var t=this,r=!1;return function(){if(!r){r=!0;var n=Dh(arguments);jh("sending ack %j",n),t.packet({type:kp(n)?up.BINARY_ACK:up.ACK,id:e,data:n})}}},Hh.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(jh("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):jh("bad ack %s",e.id)},Hh.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},Hh.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)zh.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},Hh.prototype.ondisconnect=function(){jh("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},Hh.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)},Hh.prototype.close=Hh.prototype.disconnect=function(){return this.connected&&(jh("performing disconnect (%s)",this.nsp),this.packet({type:up.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},Hh.prototype.compress=function(e){return this.flags.compress=e,this},Hh.prototype.binary=function(e){return this.flags.binary=e,this};var qh={};function Vh(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}qh=Vh,Vh.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-r:e+r}return 0|Math.min(e,this.max)},Vh.prototype.reset=function(){this.attempts=0},Vh.prototype.setMin=function(e){this.ms=e},Vh.prototype.setMax=function(e){this.max=e},Vh.prototype.setJitter=function(e){this.jitter=e};var Wh={},Xh=$c("socket.io-client:manager"),Yh=Object.prototype.hasOwnProperty;function Gh(e,t){if(!(this instanceof Gh))return new Gh(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 qh({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||up;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}Wh=Gh,Gh.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)Yh.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},Gh.prototype.updateSocketIds=function(){for(var e in this.nsps)Yh.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},Gh.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},mp(Gh.prototype),Gh.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},Gh.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},Gh.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},Gh.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},Gh.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},Gh.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},Gh.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Gh.prototype.open=Gh.prototype.connect=function(e,t){if(Xh("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;Xh("opening %s",this.uri),this.engine=Th(this.uri,this.opts);var r=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var i=Bh(r,"open",(function(){n.onopen(),e&&e()})),o=Bh(r,"error",(function(t){if(Xh("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}else n.maybeReconnectOnOpen()}));if(!1!==this._timeout){var s=this._timeout;Xh("connect attempt will timeout after %d",s);var a=setTimeout((function(){Xh("connect attempt timed out after %d",s),i.destroy(),r.close(),r.emit("error","timeout"),n.emitAll("connect_timeout",s)}),s);this.subs.push({destroy:function(){clearTimeout(a)}})}return this.subs.push(i),this.subs.push(o),this},Gh.prototype.onopen=function(){Xh("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(Bh(e,"data",Nh(this,"ondata"))),this.subs.push(Bh(e,"ping",Nh(this,"onping"))),this.subs.push(Bh(e,"pong",Nh(this,"onpong"))),this.subs.push(Bh(e,"error",Nh(this,"onerror"))),this.subs.push(Bh(e,"close",Nh(this,"onclose"))),this.subs.push(Bh(this.decoder,"decoded",Nh(this,"ondecoded")))},Gh.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Gh.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Gh.prototype.ondata=function(e){this.decoder.add(e)},Gh.prototype.ondecoded=function(e){this.emit("packet",e)},Gh.prototype.onerror=function(e){Xh("error",e),this.emitAll("error",e)},Gh.prototype.socket=function(e,t){var r=this.nsps[e];if(!r){r=new Mh(this,e,t),this.nsps[e]=r;var n=this;r.on("connecting",i),r.on("connect",(function(){r.id=n.generateId(e)})),this.autoConnect&&i()}function i(){~bp(n.connecting,r)||n.connecting.push(r)}return r},Gh.prototype.destroy=function(e){var t=bp(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},Gh.prototype.packet=function(e){Xh("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(r){for(var n=0;n<r.length;n++)t.engine.write(r[n],e.options);t.encoding=!1,t.processPacketQueue()})))},Gh.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},Gh.prototype.cleanup=function(){Xh("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()},Gh.prototype.close=Gh.prototype.disconnect=function(){Xh("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},Gh.prototype.onclose=function(e){Xh("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},Gh.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)Xh("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();Xh("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var r=setTimeout((function(){e.skipReconnect||(Xh("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(Xh("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(Xh("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(r)}})}},Gh.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)};function Kh(){return(Kh=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 $h(e,t){return($h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Jh,Qh=["ASSEMBLY_UPLOADING","ASSEMBLY_EXECUTING","ASSEMBLY_COMPLETED"];function Zh(e,t){return Qh.indexOf(e)>=Qh.indexOf(t)}var ed=function(e){var t,r;function n(t){var r;return(r=e.call(this)||this).status=t,r.socket=null,r.pollInterval=null,r.closed=!1,r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,$h(t,r);var o=n.prototype;return o.connect=function(){this._connectSocket(),this._beginPolling()},o._onFinished=function(){this.emit("finished"),this.close()},o._connectSocket=function(){var e=this,t=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)}}(this.status.websocket_url),r=(Jh||(Jh=i({})),Jh).connect(t.origin,{transports:["websocket"],path:t.pathname});r.on("connect",(function(){r.emit("assembly_connect",{id:e.status.assembly_id}),e.emit("connect")})),r.on("connect_failed",(function(){e._onError(new Ue("Transloadit Socket.io connection error")),e.socket=null})),r.on("error",(function(){r.disconnect(),e.socket=null})),r.on("assembly_finished",(function(){e._onFinished()})),r.on("assembly_upload_finished",(function(t){e.emit("upload",t),e.status.uploads.push(t)})),r.on("assembly_uploading_finished",(function(){e.emit("executing")})),r.on("assembly_upload_meta_data_extracted",(function(){e.emit("metadata"),e._fetchStatus({diff:!1})})),r.on("assembly_result_finished",(function(t,r){e.emit("result",t,r),e.status.results[t]||(e.status.results[t]=[]),e.status.results[t].push(r)})),r.on("assembly_error",(function(t){e._onError(t),e._fetchStatus({diff:!1})})),this.socket=r},o._onError=function(e){this.emit("error",Kh(new Error(e.message),e))},o._beginPolling=function(){var e=this;this.pollInterval=setInterval((function(){e.socket&&e.socket.connected||e._fetchStatus()}),2e3)},o._fetchStatus=function(e){var t=this,r=(void 0===e?{}:e).diff,n=void 0===r||r;return Te(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)}))},o.update=function(){return this._fetchStatus({diff:!0})},o.updateStatus=function(e){this._diffStatus(this.status,e),this.status=e},o._diffStatus=function(e,t){var r=this,n=e.ok,i=t.ok;if(t.error&&!e.error)return this._onError(t);var o=Zh(i,"ASSEMBLY_EXECUTING")&&!Zh(n,"ASSEMBLY_EXECUTING");o&&this.emit("executing"),Object.keys(t.uploads).filter((function(t){return!_(e.uploads,t)})).map((function(e){return t.uploads[e]})).forEach((function(e){r.emit("upload",e)})),o&&this.emit("metadata"),Object.keys(t.results).forEach((function(n){var i=t.results[n],o=e.results[n];i.filter((function(e){return!o||!o.some((function(t){return t.id===e.id}))})).forEach((function(e){r.emit("result",n,e)}))})),Zh(i,"ASSEMBLY_COMPLETED")&&!Zh(n,"ASSEMBLY_COMPLETED")&&this.emit("finished")},o.close=function(){this.closed=!0,this.socket&&(this.socket.disconnect(),this.socket=null),clearInterval(this.pollInterval)},n}(mp),td=function(){function e(e){void 0===e&&(e={}),this.opts=e,this._reportError=this._reportError.bind(this),this._headers={"Transloadit-Client":this.opts.client}}var t=e.prototype;return t.createAssembly=function(e){var t=this,r=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=new Ve("/assemblies",""+this.opts.service).href;return Te(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,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"})}))},t.reserveFile=function(e,t){var r=this,n=encodeURIComponent(t.size),i=e.assembly_ssl_url+"/reserve_file?size="+n;return Te(i,{method:"post",headers:this._headers}).then((function(e){return e.json()})).catch((function(n){return r._reportError(n,{assembly:e,file:t,url:i,type:"API_ERROR"})}))},t.addFile=function(e,t){var r=this;if(!t.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));var n=encodeURIComponent(t.size),i=encodeURIComponent(t.uploadURL),o="size="+n+"&filename="+encodeURIComponent(t.name)+"&fieldname=file&s3Url="+i,s=e.assembly_ssl_url+"/add_file?"+o;return Te(s,{method:"post",headers:this._headers}).then((function(e){return e.json()})).catch((function(n){return r._reportError(n,{assembly:e,file:t,url:s,type:"API_ERROR"})}))},t.cancelAssembly=function(e){var t=this,r=e.assembly_ssl_url;return Te(r,{method:"delete",headers:this._headers}).then((function(e){return e.json()})).catch((function(e){return t._reportError(e,{url:r,type:"API_ERROR"})}))},t.getAssemblyStatus=function(e){var t=this;return Te(e,{headers:this._headers}).then((function(e){return e.json()})).catch((function(r){return t._reportError(r,{url:e,type:"STATUS_ERROR"})}))},t.submitError=function(e,t){var r=t.endpoint,n=t.instance,i=t.assembly,o=e.details?e.message+" ("+e.details+")":e.message;return Te("https://transloaditstatus.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()}))},t._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},e}(),rd={};function nd(e){if(!e)throw new Error("Transloadit: The `params` option is required.");if("string"==typeof e)try{e=JSON.parse(e)}catch(th){throw th.message="Transloadit: The `params` option is a malformed JSON string: "+th.message,th}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 id=function(){function e(e,t){this.files=e,this.opts=t}var t=e.prototype;return t._normalizeAssemblyOptions=function(e,t){if(Array.isArray(t.fields)){var r=t.fields;t.fields={},r.forEach((function(r){t.fields[r]=e.meta[r]}))}return t.fields||(t.fields={}),t},t._getAssemblyOptions=function(e){var t=this,r=this.opts;return Promise.resolve().then((function(){return r.getAssemblyOptions(e,r)})).then((function(r){return t._normalizeAssemblyOptions(e,r)})).then((function(t){return nd(t.params),{fileIDs:[e.id],options:t}}))},t._dedupe=function(e){var t=Object.create(null);return e.forEach((function(e){var r,n=e.fileIDs,i=e.options,o=JSON.stringify(i);t[o]?(r=t[o].fileIDs).push.apply(r,n):t[o]={options:i,fileIDs:[].concat(n)}})),Object.keys(t).map((function(e){return t[e]}))},t.build=function(){var e=this,t=this.opts;return this.files.length>0?Promise.all(this.files.map((function(t){return e._getAssemblyOptions(t)}))).then((function(t){return e._dedupe(t)})):t.alwaysRunAssembly?Promise.resolve(t.getAssemblyOptions(null,t)).then((function(t){return nd(t.params),[{fileIDs:e.files.map((function(e){return e.id})),options:t}]})):Promise.resolve([])},e}();function od(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sd(e,t){return(sd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(rd=id).validateParams=nd;var ad,ud,ld=function(e){var t,r;function n(t,r){var n;return(n=e.call(this)||this)._uppy=t,n._assemblyIDs=r,n._remaining=r.length,n.promise=new Promise((function(e,t){n._resolve=e,n._reject=t})),n._onAssemblyComplete=n._onAssemblyComplete.bind(od(n)),n._onAssemblyCancel=n._onAssemblyCancel.bind(od(n)),n._onAssemblyError=n._onAssemblyError.bind(od(n)),n._onImportError=n._onImportError.bind(od(n)),n._addListeners(),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,sd(t,r);var i=n.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-=1,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)},n}(mp),cd={};function pd(){return(pd=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 hd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dd(e,t){return(dd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fd(e,t){return{params:t.params,signature:t.signature,fields:t.fields}}var gd,md,vd="https://api2.transloadit.com/companion",yd=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/companion/,bd=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/uppy-server/;function wd(e,t){return(wd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sd(){return(Sd=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)}ud=ad=function(e){var t,r;function n(t,r){var n;(n=e.call(this,t,r)||this).type="uploader",n.id=n.opts.id||"Transloadit",n.title="Transloadit",n.defaultLocale={strings:{creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",encoding:"Encoding..."}};var i={service:"https://api2.transloadit.com",errorReporting:!0,waitForEncoding:!1,waitForMetadata:!1,alwaysRunAssembly:!1,importFromUploadURLs:!1,signature:null,params:null,fields:{},getAssemblyOptions:fd,limit:0};n.opts=pd({},i,r),n.i18nInit(),n._prepareUpload=n._prepareUpload.bind(hd(n)),n._afterUpload=n._afterUpload.bind(hd(n)),n._onError=n._onError.bind(hd(n)),n._onTusError=n._onTusError.bind(hd(n)),n._onCancelAll=n._onCancelAll.bind(hd(n)),n._onFileUploadURLAvailable=n._onFileUploadURLAvailable.bind(hd(n)),n._onRestored=n._onRestored.bind(hd(n)),n._getPersistentData=n._getPersistentData.bind(hd(n));var o=n.opts.getAssemblyOptions!==i.getAssemblyOptions;return n.opts.params?rd.validateParams(n.opts.params):o||rd.validateParams(null),n.client=new td({service:n.opts.service,client:n._getClientVersion(),errorReporting:n.opts.errorReporting}),n.activeAssemblies={},n.assemblyWatchers={},n.completedFiles=Object.create(null),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,dd(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([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._getClientVersion=function(){var e=this,t=["uppy-core:"+this.uppy.constructor.VERSION,"uppy-transloadit:"+this.constructor.VERSION,"uppy-tus:"+jc.VERSION],r=function(r,n){var i=e.uppy.getPlugin(r);i&&t.push(n+":"+i.constructor.VERSION)};return this.opts.importFromUploadURLs&&(r("XHRUpload","uppy-xhr-upload"),r("AwsS3","uppy-aws-s3"),r("AwsS3Multipart","uppy-aws-s3-multipart")),r("Dropbox","uppy-dropbox"),r("Box","uppy-box"),r("Facebook","uppy-facebook"),r("GoogleDrive","uppy-google-drive"),r("Instagram","uppy-instagram"),r("OneDrive","uppy-onedrive"),r("Zoom","uppy-zoom"),r("Url","uppy-url"),t.join(",")},i._attachAssemblyMetadata=function(e,t){var r=pd({},e.meta,{assembly_url:t.assembly_url,filename:e.name,fieldname:"file"}),n=pd({},e.tus,{endpoint:t.tus_url,addRequestId:!0}),i=e.remote;if(e.remote&&bd.test(e.remote.companionUrl)){var o=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(o),o}if(e.remote&&yd.test(e.remote.companionUrl)){var s=t.companion_url.replace(/\/$/,""),a=e.remote.url.replace(e.remote.companionUrl,"").replace(/^\//,"");i=pd({},e.remote,{companionUrl:s,url:s+"/"+a})}var u=pd({},e,{transloadit:{assembly:t.assembly_id}});return this.opts.importFromUploadURLs||pd(u,{meta:r,tus:n,remote:i}),u},i._createAssembly=function(e,t,r){var n=this;return this.uppy.log("[Transloadit] Create Assembly"),this.client.createAssembly({params:r.params,fields:r.fields,expectedFiles:e.length,signature:r.signature}).then((function(r){var i,o,s=new ed(r),a=s.status,u=a.assembly_id,l=n.getPluginState(),c=l.assemblies,p=l.uploadsAssemblies;n.setPluginState({assemblies:pd({},c,(i={},i[u]=a,i)),uploadsAssemblies:pd({},p,(o={},o[t]=[].concat(p[t],[u]),o))});var h=n.uppy.getState().files,d={};return e.forEach((function(e){d[e]=n._attachAssemblyMetadata(n.uppy.getFile(e),a)})),n.uppy.setState({files:pd({},h,d)}),n.uppy.emit("transloadit:assembly-created",a,e),n.uppy.log("[Transloadit] Created Assembly "+u),s})).catch((function(e){throw e.message=n.i18n("creatingAssemblyFailed")+": "+e.message,e}))},i._createAssemblyWatcher=function(e,t,r){var n=this,i=new ld(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},i._shouldWaitAfterUpload=function(){return this.opts.waitForEncoding||this.opts.waitForMetadata},i._reserveFiles=function(e,t){var r=this;return Promise.all(t.map((function(t){var n=r.uppy.getFile(t);return r.client.reserveFile(e.status,n)})))},i._onFileUploadURLAvailable=function(e){var t=this,r=this.uppy.getFile(e.id);if(r&&r.transloadit&&r.transloadit.assembly){var n=this.getPluginState().assemblies[r.transloadit.assembly];this.client.addFile(n,r).catch((function(e){t.uppy.log(e),t.uppy.emit("transloadit:import-error",n,r.id,e)}))}},i._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}},i._onFileUploadComplete=function(e,t){var r,n=this.getPluginState(),i=this._findFile(t);i?(this.setPluginState({files:pd({},n.files,(r={},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\u2019t file the file, it was likely removed in the process")},i._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))},i._onAssemblyFinished=function(e){var t=this,r=e.assembly_ssl_url;this.client.getAssemblyStatus(r).then((function(e){var r,n=e.assembly_id,i=t.getPluginState();t.setPluginState({assemblies:pd({},i.assemblies,(r={},r[n]=e,r))}),t.uppy.emit("transloadit:complete",e)}))},i._cancelAssembly=function(e){var t=this;return this.client.cancelAssembly(e).then((function(){t.uppy.emit("transloadit:assembly-cancelled",e)}))},i._onCancelAll=function(){var e=this,t=this.getPluginState().uploadsAssemblies,r=Object.keys(t).reduce((function(e,r){return e.push.apply(e,t[r]),e}),[]).map((function(t){var r=e.getAssembly(t);return e._cancelAssembly(r)}));Promise.all(r).catch((function(t){e.uppy.log(t)}))},i._getPersistentData=function(e){var t,r=this.getPluginState(),n=r.assemblies,i=r.uploadsAssemblies;e(((t={})[this.id]={assemblies:n,uploadsAssemblies:i},t))},i._onRestored=function(e){var t=this,r=e&&e[this.id]?e[this.id]:{},n=r.assemblies||{},i=r.uploadsAssemblies||{};0!==Object.keys(i).length&&(this.restored=Promise.resolve().then((function(){var e,r,o;return e=n,r={},o=[],Object.keys(e).forEach((function(n){var i=e[n];i.uploads.forEach((function(e){var i=t._findFile(e);r[e.id]={id:i.id,assembly:n,uploadedFile:e}}));var s=t.getPluginState();Object.keys(i.results).forEach((function(e){i.results[e].forEach((function(t){var r=s.files[t.original_id];t.localId=r?r.id:null,o.push({id:t.id,result:t,stepName:e,assembly:n})}))}))})),t.setPluginState({assemblies:e,files:r,results:o,uploadsAssemblies:i}),function(){var e=t.getPluginState(),r=e.assemblies,n=e.uploadsAssemblies;Object.keys(n).forEach((function(e){var r=n[e],i=r.reduce((function(e,r){var n=t.getAssemblyFiles(r).map((function(e){return e.id}));return e.push.apply(e,n),e}),[]);t._createAssemblyWatcher(r,i,e)})),Object.keys(r).forEach((function(e){var n=new ed(r[e]);t._connectAssembly(n)}))}(),function(){var e=t.getPluginState().assemblies;return Promise.all(Object.keys(e).map((function(e){return t.activeAssemblies[e].update()})))}()})),this.restored.then((function(){t.restored=null})))},i._connectAssembly=function(e){var t=this,r=e.status.assembly_id;return this.activeAssemblies[r]=e,e.on("status",(function(e){var n,i=t.getPluginState().assemblies;t.setPluginState({assemblies:pd({},i,(n={},n[r]=e,n))})})),e.on("upload",(function(e){t._onFileUploadComplete(r,e)})),e.on("error",(function(r){r.assembly=e.status,t.uppy.emit("transloadit:assembly-error",e.status,r)})),e.on("executing",(function(){t.uppy.emit("transloadit:assembly-executing",e.status)})),this.opts.waitForEncoding&&e.on("result",(function(e,n){t._onResult(r,e,n)})),this.opts.waitForEncoding?e.on("finished",(function(){t._onAssemblyFinished(e.status)})):this.opts.waitForMetadata&&e.on("metadata",(function(){t._onAssemblyFinished(e.status)})),"ASSEMBLY_COMPLETE"===e.ok||(new Promise((function(t,r){e.once("connect",t),e.once("status",t),e.once("error",r)})).then((function(){t.uppy.log("[Transloadit] Socket is ready")})),e.connect()),e},i._prepareUpload=function(e,t){var r,n=this;(e=e.filter((function(e){return!e.error}))).forEach((function(e){var t=n.uppy.getFile(e);n.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:n.i18n("creatingAssembly")})}));var i=function(e){var r,i=e.fileIDs,o=e.options;return n._createAssembly(i,t,o).then((function(e){if(r=e,n.opts.importFromUploadURLs)return n._reserveFiles(e,i)})).then((function(){return i.forEach((function(e){var t=n.uppy.getFile(e);n.uppy.emit("preprocess-complete",t)})),r})).catch((function(e){throw i.forEach((function(t){var r=n.uppy.getFile(t);n.uppy.emit("preprocess-complete",r),n.uppy.emit("upload-error",r,e)})),e}))},o=this.getPluginState().uploadsAssemblies;this.setPluginState({uploadsAssemblies:pd({},o,(r={},r[t]=[],r))});var s=e.map((function(e){return n.uppy.getFile(e)}));return new rd(s,this.opts).build().then((function(r){return Promise.all(r.map(i)).then((function(r){var i=r.map((function(e){return e.status.assembly_id}));n._createAssemblyWatcher(i,e,t),r.map((function(e){return n._connectAssembly(e)}))}))}),(function(t){throw e.forEach((function(e){var r=n.uppy.getFile(e);n.uppy.emit("preprocess-complete",r),n.uppy.emit("upload-error",r,t)})),t}))},i._afterUpload=function(e,t){var r=this,n=e.map((function(e){return r.uppy.getFile(e)}));e=n.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 r._afterUpload(e,t)}));var o=i.uploadsAssemblies[t],s=function(){o.forEach((function(e){r.activeAssemblies[e].close(),delete r.activeAssemblies[e]}))};if(!this._shouldWaitAfterUpload()){s();var a=o.map((function(e){return r.getAssembly(e)}));return this.uppy.addResultData(t,{transloadit:a}),Promise.resolve()}return 0===o.length?(this.uppy.addResultData(t,{transloadit:[]}),Promise.resolve()):(n.filter((function(e){return!_(r.completedFiles,e.id)})).forEach((function(e){r.uppy.emit("postprocess-progress",e,{mode:"indeterminate",message:r.i18n("encoding")})})),this.assemblyWatchers[t].promise.then((function(){s();var e=o.map((function(e){return r.getAssembly(e)})),n=pd({},r.getPluginState().uploadsAssemblies);delete n[t],r.setPluginState({uploadsAssemblies:n}),r.uppy.addResultData(t,{transloadit:e})})))},i._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()}))},i._onTusError=function(e){if(e&&/^tus: /.test(e.message)){var t=e.originalRequest?e.originalRequest.getUnderlyingObject():null,r=t&&t.responseURL?t.responseURL:null;this.client.submitError(e,{url:r,type:"TUS_ERROR"}).then((function(e){}))}},i.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(jc,{storeFingerprintForResuming:!1,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:pd({},e,{individualCancellation:!1})})},i.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:pd({},e,{individualCancellation:!0})})},i.getAssembly=function(e){return this.getPluginState().assemblies[e]},i.getAssemblyFiles=function(e){return this.uppy.getFiles().filter((function(t){return t&&t.transloadit&&t.transloadit.assembly===e}))},n}(le.Plugin),ad.VERSION="1.6.25",(cd=ud).COMPANION=vd,cd.UPPY_SERVER=vd,cd.COMPANION_PATTERN=/\.transloadit\.com$/;var _d=$e.Provider,Pd=$e.RequestClient,kd=$e.Socket;function Cd(e,t){return t||(t=new Error("Upload error")),"string"==typeof t&&(t=new Error(t)),t instanceof Error||(t=Sd(new Error("Upload error"),{data:t})),su(e)?t=new Ue(t,e):(t.request=e,t)}function Od(e){return e.data.slice(0,e.data.size,e.meta.type)}var Ed=(md=gd=function(e){var t,r;function n(t,r){var n;(n=e.call(this,t,r)||this).type="uploader",n.id=n.opts.id||"XHRUpload",n.title="XHRUpload",n.defaultLocale={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}};var i={formData:!0,fieldName:"files[]",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:0,withCredentials:!1,responseType:"",getResponseData:function(e,t){var r={};try{r=JSON.parse(e)}catch(th){console.log(th)}return r},getResponseError:function(e,t){var r=new Error("Upload error");return su(t)&&(r=new Ue(r,t)),r},validateStatus:function(e,t,r){return e>=200&&e<300}};if(n.opts=Sd({},i,r),n.i18nInit(),n.handleUpload=n.handleUpload.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)),n.opts.__queue instanceof eu?n.requests=n.opts.__queue:n.requests=new eu(n.opts.limit),n.opts.bundle&&!n.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");return n.uploaderEvents=Object.create(null),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,wd(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},i.getOptions=function(e){var t=this.uppy.getState().xhrUpload,r=this.opts.headers,n=Sd({},this.opts,t||{},e.xhrUpload||{},{headers:{}});return"function"==typeof r?n.headers=r(e):Sd(n.headers,this.opts.headers),t&&Sd(n.headers,t.headers),e.xhrUpload&&Sd(n.headers,e.xhrUpload.headers),n},i.addMetadata=function(e,t,r){(Array.isArray(r.metaFields)?r.metaFields:Object.keys(t)).forEach((function(r){e.append(r,t[r])}))},i.createFormDataUpload=function(e,t){var r=new FormData;this.addMetadata(r,e.meta,t);var n=Od(e);return e.name?r.append(t.fieldName,n,e.meta.name):r.append(t.fieldName,n),r},i.createBundledUpload=function(e,t){var r=this,n=new FormData,i=this.uppy.getState().meta;return this.addMetadata(n,i,t),e.forEach((function(e){var t=r.getOptions(e),i=Od(e);e.name?n.append(t.fieldName,i,e.name):n.append(t.fieldName,i)})),n},i.createBareUpload=function(e,t){return e.data},i.upload=function(e,t,r){var n=this,i=this.getOptions(e);return this.uppy.log("uploading "+t+" of "+r),new Promise((function(t,r){n.uppy.emit("upload-started",e);var o=i.formData?n.createFormDataUpload(e,i):n.createBareUpload(e,i),s=new XMLHttpRequest;n.uploaderEvents[e.id]=new iu(n.uppy);var a=new ou(i.timeout,(function(){s.abort(),l.done();var t=new Error(n.i18n("timedOut",{seconds:Math.ceil(i.timeout/1e3)}));n.uppy.emit("upload-error",e,t),r(t)})),u=B();s.upload.addEventListener("loadstart",(function(e){n.uppy.log("[XHRUpload] "+u+" started")})),s.upload.addEventListener("progress",(function(t){n.uppy.log("[XHRUpload] "+u+" progress: "+t.loaded+" / "+t.total),a.progress(),t.lengthComputable&&n.uppy.emit("upload-progress",e,{uploader:n,bytesUploaded:t.loaded,bytesTotal:t.total})})),s.addEventListener("load",(function(o){if(n.uppy.log("[XHRUpload] "+u+" finished"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),i.validateStatus(o.target.status,s.responseText,s)){var c=i.getResponseData(s.responseText,s),p=c[i.responseUrlFieldName],h={status:o.target.status,body:c,uploadURL:p};return n.uppy.emit("upload-success",e,h),p&&n.uppy.log("Download "+e.name+" from "+p),t(e)}var d=i.getResponseData(s.responseText,s),f=Cd(s,i.getResponseError(s.responseText,s)),g={status:o.target.status,body:d};return n.uppy.emit("upload-error",e,f,g),r(f)})),s.addEventListener("error",(function(t){n.uppy.log("[XHRUpload] "+u+" errored"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null);var o=Cd(s,i.getResponseError(s.responseText,s));return n.uppy.emit("upload-error",e,o),r(o)})),s.open(i.method.toUpperCase(),i.endpoint,!0),s.withCredentials=i.withCredentials,""!==i.responseType&&(s.responseType=i.responseType);var l=n.requests.run((function(){var t=n.getOptions(e);return Object.keys(t.headers).forEach((function(e){s.setRequestHeader(e,t.headers[e])})),s.send(o),function(){a.done(),s.abort()}}));n.onFileRemove(e.id,(function(){l.abort(),r(new Error("File removed"))})),n.onCancelAll(e.id,(function(){l.abort(),r(new Error("Upload cancelled"))}))}))},i.uploadRemote=function(e,t,r){var n=this,i=this.getOptions(e);return new Promise((function(t,r){n.uppy.emit("upload-started",e);var o={};(Array.isArray(i.metaFields)?i.metaFields:Object.keys(e.meta)).forEach((function(t){o[t]=e.meta[t]})),new(e.remote.providerOptions.provider?_d:Pd)(n.uppy,e.remote.providerOptions).post(e.remote.url,Sd({},e.remote.body,{endpoint:i.endpoint,size:e.data.size,fieldname:i.fieldName,metadata:o,httpMethod:i.method,useFormData:i.formData,headers:i.headers})).then((function(o){var s=o.token,a=nu(e.remote.companionUrl),u=new kd({target:a+"/api/"+s,autoOpen:!1});n.uploaderEvents[e.id]=new iu(n.uppy),n.onFileRemove(e.id,(function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was removed")})),n.onCancelAll(e.id,(function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was canceled")})),n.onRetry(e.id,(function(){u.send("pause",{}),u.send("resume",{})})),n.onRetryAll(e.id,(function(){u.send("pause",{}),u.send("resume",{})})),u.on("progress",(function(t){return ru(n,t,e)})),u.on("success",(function(r){var o=i.getResponseData(r.response.responseText,r.response),s=o[i.responseUrlFieldName],a={status:r.response.status,body:o,uploadURL:s};return n.uppy.emit("upload-success",e,a),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),t()})),u.on("error",(function(t){var o=t.response,s=o?i.getResponseError(o.responseText,o):Sd(new Error(t.error.message),{cause:t.error});n.uppy.emit("upload-error",e,s),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),r(s)}));var l=n.requests.run((function(){return u.open(),e.isPaused&&u.send("pause",{}),function(){return u.close()}}))})).catch((function(t){n.uppy.emit("upload-error",e,t),r(t)}))}))},i.uploadBundle=function(e){var t=this;return new Promise((function(r,n){var i=t.opts.endpoint,o=t.opts.method,s=t.uppy.getState().xhrUpload,a=t.createBundledUpload(e,Sd({},t.opts,s||{})),u=new XMLHttpRequest,l=new ou(t.opts.timeout,(function(){u.abort();var e=new Error(t.i18n("timedOut",{seconds:Math.ceil(t.opts.timeout/1e3)}));c(e),n(e)})),c=function(r){e.forEach((function(e){t.uppy.emit("upload-error",e,r)}))};u.upload.addEventListener("loadstart",(function(e){t.uppy.log("[XHRUpload] started uploading bundle"),l.progress()})),u.upload.addEventListener("progress",(function(r){l.progress(),r.lengthComputable&&e.forEach((function(e){t.uppy.emit("upload-progress",e,{uploader:t,bytesUploaded:r.loaded/r.total*e.size,bytesTotal:e.size})}))})),u.addEventListener("load",(function(i){if(l.done(),t.opts.validateStatus(i.target.status,u.responseText,u)){var o=t.opts.getResponseData(u.responseText,u),s={status:i.target.status,body:o};return e.forEach((function(e){t.uppy.emit("upload-success",e,s)})),r()}var a=t.opts.getResponseError(u.responseText,u)||new Error("Upload error");return a.request=u,c(a),n(a)})),u.addEventListener("error",(function(e){l.done();var r=t.opts.getResponseError(u.responseText,u)||new Error("Upload error");return c(r),n(r)})),t.uppy.on("cancel-all",(function(){l.done(),u.abort()})),u.open(o.toUpperCase(),i,!0),u.withCredentials=t.opts.withCredentials,""!==t.opts.responseType&&(u.responseType=t.opts.responseType),Object.keys(t.opts.headers).forEach((function(e){u.setRequestHeader(e,t.opts.headers[e])})),u.send(a),e.forEach((function(e){t.uppy.emit("upload-started",e)}))}))},i.uploadFiles=function(e){var t=this,r=e.map((function(r,n){var i=parseInt(n,10)+1,o=e.length;return r.error?Promise.reject(new Error(r.error)):r.isRemote?t.uploadRemote(r,i,o):t.upload(r,i,o)}));return tu(r)},i.onFileRemove=function(e,t){this.uploaderEvents[e].on("file-removed",(function(r){e===r.id&&t(r.id)}))},i.onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",(function(r){e===r&&t()}))},i.onRetryAll=function(e,t){var r=this;this.uploaderEvents[e].on("retry-all",(function(n){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.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\u2019t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(r)}return this.uploadFiles(r).then((function(){return null}))},i.install=function(){if(this.opts.bundle){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Sd({},e,{individualCancellation:!1})})}this.uppy.addUploader(this.handleUpload)},i.uninstall=function(){if(this.opts.bundle){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Sd({},e,{individualCancellation:!0})})}this.uppy.removeUploader(this.handleUpload)},n}(le.Plugin),gd.VERSION="1.7.4",md),Ad={__esModule:!0};Ad.default=Nd,Ad.getFieldData=Md;var Fd,Rd,xd={"[object HTMLCollection]":!0,"[object NodeList]":!0,"[object RadioNodeList]":!0},Ud={button:!0,fieldset:!0,reset:!0,submit:!0},Td={checkbox:!0,radio:!0},Dd=/^\s+|\s+$/g,Bd=Array.prototype.slice,Id=Object.prototype.toString;function Nd(e){var t=arguments.length>1&&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];Ud[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=Md(e,n=i[l],t);null!=p&&(r[n]=p)}return r}function Md(e,t){var r=arguments.length>2&&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]"!==Id.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(!xd[Id.call(n)])return jd(n,r.trim);for(var i=[],o=!0,s=0,a=n.length;s<a;s++)if(!n[s].disabled){o&&"radio"!==n[s].type&&(o=!1);var u=jd(n[s],r.trim);null!=u&&(i=i.concat(u))}return o&&1===i.length?i[0]:i.length>0?i:null}function jd(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){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}return"file"===n&&"files"in e?(e.multiple?0===(r=Bd.call(e.files)).length&&(r=null):r=e.files[0],r):(Td[n]?e.checked&&(r=e.value):r=t?e.value.replace(Dd,""):e.value,r)}function Ld(){return(Ld=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 zd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hd(e,t){return(Hd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Nd.getFieldData=Md;var qd=le.Plugin,Vd=Ad.default||Ad,Wd=(Rd=Fd=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).type="acquirer",n.id=n.opts.id||"Form",n.title="Form",n.opts=Ld({},{target:null,resultName:"uppyResult",getMetaFromForm:!0,addResultToForm:!0,multipleResults:!1,submitOnSuccess:!1,triggerUploadOnSubmit:!1},r),n.handleFormSubmit=n.handleFormSubmit.bind(zd(n)),n.handleUploadStart=n.handleUploadStart.bind(zd(n)),n.handleSuccess=n.handleSuccess.bind(zd(n)),n.addResultToForm=n.addResultToForm.bind(zd(n)),n.getMetaFromForm=n.getMetaFromForm.bind(zd(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Hd(t,r);var i=n.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=this;if(this.opts.triggerUploadOnSubmit){e.preventDefault();var r=gi(e.target.elements),n=[];r.forEach((function(e){("BUTTON"===e.tagName||"INPUT"===e.tagName&&"submit"===e.type)&&!e.disabled&&(e.disabled=!0,n.push(e))})),this.uppy.upload().then((function(){n.forEach((function(e){e.disabled=!1}))}),(function(e){return n.forEach((function(e){e.disabled=!1})),Promise.reject(e)})).catch((function(e){t.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=this.form.querySelector('[name="'+this.opts.resultName+'"]');if(t)if(this.opts.multipleResults){var r;try{r=JSON.parse(t.value)}catch(th){}Array.isArray(r)||(r=[]),r.push(e),t.value=JSON.stringify(r)}else t.value=JSON.stringify(e);else(t=document.createElement("input")).name=this.opts.resultName,t.type="hidden",this.opts.multipleResults?t.value=JSON.stringify([e]):t.value=JSON.stringify(e),this.form.appendChild(t)},i.getMetaFromForm=function(){var e=Vd(this.form);delete e[this.opts.resultName],this.uppy.setMeta(e)},i.install=function(){this.form=ae(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)},n}(qd),Fd.VERSION="1.3.30",Rd),Xd={},Yd="undefined"!=typeof navigator&&"serviceWorker"in navigator,Gd=function(){function e(e){this.ready=new Promise((function(e,t){Yd?navigator.serviceWorker.controller?e():navigator.serviceWorker.addEventListener("controllerchange",(function(){e()})):t(new Error("Unsupported"))})),this.name=e.storeName}var t=e.prototype;return t.list=function(){var e=this,t={},r=new Promise((function(e,r){t.resolve=e,t.reject=r}));console.log("Loading stored blobs from Service Worker");var n=function r(n){if(n.data.store===e.name)switch(n.data.type){case"uppy/ALL_FILES":t.resolve(n.data.files),navigator.serviceWorker.removeEventListener("message",r)}};return this.ready.then((function(){navigator.serviceWorker.addEventListener("message",n),navigator.serviceWorker.controller.postMessage({type:"uppy/GET_FILES",store:e.name})})),r},t.put=function(e){var t=this;return this.ready.then((function(){navigator.serviceWorker.controller.postMessage({type:"uppy/ADD_FILE",store:t.name,file:e})}))},t.delete=function(e){var t=this;return this.ready.then((function(){navigator.serviceWorker.controller.postMessage({type:"uppy/REMOVE_FILE",store:t.name,fileID:e})}))},e}();Gd.isSupported=Yd,Xd=Gd;var Kd={};function $d(){return($d=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 Jd="undefined"!=typeof window&&(window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB),Qd=!!Jd;function Zd(e){var t=Jd.open(e,3);return new Promise((function(e,r){t.onupgradeneeded=function(t){var r=t.target.result,n=t.currentTarget.transaction;if(t.oldVersion<2&&r.createObjectStore("files",{keyPath:"id"}).createIndex("store","store",{unique:!1}),t.oldVersion<3){var i=n.objectStore("files");i.createIndex("expires","expires",{unique:!1}),i.openCursor().onsuccess=function(e){var t=e.target.result;if(t){var r=t.value;r.expires=Date.now()+864e5,t.update(r)}}}n.oncomplete=function(){e(r)}},t.onsuccess=function(t){e(t.target.result)},t.onerror=r}))}function ef(e){return new Promise((function(t,r){e.onsuccess=function(e){t(e.target.result)},e.onerror=r}))}var tf=!1,rf=function(){function e(t){var r=this;this.opts=$d({dbName:"uppy-blobs",storeName:"default",expires:864e5,maxFileSize:10485760,maxTotalSize:314572800},t),this.name=this.opts.storeName;var n=function(){return Zd(r.opts.dbName)};tf?this.ready=n():(tf=!0,this.ready=e.cleanup().then(n,n))}var t=e.prototype;return t.key=function(e){return this.name+"!"+e},t.list=function(){var e=this;return this.ready.then((function(t){return ef(t.transaction(["files"],"readonly").objectStore("files").index("store").getAll(IDBKeyRange.only(e.name)))})).then((function(e){var t={};return e.forEach((function(e){t[e.fileID]=e.data})),t}))},t.get=function(e){var t=this;return this.ready.then((function(r){return ef(r.transaction(["files"],"readonly").objectStore("files").get(t.key(e)))})).then((function(e){return{id:e.data.fileID,data:e.data.data}}))},t.getSize=function(){var e=this;return this.ready.then((function(t){var r=t.transaction(["files"],"readonly").objectStore("files").index("store").openCursor(IDBKeyRange.only(e.name));return new Promise((function(e,t){var n=0;r.onsuccess=function(t){var r=t.target.result;r?(n+=r.value.data.size,r.continue()):e(n)},r.onerror=function(){t(new Error("Could not retrieve stored blobs size"))}}))}))},t.put=function(e){var t=this;return e.data.size>this.opts.maxFileSize?Promise.reject(new Error("File is too big to store.")):this.getSize().then((function(e){return e>t.opts.maxTotalSize?Promise.reject(new Error("No space left")):t.ready})).then((function(r){return ef(r.transaction(["files"],"readwrite").objectStore("files").add({id:t.key(e.id),fileID:e.id,store:t.name,expires:Date.now()+t.opts.expires,data:e.data}))}))},t.delete=function(e){var t=this;return this.ready.then((function(r){return ef(r.transaction(["files"],"readwrite").objectStore("files").delete(t.key(e)))}))},e.cleanup=function(){return Zd("uppy-blobs").then((function(e){var t=e.transaction(["files"],"readwrite").objectStore("files").index("expires").openCursor(IDBKeyRange.upperBound(Date.now()));return new Promise((function(r,n){t.onsuccess=function(t){var n=t.target.result;if(n){var i=n.value;console.log("[IndexedDBStore] Deleting record",i.fileID,"of size",q(i.data.size),"- expired on",new Date(i.expires)),n.delete(),n.continue()}else r(e)},t.onerror=n}))})).then((function(e){e.close()}))},e}();function nf(){return(nf=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 of(e){try{return JSON.parse(e)}catch(th){return null}}rf.isSupported=Qd,Kd=rf;var sf,af,uf=!1,lf=function(){function e(t){this.opts=nf({expires:864e5},t),this.name="uppyState:"+t.storeName,uf||(uf=!0,e.cleanup())}var t=e.prototype;return t.load=function(){var e=localStorage.getItem(this.name);if(!e)return null;var t=of(e);return t?t.metadata?t.metadata:(this.save(t),t):null},t.save=function(e){var t=Date.now()+this.opts.expires,r=JSON.stringify({metadata:e,expires:t});localStorage.setItem(this.name,r)},e.cleanup=function(e){if(e)localStorage.removeItem("uppyState:"+e);else{var t=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}(),r=Date.now();t.forEach((function(e){var t=localStorage.getItem("uppyState:"+e);if(!t)return null;var n=of(t);if(!n)return null;n.expires&&n.expires<r&&localStorage.removeItem("uppyState:"+e)}))}},e}();function cf(){return(cf=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 pf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hf(e,t){return(hf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var df,ff,gf=(af=sf=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).addBlobToStores=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)})))},n.removeBlobFromStores=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)}))},n.replaceBlobInStores=function(e){n.removeBlobFromStores(e),n.addBlobToStores(e)},n.handleRestoreConfirmed=function(){n.uppy.log("[GoldenRetriever] Restore confirmed, proceeding...");var e=n.uppy.getState().currentUploads;e&&(Object.keys(e).forEach((function(t){n.uppy.restore(t,e[t])})),n.uppy.resumeAll()),n.uppy.upload(),n.uppy.setState({recoveredState:null})},n.abortRestore=function(){n.uppy.log("[GoldenRetriever] Aborting restore...");var e=Object.keys(n.uppy.getState().files);n.deleteBlobs(e).then((function(){n.uppy.log("[GoldenRetriever] Removed "+e.length+" files")})).catch((function(t){n.uppy.log("[GoldenRetriever] Could not remove "+e.length+" files","warning"),n.uppy.log(t)})),n.uppy.cancelAll(),n.uppy.setState({recoveredState:null}),lf.cleanup(n.uppy.opts.id)},n.handleComplete=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)})),n.uppy.setState({recoveredState:null}),lf.cleanup(n.uppy.opts.id)},n.restoreBlobs=function(){n.uppy.getFiles().length>0?Promise.all([n.loadFileBlobsFromServiceWorker(),n.loadFileBlobsFromIndexedDB()]).then((function(e){var t=cf({},e[0],e[1]);n.onBlobsLoaded(t)})):(n.uppy.log("[GoldenRetriever] No files need to be loaded, only restoring processing state..."),n.onBlobsLoaded([]))},n.type="debugger",n.id=n.opts.id||"GoldenRetriever",n.title="Golden Retriever",n.opts=cf({},{expires:864e5,serviceWorker:!1},r),n.MetaDataStore=new lf({expires:n.opts.expires,storeName:t.getID()}),n.ServiceWorkerStore=null,n.opts.serviceWorker&&(n.ServiceWorkerStore=new Xd({storeName:t.getID()})),n.IndexedDBStore=new Kd(cf({expires:n.opts.expires},n.opts.indexedDB||{},{storeName:t.getID()})),n.saveFilesStateToLocalStorage=z(n.saveFilesStateToLocalStorage.bind(pf(n)),500,{leading:!0,trailing:!0}),n.restoreState=n.restoreState.bind(pf(n)),n.loadFileBlobsFromServiceWorker=n.loadFileBlobsFromServiceWorker.bind(pf(n)),n.loadFileBlobsFromIndexedDB=n.loadFileBlobsFromIndexedDB.bind(pf(n)),n.onBlobsLoaded=n.onBlobsLoaded.bind(pf(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,hf(t,r);var i=n.prototype;return i.restoreState=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||{},recoveredState:e}),this.savedPluginData=e.pluginData)},i.getWaitingFiles=function(){var e={};return this.uppy.getFiles().forEach((function(t){t.progress&&t.progress.uploadStarted||(e[t.id]=t)})),e},i.getUploadingFiles=function(){var e=this,t={},r=this.uppy.getState().currentUploads;return r&&Object.keys(r).forEach((function(n){r[n].fileIDs.forEach((function(r){t[r]=e.uppy.getFile(r)}))})),t},i.saveFilesStateToLocalStorage=function(){var e=cf({},this.getWaitingFiles(),this.getUploadingFiles());if(0===Object.keys(e).length)return this.uppy.setState({recoveredState:null}),void lf.cleanup(this.uppy.opts.id);var t={};Object.keys(e).forEach((function(r){e[r].isRemote?t[r]=cf({},e[r],{isRestored:!0}):t[r]=cf({},e[r],{isRestored:!0,data:null,preview:null})}));var r={};this.uppy.emit("restore:get-data",(function(e){cf(r,e)}));var n=this.uppy.getState().currentUploads;this.MetaDataStore.save({currentUploads:n,files:t,pluginData:r})},i.loadFileBlobsFromServiceWorker=function(){var e=this;return this.ServiceWorkerStore?this.ServiceWorkerStore.list().then((function(t){var r=e.uppy.getFiles().filter((function(e){return!e.isRemote})),n=Object.keys(t).length;return n===r.length?(e.uppy.log("[GoldenRetriever] Successfully recovered "+n+" blobs from Service Worker!"),t):(e.uppy.log("[GoldenRetriever] No blobs found in Service Worker, trying IndexedDB now..."),{})})).catch((function(t){return e.uppy.log("[GoldenRetriever] Failed to recover blobs from Service Worker","warning"),e.uppy.log(t),{}})):Promise.resolve({})},i.loadFileBlobsFromIndexedDB=function(){var e=this;return this.IndexedDBStore.list().then((function(t){var r=Object.keys(t).length;return r>0?(e.uppy.log("[GoldenRetriever] Successfully recovered "+r+" blobs from IndexedDB!"),t):(e.uppy.log("[GoldenRetriever] No blobs found in IndexedDB"),{})})).catch((function(t){return e.uppy.log("[GoldenRetriever] Failed to recover blobs from IndexedDB","warning"),e.uppy.log(t),{}}))},i.onBlobsLoaded=function(e){var t=this,r=[],n=cf({},this.uppy.getState().files);Object.keys(e).forEach((function(i){var o=t.uppy.getFile(i);if(o){var s={data:e[i],isRestored:!0,isGhost:!1};n[i]=cf({},o,s)}else r.push(i)})),Object.keys(n).forEach((function(e){null===n[e].data&&(n[e]=cf({},n[e],{isGhost:!0}))})),this.uppy.setState({files:n}),this.uppy.emit("restored",this.savedPluginData),r.length&&this.deleteBlobs(r).then((function(){t.uppy.log("[GoldenRetriever] Cleaned up "+r.length+" old files")})).catch((function(e){t.uppy.log("[GoldenRetriever] Could not clean up "+r.length+" old files","warning"),t.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(){this.restoreState(),this.restoreBlobs(),this.uppy.on("file-added",this.addBlobToStores),this.uppy.on("file-editor:complete",this.replaceBlobInStores),this.uppy.on("file-removed",this.removeBlobFromStores),this.uppy.on("state-update",this.saveFilesStateToLocalStorage),this.uppy.on("restore-confirmed",this.handleRestoreConfirmed),this.uppy.on("restore-canceled",this.abortRestore),this.uppy.on("complete",this.handleComplete)},i.uninstall=function(){this.uppy.off("file-added",this.addBlobToStores),this.uppy.off("file-editor:complete",this.replaceBlobInStores),this.uppy.off("file-removed",this.removeBlobFromStores),this.uppy.off("state-update",this.saveFilesStateToLocalStorage),this.uppy.off("restore-confirmed",this.handleRestoreConfirmed),this.uppy.off("restore-canceled",this.abortRestore),this.uppy.off("complete",this.handleComplete)},n}(le.Plugin),sf.VERSION="1.4.1",af);function mf(){return(mf=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 vf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yf(e,t){return(yf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var bf=(ff=df=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this).type="debugger",n.id=n.opts.id||"ReduxDevTools",n.title="Redux DevTools",n.opts=mf({},{},r),n.handleStateChange=n.handleStateChange.bind(vf(n)),n.initDevTools=n.initDevTools.bind(vf(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,yf(t,r);var i=n.prototype;return i.handleStateChange=function(e,t,r){this.devTools.send("UPPY_STATE_UPDATE",t)},i.initDevTools=function(){var e=this;this.devTools=window.devToolsExtension.connect(),this.devToolsUnsubscribe=this.devTools.subscribe((function(t){if("DISPATCH"===t.type)switch(t.payload.type){case"RESET":return void e.uppy.reset();case"IMPORT_STATE":var r=t.payload.nextLiftedState.computedStates;return e.uppy.store.state=mf({},e.uppy.getState(),r[r.length-1].state),void e.uppy.updateAll(e.uppy.getState());case"JUMP_TO_STATE":case"JUMP_TO_ACTION":e.uppy.store.state=mf({},e.uppy.getState(),JSON.parse(t.state)),e.uppy.updateAll(e.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))},n}(le.Plugin),df.VERSION="1.3.9",ff),wf={};wf.Core=le,wf.debugLogger=wf.Core.debugLogger,wf.server=$e,wf.views={ProviderView:Jt},wf.DefaultStore=W,wf.ReduxStore=Kt,wf.Dashboard=zi,wf.DragDrop=Ki,wf.DropTarget=eo,wf.FileInput=uo,wf.Informer=Gn,wf.ProgressBar=mo,wf.StatusBar=qn,wf.ImageEditor=Fo,wf.Dropbox=Io,wf.GoogleDrive=Go,wf.Instagram=ns,wf.OneDrive=hs,wf.Box=Ss,wf.Facebook=Rs,wf.Unsplash=Ns,wf.Url=Qs,wf.Webcam=Ra,wf.ScreenCapture=Za,wf.AwsS3=ku,wf.AwsS3Multipart=el,wf.Transloadit=cd,wf.Tus=jc,wf.XHRUpload=Ed,wf.Form=Wd,wf.GoldenRetriever=gf,wf.ReduxDevTools=bf,wf.ThumbnailGenerator=di,wf.locales={};return wf}));
  //# sourceMappingURL=uppy.min.js.map