!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Uppy=e()}(function(){var define,module,exports,createModuleFactory=function(t){var r;return function(e){return r||t(r={exports:{},parent:e},r.exports),r.exports}},_$lib_60=createModuleFactory(function(e,t){var u=_$browser_66("socket.io-client");e.exports=t=r;var l=t.managers={};function r(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r=_$url_64(e),n=r.source,i=r.id,o=r.path,s=l[i]&&o in l[i].nsps,a=t.forceNew||t["force new connection"]||!1===t.multiplex||s?(u("ignoring socket cache for %s",n),_$manager_61(n,t)):(l[i]||(u("new io instance for %s",n),l[i]=_$manager_61(n,t)),l[i]);return r.query&&!t.query&&(t.query=r.query),a.socket(r.path,t)}t.protocol=_$socketIoParser_70.protocol,t.connect=r,t.Manager=_$manager_61,t.Socket=_$socket_63}),_$empty_7=createModuleFactory(function(e,t){}),_$buffer_8=createModuleFactory(function(e,A){(function(p){"use strict";A.Buffer=p,A.INSPECT_MAX_BYTES=50;var r=2147483647;function s(e){if(r>>1;case"base64":return k(e).length;default:if(i)return n?-1:S(e).length;t=(""+t).toLowerCase(),i=!0}}function c(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function d(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=p.from(t,n)),p.isBuffer(t))return 0===t.length?-1:h(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):h(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function h(e,t,r,n,i){var o=1,s=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s/=o=2,a/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i)for(var l=-1,c=r;c>>10&1023|55296),c=56320|1023&c),n.push(c),i+=p}return function(e){var t=e.length;if(t<=g)return String.fromCharCode.apply(String,e);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,r){var n,i=e.length;(!t||t<0)&&(t=0),(!r||r<0||it&&(e+=" ... "),""},p.prototype.compare=function(e,t,r,n,i){if(C(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=t)return 0;if(i<=n)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||ithis.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,u,l,c,p,d,h,_=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;(!n||(n=Number(n))>i)&&(n=i);var o=t.length;o/2>8,i=r%256,o.push(i),o.push(n);return o}(e,(o=this).length-s),o,s,a);default:if(_)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),_=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var g=4096;function y(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(re.length)throw new RangeError("Index out of range")}function v(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function b(e,t,r,n,i){return t=+t,r>>>=0,i||v(e,0,r,4),_$ieee754_41.write(e,t,r,n,23,4),r+4}function w(e,t,r,n,i){return t=+t,r>>>=0,i||v(e,0,r,8),_$ieee754_41.write(e,t,r,n,52,8),r+8}p.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e+--t],i=1;0>>=0,t||y(e,1,this.length),this[e]},p.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},p.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},p.prototype.readUInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},p.prototype.readUInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},p.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},p.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=t,i=1,o=this[e+--n];0=(i*=128)&&(o-=Math.pow(2,8*t)),o},p.prototype.readInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},p.prototype.readInt16LE=function(e,t){e>>>=0,t||y(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt16BE=function(e,t){e>>>=0,t||y(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},p.prototype.readInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},p.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),_$ieee754_41.read(this,e,!0,23,4)},p.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),_$ieee754_41.read(this,e,!1,23,4)},p.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),_$ieee754_41.read(this,e,!0,52,8)},p.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),_$ieee754_41.read(this,e,!1,52,8)},p.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||m(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||m(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;0<=--i&&(o*=256);)this[t+i]=e/o&255;return t+r},p.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,1,255,0),this[t]=255&e,t+1},p.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},p.prototype.writeIntLE=function(e,t,r,n){var i;e=+e,t>>>=0,n||m(this,e,t,r,(i=Math.pow(2,8*r-1))-1,-i);var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+r},p.prototype.writeIntBE=function(e,t,r,n){var i;e=+e,t>>>=0,n||m(this,e,t,r,(i=Math.pow(2,8*r-1))-1,-i);var o=r-1,s=1,a=0;for(this[t+o]=255&e;0<=--o&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},p.prototype.writeFloatLE=function(e,t,r){return b(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return b(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return w(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return w(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function k(e){return _$base64Js_5.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function E(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function C(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function P(e){return e!=e}}).call(this,_$buffer_8({}).Buffer)}),_$browser_55={},cachedSetTimeout,cachedClearTimeout,process=_$browser_55={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch(e){try{return cachedSetTimeout.call(null,t,0)}catch(e){return cachedSetTimeout.call(this,t,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex tag initializing Uppy is right before the closing tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.")},zu.render=function(e){throw new Error("Extend the render method to add your plugin to a DOM element")},zu.addTarget=function(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")},zu.unmount=function(){this.isTargetDOMEl&&this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},zu.install=function(){},zu.uninstall=function(){this.unmount()},yu),_$lib_104={},zu;function yu(e,t){this.uppy=e,this.opts=t||{},this.update=this.update.bind(this),this.mount=this.mount.bind(this),this.install=this.install.bind(this),this.uninstall=this.uninstall.bind(this)}function ___extends_104(){return(___extends_104=Object.assign||function(e){for(var t=1;ti)throw new RestrictionError(""+this.i18n("youCanOnlyUploadX",{smart_count:i}));if(o&&!o.some(function(e){return-1n)throw new RestrictionError(this.i18n("exceedsSize2",{backwardsCompat:this.i18n("exceedsSize"),size:_$prettierBytes_107(n)}))},Kv._showOrLogErrorAndThrow=function(e,t){var r=void 0===t?{}:t,n=r.showInformer,i=void 0===n||n,o=r.file,s=void 0===o?null:o,a=r.throwErr,u=void 0===a||a,l="object"==typeof e?e.message:e,c="object"==typeof e&&e.details?e.details:"",p=l;if(c&&(p+=" "+c),e.isRestriction?(this.log(p),this.emit("restriction-failed",s,e)):this.log(p,"error"),i&&this.info({message:l,details:c},"error",5e3),u)throw"object"==typeof e?e:new Error(e)},Kv._assertNewUploadAllowed=function(e){!1===this.getState().allowNewUpload&&this._showOrLogErrorAndThrow(new RestrictionError(this.i18n("noNewAlreadyUploading")),{file:e})},Kv._checkAndCreateFileStateObject=function(e,t){var r=_$getFileType_205(t);t.type=r;var n,i=this.opts.onBeforeFileAdded(t,e);!1===i&&this._showOrLogErrorAndThrow(new RestrictionError("Cannot add the file because onBeforeFileAdded returned false."),{showInformer:!1,file:t}),"object"==typeof i&&i&&(t=i),n=t.name?t.name:"image"===r.split("/")[0]?r.split("/")[0]+"."+r.split("/")[1]:"noname";var o=_$getFileNameAndExtension_204(n).extension,s=t.isRemote||!1,a=_$generateFileID_197(t);e[a]&&this._showOrLogErrorAndThrow(new RestrictionError(this.i18n("noDuplicates",{fileName:n})),{file:t});var u=t.meta||{};u.name=n,u.type=r;var l=isFinite(t.data.size)?t.data.size:null,c={source:t.source||"",id:a,name:n,extension:o||"",meta:___extends_104({},this.getState().meta,{},u),type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isRemote:s,remote:t.remote||"",preview:t.preview};try{this._checkRestrictions(e,c)}catch(e){this._showOrLogErrorAndThrow(e,{file:c})}return c},Kv._startIfAutoProceed=function(){var t=this;this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(function(){t.scheduledAutoProceed=null,t.upload().catch(function(e){e.isRestriction||t.log(e.stack||e.message||e)})},4))},Kv.addFile=function(e){var t;this._assertNewUploadAllowed(e);var r=this.getState().files,n=this._checkAndCreateFileStateObject(r,e);return this.setState({files:___extends_104({},r,((t={})[n.id]=n,t))}),this.emit("file-added",n),this.log("Added file: "+n.name+", "+n.id+", mime type: "+n.type),this._startIfAutoProceed(),n.id},Kv.addFiles=function(e){var t=this;this._assertNewUploadAllowed();for(var r=___extends_104({},this.getState().files),n=[],i=[],o=0;o>16&255,o[s++]=t>>8&255,o[s++]=255&t;return 2===i&&(t=revLookup[e.charCodeAt(u)]<<2|revLookup[e.charCodeAt(u+1)]>>4,o[s++]=255&t),1===i&&(t=revLookup[e.charCodeAt(u)]<<10|revLookup[e.charCodeAt(u+1)]<<4|revLookup[e.charCodeAt(u+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t),o},fromByteArray:function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;o>2]+lookup[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],i.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),i.join("")}},lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length,cS,dS,eS;i>18&63]+lookup[n>>12&63]+lookup[n>>6&63]+lookup[63&n]);return i.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_41={read:function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,c=-7,p=r?i-1:0,d=r?-1:1,h=e[t+p];for(p+=d,o=h&(1<<-c)-1,h>>=-c,c+=a;0>=-c,c+=n;0>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,_=n?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),2<=(t+=1<=s+p?d/u:d*Math.pow(2,1-p))*u&&(s++,u/=2),c<=s+p?(a=0,s=c):1<=s+p?(a=(t*u-1)*Math.pow(2,i),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));8<=i;e[r+h]=255&a,h+=_,a/=256,i-=8);for(s=s<e.byteOffset+e.byteLength)throw U("Creating view outside of available memory in ArrayBuffer");var o=new DataView(e.buffer,t,r);this._swapDataView(o)}else{if("number"!=typeof e)throw U("Invalid input argument for BufferView: "+e);var s=new DataView(new ArrayBuffer(e));this._swapDataView(s)}}function L(e,t){throw U("".concat(e," '").concat(t,"' was not loaded, try using full build of exifr."))}var j=(r(H,s(E)),e(H,[{key:"get",value:function(e,t){return this.has(e)||L(this.kind,e),t&&(e in t||function(e,t){throw U("Unknown ".concat(e," '").concat(t,"'."))}(this.kind,e),t[e].enabled||L(this.kind,e)),d(a(H.prototype),"get",this).call(this,e)}},{key:"keyList",value:function(){return y(this.keys())}}]),H),N=new j("file parser"),z=new j("segment parser"),q=new j("file reader");function H(e){var t;return u(this,H),(t=p(this,a(H).call(this))).kind=e,t}function V(r){return function(){for(var e=[],t=0;tthis.byteLength&&(o=this._extend(i).dataView,this._swapDataView(o))}},{key:"_extend",value:function(e){var t=O?F.allocUnsafe(e):new Uint8Array(e),r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}},{key:"subarray",value:function(e,t){var r=2this.size?Math.max(0,this.size-e):t}},{key:"read",value:function(){return this.options.chunked?this.readChunked():this.readWhole()}},{key:"close",value:function(){}},{key:"nextChunkOffset",get:function(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}},{key:"canReadNextChunk",get:function(){return this.chunksReado+s)i.chunk=a.file.subarray(o,s);else{if(void 0!==i.size)throw U("Segment unreachable: "+JSON.stringify(i));i.chunk=a.file.subarray(o)}}())&&e.then?e.then(t):t()},function(){for(var e=[],t=0;tthis.chunk.byteLength)throw U("Invalid TIFF value offset. block: ".concat(r.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(i,", offset ").concat(e," is outside of chunk size ").concat(this.chunk.byteLength));if(1===i)return this.chunk.getUint8Array(e,o);if(2===i)return""===(n=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(this.chunk.getString(e,o)).trim())?void 0:n;if(7===i)return this.chunk.getUint8Array(e,o);if(1===o)return this.parseTagValue(i,e);for(var a=new(function(){switch(i){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}())(o),u=s,l=0;lt.file.byteLength)throw U("IFD0 offset points to outside of file.\nthis.ifd0Offset: ".concat(t.ifd0Offset,", file.byteLength: ").concat(t.file.byteLength));return Ct(function(){if(t.file.isTiff)return Et(t.file.ensureChunk(t.ifd0Offset,B(t.options)))},function(){var e=t.parseBlock(t.ifd0Offset,"ifd0");if(0!==e.size)return t.exifOffset=e.get(34665),t.interopOffset=e.get(40965),t.gpsOffset=e.get(34853),t.xmp=e.get(700),t.iptc=e.get(33723),t.icc=e.get(34675),t.options.sanitize&&(e.delete(34665),e.delete(40965),e.delete(34853),e.delete(700),e.delete(33723),e.delete(34675)),e})}catch(t){return Promise.reject(t)}}},{key:"ensureBlockChunk",value:function(e,t){try{var r=this;return Ct(function(){if(r.file.isTiff)return Et(r.file.ensureChunk(e,t))},function(){e>r.chunk.byteLength&&(r.chunk=D.from(r.file,r.le))})}catch(e){return Promise.reject(e)}}},{key:"parseExifBlock",value:function(){try{var t=this;if(t.exif)return;return Ct(function(){if(!t.ifd0)return Et(t.parseIfd0Block())},function(){if(void 0!==t.exifOffset)return Ct(function(){if(t.file.isTiff)return Et(t.file.ensureChunk(t.exifOffset,B(t.options)))},function(){var e=t.parseBlock(t.exifOffset,"exif");return t.interopOffset||(t.interopOffset=e.get(40965)),t.makerNote=e.get(37500),t.userComment=e.get(37510),t.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),t.unpack(e,41728),t.unpack(e,41729),e})})}catch(t){return Promise.reject(t)}}},{key:"unpack",value:function(e,t){var r=e.get(t);r&&1===r.length&&e.set(t,r[0])}},{key:"parseGpsBlock",value:function(){try{var t=this;if(t.gps)return;return Ct(function(){if(!t.ifd0)return Et(t.parseIfd0Block())},function(){if(void 0!==t.gpsOffset){var e=t.parseBlock(t.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",$t.apply(void 0,e.get(2).concat([e.get(1)]))),e.set("longitude",$t.apply(void 0,e.get(4).concat([e.get(3)])))),e}})}catch(t){return Promise.reject(t)}}},{key:"parseInteropBlock",value:function(){try{var e=this;if(e.interop)return;return Ct(function(){if(!e.ifd0)return Et(e.parseIfd0Block())},function(){return Ct(function(){if(void 0===e.interopOffset&&!e.exif)return Et(e.parseExifBlock())},function(){if(void 0!==e.interopOffset)return e.parseBlock(e.interopOffset,"interop")})})}catch(e){return Promise.reject(e)}}},{key:"parseThumbnailBlock",value:function(){var e=0n&&((t=document.createElement("canvas")).width=n,t.height=i,t.getContext("2d").drawImage(e,0,0,n,i),e=t),e},i.resizeImage=function(e,t,r){e=this.protect(e);var n=Math.ceil(_$mathLog2_47(e.width/t));n<1&&(n=1);for(var i=t*Math.pow(2,n-1),o=r*Math.pow(2,n-1);n--;){var s=document.createElement("canvas");s.width=i,s.height=o,s.getContext("2d").drawImage(e,0,0,i,o),e=s,i=Math.round(i/2),o=Math.round(o/2)}return e},i.rotateImage=function(e,t){var r=e.width,n=e.height;90!==t.deg&&270!==t.deg||(r=e.height,n=e.width);var i=document.createElement("canvas");i.width=r,i.height=n;var o=i.getContext("2d");return o.translate(r/2,n/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),i},i.canvasToBlob=function(t,r,n){try{t.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return t.toBlob?new Promise(function(e){t.toBlob(e,r,n)}).then(function(e){if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e}):Promise.resolve().then(function(){return _$dataURItoBlob_192(t.toDataURL(r,n),{})}).then(function(e){if(null===e)throw new Error("could not extract blob, probably an old browser");return e})},i.setPreviewURL=function(e,t){this.uppy.setFileState(e,{preview:t})},i.addToQueue=function(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()},i.processQueue=function(){var e=this;if(this.queueProcessing=!0,0Math.max(0,n.maxFileSize-r)&&(o=!0,i.uppy.info(i.i18n("recordingStoppedMaxSize"),"warning",4e3),i._stopRecording()))}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(function(){var e=i.getPluginState().recordingLengthSeconds;i.setPluginState({recordingLengthSeconds:e+1})},1e3)),this.setPluginState({isRecording:!0})},n._stopRecording=function(){var r=this;return new Promise(function(e,t){r.recorder.addEventListener("stop",function(){e()}),r.recorder.stop(),r.opts.showRecordingLength&&(clearInterval(r.recordingLengthTimer),r.setPluginState({recordingLengthSeconds:0}))}).then(function(){return r.setPluginState({isRecording:!1}),r.getVideo()}).then(function(e){try{r.uppy.addFile(e)}catch(e){e.isRestriction||r.uppy.log(e)}}).then(function(){r.recordingChunks=null,r.recorder=null},function(e){throw r.recordingChunks=null,r.recorder=null,e})},n._stop=function(){this.stream.getAudioTracks().forEach(function(e){e.stop()}),this.stream.getVideoTracks().forEach(function(e){e.stop()}),this.webcamActive=!1,this.stream=null},n._getVideoElement=function(){return this.el.querySelector(".uppy-Webcam-video")},n._oneTwoThreeSmile=function(){var i=this;return new Promise(function(e,t){var r=i.opts.countdown,n=setInterval(function(){return i.webcamActive?void(0=this.limit||0===this.queuedHandlers.length||(e=this.queuedHandlers.shift(),t=this._call(e.fn),e.abort=t.abort,e.done=t.done)},vqa._queue=function(e,t){var r=this;void 0===t&&(t={});var n={fn:e,priority:t.priority||0,abort:function(){r._dequeue(n)},done:function(){throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=function(e){for(var t,r=0;rt.priority)return r;return-1}(this.queuedHandlers);return-1===i?this.queuedHandlers.push(n):this.queuedHandlers.splice(i,0,n),n},vqa._dequeue=function(e){var t=this.queuedHandlers.indexOf(e);-1!==t&&this.queuedHandlers.splice(t,1)},vqa.run=function(e,t){return this.activeRequests"),n=e.indexOf("",r);return-1!==r&&-1!==n?e.slice(r+t.length+2,n):""}function assertServerError(e){if(e&&e.error){var t=new Error(e.message);throw ___extends_96(t,e.error),t}return e}var warnedSuccessActionStatus=!1,_$lib_96=(___temp_96=___class_96=function(i){var e,t;function r(e,t){var r;(r=i.call(this,e,t)||this).type="uploader",r.id=r.opts.id||"AwsS3",r.title="AWS S3";var n={timeout:3e4,limit:0,metaFields:[],getUploadParameters:r.getUploadParameters.bind(___assertThisInitialized_96(r))};return r.opts=___extends_96({},n,{},t),r.client=new __RequestClient_96(e,t),r.handleUpload=r.handleUpload.bind(___assertThisInitialized_96(r)),r.requests=new _$RateLimitedQueue_189(r.opts.limit),r}t=i,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var n=r.prototype;return n.getUploadParameters=function(t){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address.");var e=t.meta.name,r=t.meta.type,n={};this.opts.metaFields.forEach(function(e){null!=t.meta[e]&&(n[e]=t.meta[e].toString())});var i=_$queryStringify_56({filename:e,type:r,metadata:n});return this.client.get("s3/params?"+i).then(assertServerError)},n.validateParameters=function(e,t){if("object"!=typeof t||!t||"string"!=typeof t.url||"object"!=typeof t.fields&&null!=t.fields||null!=t.method&&!/^(put|post)$/i.test(t.method)){var r=new TypeError("AwsS3: got incorrect result from 'getUploadParameters()' for file '"+e.name+"', expected an object '{ url, method, fields, headers }'.\nSee https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.");throw console.error(r),r}},n.handleUpload=function(e){var c=this,p=Object.create(null);function t(e){var t=e.id;_$hasProperty_210(p,t)&&p[t].abort()}this.uppy.on("file-removed",t),e.forEach(function(e){var t=c.uppy.getFile(e);c.uppy.emit("upload-started",t)});var r=this.requests.wrapPromiseFunction(function(e){return c.opts.getUploadParameters(e)}),d=e.length;return _$settle_219(e.map(function(u,l){return p[u]=r(c.uppy.getFile(u)),p[u].then(function(e){delete p[u];var t=c.uppy.getFile(u);c.validateParameters(t,e);var r=e.method,n=void 0===r?"post":r,i=e.url,o=e.fields,s=e.headers,a={method:n,formData:"post"===n.toLowerCase(),endpoint:i,metaFields:o?Object.keys(o):[]};return s&&(a.headers=s),c.uppy.setFileState(t.id,{meta:___extends_96({},t.meta,{},o),xhrUpload:a}),c._uploader.uploadFile(t.id,l,d)}).catch(function(e){delete p[u];var t=c.uppy.getFile(u);c.uppy.emit("upload-error",t,e)})})).then(function(e){return c.uppy.off("file-removed",t),e})},n.install=function(){var i=this.uppy;this.uppy.addUploader(this.handleUpload);var e={fieldName:"file",responseUrlFieldName:"location",timeout:this.opts.timeout,__queue:this.requests,responseType:"text",getResponseData:this.opts.getResponseData||function(e,t){var r,n;return isXml(e,t)?{location:(r=t.responseURL,n=getXmlValue(e,"Location"),r?new URL_(n,r).toString():new URL_(n).toString()),bucket:getXmlValue(e,"Bucket"),key:getXmlValue(e,"Key"),etag:getXmlValue(e,"ETag")}:"POST"===this.method.toUpperCase()?(warnedSuccessActionStatus||(i.log("[AwsS3] No response data found, make sure to set the success_action_status AWS SDK option to 201. See https://uppy.io/docs/aws-s3/#POST-Uploads","warning"),warnedSuccessActionStatus=!0),{location:null}):t.responseURL?{location:t.responseURL.replace(/\?.*$/,"")}:{location:null}},getResponseError:function(e,t){if(isXml(e,t)){var r=getXmlValue(e,"Message");return new Error(r)}}};this._uploader=new _$MiniXHRUpload_95(this.uppy,e),this._uploader.i18n=this.uppy.i18n},n.uninstall=function(){this.uppy.removePreProcessor(this.handleUpload)},r}(__Plugin_96),___class_96.VERSION="1.6.6",___temp_96);function ___extends_93(){return(___extends_93=Object.assign||function(e){for(var t=1;t=e))break}r.forEach(function(e){t._uploadPart(e)})}}},Xua._uploadPart=function(n){var i=this,e=this.chunks[n];return this.chunkState[n].busy=!0,Promise.resolve().then(function(){return i.options.prepareUploadPart({key:i.key,uploadId:i.uploadId,body:e,number:n+1})}).then(function(e){if("object"!=typeof e||!e||"string"!=typeof e.url)throw new TypeError("AwsS3/Multipart: Got incorrect result from `prepareUploadPart()`, expected an object `{ url }`.");return e}).then(function(e){var t=e.url,r=e.headers;i._uploadPartBytes(n,t,r)},function(e){i._onError(e)})},Xua._onPartProgress=function(e,t,r){this.chunkState[e].uploaded=t;var n=this.chunkState.reduce(function(e,t){return e+t.uploaded},0);this.options.onProgress(n,this.file.size)},Xua._onPartComplete=function(e,t){this.chunkState[e].etag=t,this.chunkState[e].done=!0;var r={PartNumber:e+1,ETag:t};this.parts.push(r),this.options.onPartComplete(r),this._uploadParts()},Xua._uploadPartBytes=function(r,e,t){var n=this,i=this.chunks[r],o=new XMLHttpRequest;o.open("PUT",e,!0),t&&Object.keys(t).map(function(e){o.setRequestHeader(e,t[e])}),o.responseType="text",this.uploading.push(o),o.upload.addEventListener("progress",function(e){e.lengthComputable&&n._onPartProgress(r,e.loaded,e.total)}),o.addEventListener("abort",function(e){remove(n.uploading,e.target),n.chunkState[r].busy=!1}),o.addEventListener("load",function(e){var t;remove(n.uploading,e.target),n.chunkState[r].busy=!1,e.target.status<200||300<=e.target.status?n._onError(new Error("Non 2xx")):(n._onPartProgress(r,i.size,i.size),null!==(t=e.target.getResponseHeader("ETag"))?n._onPartComplete(r,t):n._onError(new Error("AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. Seee https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions.")))}),o.addEventListener("error",function(e){remove(n.uploading,e.target),n.chunkState[r].busy=!1;var t=new Error("Unknown error");t.source=e.target,n._onError(t)}),o.send(i)},Xua._completeUpload=function(){var t=this;return this.parts.sort(function(e,t){return e.PartNumber-t.PartNumber}),Promise.resolve().then(function(){return t.options.completeMultipartUpload({key:t.key,uploadId:t.uploadId,parts:t.parts})}).then(function(e){t.options.onSuccess(e)},function(e){t._onError(e)})},Xua._abortUpload=function(){var e=this;this.uploading.slice().forEach(function(e){e.abort()}),this.createdPromise.then(function(){e.options.abortMultipartUpload({key:e.key,uploadId:e.uploadId})},function(){}),this.uploading=[]},Xua._onError=function(e){this.options.onError(e)},Xua.start=function(){this.isPaused=!1,this.uploadId?this._resumeUpload():this._createUpload()},Xua.pause=function(){this.uploading.slice().forEach(function(e){e.abort()}),this.isPaused=!0},Xua.abort=function(e){if(void 0===e&&(e={}),!e.really)return this.pause();this._abortUpload()},Wua),_$MultipartUploader_93=MultipartUploader,___class_94,___temp_94,Xua;function Wua(e,t){this.options=___extends_93({},defaultOptions,{},t),this.options.getChunkSize||(this.options.getChunkSize=defaultOptions.getChunkSize),this.file=e,this.key=this.options.key||null,this.uploadId=this.options.uploadId||null,this.parts=this.options.parts||[],this.createdPromise=Promise.reject(),this.isPaused=!1,this.chunks=null,this.chunkState=null,this.uploading=[],this._initChunks(),this.createdPromise.catch(function(){})}function ___assertThisInitialized_94(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ___extends_94(){return(___extends_94=Object.assign||function(e){for(var t=1;t>>6)+fromCharCode(128|63&t):fromCharCode(224|t>>>12&15)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fromCharCode(240|t>>>18&7)+fromCharCode(128|t>>>12&63)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(e){return e.replace(re_utob,cb_utob)},cb_encode=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(1>>18),b64chars.charAt(r>>>12&63),2<=t?"=":b64chars.charAt(r>>>6&63),1<=t?"=":b64chars.charAt(63&r)].join("")},btoa=global.btoa?function(e){return global.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)?e.toString("base64"):btoa(utob(String(e)))},encode=function(e,t){return t?_encode(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):_encode(e)},encodeURI=function(e){return encode(e,!0)},re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return fromCharCode(55296+(t>>>10))+fromCharCode(56320+(1023&t));case 3:return fromCharCode((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fromCharCode((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=function(e){return e.replace(re_btou,cb_btou)},cb_decode=function(e){var t=e.length,r=t%4,n=(0>>16),fromCharCode(n>>>8&255),fromCharCode(255&n)];return i.length-=[0,0,2,1][r],i.join("")},_atob=global.atob?function(e){return global.atob(e)}:function(e){return e.replace(/\S{1,4}/g,cb_decode)},atob=function(e){return _atob(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e,"base64")).toString()}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e,"base64")).toString()}:function(e){return btou(_atob(e))},decode=function(e){return _decode(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var e=global.Base64;return global.Base64=_Base64,e},noEnum;return global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"==typeof Object.defineProperty&&(noEnum=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}},global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(e){return encode(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}),global.Meteor&&(Base64=global.Base64),_$base64_44.exports?_$base64_44.exports.Base64=global.Base64:"function"==typeof define&&define.amd&&define([],function(){return global.Base64}),{Base64:global.Base64}},"object"==typeof _$base64_44.exports?_$base64_44.exports=Tya(Sya):"function"==typeof define&&define.amd?define(Tya):Tya(Sya)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$base64_44=_$base64_44.exports;var _$request_82={};Object.defineProperty(_$request_82,"__esModule",{value:!0}),_$request_82.newRequest=function(){return new window.XMLHttpRequest},_$request_82.resolveUrl=function(e,t){return new _urlParse2.default(t,e).toString()};var obj,_urlParse2=(obj=_$urlParse_89)&&obj.__esModule?obj:{default:obj},_$isReactNative_80={};Object.defineProperty(_$isReactNative_80,"__esModule",{value:!0}),_$isReactNative_80.default=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};var _$uriToBlob_85={};Object.defineProperty(_$uriToBlob_85,"__esModule",{value:!0}),_$uriToBlob_85.default=function(e,t){var r=new XMLHttpRequest;r.responseType="blob",r.onload=function(){var e=r.response;t(null,e)},r.onerror=function(e){t(e)},r.open("GET",e),r.send()};var _$isCordova_79={};Object.defineProperty(_$isCordova_79,"__esModule",{value:!0}),_$isCordova_79.default=function(){return"undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)};var _$readAsByteArray_81={};Object.defineProperty(_$readAsByteArray_81,"__esModule",{value:!0}),_$readAsByteArray_81.default=function(e,t){var r=new FileReader;r.onload=function(){t(null,new Uint8Array(r.result))},r.onerror=function(e){t(e)},r.readAsArrayBuffer(e)};var _$source_83={};Object.defineProperty(_$source_83,"__esModule",{value:!0});var _createClass=function(e,t,r){return t&&Oza(e.prototype,t),r&&Oza(e,r),e};function Oza(e,t){for(var r=0;rthis._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var r=0===__len_83(this._buffer);return this._done&&r?null:this._buffer.slice(0,t-e)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}]),jAa);function jAa(e,t){_classCallCheck(this,jAa),this._chunkSize=t,this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}function cAa(e){_classCallCheck(this,cAa),this._file=e,this.size=e.size}function __len_83(e){return void 0===e?0:void 0!==e.size?e.size:e.length}var _$storage_84={};Object.defineProperty(_$storage_84,"__esModule",{value:!0});var ___createClass_84=function(e,t,r){return t&&FAa(e.prototype,t),r&&FAa(e,r),e};function FAa(e,t){for(var r=0;ro._offsetBeforeRetry&&(o._retryAttempt=0);var t=!0;"undefined"!=typeof window&&"navigator"in window&&!1===window.navigator.onLine&&(t=!1);var r,n=e.originalRequest?e.originalRequest.status:0,i=!inStatusCategory(n,400)||409===n||423===n;o._retryAttemptthis._size)&&!this.options.uploadLengthDeferred&&(e=this._size),this._source.slice(t,e,function(e,t,r){e?i._emitError(e):(i.options.uploadLengthDeferred&&r&&(i._size=i._offset+(t&&t.size?t.size:0),n.setRequestHeader("Upload-Length",i._size)),null===t?n.send():(n.send(t),i._emitProgress(i._offset,i._size)))})}},{key:"_handleUploadResponse",value:function(e){var t=this,r=parseInt(e.getResponseHeader("Upload-Offset"),10);if(isNaN(r))this._emitXhrError(e,new Error("tus: invalid or missing offset value"));else{if(this._emitProgress(r,this._size),this._emitChunkComplete(r-this._offset,r,this._size),(this._offset=r)==this._size)return this.options.removeFingerprintOnSuccess&&this.options.resume&&this._storage.removeItem(this._fingerprint,function(e){e&&t._emitError(e)}),this._emitSuccess(),void this._source.close();this._startUpload()}}}],[{key:"terminate",value:function(e,t,r){if("function"!=typeof t&&"function"!=typeof r)throw new Error("tus: a callback function must be specified");"function"==typeof t&&(r=t,t={});var n=(0,_$request_82.newRequest)();n.open("DELETE",e,!0),n.onload=function(){204===n.status?r():r(new _error2.default(new Error("tus: unexpected response while terminating upload"),null,n))},n.onerror=function(e){r(new _error2.default(e,new Error("tus: failed to terminate upload"),n))},setupXHR(n,t),n.send(null)}}]),oBa);function oBa(e,t){!function(e){if(!(e instanceof oBa))throw new TypeError("Cannot call a class as a function")}(this),this.options=(0,_extend2.default)(!0,{},__defaultOptions_88,t),this._storage=this.options.urlStorage,this.file=e,this.url=null,this._xhr=null,this._fingerprint=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0}function inStatusCategory(e,t){return t<=e&&e>t&63|128)}function encodeCodePoint(e,t){if(0==(4294967168&e))return stringFromCharCode(e);var r="";return 0==(4294965248&e)?r=stringFromCharCode(e>>6&31|192):0==(4294901760&e)?(checkScalarValue(e,t)||(e=65533),r=stringFromCharCode(e>>12&15|224),r+=createByte(e,6)):0==(4292870144&e)&&(r=stringFromCharCode(e>>18&7|240),r+=createByte(e,12),r+=createByte(e,6)),r+stringFromCharCode(63&e|128)}function readContinuationByte(){if(byteCount<=byteIndex)throw Error("Invalid byte index");var e=255&byteArray[byteIndex];if(byteIndex++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function decodeSymbol(e){var t,r;if(byteCount>>10&1023|55296),t=56320|1023&t),i+=stringFromCharCode(t);return i}(i)}},_$base64Arraybuffer_4={};!function(){"use strict";for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=new Uint8Array(256),e=0;e>2],n+=o[(3&t[i])<<4|t[i+1]>>4],n+=o[(15&t[i+1])<<2|t[i+2]>>6],n+=o[63&t[i+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n},_$base64Arraybuffer_4.decode=function(e){var t,r,n,i,o=.75*e.length,s=e.length,a=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);for(var u=new ArrayBuffer(o),l=new Uint8Array(u),c=0;c>4,l[a++]=(15&r)<<4|n>>2,l[a++]=(3&n)<<6|63&i;return u}}();var _$blob_6={},BlobBuilder=void 0!==BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,blobSupported=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),blobSupportsArrayBufferView=blobSupported&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),blobBuilderSupported=BlobBuilder&&BlobBuilder.prototype.append&&BlobBuilder.prototype.getBlob;function mapArrayBufferViews(e){return e.map(function(e){if(e.buffer instanceof ArrayBuffer){var t,r=e.buffer;return e.byteLength!==r.byteLength&&((t=new Uint8Array(e.byteLength)).set(new Uint8Array(r,e.byteOffset,e.byteLength)),r=t.buffer),r}return e})}function BlobBuilderConstructor(e,t){t=t||{};var r=new BlobBuilder;return mapArrayBufferViews(e).forEach(function(e){r.append(e)}),t.type?r.getBlob(t.type):r.getBlob()}function BlobConstructor(e,t){return new Blob(mapArrayBufferViews(e),t||{})}"undefined"!=typeof Blob&&(BlobBuilderConstructor.prototype=Blob.prototype,BlobConstructor.prototype=Blob.prototype),_$blob_6=blobSupported?blobSupportsArrayBufferView?Blob:BlobConstructor:blobBuilderSupported?BlobBuilderConstructor:void 0;var _$browser_30={},base64encoder;"undefined"!=typeof ArrayBuffer&&(base64encoder=_$base64Arraybuffer_4);var isAndroid="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),isPhantomJS="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),dontSendBlobs=isAndroid||isPhantomJS;_$browser_30.protocol=3;var packets=_$browser_30.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},packetslist=_$keys_31(packets),err={type:"error",data:"parser error"};function map(e,t,r){for(var i=new Array(e.length),n=_$after_1(e.length,r),o=0;o';r=document.createElement(e)}catch(e){(r=document.createElement("iframe")).name=s.iframeId,r.src="javascript:0"}r.id=s.iframeId,s.form.appendChild(r),s.iframe=r}this.form||(n=document.createElement("form"),i=document.createElement("textarea"),o=this.iframeId="eio_iframe_"+this.index,n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=o,n.method="POST",n.setAttribute("accept-charset","utf-8"),i.name="d",n.appendChild(i),document.body.appendChild(n),this.form=n,this.area=i),this.form.action=this.uri(),u(),e=e.replace(c,"\\\n"),this.area.value=e.replace(l,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===s.iframe.readyState&&a()}:this.iframe.onload=a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var _$websocket_24={};(function(o){var t,r,s=_$browser_27("engine.io-client:websocket");if("undefined"!=typeof WebSocket)t=WebSocket;else if("undefined"!=typeof self)t=self.WebSocket||self.MozWebSocket;else try{r=_$empty_7({})}catch(e){}var n=t||r;function e(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=t&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(n=r),_$transport_19.call(this,e)}_$componentInherit_12(_$websocket_24=e,_$transport_19),e.prototype.name="websocket",e.prototype.supportsBinary=!0,e.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new n(e,t):new n(e):new n(e,t,r)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},e.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},e.prototype.write=function(e){var n=this;this.writable=!1;for(var i=e.length,t=0,r=i;t=this._reconnectionAttempts?(__debug_61("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1):(e=this.backoff.duration(),__debug_61("will wait %dms before reconnect attempt",e),this.reconnecting=!0,t=setTimeout(function(){r.skipReconnect||(__debug_61("attempting reconnect"),r.emitAll("reconnect_attempt",r.backoff.attempts),r.emitAll("reconnecting",r.backoff.attempts),r.skipReconnect||r.open(function(e){e?(__debug_61("reconnect attempt error"),r.reconnecting=!1,r.reconnect(),r.emitAll("reconnect_error",e.data)):(__debug_61("reconnect success"),r.onreconnect())}))},e),this.subs.push({destroy:function(){clearTimeout(t)}}))},Manager.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)};var _$componentEmitter_11={exports:{}};function __Emitter_11(e){if(e)return function(e){for(var t in __Emitter_11.prototype)e[t]=__Emitter_11.prototype[t];return e}(e)}_$componentEmitter_11.exports=__Emitter_11,__Emitter_11.prototype.on=__Emitter_11.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},__Emitter_11.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},__Emitter_11.prototype.off=__Emitter_11.prototype.removeListener=__Emitter_11.prototype.removeAllListeners=__Emitter_11.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i=statusOrder.indexOf(t)}var TransloaditAssembly=function(r){var e,t;function n(e){var t;return(t=r.call(this)||this).status=e,t.socket=null,t.pollInterval=null,t.closed=!1,t}t=r,(e=n).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;var i=n.prototype;return i.connect=function(){this._connectSocket(),this._beginPolling()},i._onFinished=function(){this.emit("finished"),this.close()},i._connectSocket=function(){var r=this,e=_$parseUrl_179(this.status.websocket_url),t=io().connect(e.origin,{transports:["websocket"],path:e.pathname});t.on("connect",function(){t.emit("assembly_connect",{id:r.status.assembly_id}),r.emit("connect")}),t.on("connect_failed",function(){r._onError(new _$NetworkError_187("Transloadit Socket.io connection error")),r.socket=null}),t.on("error",function(){t.disconnect(),r.socket=null}),t.on("assembly_finished",function(){r._onFinished()}),t.on("assembly_upload_finished",function(e){r.emit("upload",e),r.status.uploads.push(e)}),t.on("assembly_uploading_finished",function(){r.emit("executing")}),t.on("assembly_upload_meta_data_extracted",function(){r.emit("metadata"),r._fetchStatus({diff:!1})}),t.on("assembly_result_finished",function(e,t){r.emit("result",e,t),r.status.results[e]||(r.status.results[e]=[]),r.status.results[e].push(t)}),t.on("assembly_error",function(e){r._onError(e),r._fetchStatus({diff:!1})}),this.socket=t},i._onError=function(e){this.emit("error",___extends_174(new Error(e.message),e))},i._beginPolling=function(){var e=this;this.pollInterval=setInterval(function(){e.socket&&e.socket.connected||e._fetchStatus()},2e3)},i._fetchStatus=function(e){var t=this,r=(void 0===e?{}:e).diff,n=void 0===r||r;return _$fetchWithNetworkError_194(this.status.assembly_ssl_url).then(function(e){return e.json()}).then(function(e){t.closed||(t.emit("status",e),n?t.updateStatus(e):t.status=e)}).catch(function(e){return t._onError(e)})},i.update=function(){return this._fetchStatus({diff:!0})},i.updateStatus=function(e){this._diffStatus(this.status,e),this.status=e},i._diffStatus=function(n,i){var o=this,e=n.ok,t=i.ok;if(i.error&&!n.error)return this._onError(i);var r=isStatus(t,"ASSEMBLY_EXECUTING")&&!isStatus(e,"ASSEMBLY_EXECUTING");r&&this.emit("executing"),Object.keys(i.uploads).filter(function(e){return!_$hasProperty_210(n.uploads,e)}).map(function(e){return i.uploads[e]}).forEach(function(e){o.emit("upload",e)}),r&&this.emit("metadata"),Object.keys(i.results).forEach(function(t){var e=i.results[t],r=n.results[t];e.filter(function(t){return!r||!r.some(function(e){return e.id===t.id})}).forEach(function(e){o.emit("result",t,e)})}),isStatus(t,"ASSEMBLY_COMPLETED")&&!isStatus(e,"ASSEMBLY_COMPLETED")&&this.emit("finished")},i.close=function(){this.closed=!0,this.socket&&(this.socket.disconnect(),this.socket=null),clearInterval(this.pollInterval)},n}(_$componentEmitter_11),_$TransloaditAssembly_174=TransloaditAssembly,_$Client_177=(aVa=_Ua.prototype,aVa.createAssembly=function(e){var t=this,r=(e.templateId,e.params),n=e.fields,i=e.signature,o=e.expectedFiles,s=new FormData;s.append("params","string"==typeof r?r:JSON.stringify(r)),i&&s.append("signature",i),Object.keys(n).forEach(function(e){s.append(e,n[e])}),s.append("num_expected_upload_files",o);var a=this.opts.service+"/assemblies";return _$fetchWithNetworkError_194(a,{method:"post",headers:this._headers,body:s}).then(function(e){return e.json()}).then(function(e){if(e.error){var t=new Error(e.error);throw t.details=e.message,(t.assembly=e).assembly_id&&(t.details+=" Assembly ID: "+e.assembly_id),t}return e}).catch(function(e){return t._reportError(e,{url:a,type:"API_ERROR"})})},aVa.reserveFile=function(t,r){var n=this,e=encodeURIComponent(r.size),i=t.assembly_ssl_url+"/reserve_file?size="+e;return _$fetchWithNetworkError_194(i,{method:"post",headers:this._headers}).then(function(e){return e.json()}).catch(function(e){return n._reportError(e,{assembly:t,file:r,url:i,type:"API_ERROR"})})},aVa.addFile=function(t,r){var n=this;if(!r.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));var e=encodeURIComponent(r.size),i=encodeURIComponent(r.uploadURL),o="size="+e+"&filename="+encodeURIComponent(r.name)+"&fieldname=file&s3Url="+i,s=t.assembly_ssl_url+"/add_file?"+o;return _$fetchWithNetworkError_194(s,{method:"post",headers:this._headers}).then(function(e){return e.json()}).catch(function(e){return n._reportError(e,{assembly:t,file:r,url:s,type:"API_ERROR"})})},aVa.cancelAssembly=function(e){var t=this,r=e.assembly_ssl_url;return _$fetchWithNetworkError_194(r,{method:"delete",headers:this._headers}).then(function(e){return e.json()}).catch(function(e){return t._reportError(e,{url:r,type:"API_ERROR"})})},aVa.getAssemblyStatus=function(t){var r=this;return _$fetchWithNetworkError_194(t,{headers:this._headers}).then(function(e){return e.json()}).catch(function(e){return r._reportError(e,{url:t,type:"STATUS_ERROR"})})},aVa.submitError=function(e,t){var r=t.endpoint,n=t.instance,i=t.assembly,o=e.details?e.message+" ("+e.details+")":e.message;return _$fetchWithNetworkError_194("https://status.transloadit.com/client_error",{method:"post",body:JSON.stringify({endpoint:r,instance:n,assembly_id:i,agent:"undefined"!=typeof navigator?navigator.userAgent:"",client:this.opts.client,error:o})}).then(function(e){return e.json()})},aVa._reportError=function(e,t){if(!1===this.opts.errorReporting)throw e;var r={type:t.type};throw t.assembly&&(r.assembly=t.assembly.assembly_id,r.instance=t.assembly.instance),t.url&&(r.endpoint=t.url),this.submitError(e,r).catch(function(e){}),e},_Ua),_$AssemblyOptions_175={},aVa;function _Ua(e){void 0===e&&(e={}),this.opts=e,this._reportError=this._reportError.bind(this),this._headers={"Transloadit-Client":this.opts.client}}function validateParams(e){if(!e)throw new Error("Transloadit: The `params` option is required.");if("string"==typeof e)try{e=JSON.parse(e)}catch(e){throw e.message="Transloadit: The `params` option is a malformed JSON string: "+e.message,e}if(!e.auth||!e.auth.key)throw new Error("Transloadit: The `params.auth.key` option is required. You can find your Transloadit API key at https://transloadit.com/account/api-settings.")}var AssemblyOptions=(aWa=_Va.prototype,aWa._normalizeAssemblyOptions=function(t,r){var e;return Array.isArray(r.fields)&&(e=r.fields,r.fields={},e.forEach(function(e){r.fields[e]=t.meta[e]})),r.fields||(r.fields={}),r},aWa._getAssemblyOptions=function(t){var r=this,e=this.opts;return Promise.resolve().then(function(){return e.getAssemblyOptions(t,e)}).then(function(e){return r._normalizeAssemblyOptions(t,e)}).then(function(e){return validateParams(e.params),{fileIDs:[t.id],options:e}})},aWa._dedupe=function(e){var o=Object.create(null);return e.forEach(function(e){var t,r=e.fileIDs,n=e.options,i=JSON.stringify(n);o[i]?(t=o[i].fileIDs).push.apply(t,r):o[i]={options:n,fileIDs:[].concat(r)}}),Object.keys(o).map(function(e){return o[e]})},aWa.build=function(){var t=this,e=this.opts;return 0 target element passed in options to operate, none was found","error")},i.uninstall=function(){this.form.removeEventListener("submit",this.handleFormSubmit),this.uppy.off("upload",this.handleUploadStart),this.uppy.off("complete",this.handleSuccess)},r}(__Plugin_135),___class_135.VERSION="1.3.16",___temp_135),_$ServiceWorkerStore_138={},isSupported="undefined"!=typeof navigator&&"serviceWorker"in navigator,ServiceWorkerStore=(z2a=y2a.prototype,z2a.list=function(){var t=this,r={},e=new Promise(function(e,t){r.resolve=e,r.reject=t});function n(e){if(e.data.store===t.name)switch(e.data.type){case"uppy/ALL_FILES":r.resolve(e.data.files),navigator.serviceWorker.removeEventListener("message",n)}}return console.log("Loading stored blobs from Service Worker"),this.ready.then(function(){navigator.serviceWorker.addEventListener("message",n),navigator.serviceWorker.controller.postMessage({type:"uppy/GET_FILES",store:t.name})}),e},z2a.put=function(e){var t=this;return this.ready.then(function(){navigator.serviceWorker.controller.postMessage({type:"uppy/ADD_FILE",store:t.name,file:e})})},z2a.delete=function(e){var t=this;return this.ready.then(function(){navigator.serviceWorker.controller.postMessage({type:"uppy/REMOVE_FILE",store:t.name,fileID:e})})},y2a),z2a;function y2a(e){this.ready=new Promise(function(e,t){isSupported?navigator.serviceWorker.controller?e():navigator.serviceWorker.addEventListener("controllerchange",function(){e()}):t(new Error("Unsupported"))}),this.name=e.storeName}ServiceWorkerStore.isSupported=isSupported,_$ServiceWorkerStore_138=ServiceWorkerStore;var _$prettierBytes_140=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return 10<=e||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i},_$IndexedDBStore_136={};function ___extends_136(){return(___extends_136=Object.assign||function(e){for(var t=1;tthis.opts.maxFileSize?Promise.reject(new Error("File is too big to store.")):this.getSize().then(function(e){return e>r.opts.maxTotalSize?Promise.reject(new Error("No space left")):r.ready}).then(function(e){return waitForRequest(e.transaction([STORE_NAME],"readwrite").objectStore(STORE_NAME).add({id:r.key(t.id),fileID:t.id,store:r.name,expires:Date.now()+r.opts.expires,data:t.data}))})},n3a.delete=function(t){var r=this;return this.ready.then(function(e){return waitForRequest(e.transaction([STORE_NAME],"readwrite").objectStore(STORE_NAME).delete(r.key(t)))})},m3a.cleanup=function(){return connect(DB_NAME).then(function(i){var t=i.transaction([STORE_NAME],"readwrite").objectStore(STORE_NAME).index("expires").openCursor(IDBKeyRange.upperBound(Date.now()));return new Promise(function(n,e){t.onsuccess=function(e){var t,r=e.target.result;r?(t=r.value,console.log("[IndexedDBStore] Deleting record",t.fileID,"of size",_$prettierBytes_140(t.data.size),"- expired on",new Date(t.expires)),r.delete(),r.continue()):n(i)},t.onerror=e})}).then(function(e){e.close()})},m3a),n3a;function m3a(e){var t=this;this.opts=___extends_136({dbName:DB_NAME,storeName:"default",expires:DEFAULT_EXPIRY,maxFileSize:10485760,maxTotalSize:314572800},e),this.name=this.opts.storeName;function r(){return connect(t.opts.dbName)}cleanedUp?this.ready=r():(cleanedUp=!0,this.ready=m3a.cleanup().then(r,r))}function ___extends_137(){return(___extends_137=Object.assign||function(e){for(var t=1;t