@micromag/viewer-build 0.4.88 → 0.4.90-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/build/asset-manifest.json +26 -8
  2. package/build/index.html +1 -1
  3. package/build/static/css/656.cf2dc07c.css +5 -0
  4. package/build/static/css/main.8d373834.css +2 -0
  5. package/build/static/js/160.0718cb47.chunk.js +1 -0
  6. package/build/static/js/231.2dd1f543.chunk.js +1 -0
  7. package/build/static/js/268.f9b85afc.chunk.js +1 -0
  8. package/build/static/js/270.85f114b4.chunk.js +1 -0
  9. package/build/static/js/278.1bc9b3a8.chunk.js +1 -0
  10. package/build/static/js/359.8b129b69.chunk.js +1 -0
  11. package/build/static/js/50.37bde52c.chunk.js +1 -0
  12. package/build/static/js/51.24437974.chunk.js +2 -0
  13. package/build/static/js/51.24437974.chunk.js.LICENSE.txt +10 -0
  14. package/build/static/js/543.a221a89d.chunk.js +1 -0
  15. package/build/static/js/558.01ab5aca.chunk.js +1 -0
  16. package/build/static/js/6.a54a904c.chunk.js +1 -0
  17. package/build/static/js/656.81c40916.js +2 -0
  18. package/build/static/js/{616.aa54e035.js.LICENSE.txt → 656.81c40916.js.LICENSE.txt} +4 -2
  19. package/build/static/js/699.abf614c9.chunk.js +2 -0
  20. package/build/static/js/699.abf614c9.chunk.js.LICENSE.txt +12 -0
  21. package/build/static/js/727.018496cf.chunk.js +1 -0
  22. package/build/static/js/951.cb178734.chunk.js +2 -0
  23. package/build/static/js/951.cb178734.chunk.js.LICENSE.txt +10 -0
  24. package/build/static/js/main.caa09ea9.js +2 -0
  25. package/build/static/js/runtime~main.ece9ec3d.js +1 -0
  26. package/build/static/media/bootstrap-icons.1295669cd4e305c97f2c.woff +0 -0
  27. package/build/static/media/bootstrap-icons.92ea18a81d737146ff04.woff2 +0 -0
  28. package/package.json +6 -6
  29. package/build/static/css/main.090cebea.css +0 -2
  30. package/build/static/js/616.aa54e035.js +0 -2
  31. package/build/static/js/main.3de143e7.js +0 -2
  32. package/build/static/js/runtime~main.0daca723.js +0 -1
  33. /package/build/static/js/{main.3de143e7.js.LICENSE.txt → main.caa09ea9.js.LICENSE.txt} +0 -0
@@ -37,9 +37,11 @@ object-assign
37
37
  * (c) Sindre Sorhus; MIT License
38
38
  */
39
39
 
40
- /*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */
40
+ /*! @license DOMPurify 3.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.7/LICENSE */
41
41
 
42
- /*! js-cookie v3.0.5 | MIT */
42
+ /*! clipboard-copy. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
43
+
44
+ /*! js-cookie v3.0.7 | MIT */
43
45
 
44
46
  /**
45
47
  * @license React
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 699.abf614c9.chunk.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[699],{1359:function(t,e){var r=Object.prototype.hasOwnProperty;function n(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function o(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var n,i,a=[];for(i in"string"!=typeof e&&(e="?"),t)if(r.call(t,i)){if((n=t[i])||null!=n&&!isNaN(n)||(n=""),i=o(i),n=o(n),null===i||null===n)continue;a.push(i+"="+n)}return a.length?e+a.join("&"):""},e.parse=function(t){for(var e,r=/([^=?#&]+)=?([^&]*)/g,o={};e=r.exec(t);){var i=n(e[1]),a=n(e[2]);null===i||null===a||i in o||(o[i]=a)}return o}},3062:function(t){t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},2225:function(t,e,r){var n=r(3062),o=r(1359),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a=/[\n\r\t]/g,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function p(t){return(t||"").toString().replace(i,"")}var f=[["#","hash"],["?","query"],function(t,e){return y(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function d(t){var e,n=("undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).location||{},o={},i=typeof(t=t||n);if("blob:"===t.protocol)o=new v(unescape(t.pathname),{});else if("string"===i)for(e in o=new v(t,{}),h)delete o[e];else if("object"===i){for(e in t)e in h||(o[e]=t[e]);void 0===o.slashes&&(o.slashes=s.test(t.href))}return o}function y(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function m(t,e){t=(t=p(t)).replace(a,""),e=e||{};var r,n=l.exec(t),o=n[1]?n[1].toLowerCase():"",i=!!n[2],s=!!n[3],u=0;return i?s?(r=n[2]+n[3]+n[4],u=n[2].length+n[3].length):(r=n[2]+n[4],u=n[2].length):s?(r=n[3]+n[4],u=n[3].length):r=n[4],"file:"===o?u>=2&&(r=r.slice(2)):y(o)?r=n[4]:o?i&&(r=r.slice(2)):u>=2&&y(e.protocol)&&(r=n[4]),{protocol:o,slashes:i||y(o),slashesCount:u,rest:r}}function v(t,e,r){if(t=(t=p(t)).replace(a,""),!(this instanceof v))return new v(t,e,r);var i,s,u,l,h,g,b=f.slice(),w=typeof e,_=this,S=0;for("object"!==w&&"string"!==w&&(r=e,e=null),r&&"function"!=typeof r&&(r=o.parse),i=!(s=m(t||"",e=d(e))).protocol&&!s.slashes,_.slashes=s.slashes||i&&e.slashes,_.protocol=s.protocol||e.protocol||"",t=s.rest,("file:"===s.protocol&&(2!==s.slashesCount||c.test(t))||!s.slashes&&(s.protocol||s.slashesCount<2||!y(_.protocol)))&&(b[3]=[/(.*)/,"pathname"]);S<b.length;S++)"function"!=typeof(l=b[S])?(u=l[0],g=l[1],u!=u?_[g]=t:"string"==typeof u?~(h="@"===u?t.lastIndexOf(u):t.indexOf(u))&&("number"==typeof l[2]?(_[g]=t.slice(0,h),t=t.slice(h+l[2])):(_[g]=t.slice(h),t=t.slice(0,h))):(h=u.exec(t))&&(_[g]=h[1],t=t.slice(0,h.index)),_[g]=_[g]||i&&l[3]&&e[g]||"",l[4]&&(_[g]=_[g].toLowerCase())):t=l(t,_);r&&(_.query=r(_.query)),i&&e.slashes&&"/"!==_.pathname.charAt(0)&&(""!==_.pathname||""!==e.pathname)&&(_.pathname=function(t,e){if(""===t)return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,o=r[n-1],i=!1,a=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),a++):a&&(0===n&&(i=!0),r.splice(n,1),a--);return i&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}(_.pathname,e.pathname)),"/"!==_.pathname.charAt(0)&&y(_.protocol)&&(_.pathname="/"+_.pathname),n(_.port,_.protocol)||(_.host=_.hostname,_.port=""),_.username=_.password="",_.auth&&(~(h=_.auth.indexOf(":"))?(_.username=_.auth.slice(0,h),_.username=encodeURIComponent(decodeURIComponent(_.username)),_.password=_.auth.slice(h+1),_.password=encodeURIComponent(decodeURIComponent(_.password))):_.username=encodeURIComponent(decodeURIComponent(_.auth)),_.auth=_.password?_.username+":"+_.password:_.username),_.origin="file:"!==_.protocol&&y(_.protocol)&&_.host?_.protocol+"//"+_.host:"null",_.href=_.toString()}v.prototype={set:function(t,e,r){var i=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(r||o.parse)(e)),i[t]=e;break;case"port":i[t]=e,n(e,i.protocol)?e&&(i.host=i.hostname+":"+e):(i.host=i.hostname,i[t]="");break;case"hostname":i[t]=e,i.port&&(e+=":"+i.port),i.host=e;break;case"host":i[t]=e,u.test(e)?(e=e.split(":"),i.port=e.pop(),i.hostname=e.join(":")):(i.hostname=e,i.port="");break;case"protocol":i.protocol=e.toLowerCase(),i.slashes=!r;break;case"pathname":case"hash":if(e){var a="pathname"===t?"/":"#";i[t]=e.charAt(0)!==a?a+e:e}else i[t]=e;break;case"username":case"password":i[t]=encodeURIComponent(e);break;case"auth":var s=e.indexOf(":");~s?(i.username=e.slice(0,s),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=e.slice(s+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(e))}for(var l=0;l<f.length;l++){var c=f[l];c[4]&&(i[c[1]]=i[c[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&y(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(t){t&&"function"==typeof t||(t=o.stringify);var e,r=this,n=r.host,i=r.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var a=i+(r.protocol&&r.slashes||y(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):"file:"!==r.protocol&&y(r.protocol)&&!n&&"/"!==r.pathname&&(a+="@"),(":"===n[n.length-1]||u.test(r.hostname)&&!r.port)&&(n+=":"),a+=n+r.pathname,(e="object"==typeof r.query?t(r.query):r.query)&&(a+="?"!==e.charAt(0)?"?"+e:e),r.hash&&(a+=r.hash),a}},v.extractProtocol=m,v.location=d,v.trimLeft=p,v.qs=o,t.exports=v},2729:function(t,e,r){r.d(e,{A:function(){return o}});var n=r(9491);class o{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(t,e){this.uppy=t,this.opts=e??{}}getPluginState(){const{plugins:t}=this.uppy.getState();return t?.[this.id]||{}}setPluginState(t){const{plugins:e}=this.uppy.getState();this.uppy.setState({plugins:{...e,[this.id]:{...e[this.id],...t}}})}setOptions(t){this.opts={...this.opts,...t},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const t=new n.A([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState(void 0)}addTarget(t){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(t){}afterUpdate(){}}},4528:function(t,e,r){r.d(e,{A:function(){return n}});class n{#t;#e=[];constructor(t){this.#t=t}on(t,e){return this.#e.push([t,e]),this.#t.on(t,e)}remove(){for(const[t,e]of this.#e.splice(0))this.#t.off(t,e)}onFilePause(t,e){this.on("upload-pause",(r,n)=>{t===r?.id&&e(n)})}onFileRemove(t,e){this.on("file-removed",r=>{t===r.id&&e(r.id)})}onPause(t,e){this.on("upload-pause",(r,n)=>{t===r?.id&&e(n)})}onRetry(t,e){this.on("upload-retry",r=>{t===r?.id&&e()})}onRetryAll(t,e){this.on("retry-all",()=>{this.#t.getFile(t)&&e()})}onPauseAll(t,e){this.on("pause-all",()=>{this.#t.getFile(t)&&e()})}onCancelAll(t,e){this.on("cancel-all",(...r)=>{this.#t.getFile(t)&&e(...r)})}onResumeAll(t,e){this.on("resume-all",()=>{this.#t.getFile(t)&&e()})}}},7699:function(t,e,r){r.r(e),r.d(e,{default:function(){return Wt}});var n=r(2729),o=r(4528),i=r(1422),a=r(9420),s=r(7853),u=r(6681),l=r(2289),c=r(8284);function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h(n.key),n)}}function h(t){var e=function(t){if("object"!=p(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==p(e)?e:e+""}var d=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(t){return Promise.resolve([])}},{key:"removeUpload",value:function(t){return Promise.resolve()}},{key:"addUpload",value:function(t,e){return Promise.resolve(null)}}])&&f(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const y="function"==typeof Buffer,m=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),v=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),g=((t=>{let e={};t.forEach((t,r)=>e[t]=r)})(v),String.fromCharCode.bind(String)),b=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),t=>t.replace(/=/g,"").replace(/[+\/]/g,t=>"+"==t?"-":"_")),w="function"==typeof btoa?t=>btoa(t):y?t=>Buffer.from(t,"binary").toString("base64"):t=>{let e,r,n,o,i="";const a=t.length%3;for(let a=0;a<t.length;){if((r=t.charCodeAt(a++))>255||(n=t.charCodeAt(a++))>255||(o=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|o,i+=v[e>>18&63]+v[e>>12&63]+v[e>>6&63]+v[63&e]}return a?i.slice(0,a-3)+"===".substring(a):i},_=y?t=>Buffer.from(t).toString("base64"):t=>{let e=[];for(let r=0,n=t.length;r<n;r+=4096)e.push(g.apply(null,t.subarray(r,r+4096)));return w(e.join(""))},S=t=>{if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?g(192|e>>>6)+g(128|63&e):g(224|e>>>12&15)+g(128|e>>>6&63)+g(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return g(240|e>>>18&7)+g(128|e>>>12&63)+g(128|e>>>6&63)+g(128|63&e)},U=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,E=y?t=>Buffer.from(t,"utf8").toString("base64"):m?t=>_(m.encode(t)):t=>w(t.replace(U,S)),P=(t,e=!1)=>e?b(E(t)):E(t);var O=r(2225),x=r.n(O);function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function R(t){var e="function"==typeof Map?new Map:void 0;return R=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(k())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&L(o,r.prototype),o}(t,arguments,q(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),L(r,t)},R(t)}function k(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(k=function(){return!!t})()}function L(t,e){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},L(t,e)}function q(t){return q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},q(t)}var T=function(t){function e(t){var r,n,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,o=e,i=[t],o=q(o),r=function(t,e){if(e&&("object"===j(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,k()?Reflect.construct(o,i||[],q(n).constructor):o.apply(n,i))).originalRequest=s,r.originalResponse=u,r.causingError=a,null!=a&&(t+=", caused by ".concat(a.toString())),null!=s){var l=s.getHeader("X-Request-ID")||"n/a",c=s.getMethod(),p=s.getURL(),f=u?u.getStatus():"n/a",h=u?u.getBody()||"":"n/a";t+=", originated from request (method: ".concat(c,", url: ").concat(p,", response code: ").concat(f,", response text: ").concat(h,", request id: ").concat(l,")")}return r.message=t,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&L(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(R(Error)),C=T;function A(){A=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new k(n||[]);return o(a,"_invoke",{value:O(t,r,s)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var f="suspendedStart",h="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var w={};l(w,a,function(){return this});var _=Object.getPrototypeOf,S=_&&_(_(L([])));S&&S!==r&&n.call(S,a)&&(w=S);var U=b.prototype=v.prototype=Object.create(w);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(o,i,a,s){var u=p(t[o],t,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==I(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=f;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=x(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?y:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function x(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(I(e)+" is not iterable")}return g.prototype=b,o(U,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(U),t},e.awrap=function(t){return{__await:t}},E(P.prototype),l(P.prototype,s,function(){return this}),e.AsyncIterator=P,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new P(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},E(U),l(U,u,"Generator"),l(U,a,function(){return this}),l(U,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function F(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function D(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||z(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function z(t,e){if(t){if("string"==typeof t)return N(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?N(t,e):void 0}}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function H(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?H(Object(r),!0).forEach(function(e){M(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function M(t,e,r){return(e=$(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$(n.key),n)}}function $(t){var e=function(t){if("object"!=I(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==I(e)?e:e+""}var K="tus-v1",X="ietf-draft-03",Y="ietf-draft-05",V={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:nt,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:K},J=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"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.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,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}return e=t,r=[{key:"findPreviousUploads",value:function(){var t=this;return this.options.fingerprint(this.file,this.options).then(function(e){return t._urlStorage.findUploadsByFingerprint(e)})}},{key:"resumeFromPreviousUpload",value:function(t){this.url=t.uploadUrl||null,this._parallelUploadUrls=t.parallelUploadUrls||null,this._urlStorageKey=t.urlStorageKey}},{key:"start",value:function(){var t=this,e=this.file;if(e)if([K,X,Y].includes(this.options.protocol))if(this.options.endpoint||this.options.uploadUrl||this.url){var r=this.options.retryDelays;if(null==r||"[object Array]"===Object.prototype.toString.call(r)){if(this.options.parallelUploads>1)for(var n=0,o=["uploadUrl","uploadSize","uploadLengthDeferred"];n<o.length;n++){var i=o[n];if(this.options[i])return void this._emitError(new Error("tus: cannot use the ".concat(i," option when parallelUploads is enabled")))}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1)return void this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length)return void this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"))}this.options.fingerprint(e,this.options).then(function(r){return null==r||"Calculated fingerprint: ".concat(r),t._fingerprint=r,t._source?t._source:t.options.fileReader.openFile(e,t.options.chunkSize)}).then(function(e){if(t._source=e,t.options.uploadLengthDeferred)t._size=null;else if(null!=t.options.uploadSize){if(t._size=Number(t.options.uploadSize),Number.isNaN(t._size))return void t._emitError(new Error("tus: cannot convert `uploadSize` option into a number"))}else if(t._size=t._source.size,null==t._size)return void t._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));t.options.parallelUploads>1||null!=t._parallelUploadUrls?t._startParallelUpload():t._startSingleUpload()}).catch(function(e){t._emitError(e)})}else 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: unsupported protocol ".concat(this.options.protocol)));else this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"_startParallelUpload",value:function(){var e,r=this,n=this._size,o=0;this._parallelUploads=[];var i=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,a=null!==(e=this.options.parallelUploadBoundaries)&&void 0!==e?e:function(t,e){for(var r=Math.floor(t/e),n=[],o=0;o<e;o++)n.push({start:r*o,end:r*(o+1)});return n[e-1].end=t,n}(this._source.size,i);this._parallelUploadUrls&&a.forEach(function(t,e){t.uploadUrl=r._parallelUploadUrls[e]||null}),this._parallelUploadUrls=new Array(a.length);var s,u=a.map(function(e,i){var s=0;return r._source.slice(e.start,e.end).then(function(u){var l=u.value;return new Promise(function(u,c){var p=B(B({},r.options),{},{uploadUrl:e.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:r.options.metadataForPartialUploads,headers:B(B({},r.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:u,onError:c,onProgress:function(t){o=o-s+t,s=t,r._emitProgress(o,n)},onUploadUrlAvailable:function(){r._parallelUploadUrls[i]=f.url,r._parallelUploadUrls.filter(function(t){return Boolean(t)}).length===a.length&&r._saveUploadInUrlStorage()}}),f=new t(l,p);f.start(),r._parallelUploads.push(f)})})});Promise.all(u).then(function(){(s=r._openRequest("POST",r.options.endpoint)).setHeader("Upload-Concat","final;".concat(r._parallelUploadUrls.join(" ")));var t=Q(r.options.metadata);return""!==t&&s.setHeader("Upload-Metadata",t),r._sendRequest(s,null)}).then(function(t){if(Z(t.getStatus(),200)){var e=t.getHeader("Location");null!=e?(r.url=ot(r.options.endpoint,e),"Created upload at ".concat(r.url),r._emitSuccess(t)):r._emitHttpError(s,t,"tus: invalid or missing Location header")}else r._emitHttpError(s,t,"tus: unexpected response while creating upload")}).catch(function(t){r._emitError(t)})}},{key:"_startSingleUpload",value:function(){return this._aborted=!1,null!=this.url?("Resuming upload from previous URL: ".concat(this.url),void this._resumeUpload()):null!=this.options.uploadUrl?("Resuming upload from provided URL: ".concat(this.options.uploadUrl),this.url=this.options.uploadUrl,void this._resumeUpload()):void this._createUpload()}},{key:"abort",value:function(e){var r=this;if(null!=this._parallelUploads){var n,o=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=z(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}(this._parallelUploads);try{for(o.s();!(n=o.n()).done;)n.value.abort(e)}catch(t){o.e(t)}finally{o.f()}}return null!==this._req&&this._req.abort(),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),e&&null!=this.url?t.terminate(this.url,this.options).then(function(){return r._removeFromUrlStorage()}):Promise.resolve()}},{key:"_emitHttpError",value:function(t,e,r,n){this._emitError(new C(r,n,t,e))}},{key:"_emitError",value:function(t){var e=this;if(!this._aborted){if(null!=this.options.retryDelays&&(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),rt(t,this._retryAttempt,this.options))){var r=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout(function(){e.start()},r))}if("function"!=typeof this.options.onError)throw t;this.options.onError(t)}}},{key:"_emitSuccess",value:function(t){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess({lastResponse:t})}},{key:"_emitProgress",value:function(t,e){"function"==typeof this.options.onProgress&&this.options.onProgress(t,e)}},{key:"_emitChunkComplete",value:function(t,e,r){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(t,e,r)}},{key:"_createUpload",value:function(){var t=this;if(this.options.endpoint){var e=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?e.setHeader("Upload-Defer-Length","1"):e.setHeader("Upload-Length","".concat(this._size));var r,n=Q(this.options.metadata);""!==n&&e.setHeader("Upload-Metadata",n),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,r=this._addChunkToRequest(e)):(this.options.protocol!==X&&this.options.protocol!==Y||e.setHeader("Upload-Complete","?0"),r=this._sendRequest(e,null)),r.then(function(r){if(Z(r.getStatus(),200)){var n=r.getHeader("Location");if(null!=n){if(t.url=ot(t.options.endpoint,n),"Created upload at ".concat(t.url),"function"==typeof t.options.onUploadUrlAvailable&&t.options.onUploadUrlAvailable(),0===t._size)return t._emitSuccess(r),void t._source.close();t._saveUploadInUrlStorage().then(function(){t.options.uploadDataDuringCreation?t._handleUploadResponse(e,r):(t._offset=0,t._performUpload())})}else t._emitHttpError(e,r,"tus: invalid or missing Location header")}else t._emitHttpError(e,r,"tus: unexpected response while creating upload")}).catch(function(r){t._emitHttpError(e,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 t=this,e=this._openRequest("HEAD",this.url);this._sendRequest(e,null).then(function(r){var n=r.getStatus();if(!Z(n,200))return 423===n?void t._emitHttpError(e,r,"tus: upload is currently locked; retry later"):(Z(n,400)&&t._removeFromUrlStorage(),t.options.endpoint?(t.url=null,void t._createUpload()):void t._emitHttpError(e,r,"tus: unable to resume upload (new upload cannot be created without an endpoint)"));var o=Number.parseInt(r.getHeader("Upload-Offset"),10);if(Number.isNaN(o))t._emitHttpError(e,r,"tus: invalid or missing offset value");else{var i=Number.parseInt(r.getHeader("Upload-Length"),10);!Number.isNaN(i)||t.options.uploadLengthDeferred||t.options.protocol!==K?("function"==typeof t.options.onUploadUrlAvailable&&t.options.onUploadUrlAvailable(),t._saveUploadInUrlStorage().then(function(){if(o===i)return t._emitProgress(i,i),void t._emitSuccess(r);t._offset=o,t._performUpload()})):t._emitHttpError(e,r,"tus: invalid or missing length value")}}).catch(function(r){t._emitHttpError(e,null,"tus: failed to resume upload",r)})}},{key:"_performUpload",value:function(){var t,e=this;this._aborted||(this.options.overridePatchMethod?(t=this._openRequest("POST",this.url)).setHeader("X-HTTP-Method-Override","PATCH"):t=this._openRequest("PATCH",this.url),t.setHeader("Upload-Offset","".concat(this._offset)),this._addChunkToRequest(t).then(function(r){Z(r.getStatus(),200)?e._handleUploadResponse(t,r):e._emitHttpError(t,r,"tus: unexpected response while uploading chunk")}).catch(function(r){e._aborted||e._emitHttpError(t,null,"tus: failed to upload chunk at offset ".concat(e._offset),r)}))}},{key:"_addChunkToRequest",value:function(t){var e=this,r=this._offset,n=this._offset+this.options.chunkSize;return t.setProgressHandler(function(t){e._emitProgress(r+t,e._size)}),this.options.protocol===K?t.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===Y&&t.setHeader("Content-Type","application/partial-upload"),(n===Number.POSITIVE_INFINITY||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(r,n).then(function(r){var n=r.value,o=r.done,i=null!=n&&n.size?n.size:0;e.options.uploadLengthDeferred&&o&&(e._size=e._offset+i,t.setHeader("Upload-Length","".concat(e._size)));var a=e._offset+i;return!e.options.uploadLengthDeferred&&o&&a!==e._size?Promise.reject(new Error("upload was configured with a size of ".concat(e._size," bytes, but the source is done after ").concat(a," bytes"))):null===n?e._sendRequest(t):(e.options.protocol!==X&&e.options.protocol!==Y||t.setHeader("Upload-Complete",o?"?1":"?0"),e._emitProgress(e._offset,e._size),e._sendRequest(t,n))})}},{key:"_handleUploadResponse",value:function(t,e){var r=Number.parseInt(e.getHeader("Upload-Offset"),10);if(Number.isNaN(r))this._emitHttpError(t,e,"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(e),void this._source.close();this._performUpload()}}},{key:"_openRequest",value:function(t,e){var r=W(t,e,this.options);return this._req=r,r}},{key:"_removeFromUrlStorage",value:function(){var t=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(e){t._emitError(e)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var t=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||null!==this._urlStorageKey)return Promise.resolve();var e={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};return this._parallelUploads?e.parallelUploadUrls=this._parallelUploadUrls:e.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,e).then(function(e){t._urlStorageKey=e})}},{key:"_sendRequest",value:function(t){return tt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,this.options)}}],n=[{key:"terminate",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=W("DELETE",e,r);return tt(n,null,r).then(function(t){if(204!==t.getStatus())throw new C("tus: unexpected response while terminating upload",null,n,t)}).catch(function(o){if(o instanceof C||(o=new C("tus: failed to terminate upload",o,n,null)),!rt(o,0,r))throw o;var i=r.retryDelays[0],a=r.retryDelays.slice(1),s=B(B({},r),{},{retryDelays:a});return new Promise(function(t){return setTimeout(t,i)}).then(function(){return t.terminate(e,s)})})}}],r&&G(e.prototype,r),n&&G(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Q(t){return Object.entries(t).map(function(t){var e=D(t,2),r=e[0],n=e[1];return"".concat(r," ").concat(P(String(n)))}).join(",")}function Z(t,e){return t>=e&&t<e+100}function W(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===X?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===Y?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var o=r.headers||{},i=0,a=Object.entries(o);i<a.length;i++){var s=D(a[i],2),u=s[0],l=s[1];n.setHeader(u,l)}if(r.addRequestId){var c="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)});n.setHeader("X-Request-ID",c)}return n}function tt(t,e,r){return et.apply(this,arguments)}function et(){var t;return t=A().mark(function t(e,r,n){var o;return A().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof n.onBeforeRequest){t.next=3;break}return t.next=3,n.onBeforeRequest(e);case 3:return t.next=5,e.send(r);case 5:if(o=t.sent,"function"!=typeof n.onAfterResponse){t.next=9;break}return t.next=9,n.onAfterResponse(e,o);case 9:return t.abrupt("return",o);case 10:case"end":return t.stop()}},t)}),et=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){F(i,n,o,a,s,"next",t)}function s(t){F(i,n,o,a,s,"throw",t)}a(void 0)})},et.apply(this,arguments)}function rt(t,e,r){return!(null==r.retryDelays||e>=r.retryDelays.length||null==t.originalRequest)&&(r&&"function"==typeof r.onShouldRetry?r.onShouldRetry(t,e,r):nt(t))}function nt(t){var e,r=t.originalResponse?t.originalResponse.getStatus():0;return(!Z(r,400)||409===r||423===r)&&(e=!0,"undefined"!=typeof navigator&&!1===navigator.onLine&&(e=!1),e)}function ot(t,e){return new(x())(e,t).toString()}J.defaultOptions=V;var it=J,at=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};function st(t){return new Promise(function(e,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var t=n.response;e(t)},n.onerror=function(t){r(t)},n.open("GET",t),n.send()})}function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ct(n.key),n)}}function ct(t){var e=function(t){if("object"!=ut(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ut(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ut(e)?e:e+""}var pt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._file=e,this.size=e.size},(e=[{key:"slice",value:function(t,e){if("undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova))return r=this._file.slice(t,e),new Promise(function(t,e){var n=new FileReader;n.onload=function(){var e=new Uint8Array(n.result);t({value:e})},n.onerror=function(t){e(t)},n.readAsArrayBuffer(r)});var r,n=this._file.slice(t,e),o=e>=this.size;return Promise.resolve({value:n,done:o})}},{key:"close",value:function(){}}])&&lt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ft(t){return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(t)}function ht(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dt(n.key),n)}}function dt(t){var e=function(t){if("object"!=ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ft(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ft(e)?e:e+""}function yt(t){return void 0===t?0:void 0!==t.size?t.size:t.length}var mt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1},(e=[{key:"slice",value:function(t,e){return t<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(t,e)}},{key:"_readUntilEnoughDataOrDone",value:function(t,e){var r=this,n=e<=this._bufferOffset+yt(this._buffer);if(this._done||n){var o=this._getDataFromBuffer(t,e),i=null==o&&this._done;return Promise.resolve({value:o,done:i})}return this._reader.read().then(function(n){var o=n.value;return n.done?r._done=!0:void 0===r._buffer?r._buffer=o:r._buffer=function(t,e){if(t.concat)return t.concat(e);if(t instanceof Blob)return new Blob([t,e],{type:t.type});if(t.set){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}throw new Error("Unknown data type")}(r._buffer,o),r._readUntilEnoughDataOrDone(t,e)})}},{key:"_getDataFromBuffer",value:function(t,e){t>this._bufferOffset&&(this._buffer=this._buffer.slice(t-this._bufferOffset),this._bufferOffset=t);var r=0===yt(this._buffer);return this._done&&r?null:this._buffer.slice(0,e-t)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}])&&ht(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function vt(t){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vt(t)}function gt(){gt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new k(n||[]);return o(a,"_invoke",{value:O(t,r,s)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var f="suspendedStart",h="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var w={};l(w,a,function(){return this});var _=Object.getPrototypeOf,S=_&&_(_(L([])));S&&S!==r&&n.call(S,a)&&(w=S);var U=b.prototype=v.prototype=Object.create(w);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(o,i,a,s){var u=p(t[o],t,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==vt(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=f;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=x(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?y:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function x(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(vt(e)+" is not iterable")}return g.prototype=b,o(U,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(U),t},e.awrap=function(t){return{__await:t}},E(P.prototype),l(P.prototype,s,function(){return this}),e.AsyncIterator=P,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new P(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},E(U),l(U,u,"Generator"),l(U,a,function(){return this}),l(U,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function bt(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function wt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_t(n.key),n)}}function _t(t){var e=function(t){if("object"!=vt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=vt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==vt(e)?e:e+""}var St=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"openFile",value:(r=gt().mark(function t(e,r){var n;return gt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!at()||!e||void 0===e.uri){t.next=11;break}return t.prev=1,t.next=4,st(e.uri);case 4:return n=t.sent,t.abrupt("return",new pt(n));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(t.t0));case 11:if("function"!=typeof e.slice||void 0===e.size){t.next=13;break}return t.abrupt("return",Promise.resolve(new pt(e)));case 13:if("function"!=typeof e.read){t.next=18;break}if(r=Number(r),Number.isFinite(r)){t.next=17;break}return t.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return t.abrupt("return",Promise.resolve(new mt(e,r)));case 18:return t.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return t.stop()}},t,null,[[1,8]])}),n=function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function a(t){bt(i,n,o,a,s,"next",t)}function s(t){bt(i,n,o,a,s,"throw",t)}a(void 0)})},function(t,e){return n.apply(this,arguments)})}],e&&wt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n}();function Ut(t){return Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(t)}function Et(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xt(n.key),n)}}function Ot(t,e,r){return e&&Pt(t.prototype,e),r&&Pt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xt(t){var e=function(t){if("object"!=Ut(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ut(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ut(e)?e:e+""}var jt=function(){return Ot(function t(){Et(this,t)},[{key:"createRequest",value:function(t,e){return new Rt(t,e)}},{key:"getName",value:function(){return"XHRHttpStack"}}])}(),Rt=function(){return Ot(function t(e,r){Et(this,t),this._xhr=new XMLHttpRequest,this._xhr.open(e,r,!0),this._method=e,this._url=r,this._headers={}},[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(t,e){this._xhr.setRequestHeader(t,e),this._headers[t]=e}},{key:"getHeader",value:function(t){return this._headers[t]}},{key:"setProgressHandler",value:function(t){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(e){e.lengthComputable&&t(e.loaded)})}},{key:"send",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise(function(r,n){t._xhr.onload=function(){r(new kt(t._xhr))},t._xhr.onerror=function(t){n(t)},t._xhr.send(e)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])}(),kt=function(){return Ot(function t(e){Et(this,t),this._xhr=e},[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(t){return this._xhr.getResponseHeader(t)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])}();function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}function qt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Tt(n.key),n)}}function Tt(t){var e=function(t){if("object"!=Lt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Lt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lt(e)?e:e+""}var Ct=!1;try{Ct="localStorage"in window;var At="tusSupport",Ft=localStorage.getItem(At);localStorage.setItem(At,Ft),null===Ft&&localStorage.removeItem(At)}catch(t){if(t.code!==t.SECURITY_ERR&&t.code!==t.QUOTA_EXCEEDED_ERR)throw t;Ct=!1}var Dt=Ct,It=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"findAllUploads",value:function(){var t=this._findEntries("tus::");return Promise.resolve(t)}},{key:"findUploadsByFingerprint",value:function(t){var e=this._findEntries("tus::".concat(t,"::"));return Promise.resolve(e)}},{key:"removeUpload",value:function(t){return localStorage.removeItem(t),Promise.resolve()}},{key:"addUpload",value:function(t,e){var r=Math.round(1e12*Math.random()),n="tus::".concat(t,"::").concat(r);return localStorage.setItem(n,JSON.stringify(e)),Promise.resolve(n)}},{key:"_findEntries",value:function(t){for(var e=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);if(0===n.indexOf(t))try{var o=JSON.parse(localStorage.getItem(n));o.urlStorageKey=n,e.push(o)}catch(t){}}return e}}],e&&qt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function zt(t){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(t)}function Nt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xt(n.key),n)}}function Ht(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ht=function(){return!!t})()}function Bt(t){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bt(t)}function Mt(t,e){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mt(t,e)}function Gt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function $t(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gt(Object(r),!0).forEach(function(e){Kt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Kt(t,e,r){return(e=Xt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xt(t){var e=function(t){if("object"!=zt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zt(e)?e:e+""}var Yt=$t($t({},it.defaultOptions),{},{httpStack:new jt,fileReader:new St,urlStorage:Dt?new It:new d,fingerprint:function(t,e){return at()?Promise.resolve(function(t,e){var r=t.exif?function(t){var e=0;if(0===t.length)return e;for(var r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e&=e;return e}(JSON.stringify(t.exif)):"noexif";return["tus-rn",t.name||"noname",t.size||"nosize",r,e.endpoint].join("/")}(t,e)):Promise.resolve(["tus-br",t.name,t.type,t.size,t.lastModified,e.endpoint].join("-"))}}),Vt=function(t){function e(){var t,r,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=e,n=[o,i=$t($t({},Yt),i)],r=Bt(r),function(t,e){if(e&&("object"===zt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ht()?Reflect.construct(r,n||[],Bt(t).constructor):r.apply(t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mt(t,e)}(e,t),r=e,n=[{key:"terminate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=$t($t({},Yt),e),it.terminate(t,e)}}],null&&Nt(r.prototype,null),n&&Nt(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(it),Jt=("function"==typeof XMLHttpRequest&&"function"==typeof Blob&&Blob.prototype.slice,"5.1.1");const Qt={endpoint:"",uploadUrl:null,metadata:{},uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,overridePatchMethod:!1,headers:{},addRequestId:!1,chunkSize:1/0,retryDelays:[100,1e3,3e3,5e3],parallelUploads:1,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1},Zt={limit:20,retryDelays:Qt.retryDelays,withCredentials:!1,allowedMetaFields:!0};class Wt extends n.A{static VERSION=Jt;#r;requests;uploaders;uploaderEvents;constructor(t,e){if(super(t,{...Zt,...e}),this.type="uploader",this.id=this.opts.id||"Tus",void 0===e?.allowedMetaFields&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");if("autoRetry"in e)throw new Error("The `autoRetry` option was deprecated and has been removed.");this.requests=this.opts.rateLimitedQueue??new i.i(this.opts.limit),this.#r=this.opts.retryDelays?.values(),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null)}resetUploaderReferences(t,e){const r=this.uploaders[t];r&&(r.abort(),e?.abort&&r.abort(!0),this.uploaders[t]=null),this.uploaderEvents[t]&&(this.uploaderEvents[t].remove(),this.uploaderEvents[t]=null)}async#n(t){return this.resetUploaderReferences(t.id),new Promise((e,r)=>{let n,i,c;const p={...this.opts,...t.tus||{}};"function"==typeof p.headers&&(p.headers=p.headers(t));const{onShouldRetry:f,onBeforeRequest:h,...d}=p,y={...Qt,...d};var m;y.fingerprint=(m=t,(t,e)=>{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 Yt.fingerprint(t,e);const r=["tus",m.id,e.endpoint].join("-");return Promise.resolve(r)}),y.onBeforeRequest=async e=>{const r=e.getUnderlyingObject();let o;if(r&&(r.withCredentials=!!p.withCredentials),"function"==typeof h&&(o=h(e,t)),(0,a.A)(n,"shouldBeRequeued")){if(!n.shouldBeRequeued)return Promise.reject();let e;const r=new Promise(t=>{e=t});return n=this.requests.run(()=>(t.isPaused&&n.abort(),e(),()=>{})),void await Promise.all([r,o])}return o},y.onError=e=>{this.uppy.log(e);const o=null!=e.originalRequest?e.originalRequest.getUnderlyingObject():null;(0,s.A)(o)&&(e=new u.A(e,o)),this.resetUploaderReferences(t.id),n?.abort(),"function"==typeof p.onError&&p.onError(e),r(e)},y.onProgress=(e,r)=>{this.onReceiveUploadUrl(t,c.url),"function"==typeof p.onProgress&&p.onProgress(e,r);const n=this.uppy.getFile(t.id);this.uppy.emit("upload-progress",n,{uploadStarted:n.progress.uploadStarted??0,bytesUploaded:e,bytesTotal:r})},y.onSuccess=r=>{const o={uploadURL:c.url??void 0,status:200,body:{xhr:r.lastResponse.getUnderlyingObject()}};this.uppy.emit("upload-success",this.uppy.getFile(t.id),o),this.resetUploaderReferences(t.id),n.done(),c.url&&this.uppy.log(`Download ${c.url}`),"function"==typeof p.onSuccess&&p.onSuccess(r),e(c)};const v=t=>{const e=t?.originalResponse?.getStatus();if(429===e){if(!this.requests.isPaused){const t=this.#r?.next();if(null==t||t.done)return!1;this.requests.rateLimit(t.value)}}else{if(null!=e&&e>=400&&e<500&&409!==e&&423!==e)return!1;"undefined"!=typeof navigator&&!1===navigator.onLine&&(this.requests.isPaused||(this.requests.pause(),window.addEventListener("online",()=>{this.requests.resume()},{once:!0})))}return n.abort(),n={shouldBeRequeued:!0,abort(){this.shouldBeRequeued=!1},done(){throw new Error("Cannot mark a queued request as done: this indicates a bug")},fn(){throw new Error("Cannot run a queued request: this indicates a bug")}},!0};y.onShouldRetry=null!=f?(t,e)=>f(t,e,p,v):v;const g=(t,e,r)=>{(0,a.A)(t,e)&&!(0,a.A)(t,r)&&(t[r]=t[e])},b={};if((0,l.A)(p.allowedMetaFields,t.meta).forEach(e=>{b[e]=String(t.meta[e])}),g(b,"type","filetype"),g(b,"name","filename"),y.metadata=b,null==t.data)throw new Error("File data is empty");c=new Vt(t.data,y),this.uploaders[t.id]=c;const w=new o.A(this.uppy);this.uploaderEvents[t.id]=w,i=()=>(t.isPaused||c.start(),()=>{}),c.findPreviousUploads().then(e=>{const r=e[0];r&&(this.uppy.log(`[Tus] Resuming upload of ${t.id} started at ${r.creationTime}`),c.resumeFromPreviousUpload(r)),n=this.requests.run(i)}),w.onFileRemove(t.id,r=>{n.abort(),this.resetUploaderReferences(t.id,{abort:!!c.url}),e(`upload ${r} was removed`)}),w.onPause(t.id,t=>{n.abort(),t?c.abort():n=this.requests.run(i)}),w.onPauseAll(t.id,()=>{n.abort(),c.abort()}),w.onCancelAll(t.id,()=>{n.abort(),this.resetUploaderReferences(t.id,{abort:!!c.url}),e(`upload ${t.id} was canceled`)}),w.onResumeAll(t.id,()=>{n.abort(),t.error&&c.abort(),n=this.requests.run(i)})}).catch(e=>{throw this.uppy.emit("upload-error",t,e),e})}onReceiveUploadUrl(t,e){const r=this.uppy.getFile(t.id);r&&(r.tus&&r.tus.uploadUrl===e||(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(r.id,{tus:{...r.tus,uploadUrl:e}})))}#o(t){const e={...this.opts};return t.tus&&Object.assign(e,t.tus),"function"==typeof e.headers&&(e.headers=e.headers(t)),{..."remote"in t&&t.remote.body,endpoint:e.endpoint,uploadUrl:e.uploadUrl,protocol:"tus",size:t.data.size,headers:e.headers,metadata:t.meta}}async#i(t){const e=(0,c.e)(t),r=(0,c.S)(e);this.uppy.emit("upload-start",r),await Promise.allSettled(e.map(t=>{if(t.isRemote){const e=()=>this.requests,r=new AbortController,n=e=>{e.id===t.id&&r.abort()};this.uppy.on("file-removed",n);const o=this.uppy.getRequestClientForFile(t).uploadRemoteFile(t,this.#o(t),{signal:r.signal,getQueue:e});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",n)},{priority:-1})(),o}return this.#n(t)}))}#a=async t=>{if(0===t.length)return void this.uppy.log("[Tus] No files to upload");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...");const e=this.uppy.getFilesByIds(t);await this.#i(e)};install(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!0}}),this.uppy.addUploader(this.#a)}uninstall(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!1}}),this.uppy.removeUploader(this.#a)}}},6681:function(t,e){class r extends Error{cause;isNetworkError;request;constructor(t,e=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=t,this.isNetworkError=!0,this.request=e}}e.A=r},1422:function(t,e,r){function n(t){if(null!=t){const e=()=>this.abort(t.reason);t.addEventListener("abort",e,{once:!0});const r=()=>{t.removeEventListener("abort",e)};this.then?.(r,r)}return this}r.d(e,{i:function(){return o}});class o{#s=0;#u=[];#l=!1;#c;#p=1;#f;#h;limit;constructor(t){this.limit="number"!=typeof t||0===t?1/0:t}#d(t){this.#s+=1;let e,r=!1;try{e=t()}catch(t){throw this.#s-=1,t}return{abort:t=>{r||(r=!0,this.#s-=1,e?.(t),this.#y())},done:()=>{r||(r=!0,this.#s-=1,this.#y())}}}#y(){queueMicrotask(()=>this.#m())}#m(){if(this.#l||this.#s>=this.limit)return;if(0===this.#u.length)return;const t=this.#u.shift();if(null==t)throw new Error("Invariant violation: next is null");const e=this.#d(t.fn);t.abort=e.abort,t.done=e.done}#v(t,e){const r={fn:t,priority:e?.priority||0,abort:()=>{this.#g(r)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=this.#u.findIndex(t=>r.priority>t.priority);return-1===n?this.#u.push(r):this.#u.splice(n,0,r),r}#g(t){const e=this.#u.indexOf(t);-1!==e&&this.#u.splice(e,1)}run(t,e){return!this.#l&&this.#s<this.limit?this.#d(t):this.#v(t,e)}wrapSyncFunction(t,e){return(...r)=>{const o=this.run(()=>(t(...r),queueMicrotask(()=>o.done()),()=>{}),e);return{abortOn:n,abort(){o.abort()}}}}wrapPromiseFunction(t,e){return(...r)=>{let o;const i=new Promise((n,i)=>{o=this.run(()=>{let e,a;try{a=Promise.resolve(t(...r))}catch(t){a=Promise.reject(t)}return a.then(t=>{e?i(e):(o.done(),n(t))},t=>{e?i(e):(o.done(),i(t))}),t=>{e=function(t){return new Error("Cancelled",{cause:t})}(t)}},e)});return i.abort=t=>{o.abort(t)},i.abortOn=n,i}}resume(){this.#l=!1,clearTimeout(this.#c);for(let t=0;t<this.limit;t++)this.#y()}#b=()=>this.resume();pause(t=null){this.#l=!0,clearTimeout(this.#c),null!=t&&(this.#c=setTimeout(this.#b,t))}rateLimit(t){clearTimeout(this.#h),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(this.#f=this.limit-1,this.limit=this.#p,this.#h=setTimeout(this.#w,t))}#w=()=>{if(this.#l)this.#h=setTimeout(this.#w,0);else{this.#p=this.limit,this.limit=Math.ceil((this.#f+this.#p)/2);for(let t=this.#p;t<=this.limit;t++)this.#y();this.#f-this.#p>3?this.#h=setTimeout(this.#w,2e3):this.#p=Math.floor(this.#p/2)}};get isPaused(){return this.#l}}Symbol("__queue")},9491:function(t,e,r){function n(t,e,r){const n=[];return t.forEach(t=>"string"!=typeof t?n.push(t):e[Symbol.split](t).forEach((t,e,o)=>{""!==t&&n.push(t),e<o.length-1&&n.push(r)})),n}function o(t,e){const r=/\$/g;let o=[t];if(null==e)return o;for(const t of Object.keys(e))if("_"!==t){let i=e[t];"string"==typeof i&&(i=r[Symbol.replace](i,"$$$$")),o=n(o,new RegExp(`%\\{${t}\\}`,"g"),i)}return o}r.d(e,{A:function(){return a}});const i=t=>{throw new Error(`missing string: ${t}`)};class a{locale;constructor(t,{onMissingKey:e=i}={}){this.locale={strings:{},pluralize(t){return 1===t?0:1}},Array.isArray(t)?t.forEach(this.#_,this):this.#_(t),this.#S=e}#S;#_(t){if(!t?.strings)return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...t.strings},pluralize:t.pluralize||e.pluralize})}translate(t,e){return this.translateArray(t,e).join("")}translateArray(t,e){let r=this.locale.strings[t];if(null==r&&(this.#S(t),r=t),"object"==typeof r){if(e&&void 0!==e.smart_count)return o(r[this.locale.pluralize(e.smart_count)],e);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof r)throw new Error("string was not a string");return o(r,e)}}},8284:function(t,e,r){r.d(e,{S:function(){return a},e:function(){return i}});const n=t=>"error"in t&&!!t.error,o=t=>t.progress.uploadComplete;function i(t){return t.filter(t=>!n(t)&&!o(t))}function a(t){return t.filter(t=>!t.progress?.uploadStarted||!t.isRestored)}},2289:function(t,e,r){function n(t,e){return!0===t?Object.keys(e):Array.isArray(t)?t:[]}r.d(e,{A:function(){return n}})},9420:function(t,e,r){function n(t,e){return Object.hasOwn(t,e)}r.d(e,{A:function(){return n}})},7853:function(t,e){e.A=function(t){return!!t&&4===t.readyState&&0===t.status}}}]);
@@ -0,0 +1,12 @@
1
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
2
+
3
+ /**
4
+ * Takes a string with placeholder variables like `%{smart_count} file selected`
5
+ * and replaces it with values from options `{smart_count: 5}`
6
+ *
7
+ * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
8
+ * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
9
+ *
10
+ * @param phrase that needs interpolation, with placeholders
11
+ * @param options with values that will be used to replace placeholders
12
+ */
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[727],{7727:function(){}}]);
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 951.cb178734.chunk.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[951],{5181:function(t,e,n){n.d(e,{FK:function(){return P},XX:function(){return q},fF:function(){return i},uA:function(){return S}});var o,i,l,r,_,s,u,a,p,c,f,d,h,m,g={},y=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,x=Array.isArray;function b(t,e){for(var n in e)t[n]=e[n];return t}function w(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function k(t,e,n,o,r){var _={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++l:r,__i:-1,__u:0};return null==r&&null!=i.vnode&&i.vnode(_),_}function P(t){return t.children}function S(t,e){this.props=t,this.context=e}function E(t,e){if(null==e)return t.__?E(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?E(t):null}function T(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,o=[],l=[],r=b({},e);r.__v=e.__v+1,i.vnode&&i.vnode(r),O(t.__P,r,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,o,null==n?E(e):n,!!(32&e.__u),l),r.__v=e.__v,r.__.__k[r.__i]=r,R(o,r,l),e.__e=e.__=null,r.__e!=n&&M(r)}}function M(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),M(t)}function U(t){(!t.__d&&(t.__d=!0)&&r.push(t)&&!A.__r++||_!=i.debounceRendering)&&((_=i.debounceRendering)||s)(A)}function A(){try{for(var t,e=1;r.length;)r.length>e&&r.sort(u),t=r.shift(),e=r.length,T(t)}finally{r.length=A.__r=0}}function C(t,e,n,o,i,l,r,_,s,u,a){var p,c,f,d,h,m,v,x=o&&o.__k||y,b=e.length;for(s=I(n,e,x,s,b),p=0;p<b;p++)null!=(f=n.__k[p])&&(c=-1!=f.__i&&x[f.__i]||g,f.__i=p,m=O(t,f,c,i,l,r,_,s,u,a),d=f.__e,f.ref&&c.ref!=f.ref&&(c.ref&&W(c.ref,null,f),a.push(f.ref,f.__c||d,f)),null==h&&null!=d&&(h=d),(v=!!(4&f.__u))||c.__k===f.__k?(s=D(f,s,t,v),v&&c.__e&&(c.__e=null)):"function"==typeof f.type&&void 0!==m?s=m:d&&(s=d.nextSibling),f.__u&=-7);return n.__e=h,s}function I(t,e,n,o,i){var l,r,_,s,u,a=n.length,p=a,c=0;for(t.__k=new Array(i),l=0;l<i;l++)null!=(r=e[l])&&"boolean"!=typeof r&&"function"!=typeof r?("string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?r=t.__k[l]=k(null,r,null,null,null):x(r)?r=t.__k[l]=k(P,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?r=t.__k[l]=k(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):t.__k[l]=r,s=l+c,r.__=t,r.__b=t.__b+1,_=null,-1!=(u=r.__i=$(r,n,s,p))&&(p--,(_=n[u])&&(_.__u|=2)),null==_||null==_.__v?(-1==u&&(i>a?c--:i<a&&c++),"function"!=typeof r.type&&(r.__u|=4)):u!=s&&(u==s-1?c--:u==s+1?c++:(u>s?c--:c++,r.__u|=4))):t.__k[l]=null;if(p)for(l=0;l<a;l++)null!=(_=n[l])&&!(2&_.__u)&&(_.__e==o&&(o=E(_)),X(_,_));return o}function D(t,e,n,o){var i,l;if("function"==typeof t.type){for(i=t.__k,l=0;i&&l<i.length;l++)i[l]&&(i[l].__=t,e=D(i[l],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=E(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function $(t,e,n,o){var i,l,r,_=t.key,s=t.type,u=e[n],a=null!=u&&!(2&u.__u);if(null===u&&null==_||a&&_==u.key&&s==u.type)return n;if(o>(a?1:0))for(i=n-1,l=n+1;i>=0||l<e.length;)if(null!=(u=e[r=i>=0?i--:l++])&&!(2&u.__u)&&_==u.key&&s==u.type)return r;return-1}function L(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||v.test(e)?n:n+"px"}function N(t,e,n,o,i){var l,r;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||L(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||L(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])l=e!=(e=e.replace(f,"$1")),r=e.toLowerCase(),e=r in t||"onFocusOut"==e||"onFocusIn"==e?r.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+l]=n,n?o?n[c]=o[c]:(n[c]=d,t.addEventListener(e,l?m:h,l)):t.removeEventListener(e,l?m:h,l);else{if("http://www.w3.org/2000/svg"==i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function z(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[p])e[p]=d++;else if(e[p]<n[c])return;return n(i.event?i.event(e):e)}}}function O(t,e,n,o,l,r,_,s,u,a){var p,c,f,d,h,m,g,v,k,E,T,M,U,A,I,D=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(u=!!(32&n.__u),r=[s=e.__e=n.__e]),(p=i.__b)&&p(e);t:if("function"==typeof D)try{if(v=e.props,k=D.prototype&&D.prototype.render,E=(p=D.contextType)&&o[p.__c],T=p?E?E.props.value:p.__:o,n.__c?g=(c=e.__c=n.__c).__=c.__E:(k?e.__c=c=new D(v,T):(e.__c=c=new S(v,T),c.constructor=D,c.render=K),E&&E.sub(c),c.state||(c.state={}),c.__n=o,f=c.__d=!0,c.__h=[],c._sb=[]),k&&null==c.__s&&(c.__s=c.state),k&&null!=D.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=b({},c.__s)),b(c.__s,D.getDerivedStateFromProps(v,c.__s))),d=c.props,h=c.state,c.__v=e,f)k&&null==D.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),k&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(k&&null==D.getDerivedStateFromProps&&v!==d&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(v,T),e.__v==n.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(v,c.__s,T)){e.__v!=n.__v&&(c.props=v,c.state=c.__s,c.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(t){t&&(t.__=e)}),y.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&_.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(v,c.__s,T),k&&null!=c.componentDidUpdate&&c.__h.push(function(){c.componentDidUpdate(d,h,m)})}if(c.context=T,c.props=v,c.__P=t,c.__e=!1,M=i.__r,U=0,k)c.state=c.__s,c.__d=!1,M&&M(e),p=c.render(c.props,c.state,c.context),y.push.apply(c.__h,c._sb),c._sb=[];else do{c.__d=!1,M&&M(e),p=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++U<25);c.state=c.__s,null!=c.getChildContext&&(o=b(b({},o),c.getChildContext())),k&&!f&&null!=c.getSnapshotBeforeUpdate&&(m=c.getSnapshotBeforeUpdate(d,h)),A=null!=p&&p.type===P&&null==p.key?j(p.props.children):p,s=C(t,x(A)?A:[A],e,n,o,l,r,_,s,u,a),c.base=e.__e,e.__u&=-161,c.__h.length&&_.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,u||null!=r)if(t.then){for(e.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;r[r.indexOf(s)]=null,e.__e=s}else{for(I=r.length;I--;)w(r[I]);F(e)}else e.__e=n.__e,e.__k=n.__k,t.then||F(e);i.__e(t,e,n)}else null==r&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=H(n.__e,e,n,o,l,r,_,u,a);return(p=i.diffed)&&p(e),128&e.__u?void 0:s}function F(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(F))}function R(t,e,n){for(var o=0;o<n.length;o++)W(n[o],n[++o],n[++o]);i.__c&&i.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){i.__e(t,e.__v)}})}function j(t){return"object"!=typeof t||null==t||t.__b>0?t:x(t)?t.map(j):void 0!==t.constructor?null:b({},t)}function H(t,e,n,l,r,_,s,u,a){var p,c,f,d,h,m,y,v=n.props||g,b=e.props,k=e.type;if("svg"==k?r="http://www.w3.org/2000/svg":"math"==k?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=_)for(p=0;p<_.length;p++)if((h=_[p])&&"setAttribute"in h==!!k&&(k?h.localName==k:3==h.nodeType)){t=h,_[p]=null;break}if(null==t){if(null==k)return document.createTextNode(b);t=document.createElementNS(r,k,b.is&&b),u&&(i.__m&&i.__m(e,_),u=!1),_=null}if(null==k)v===b||u&&t.data==b||(t.data=b);else{if(_="textarea"==k&&null!=b.defaultValue?null:_&&o.call(t.childNodes),!u&&null!=_)for(v={},p=0;p<t.attributes.length;p++)v[(h=t.attributes[p]).name]=h.value;for(p in v)h=v[p],"dangerouslySetInnerHTML"==p?f=h:"children"==p||p in b||"value"==p&&"defaultValue"in b||"checked"==p&&"defaultChecked"in b||N(t,p,null,h,r);for(p in b)h=b[p],"children"==p?d=h:"dangerouslySetInnerHTML"==p?c=h:"value"==p?m=h:"checked"==p?y=h:u&&"function"!=typeof h||v[p]===h||N(t,p,h,v[p],r);if(c)u||f&&(c.__html==f.__html||c.__html==t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(f&&(t.innerHTML=""),C("template"==e.type?t.content:t,x(d)?d:[d],e,n,l,"foreignObject"==k?"http://www.w3.org/1999/xhtml":r,_,s,_?_[0]:n.__k&&E(n,0),u,a),null!=_)for(p=_.length;p--;)w(_[p]);u&&"textarea"!=k||(p="value","progress"==k&&null==m?t.removeAttribute("value"):null!=m&&(m!==t[p]||"progress"==k&&!m||"option"==k&&m!=v[p])&&N(t,p,m,v[p],r),p="checked",null!=y&&y!=t[p]&&N(t,p,y,v[p],r))}return t}function W(t,e,n){try{if("function"==typeof t){var o="function"==typeof t.__u;o&&t.__u(),o&&null==e||(t.__u=t(e))}else t.current=e}catch(t){i.__e(t,n)}}function X(t,e,n){var o,l;if(i.unmount&&i.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||W(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){i.__e(t,e)}o.base=o.__P=null}if(o=t.__k)for(l=0;l<o.length;l++)o[l]&&X(o[l],e,n||"function"!=typeof t.type);n||w(t.__e),t.__c=t.__=t.__e=void 0}function K(t,e,n){return this.constructor(t,n)}function q(t,e,n){var l,r,_,s;e==document&&(e=document.documentElement),i.__&&i.__(t,e),r=(l="function"==typeof n)?null:n&&n.__k||e.__k,_=[],s=[],O(e,t=(!l&&n||e).__k=function(t,e,n){var i,l,r,_={};for(r in e)"key"==r?i=e[r]:"ref"==r?l=e[r]:_[r]=e[r];if(arguments.length>2&&(_.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===_[r]&&(_[r]=t.defaultProps[r]);return k(t,_,i,l,null)}(P,null,[t]),r||g,g,e.namespaceURI,!l&&n?[n]:r?null:e.firstChild?o.call(e.childNodes):null,_,!l&&n?n:r?r.__e:e.firstChild,l,s),R(_,t,s)}o=y.slice,i={__e:function(t,e,n,o){for(var i,l,r;e=e.__;)if((i=e.__c)&&!i.__)try{if((l=i.constructor)&&null!=l.getDerivedStateFromError&&(i.setState(l.getDerivedStateFromError(t)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,o||{}),r=i.__d),r)return i.__E=i}catch(e){t=e}throw t}},l=0,S.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=b({},this.state),"function"==typeof t&&(t=t(b({},n),this.props)),t&&b(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),U(this))},S.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),U(this))},S.prototype.render=P,r=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(t,e){return t.__v.__b-e.__v.__b},A.__r=0,a=Math.random().toString(8),p="__d"+a,c="__a"+a,f=/(PointerCapture)$|Capture$/i,d=0,h=z(!1),m=z(!0)},2729:function(t,e,n){n.d(e,{A:function(){return i}});var o=n(9491);class i{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(t,e){this.uppy=t,this.opts=e??{}}getPluginState(){const{plugins:t}=this.uppy.getState();return t?.[this.id]||{}}setPluginState(t){const{plugins:e}=this.uppy.getState();this.uppy.setState({plugins:{...e,[this.id]:{...e[this.id],...t}}})}setOptions(t){this.opts={...this.opts,...t},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const t=new o.A([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState(void 0)}addTarget(t){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(t){}afterUpdate(){}}},760:function(t,e,n){n.d(e,{A:function(){return r}});var o=n(5181),i=n(2729);class l extends i.A{#t;isTargetDOMEl;el;parent;title;getTargetPlugin(t){let e;if("function"==typeof t?.addTarget)e=t,e instanceof l||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:e,UIPlugin:l}}));else if("function"==typeof t){const n=t;this.uppy.iteratePlugins(t=>{t instanceof n&&(e=t)})}return e}mount(t,e){const n=e.id,i=function(t,e=document){return"string"==typeof t?e.querySelector(t):"object"==typeof(n=t)&&null!==n&&"nodeType"in n&&n.nodeType===Node.ELEMENT_NODE?t:null;var n}(t);if(i){this.isTargetDOMEl=!0;const e=document.createElement("div");return e.classList.add("uppy-Root"),this.#t=function(t){let e,n=null;return(...o)=>(e=o,n||(n=Promise.resolve().then(()=>(n=null,t(...e)))),n)}(t=>{this.uppy.getPlugin(this.id)&&((0,o.XX)(this.render(t,e),e),this.afterUpdate())}),this.uppy.log(`Installing ${n} to a DOM element '${t}'`),this.opts.replaceTargetContent&&(i.innerHTML=""),(0,o.XX)(this.render(this.uppy.getState(),e),e),this.el=e,i.appendChild(e),e.dir=this.opts.direction||function(t){for(;t&&!t.dir;)t=t.parentNode;return t?.dir}(e)||"ltr",this.onMount(),this.el}const l=this.getTargetPlugin(t);if(l)return this.uppy.log(`Installing ${n} to ${l.id}`),this.parent=l,this.el=l.addTarget(e),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let r=`Invalid target option given to ${n}.`;throw r+="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.",new Error(r)}render(t,e){throw new Error("Extend the render method to add your plugin to a DOM element")}update(t){null!=this.el&&this.#t?.(t)}unmount(){this.isTargetDOMEl&&this.el?.remove(),this.onUnmount()}onMount(){}onUnmount(){}}var r=l},9491:function(t,e,n){function o(t,e,n){const o=[];return t.forEach(t=>"string"!=typeof t?o.push(t):e[Symbol.split](t).forEach((t,e,i)=>{""!==t&&o.push(t),e<i.length-1&&o.push(n)})),o}function i(t,e){const n=/\$/g;let i=[t];if(null==e)return i;for(const t of Object.keys(e))if("_"!==t){let l=e[t];"string"==typeof l&&(l=n[Symbol.replace](l,"$$$$")),i=o(i,new RegExp(`%\\{${t}\\}`,"g"),l)}return i}n.d(e,{A:function(){return r}});const l=t=>{throw new Error(`missing string: ${t}`)};class r{locale;constructor(t,{onMissingKey:e=l}={}){this.locale={strings:{},pluralize(t){return 1===t?0:1}},Array.isArray(t)?t.forEach(this.#e,this):this.#e(t),this.#n=e}#n;#e(t){if(!t?.strings)return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...t.strings},pluralize:t.pluralize||e.pluralize})}translate(t,e){return this.translateArray(t,e).join("")}translateArray(t,e){let n=this.locale.strings[t];if(null==n&&(this.#n(t),n=t),"object"==typeof n){if(e&&void 0!==e.smart_count)return i(n[this.locale.pluralize(e.smart_count)],e);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof n)throw new Error("string was not a string");return i(n,e)}}},7544:function(t,e){e.A={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",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",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",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"}}}]);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Takes a string with placeholder variables like `%{smart_count} file selected`
3
+ * and replaces it with values from options `{smart_count: 5}`
4
+ *
5
+ * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
6
+ * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
7
+ *
8
+ * @param phrase that needs interpolation, with placeholders
9
+ * @param options with values that will be used to replace placeholders
10
+ */