easy-web-worker 6.2.3 → 7.0.0
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.
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
Hello and welcome to **easy-web-worker** with [cancelable-promise
|
|
5
|
+
Hello and welcome to **easy-web-worker** with [easy-cancelable-promise](https://www.npmjs.com/package/easy-cancelable-promise) – your go-to solution for seamless **Web Workers** integration, now enhanced with cancelable promises! 🚀
|
|
6
6
|
|
|
7
7
|
[Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) are a native tool provided by **JavaScript**, allowing you to use them within your favorite framework like **React**, **Angular**, **Vue**, and others, or with pure **JavaScript** and **TypeScript**.
|
|
8
8
|
|
|
@@ -89,7 +89,7 @@ const worker = new EasyWebWorker(new Worker('./worker.js')); // ƒ Worker() { [n
|
|
|
89
89
|
|
|
90
90
|
When working with **static files**, which can offer substantial benefits with web workers, you simply need to create an instance of **StaticEasyWebWorker**.
|
|
91
91
|
|
|
92
|
-
The **StaticEasyWebWorker** provides an interface to continue working with [cancelable-promise
|
|
92
|
+
The **StaticEasyWebWorker** provides an interface to continue working with [easy-cancelable-promise](https://www.npmjs.com/package/easy-cancelable-promise) and build more complex APIs within your worker.
|
|
93
93
|
|
|
94
94
|
From inside your worker, the message callbacks receive a message that includes multiple methods and functions. You can use these to communicate back with the main thread, or to subscribe to and react to the lifecycle of a worker.
|
|
95
95
|
|
|
@@ -152,7 +152,7 @@ onMessage('readCSV', (message) => {
|
|
|
152
152
|
|
|
153
153
|
It's important to mention that the **cancel** method is the only one that provides two-way binding. It can travel all the way from the main thread to the worker, cancel something inside the worker, and notify the main thread upon completion.
|
|
154
154
|
|
|
155
|
-
**easy-web-worker** is designed to enhance the capabilities of the **Worker** class by integrating a pattern of cancelable promises from the [cancelable-promise
|
|
155
|
+
**easy-web-worker** is designed to enhance the capabilities of the **Worker** class by integrating a pattern of cancelable promises from the [easy-cancelable-promise](https://www.npmjs.com/package/easy-cancelable-promise) library. For straightforward tasks, it simplifies the process by eliminating the need to configure webpack or other bundlers. And for more complex requirements, the **StaticEasyWebWorker** class allows the integration of easy worker and cancelable promises capabilities into your static workers.
|
|
156
156
|
|
|
157
157
|
Start enhancing your applications with robust, cancelable promises and easy web worker integration today! 🌐
|
|
158
158
|
|
package/lib/EasyWebWorker.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EasyWebWorkerMessage } from './EasyWebWorkerMessage';
|
|
2
|
-
import { CancelablePromise, Subscription } from 'cancelable-promise
|
|
2
|
+
import { CancelablePromise, Subscription } from 'easy-cancelable-promise';
|
|
3
3
|
/**
|
|
4
4
|
* EasyWorker Config
|
|
5
5
|
* */
|
|
@@ -227,7 +227,7 @@ export interface IEasyWebWorkerMessage<TPayload = null, TResult = void> {
|
|
|
227
227
|
*/
|
|
228
228
|
readonly onFinalize: (callback: TMessageCallback) => Subscription;
|
|
229
229
|
}
|
|
230
|
-
export declare const createBlobWorker: <IPayload = null, IResult = void, TPrimitiveParameters extends any[] = unknown[]>(source: EasyWebWorkerBody<IPayload, IResult
|
|
230
|
+
export declare const createBlobWorker: <IPayload = null, IResult = void, TPrimitiveParameters extends any[] = unknown[]>(source: EasyWebWorkerBody<IPayload, IResult> | EasyWebWorkerBody<IPayload, IResult>[], imports?: string[], { primitiveParameters, }?: {
|
|
231
231
|
primitiveParameters?: TPrimitiveParameters;
|
|
232
232
|
}) => string;
|
|
233
233
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { EasyWebWorker, EasyWebWorkerBody, IWorkerConfig } from './EasyWebWorker';
|
|
2
|
-
export declare const createEasyWebWorker: <TPayload = null, TResult = void>(source:
|
|
2
|
+
export declare const createEasyWebWorker: <TPayload = null, TResult = void>(source: EasyWebWorkerBody<TPayload, TResult> | EasyWebWorkerBody<TPayload, TResult>[] | string | URL | Worker | Worker[], parameters?: Partial<IWorkerConfig>) => EasyWebWorker<TPayload, TResult, unknown[]>;
|
package/lib/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see bundle.js.LICENSE.txt */
|
|
2
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["easy-web-worker"]=r():e["easy-web-worker"]=r()}(this,(()=>{return e={797:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.createEasyWebWorker=void 0;var n=t(30);r.createEasyWebWorker=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new n.EasyWebWorker(e,r)}},30:(e,r,t)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a,i,c=[],s=!0,l=!1;try{if(a=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=a.call(t)).done)&&(c.push(n.value),c.length!==r);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||a(e,r)||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 a(e,r){if(e){if("string"==typeof e)return i(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,r):void 0}}function i(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function c(){c=function(){return e};var e={},r=Object.prototype,t=r.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{u({},"")}catch(e){u=function(e,r,t){return e[r]=t}}function f(e,r,t,n){var a=r&&r.prototype instanceof d?r:d,i=Object.create(a.prototype),c=new C(n||[]);return o(i,"_invoke",{value:j(e,t,c)}),i}function h(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var p={};function d(){}function v(){}function y(){}var m={};u(m,i,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==r&&t.call(b,i)&&(m=b);var w=y.prototype=d.prototype=Object.create(m);function k(e){["next","throw","return"].forEach((function(r){u(e,r,(function(e){return this._invoke(r,e)}))}))}function P(e,r){function a(o,i,c,s){var l=h(e[o],e,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==n(f)&&t.call(f,"__await")?r.resolve(f.__await).then((function(e){a("next",e,c,s)}),(function(e){a("throw",e,c,s)})):r.resolve(f).then((function(e){u.value=e,c(u)}),(function(e){return a("throw",e,c,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,t){function n(){return new r((function(r,n){a(e,t,r,n)}))}return i=i?i.then(n,n):n()}})}function j(e,r,t){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(t.method=o,t.arg=a;;){var i=t.delegate;if(i){var c=O(i,t);if(c){if(c===p)continue;return c}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if("suspendedStart"===n)throw n="completed",t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);n="executing";var s=h(e,r,t);if("normal"===s.type){if(n=t.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:t.done}}"throw"===s.type&&(n="completed",t.method="throw",t.arg=s.arg)}}}function O(e,r){var t=r.method,n=e.iterator[t];if(void 0===n)return r.delegate=null,"throw"===t&&e.iterator.return&&(r.method="return",r.arg=void 0,O(e,r),"throw"===r.method)||"return"!==t&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+t+"' method")),p;var o=h(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,p):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function E(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function x(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function _(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function r(){for(;++n<e.length;)if(t.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=void 0,r.done=!0,r};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return v.prototype=y,o(w,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===v||"GeneratorFunction"===(r.displayName||r.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,l,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},k(P.prototype),u(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(r,t,n,o,a){void 0===a&&(a=Promise);var i=new P(f(r,t,n,o),a);return e.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(w),u(w,l,"Generator"),u(w,i,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=_,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&t.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t,n){return i.type="throw",i.arg=e,r.next=t,n&&(r.method="next",r.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=t.call(a,"catchLoc"),s=t.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&t.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=r,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(i)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),x(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;x(t)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,t){return this.delegate={iterator:_(e),resultName:r,nextLoc:t},"next"===this.method&&(this.arg=void 0),p}},e}function s(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(void 0,a=function(e,r){if("object"!==n(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===n(a)?a:String(a)),o)}var a}var l=function(e,r,t,n){return new(t||(t=Promise))((function(o,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function c(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(i,c)}s((n=n.apply(e,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:!0}),r.EasyWebWorker=r.createBlobWorker=void 0;var u=t(213),f=t(726),h=t(367);r.createBlobWorker=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).primitiveParameters,n=void 0===t?[]:t,o=Array.isArray(e)?e:[e],a="".concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.length?'self.importScripts(["'.concat(e.join('","'),'"]);'):""}(r),"self.primitiveParameters=JSON.parse(`").concat(JSON.stringify(null!=n?n:[]),"`);let ew$=").concat((0,f.getWorkerTemplate)(),";let cn$=self;").concat(o.map((function(e){return"\n(".concat(null==e?void 0:e.toString().trim(),")(ew$,cn$);")})).join(""));return(window.URL||window.webkitURL).createObjectURL(new Blob([a],{type:"application/javascript"}))};var p=function(){function e(r){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.source=r,this.workerUrl=null,this.config=null,this.maxWorkers=1,this.workers=[],this.keepAlive=!0,this.warmUpWorkers=!1,this.terminationDelay=1e3,this.primitiveParameters=[],this.messagesQueue=new Map,this.scripts=[],this.warmUp=function(){var e=t.config,r=e.warmUpWorkers,n=e.maxWorkers;r&&new Array(n).fill(null).forEach((function(){return t.getWorkerFromPool()}))},this.fillWorkerMethods=function(e){return e.onmessage=function(e){t.executeMessageCallback(e)},e.onerror=function(e){var r=t.config.onWorkerError;if(!r)throw e;r(e)},e},this.createNewWorker=function(){var e,r=t.workerUrl,n=t.config.workerOptions;n.name=0===(e=t.workers.length)?n.name:"".concat(n.name,"-").concat(e);var o=new Worker(r,n);return t.fillWorkerMethods(o)},this.getWorkerFromPool=function(){var e=t.config,r=e.maxWorkers,n=e.warmUpWorkers,o=t.messagesQueue.size;if(!t.workers.length||t.workers.length<r&&(o||n)){var a=t.createNewWorker();return t.workers.push(a),a}var i=t.workers.shift();return t.workers.push(i),i},this.computeWorkerBaseSource=function(){var e=function(){var e,r;if(t.source instanceof Worker)return t.workers=[t.fillWorkerMethods(t.source)],{isArrayOfWebWorkers:!1,workerUrl:null};var n="string"==typeof t.source||t.source instanceof URL,o="function"==typeof t.source;if(n||o)return{isArrayOfWebWorkers:!1,workerUrl:null!==(e=t.workerUrl)&&void 0!==e?e:t.getWorkerUrl()};var a=Array.isArray(t.source);if(a&&"function"==typeof t.source[0])return{isArrayOfWebWorkers:!1,workerUrl:null!==(r=t.workerUrl)&&void 0!==r?r:t.getWorkerUrl()};var i=a&&t.source[0]instanceof Worker;return i?(t.workers=t.source.map(t.fillWorkerMethods),{isArrayOfWebWorkers:i,workerUrl:null}):{isArrayOfWebWorkers:!1,workerUrl:null}}(),r=e.workerUrl,n=e.isArrayOfWebWorkers;return t.workerUrl=r,t.config.maxWorkers=n?t.workers.length:t.config.maxWorkers,{isArrayOfWebWorkers:n}},this.send=function(e,r){return t.sendToWorker({payload:e},r)},this.sendToWorker=function(e,r){var n,o,a=e.payload,i=e.method,c=new u.EasyWebWorkerMessage,s=c.messageId,l=c.decoupledPromise,f=t.getWorkerFromPool();l.promise.cancel=function(e){l.promise.cancel=l._cancel;var n={messageId:s,method:i,cancelation:{reason:e}};return t.workers.length?(f.postMessage(n,r),l.promise):l.cancel(e)},t.config.keepAlive||null===(o=null===(n=l.promise)||void 0===n?void 0:n.finally)||void 0===o||o.call(n,(function(){setTimeout((function(){t.messagesQueue.size||(t.workers.forEach((function(e){return e.terminate()})),t.workers=[])}),t.config.terminationDelay)})),t.addMessageToQueue(c);var h={messageId:s,method:i,execution:{payload:a}};return f.postMessage(h,r),l.promise},this.override=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=r[0],a=r[1],i=r[2];return new h.CancelablePromise((function(e,r,n){var s=n.onCancel;return l(t,void 0,void 0,c().mark((function r(){var t,n;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=this.cancelAll(a,i),n=s((function(){t.cancel()})),r.next=4,t;case 4:n(),e(this.send.apply(this,[o]));case 6:case"end":return r.stop()}}),r,this)})))}))},this.overrideAfterCurrent=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var a=r[0],i=r[1],s=r[2];return new h.CancelablePromise((function(e,r,n){var u=n.onCancel,f=n.reportProgress;return l(t,void 0,void 0,c().mark((function r(){var t,n,l,h,p,d;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.messagesQueue.size){r.next=10;break}return t=o(this.messagesQueue,1),n=t[0],l=o(n,2),h=l[1],this.RemoveMessageFromQueue(h.messageId),p=this.cancelAll(i,s).onProgress(f),d=u((function(){p.cancel()})),this.addMessageToQueue(h),r.next=9,p;case 9:d();case 10:e(this.send.apply(this,[a]));case 11:case"end":return r.stop()}}),r,this)})))}))},this.workerUrl="string"==typeof r||r instanceof URL?r:null;var a=null!=n?n:{},i=a.scripts,s=void 0===i?[]:i,p=a.name,d=a.onWorkerError,v=void 0===d?null:d,y=a.maxWorkers,m=void 0===y?1:y,g=a.terminationDelay,b=void 0===g?1e3:g,w=a.primitiveParameters,k=a.workerOptions,P=void 0===k?{}:k,j="boolean"==typeof(null==n?void 0:n.warmUpWorkers)?n.warmUpWorkers:!(1!==m),O="boolean"==typeof(null==n?void 0:n.keepAlive)?n.keepAlive:j;this.config={scripts:null!=s?s:[],name:p,maxWorkers:m,keepAlive:O,warmUpWorkers:j,workerOptions:Object.assign(Object.assign({},null!=P?P:{}),{name:P.name||(0,f.generatedId)()}),onWorkerError:v,terminationDelay:b,primitiveParameters:w},this.workerOptions=this.config.workerOptions,this.name=this.workerOptions.name,this.scripts=s,this.onWorkerError=v,this.maxWorkers=m,this.terminationDelay=b,this.warmUpWorkers=j,this.primitiveParameters=null!=w?w:[],O=!!this.computeWorkerBaseSource().isArrayOfWebWorkers||O,this.keepAlive=O,this.config.keepAlive=O,this.warmUp()}var t,n;return t=e,n=[{key:"worker",get:function(){return this.workers.length>1?null:this.workers[0]}},{key:"isExternalWorkerFile",get:function(){return"string"==typeof this.source||this.source instanceof URL}},{key:"RemoveMessageFromQueue",value:function(e){this.messagesQueue.delete(e)}},{key:"executeMessageCallback",value:function(e){var r,t,n=null!==(r=this.messagesQueue.get(e.data.messageId))&&void 0!==r?r:null;if(n){var o=e.data.progress;if(this.workers.length){var c=n.decoupledPromise;if(o){var s=o.percentage,l=o.payload;c.reportProgress(s,l)}else{this.RemoveMessageFromQueue(n.messageId);var u=e.data.worker_cancelation;if(u){var f=u.reason;c._cancel(f)}else{var h=e.data.rejected;if(h){var p=h.reason;c.reject(p)}else{var d=e.data.resolved.payload;c.resolve.apply(c,function(e){if(Array.isArray(e))return i(e)}(t=null!=d?d:[])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||a(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}}}}else this.RemoveMessageFromQueue(n.messageId)}}},{key:"getWorkerUrl",value:function(){if(this.isExternalWorkerFile)return this.source;var e=this.config,t=e.primitiveParameters,n=e.scripts;return(0,r.createBlobWorker)(this.source,n,{primitiveParameters:t})}},{key:"cancelAll",value:function(e){var r=this,t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).force,n=void 0!==t&&t;return new h.CancelablePromise((function(t,o,a){var i=a.onCancel,s=a.reportProgress;return l(r,void 0,void 0,c().mark((function r(){var o,a,l,u,f,p;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(l=Array.from(null!==(a=null===(o=this.messagesQueue)||void 0===o?void 0:o.values())&&void 0!==a?a:[]),u=l.length,f=100/u,!n){r.next=5;break}return r.abrupt("return",t(this.reboot(e)));case 5:p=(0,h.groupAsCancelablePromise)(l.map((function(r){return r.decoupledPromise.promise.cancel(e).catch((function(e){return s(f,e),e}))}))),i((function(){p.cancel()})),t(p);case 8:case"end":return r.stop()}}),r,this)})))}))}},{key:"addMessageToQueue",value:function(e){this.messagesQueue.set(e.messageId,e)}},{key:"sendToMethod",value:function(e,r,t){return this.sendToWorker({method:e,payload:r},t)}},{key:"reboot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Worker was rebooted";if(!this.workerUrl)throw new Error("You can not reboot a worker that was created from a Worker Instance");this.workers.forEach((function(e){return e.terminate()})),this.workers=[];var r=this.cancelAll(e);return this.warmUp(),r}},{key:"dispose",value:function(){return l(this,void 0,void 0,c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cancelAll(null);case 2:this.workerUrl&&(window.URL||window.webkitURL).revokeObjectURL("string"==typeof this.workerUrl?this.workerUrl:this.workerUrl.href),this.workers.forEach((function(e){return e.terminate()})),this.workers=[];case 5:case"end":return e.stop()}}),e,this)})))}}],n&&s(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();r.EasyWebWorker=p},726:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getWorkerTemplate=r.generatedId=void 0,r.generatedId=function(){return"".concat(Date.now()).concat(Math.random().toString(36).substring(2,9))},r.getWorkerTemplate=function(){return'(()=>{let e=new Map,o=new Map([["",()=>{throw"you didn\'t define a message-callback, please assign a callback by calling easyWorker.onMessage"}]]),t=({messageId:o,payload:t,method:n})=>{let a="pending",r=new Map,s=(t,s,l=[])=>{let c=a,i="progress"===t?"pending":t;if(!e.has(o)){let g="%c#"+o+" Message Not Found: %cThis means that the message was already resolved | rejected | canceled. To avoid this error, please make sure that you are not resolving | rejecting | canceling the same message twice. Also make sure that you are not reporting progress after the message was processed. Remember each message can handle his one cancelation by adding a handler with the %cmessage.onCancel%c method. To now more about this method, please check the documentation at: %chttps://www.npmjs.com/package/easy-web-worker#ieasywebworkermessageipayload--null-iresult--void %cTrying to process message:";console.error(g,"color: darkorange; font-size: 12px; font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;","color: lightblue; font-size: 10px; font-weight: bold;","font-weight: bold; color: darkorange;",{messageId:o,status:{current:c,target:i},method:n,action:s});return}let d={resolved:"onResolve",rejected:"onReject",canceled:"onCancel",worker_cancelation:"onCancel",pending:"onProgress"}[i],h=r.get(d);h?.forEach(e=>e(s,l));let w=!s.progress;w&&(r.get("onFinalize")?.forEach(e=>e(s,l)),e.delete(o)),self.postMessage({messageId:o,...s},l),a=i},l=(e,o=[])=>s("resolved",{resolved:{payload:void 0===e?[]:[e]}},o),c=(e,o=[])=>{s("rejected",{rejected:{reason:e}},o)},i=(e,o=[])=>s("worker_cancelation",{worker_cancelation:{reason:e}},o),g=(e,o,t=[])=>{s("progress",{progress:{percentage:e,payload:o}},t)},d=e=>o=>{r.has(e)||r.set(e,new Set);let t=r.get(e);return t.add(o),()=>t.delete(o)};return{messageId:o,method:n,payload:t,getStatus:()=>a,isPending:()=>"pending"===a,resolve:l,reject:c,cancel:i,reportProgress:g,onResolve:d("onResolve"),onReject:d("onReject"),onCancel:d("onCancel"),onProgress:d("onProgress"),onFinalize:d("onFinalize")}},n=(...e)=>{let[t,n]=e,a="string"==typeof t;if(a){let r=t,s=n;o.set(r,s);return}let l=t;o.set("",l)},a=()=>{let o=[...e.values()];o.forEach(e=>e.reject(Error("worker closed"))),self.close()};self.onmessage=n=>{let{data:a}=n,{messageId:r,cancelation:s}=a;if(s){let{reason:l}=s,c=e.get(r);c.cancel(l);return}let{method:i,execution:g}=n.data,{payload:d}=g,h=t({method:i,messageId:r,payload:d});e.set(r,h);let w=o.get(i||"");w(h,n)};let r=(...e)=>{self.importScripts(...e)};return{onMessage:n,close:a,importScripts:r}})()'}},213:(e,r,t)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(void 0,a=function(e,r){if("object"!==n(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===n(a)?a:String(a)),o)}var a}function a(e,r,t){return r&&o(e.prototype,r),t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(r,"__esModule",{value:!0}),r.EasyWebWorkerMessage=void 0;var i=t(367),c=t(726),s=a((function e(){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.messageId=(0,c.generatedId)(),this.decoupledPromise=(0,i.createDecoupledPromise)(),this.decoupledPromise._cancel=this.decoupledPromise.promise.cancel}));r.EasyWebWorkerMessage=s},973:(e,r)=>{"use strict";function t(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}Object.defineProperty(r,"__esModule",{value:!0}),r.createStaticEasyWebWorker=r.StaticEasyWebWorker=void 0,r.StaticEasyWebWorker=function(e){var r,n,o=(r=new Map,n=new Map([["",function(){throw"you didn't defined a message-callback, please assign a callback by calling easyWorker.onMessage"}]]),self.onmessage=function(e){var t=e.data,o=t.messageId,a=t.cancelation;if(a){var i=a.reason;r.get(o).cancel(i)}else{var c=e.data,s=c.method,l=function(e){var t=e.messageId,n=e.payload,o=e.method,a="pending",i=new Map,c=function(e,n){var c,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=a,u="progress"===e?"pending":e;if(r.has(t)){var f={resolved:"onResolve",rejected:"onReject",canceled:"onCancel",worker_cancelation:"onCancel",pending:"onProgress"}[u],h=i.get(f);null==h||h.forEach((function(e){return e(n,s)})),!n.progress&&(null===(c=i.get("onFinalize"))||void 0===c||c.forEach((function(e){return e(n,s)})),r.delete(t)),self.postMessage(Object.assign({messageId:t},n),s),a=u}else{var p="%c#"+t+" Message Not Found: %cThis means that the message was already resolved | rejected | canceled. To avoid this error, please make sure that you are not resolving | rejecting | canceling the same message twice. Also make sure that you are not reporting progress after the message was processed. Remember each message can handle his one cancelation by adding a handler with the %cmessage.onCancel%c method. To now more about this method, please check the documentation at: %chttps://www.npmjs.com/package/easy-web-worker#ieasywebworkermessageipayload--null-iresult--void %cTrying to process message:";console.error(p,"color: darkorange; font-size: 12px; font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;","color: lightblue; font-size: 10px; font-weight: bold;","font-weight: bold; color: darkorange;",{messageId:t,status:{current:l,target:u},method:o,action:n})}},s=function(e){return function(r){i.has(e)||i.set(e,new Set);var t=i.get(e);return t.add(r),function(){return t.delete(r)}}};return{messageId:t,method:o,payload:n,getStatus:function(){return a},isPending:function(){return"pending"===a},resolve:function(e){return c("resolved",{resolved:{payload:void 0===e?[]:[e]}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])},reject:function(e){c("rejected",{rejected:{reason:e}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])},cancel:function(e){return c("worker_cancelation",{worker_cancelation:{reason:e}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])},reportProgress:function(e,r){c("progress",{progress:{percentage:e,payload:r}},arguments.length>2&&void 0!==arguments[2]?arguments[2]:[])},onResolve:s("onResolve"),onReject:s("onReject"),onCancel:s("onCancel"),onProgress:s("onProgress"),onFinalize:s("onFinalize")}}({method:s,messageId:o,payload:c.execution.payload});r.set(o,l),n.get(s||"")(l,e)}},{onMessage:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var o=r[0],a=r[1];if("string"==typeof o){var i=o,c=a;n.set(i,c)}else{var s=o;n.set("",s)}},close:function(){var e;(e=r.values(),function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(e){if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(e){return e.reject(new Error("worker closed"))})),self.close()},importScripts:function(){var e;(e=self).importScripts.apply(e,arguments)}}),a=o.close,i=o.onMessage,c=o.importScripts;this.close=a,this.onMessage=i,this.importScripts=c,e&&i(e)},r.createStaticEasyWebWorker=function(e){return new r.StaticEasyWebWorker(e)}},991:(e,r,t)=>{"use strict";var n=Object.create?function(e,r,t,n){void 0===n&&(n=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,o)}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]},o=function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||n(r,e,t)};Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=t(30);Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a.EasyWebWorker}}),o(t(30),r),o(t(973),r),o(t(797),r)},367:function(e){var r;r=()=>(()=>{"use strict";var e={399:(e,r,t)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.CancelablePromise=void 0;var o=t(716);function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,r,t){var n=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=f(e)););return e}(e,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(arguments.length<3?e:t):o.value}},i.apply(this,arguments)}function c(e){var r="function"==typeof Map?new Map:void 0;return c=function(e){if(null===e||(t=e,-1===Function.toString.call(t).indexOf("[native code]")))return e;var t;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return s(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)},c(e)}function s(e,r,t){return s=l()?Reflect.construct.bind():function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&u(o,t.prototype),o},s.apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function u(e,r){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},u(e,r)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}var h=function(e){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&u(e,r)}(h,e);var r,t,o,c,s=(o=h,c=l(),function(){var e,r=f(o);if(c){var t=f(this).constructor;e=Reflect.construct(r,arguments,t)}else e=r.apply(this,arguments);return function(e,r){if(r&&("object"===n(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return a(e)}(this,e)});function h(e){var r,t,n,o,c,l;return function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,h),(o=s.call(this,(function(e,r){c=e,l=r}))).status="pending",o.cancelCallbacks=new Set,o.ownCancelCallbacks=new Set,o.onProgressCallbacks=new Set,o.disposeCallbacks=function(){o.cancelCallbacks=new Set,o.ownCancelCallbacks=new Set,o.onProgressCallbacks=new Set},o.subscribeToOwnCancelEvent=function(e){return o.ownCancelCallbacks.add(e),function(){o.ownCancelCallbacks.delete(e)}},o.cancel=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return"pending"!==o.status||(o.status="canceled",o.ownCancelCallbacks.forEach((function(r){return r(e)})),o.cancelCallbacks.forEach((function(r){return r(e)})),o._reject(e),o.disposeCallbacks()),a(o)},o.onCancel=function(e){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).signal;return o.cancelCallbacks.add(e),null==r||r.subscribe((function(){o.cancelCallbacks.delete(e)})),a(o)},o.onProgress=function(e){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).signal;return o.onProgressCallbacks.add(e),null==r||r.subscribe((function(){o.onProgressCallbacks.delete(e)})),a(o)},o.reportProgress=function(e,r){return o.onProgressCallbacks.forEach((function(t){return t(e,r)})),a(o)},o.createChildPromise=function(){var e,r,t=new h((function(t,n,o){e=t,r=n}));return t.onProgressCallbacks=o.onProgressCallbacks,t.onCancel((function(e){o.cancel(e)})),{promise:t,resolve:e,reject:r}},o._resolve=c,o._reject=l,e((function(e){o.status="resolved",o.disposeCallbacks(),o._resolve(e)}),(function(e){o.status="rejected",o.disposeCallbacks(),o._reject(e)}),{cancel:function(e){return o.cancel(e)},onCancel:function(e){return o.subscribeToOwnCancelEvent(e)},onProgress:function(e){return o.onProgress(e),function(){o.onProgressCallbacks.delete(e)}},reportProgress:function(e,r){o.reportProgress(e,r)}}),o.then=function(e,t){var n=o.createChildPromise(),c=n.promise,s=n.resolve,l=n.reject;return i((r=a(o),f(h.prototype)),"then",r).call(r,e,t).then(s,l),c},o.catch=function(e){var r=o.createChildPromise(),n=r.promise,c=r.resolve,s=r.reject;return i((t=a(o),f(h.prototype)),"catch",t).call(t,e).then(c,s),n},o.finally=function(e){var r=o.createChildPromise(),t=r.promise,c=r.resolve,s=r.reject;return i((n=a(o),f(h.prototype)),"finally",n).call(n,e).then(c,s),t},o}return r=h,t=[{key:"resolve",value:function(e){return new h((function(r){return r(e)}))}}],t&&function(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(a=function(e,r){if("object"!==n(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===n(a)?a:String(a)),o)}var a}(r,t),Object.defineProperty(r,"prototype",{writable:!1}),h}(c(Promise));r.CancelablePromise=h,h.reject=function(e){return new h((function(r,t){return t(e)}))},h.canceled=function(e){return new h((function(r,t,n){return(0,n.cancel)(e)}))},h.race=function(e){return new h((function(r,t,n){var a=n.onCancel,i=n.cancel;e.forEach((function(e){var n=(0,o.toCancelablePromise)(e);a((function(){n.cancel()})),n.then(r,(function(e){"canceled"!==n.status?t(e):i(e)}))}))}))},h.all=function(e){return new h((function(r,t,n){var a=n.onCancel,i=n.cancel,c=new Map,s=e.length,l=0;e.forEach((function(e){var n=(0,o.toCancelablePromise)(e);c.set(n,null),a((function(){n.cancel()})),n.then((function(e){l++,c.set(n,e),l===s&&r(Array.from(c.values()))}),(function(e){"canceled"!==n.status?t(e):i(e)}))}))}))},h.allSettled=function(e){return new h((function(r,t,n){var a=n.onCancel,i=new Map,c=e.length,s=0;e.forEach((function(e){var t=(0,o.toCancelablePromise)(e);i.set(t,null),a((function(){t.cancel()})),t.then((function(e){i.set(t,{status:"fulfilled",value:e})}),(function(e){i.set(t,{status:"canceled"===t.status?"canceled":"rejected",reason:e})})).finally((function(){++s===c&&r(Array.from(i.values()))}))}))}))},h.prototype.constructor=Promise},716:(e,r,t)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.toCancelablePromise=r.isPromise=r.groupAsCancelablePromise=r.createDecoupledPromise=r.allSettledCancelable=void 0;var o=t(335),a=t(399);function i(){i=function(){return e};var e={},r=Object.prototype,t=r.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{u({},"")}catch(e){u=function(e,r,t){return e[r]=t}}function f(e,r,t,n){var a=r&&r.prototype instanceof d?r:d,i=Object.create(a.prototype),c=new C(n||[]);return o(i,"_invoke",{value:j(e,t,c)}),i}function h(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var p={};function d(){}function v(){}function y(){}var m={};u(m,c,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==r&&t.call(b,c)&&(m=b);var w=y.prototype=d.prototype=Object.create(m);function k(e){["next","throw","return"].forEach((function(r){u(e,r,(function(e){return this._invoke(r,e)}))}))}function P(e,r){function a(o,i,c,s){var l=h(e[o],e,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==n(f)&&t.call(f,"__await")?r.resolve(f.__await).then((function(e){a("next",e,c,s)}),(function(e){a("throw",e,c,s)})):r.resolve(f).then((function(e){u.value=e,c(u)}),(function(e){return a("throw",e,c,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,t){function n(){return new r((function(r,n){a(e,t,r,n)}))}return i=i?i.then(n,n):n()}})}function j(e,r,t){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(t.method=o,t.arg=a;;){var i=t.delegate;if(i){var c=O(i,t);if(c){if(c===p)continue;return c}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if("suspendedStart"===n)throw n="completed",t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);n="executing";var s=h(e,r,t);if("normal"===s.type){if(n=t.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:t.done}}"throw"===s.type&&(n="completed",t.method="throw",t.arg=s.arg)}}}function O(e,r){var t=r.method,n=e.iterator[t];if(void 0===n)return r.delegate=null,"throw"===t&&e.iterator.return&&(r.method="return",r.arg=void 0,O(e,r),"throw"===r.method)||"return"!==t&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+t+"' method")),p;var o=h(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,p):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function E(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function x(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function _(e){if(e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function r(){for(;++n<e.length;)if(t.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=void 0,r.done=!0,r};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return v.prototype=y,o(w,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===v||"GeneratorFunction"===(r.displayName||r.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,l,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},k(P.prototype),u(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(r,t,n,o,a){void 0===a&&(a=Promise);var i=new P(f(r,t,n,o),a);return e.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(w),u(w,l,"Generator"),u(w,c,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=_,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&t.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t,n){return i.type="throw",i.arg=e,r.next=t,n&&(r.method="next",r.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=t.call(a,"catchLoc"),s=t.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&t.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=r,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(i)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),x(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;x(t)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,t){return this.delegate={iterator:_(e),resultName:r,nextLoc:t},"next"===this.method&&(this.arg=void 0),p}},e}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}r.createDecoupledPromise=function(){var e,r,t,n=new a.CancelablePromise((function(n,o,a){e=n,r=o,t=a}));return Object.assign(Object.assign({resolve:e,reject:r},t),{promise:n})};var s=function e(r){if(r instanceof a.CancelablePromise)return r;if("function"==typeof r)return e(r());if(!u(r))return new a.CancelablePromise((function(e){return e(r)}));var t,n,o=new a.CancelablePromise((function(e,o,a){t=e,n=o,r.then(t,n)}));return o.onCancel((function(e){n(e)})),o};r.toCancelablePromise=s;var l=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.length)return null;var t,n=r.maxConcurrent,o=void 0===n?8:n,i=r.executeInOrder,l=void 0!==i&&i,u=r.beforeEachCallback,f=void 0===u?null:u,h=r.afterEachCallback,p=void 0===h?null:h,d=r.onQueueEmptyCallback,v=void 0===d?null:d,y=function(e){if(Array.isArray(e))return c(e)}(t=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,r){if(e){if("string"==typeof e)return c(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,r):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),m=[];return new a.CancelablePromise((function(r,t,n){(function r(){if(y.length){var t=y.splice(0,o).map((function(r){var t="function"==typeof r?r():r;null==f||f();var o=s(t),a=n.onCancel((function(){o.cancel()}));return o.then((function(r){var t,o;a(),m.push(r),null==p||p(r),n.reportProgress((null!==(t=m.length)&&void 0!==t?t:1)/(null!==(o=e.length)&&void 0!==o?o:1)*100)})),l?o.then((function(e){return e})):o}));return Promise.all(t).then((function(){return r()}))}})().then((function(){null==v||v(m),r(m)}))}))};r.groupAsCancelablePromise=l;var u=function(e){return Promise.resolve(e)===e};r.isPromise=u,r.allSettledCancelable=function(e){var r=[],t=e.map((function(e){var t=s(e);return r.push(t),(0,o.tryCatchPromise)((function(){return t})).then((function(e){return{error:e.error,result:e.result,promise:t}}))})),n=l(r);return new a.CancelablePromise((function(e,r,o){return a=void 0,c=i().mark((function r(){var a,c;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=o.onCancel(n.cancel),r.next=3,Promise.all(t);case 3:c=r.sent,a(),e(c);case 6:case"end":return r.stop()}}),r)})),new(a||(a=Promise))((function(e,r){function t(e){try{o(c.next(e))}catch(e){r(e)}}function n(e){try{o(c.throw(e))}catch(e){r(e)}}function o(r){var o;r.done?e(r.value):(o=r.value,o instanceof a?o:new a((function(e){e(o)}))).then(t,n)}o((c=c.apply(void 0,[])).next())}));var a,c}))}},522:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0});var n=t(399);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===n[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return n[e]}}))}));var o=t(716);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===o[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))}))},991:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0});var n=t(522);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===n[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return n[e]}}))}));var o=t(335);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===o[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))}))},335:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0});var n=t(969);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===n[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return n[e]}}))}))},969:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0});var n=t(948);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===n[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return n[e]}}))}));var o=t(667);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===o[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))}))},948:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryCatchPromise=r.tryCatch=void 0;var n=t(522);r.tryCatch=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.defaultResult,n=void 0===t?null:t,o=r.exceptionHandlingType,a=void 0===o?"error":o;try{return{error:null,result:e()}}catch(e){return"ignore"!==a&&console[a](e),{error:e,result:n}}},r.tryCatchPromise=function(e,r){var t=r||{},o=t.defaultResult,a=void 0===o?null:o,i=t.exceptionHandlingType,c=void 0===i?"error":i,s=t.ignoreCancel,l=void 0===s||s,u=null,f=null,h=function(e){f=e,"ignore"!=c&&("canceled"===(null==u?void 0:u.status)&&l||console[c](f))};try{if(e instanceof n.CancelablePromise)return(u=e).then((function(e){return{error:null,result:e,promise:u}})).catch((function(e){return h(e),{error:e,result:a,promise:u}}));var p=e();if(void 0===p)return Promise.reject(Error("tryCatchPromise: callback parameter must return a value () => promise"));var d=p instanceof n.CancelablePromise;return(u=d?p:(0,n.toCancelablePromise)(p)).then((function(e){return{error:null,result:e,promise:u}})).catch((function(e){return h(e),{error:e,result:a,promise:u}}))}catch(e){return h(e),Promise.resolve({error:f,result:a,promise:u})}}},667:(e,r)=>{Object.defineProperty(r,"__esModule",{value:!0})}},r={};return function t(n){var o=r[n];if(void 0!==o)return o.exports;var a=r[n]={exports:{}};return e[n](a,a.exports,t),a.exports}(991)})(),e.exports=r()}},r={},function t(n){var o=r[n];if(void 0!==o)return o.exports;var a=r[n]={exports:{}};return e[n].call(a.exports,a,a.exports,t),a.exports}(991);var e,r}));
|
|
2
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["easy-web-worker"]=r():e["easy-web-worker"]=r()}(this,(()=>{return e={41:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.createEasyWebWorker=void 0;var n=t(382);r.createEasyWebWorker=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new n.EasyWebWorker(e,r)}},382:(e,r,t)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i,a,c=[],s=!0,u=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=i.call(t)).done)&&(c.push(n.value),c.length!==r);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,r)||i(e,r)||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(e,r){if(e){if("string"==typeof e)return a(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a(e,r):void 0}}function a(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function c(){c=function(){return r};var e,r={},t=Object.prototype,o=t.hasOwnProperty,i=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function f(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{f({},"")}catch(e){f=function(e,r,t){return e[r]=t}}function p(e,r,t,n){var o=r&&r.prototype instanceof b?r:b,a=Object.create(o.prototype),c=new A(n||[]);return i(a,"_invoke",{value:C(e,t,c)}),a}function d(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var h="suspendedStart",v="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function k(){}var P={};f(P,s,(function(){return this}));var j=Object.getPrototypeOf,O=j&&j(j(L([])));O&&O!==t&&o.call(O,s)&&(P=O);var E=k.prototype=b.prototype=Object.create(P);function _(e){["next","throw","return"].forEach((function(r){f(e,r,(function(e){return this._invoke(r,e)}))}))}function x(e,r){function t(i,a,c,s){var u=d(e[i],e,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(e){t("next",e,c,s)}),(function(e){t("throw",e,c,s)})):r.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return t("throw",e,c,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,n){function o(){return new r((function(r,o){t(e,n,r,o)}))}return a=a?a.then(o,o):o()}})}function C(r,t,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var s=S(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=d(r,t,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function S(r,t){var n=t.method,o=r.iterator[n];if(o===e)return t.delegate=null,"throw"===n&&r.iterator.return&&(t.method="return",t.arg=e,S(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=d(o,r.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,g;var a=i.arg;return a?a.done?(t[r.resultName]=a.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function W(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function M(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(W,this),this.reset(!0)}function L(r){if(r||""===r){var t=r[s];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var i=-1,a=function t(){for(;++i<r.length;)if(o.call(r,i))return t.value=r[i],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return w.prototype=k,i(E,"constructor",{value:k,configurable:!0}),i(k,"constructor",{value:w,configurable:!0}),w.displayName=f(k,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,f(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},r.awrap=function(e){return{__await:e}},_(x.prototype),f(x.prototype,u,(function(){return this})),r.AsyncIterator=x,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var a=new x(p(e,t,n,o),i);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(E),f(E,l,"Generator"),f(E,s,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=L,A.prototype={constructor:A,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!r)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function n(n,o){return c.type="throw",c.arg=r,t.next=n,o&&(t.method="next",t.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),g},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),M(t),g}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;M(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:L(r),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function s(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function u(e){var r=function(e){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=n(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(r)?r:r+""}var l=function(e,r,t,n){return new(t||(t=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(a,c)}s((n=n.apply(e,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:!0}),r.EasyWebWorker=r.createBlobWorker=void 0;var f=t(655),p=t(920),d=t(806);r.createBlobWorker=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).primitiveParameters,n=void 0===t?[]:t,o=Array.isArray(e)?e:[e],i="".concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.length?'self.importScripts(["'.concat(e.join('","'),'"]);'):""}(r),"self.primitiveParameters=JSON.parse(`").concat(JSON.stringify(null!=n?n:[]),"`);let ew$=").concat((0,p.getWorkerTemplate)(),";let cn$=self;").concat(o.map((function(e){return"\n(".concat(null==e?void 0:e.toString().trim(),")(ew$,cn$);")})).join(""));return(window.URL||window.webkitURL).createObjectURL(new Blob([i],{type:"application/javascript"}))};var h=function(){return e=function e(r){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.source=r,this.workerUrl=null,this.config=null,this.maxWorkers=1,this.workers=[],this.keepAlive=!0,this.warmUpWorkers=!1,this.terminationDelay=1e3,this.primitiveParameters=[],this.messagesQueue=new Map,this.scripts=[],this.warmUp=function(){var e=t.config,r=e.warmUpWorkers,n=e.maxWorkers;r&&new Array(n).fill(null).forEach((function(){return t.getWorkerFromPool()}))},this.fillWorkerMethods=function(e){return e.onmessage=function(e){t.executeMessageCallback(e)},e.onerror=function(e){var r=t.config.onWorkerError;if(!r)throw e;r(e)},e},this.createNewWorker=function(){var e,r=t.workerUrl,n=t.config.workerOptions;n.name=0===(e=t.workers.length)?n.name:"".concat(n.name,"-").concat(e);var o=new Worker(r,n);return t.fillWorkerMethods(o)},this.getWorkerFromPool=function(){var e=t.config,r=e.maxWorkers,n=e.warmUpWorkers,o=t.messagesQueue.size;if(!t.workers.length||t.workers.length<r&&(o||n)){var i=t.createNewWorker();return t.workers.push(i),i}var a=t.workers.shift();return t.workers.push(a),a},this.computeWorkerBaseSource=function(){var e=function(){var e,r;if(t.source instanceof Worker)return t.workers=[t.fillWorkerMethods(t.source)],{isArrayOfWebWorkers:!1,workerUrl:null};var n="string"==typeof t.source||t.source instanceof URL,o="function"==typeof t.source;if(n||o)return{isArrayOfWebWorkers:!1,workerUrl:null!==(e=t.workerUrl)&&void 0!==e?e:t.getWorkerUrl()};var i=Array.isArray(t.source);if(i&&"function"==typeof t.source[0])return{isArrayOfWebWorkers:!1,workerUrl:null!==(r=t.workerUrl)&&void 0!==r?r:t.getWorkerUrl()};var a=i&&t.source[0]instanceof Worker;return a?(t.workers=t.source.map(t.fillWorkerMethods),{isArrayOfWebWorkers:a,workerUrl:null}):{isArrayOfWebWorkers:!1,workerUrl:null}}(),r=e.workerUrl,n=e.isArrayOfWebWorkers;return t.workerUrl=r,t.config.maxWorkers=n?t.workers.length:t.config.maxWorkers,{isArrayOfWebWorkers:n}},this.send=function(e,r){return t.sendToWorker({payload:e},r)},this.sendToWorker=function(e,r){var n,o,i=e.payload,a=e.method,c=new f.EasyWebWorkerMessage,s=c.messageId,u=c.decoupledPromise,l=t.getWorkerFromPool();u.promise.cancel=function(e){u.promise.cancel=u._cancel;var n={messageId:s,method:a,cancelation:{reason:e}};return t.workers.length?(l.postMessage(n,r),u.promise):u.cancel(e)},t.config.keepAlive||null===(o=null===(n=u.promise)||void 0===n?void 0:n.finally)||void 0===o||o.call(n,(function(){setTimeout((function(){t.messagesQueue.size||(t.workers.forEach((function(e){return e.terminate()})),t.workers=[])}),t.config.terminationDelay)})),t.addMessageToQueue(c);var p={messageId:s,method:a,execution:{payload:i}};return l.postMessage(p,r),u.promise},this.override=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=r[0],i=r[1],a=r[2];return new d.CancelablePromise((function(e,r,n){return l(t,[e,r,n],void 0,(function(e,r,t){var n=this,s=t.onCancel;return c().mark((function r(){var t,u;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=n.cancelAll(i,a),u=s((function(){t.cancel()})),r.next=4,t;case 4:u(),e(n.send.apply(n,[o]));case 6:case"end":return r.stop()}}),r)}))()}))}))},this.overrideAfterCurrent=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0],a=r[1],s=r[2];return new d.CancelablePromise((function(e,r,n){return l(t,[e,r,n],void 0,(function(e,r,t){var n=this,u=t.onCancel,l=t.reportProgress;return c().mark((function r(){var t,f,p,d,h,v;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!n.messagesQueue.size){r.next=10;break}return t=o(n.messagesQueue,1),f=t[0],p=o(f,2),d=p[1],n.RemoveMessageFromQueue(d.messageId),h=n.cancelAll(a,s).onProgress(l),v=u((function(){h.cancel()})),n.addMessageToQueue(d),r.next=9,h;case 9:v();case 10:e(n.send.apply(n,[i]));case 11:case"end":return r.stop()}}),r)}))()}))}))},this.workerUrl="string"==typeof r||r instanceof URL?r:null;var i=null!=n?n:{},a=i.scripts,s=void 0===a?[]:a,u=i.name,h=i.onWorkerError,v=void 0===h?null:h,y=i.maxWorkers,m=void 0===y?1:y,g=i.terminationDelay,b=void 0===g?1e3:g,w=i.primitiveParameters,k=i.workerOptions,P=void 0===k?{}:k,j="boolean"==typeof(null==n?void 0:n.warmUpWorkers)?n.warmUpWorkers:!(1!==m),O="boolean"==typeof(null==n?void 0:n.keepAlive)?n.keepAlive:j;this.config={scripts:null!=s?s:[],name:u,maxWorkers:m,keepAlive:O,warmUpWorkers:j,workerOptions:Object.assign(Object.assign({},null!=P?P:{}),{name:P.name||(0,p.generatedId)()}),onWorkerError:v,terminationDelay:b,primitiveParameters:w},this.workerOptions=this.config.workerOptions,this.name=this.workerOptions.name,this.scripts=s,this.onWorkerError=v,this.maxWorkers=m,this.terminationDelay=b,this.warmUpWorkers=j,this.primitiveParameters=null!=w?w:[],O=!!this.computeWorkerBaseSource().isArrayOfWebWorkers||O,this.keepAlive=O,this.config.keepAlive=O,this.warmUp()},t=[{key:"worker",get:function(){return this.workers.length>1?null:this.workers[0]}},{key:"isExternalWorkerFile",get:function(){return"string"==typeof this.source||this.source instanceof URL}},{key:"RemoveMessageFromQueue",value:function(e){this.messagesQueue.delete(e)}},{key:"executeMessageCallback",value:function(e){var r,t=null!==(r=this.messagesQueue.get(e.data.messageId))&&void 0!==r?r:null;if(t){var n=e.data.progress;if(this.workers.length){var o=t.decoupledPromise;if(n){var c=n.percentage,s=n.payload;o.reportProgress(c,s)}else{this.RemoveMessageFromQueue(t.messageId);var u=e.data.worker_cancelation;if(u){var l=u.reason;o._cancel(l)}else{var f=e.data.rejected;if(f){var p=f.reason;o.reject(p)}else{var d=e.data.resolved.payload;o.resolve.apply(o,function(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(null!=d?d:[]))}}}}else this.RemoveMessageFromQueue(t.messageId)}}},{key:"getWorkerUrl",value:function(){if(this.isExternalWorkerFile)return this.source;var e=this.config,t=e.primitiveParameters,n=e.scripts;return(0,r.createBlobWorker)(this.source,n,{primitiveParameters:t})}},{key:"cancelAll",value:function(e){var r=this,t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).force,n=void 0!==t&&t;return new d.CancelablePromise((function(t,o,i){return l(r,[t,o,i],void 0,(function(r,t,o){var i=this,a=o.onCancel,s=o.reportProgress;return c().mark((function t(){var o,u,l,f,p,h;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l=Array.from(null!==(u=null===(o=i.messagesQueue)||void 0===o?void 0:o.values())&&void 0!==u?u:[]),f=l.length,p=100/f,!n){t.next=5;break}return t.abrupt("return",r(i.reboot(e)));case 5:h=(0,d.groupAsCancelablePromise)(l.map((function(r){return r.decoupledPromise.promise.cancel(e).catch((function(e){return s(p,e),e}))}))),a((function(){h.cancel()})),r(h);case 8:case"end":return t.stop()}}),t)}))()}))}))}},{key:"addMessageToQueue",value:function(e){this.messagesQueue.set(e.messageId,e)}},{key:"sendToMethod",value:function(e,r,t){return this.sendToWorker({method:e,payload:r},t)}},{key:"reboot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Worker was rebooted";if(!this.workerUrl)throw new Error("You can not reboot a worker that was created from a Worker Instance");this.workers.forEach((function(e){return e.terminate()})),this.workers=[];var r=this.cancelAll(e);return this.warmUp(),r}},{key:"dispose",value:function(){return l(this,void 0,void 0,c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cancelAll(null);case 2:this.workerUrl&&(window.URL||window.webkitURL).revokeObjectURL("string"==typeof this.workerUrl?this.workerUrl:this.workerUrl.href),this.workers.forEach((function(e){return e.terminate()})),this.workers=[];case 5:case"end":return e.stop()}}),e,this)})))}}],t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();r.EasyWebWorker=h},920:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getWorkerTemplate=r.generatedId=void 0,r.generatedId=function(){return"".concat(Date.now()).concat(Math.random().toString(36).substring(2,9))},r.getWorkerTemplate=function(){return'(()=>{let e=new Map,o=new Map([["",()=>{throw"you didn\'t define a message-callback, please assign a callback by calling easyWorker.onMessage"}]]),t=({messageId:o,payload:t,method:n})=>{let a="pending",r=new Map,s=(t,s,l=[])=>{let c=a,i="progress"===t?"pending":t;if(!e.has(o)){let g="%c#"+o+" Message Not Found: %cThis means that the message was already resolved | rejected | canceled. To avoid this error, please make sure that you are not resolving | rejecting | canceling the same message twice. Also make sure that you are not reporting progress after the message was processed. Remember each message can handle his one cancelation by adding a handler with the %cmessage.onCancel%c method. To now more about this method, please check the documentation at: %chttps://www.npmjs.com/package/easy-web-worker#ieasywebworkermessageipayload--null-iresult--void %cTrying to process message:";console.error(g,"color: darkorange; font-size: 12px; font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;","color: lightblue; font-size: 10px; font-weight: bold;","font-weight: bold; color: darkorange;",{messageId:o,status:{current:c,target:i},method:n,action:s});return}let d={resolved:"onResolve",rejected:"onReject",canceled:"onCancel",worker_cancelation:"onCancel",pending:"onProgress"}[i],h=r.get(d);h?.forEach(e=>e(s,l));let w=!s.progress;w&&(r.get("onFinalize")?.forEach(e=>e(s,l)),e.delete(o)),self.postMessage({messageId:o,...s},l),a=i},l=(e,o=[])=>s("resolved",{resolved:{payload:void 0===e?[]:[e]}},o),c=(e,o=[])=>{s("rejected",{rejected:{reason:e}},o)},i=(e,o=[])=>s("worker_cancelation",{worker_cancelation:{reason:e}},o),g=(e,o,t=[])=>{s("progress",{progress:{percentage:e,payload:o}},t)},d=e=>o=>{r.has(e)||r.set(e,new Set);let t=r.get(e);return t.add(o),()=>t.delete(o)};return{messageId:o,method:n,payload:t,getStatus:()=>a,isPending:()=>"pending"===a,resolve:l,reject:c,cancel:i,reportProgress:g,onResolve:d("onResolve"),onReject:d("onReject"),onCancel:d("onCancel"),onProgress:d("onProgress"),onFinalize:d("onFinalize")}},n=(...e)=>{let[t,n]=e,a="string"==typeof t;if(a){let r=t,s=n;o.set(r,s);return}let l=t;o.set("",l)},a=()=>{let o=[...e.values()];o.forEach(e=>e.reject(Error("worker closed"))),self.close()};self.onmessage=n=>{let{data:a}=n,{messageId:r,cancelation:s}=a;if(s){let{reason:l}=s,c=e.get(r);c.cancel(l);return}let{method:i,execution:g}=n.data,{payload:d}=g,h=t({method:i,messageId:r,payload:d});e.set(r,h);let w=o.get(i||"");w(h,n)};let r=(...e)=>{self.importScripts(...e)};return{onMessage:n,close:a,importScripts:r}})()'}},655:(e,r,t)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function i(e,r,t){return r&&o(e.prototype,r),t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var r=function(e){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=n(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(r)?r:r+""}Object.defineProperty(r,"__esModule",{value:!0}),r.EasyWebWorkerMessage=void 0;var c=t(806),s=t(920),u=i((function e(){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.messageId=(0,s.generatedId)(),this.decoupledPromise=(0,c.createDecoupledPromise)(),this.decoupledPromise._cancel=this.decoupledPromise.promise.cancel}));r.EasyWebWorkerMessage=u},600:(e,r)=>{"use strict";function t(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}Object.defineProperty(r,"__esModule",{value:!0}),r.createStaticEasyWebWorker=r.StaticEasyWebWorker=void 0,r.StaticEasyWebWorker=function(e){var r,n,o=(r=new Map,n=new Map([["",function(){throw"you didn't defined a message-callback, please assign a callback by calling easyWorker.onMessage"}]]),self.onmessage=function(e){var t=e.data,o=t.messageId,i=t.cancelation;if(i){var a=i.reason;r.get(o).cancel(a)}else{var c=e.data,s=c.method,u=function(e){var t=e.messageId,n=e.payload,o=e.method,i="pending",a=new Map,c=function(e,n){var c,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],u=i,l="progress"===e?"pending":e;if(r.has(t)){var f={resolved:"onResolve",rejected:"onReject",canceled:"onCancel",worker_cancelation:"onCancel",pending:"onProgress"}[l],p=a.get(f);null==p||p.forEach((function(e){return e(n,s)})),!n.progress&&(null===(c=a.get("onFinalize"))||void 0===c||c.forEach((function(e){return e(n,s)})),r.delete(t)),self.postMessage(Object.assign({messageId:t},n),s),i=l}else{var d="%c#"+t+" Message Not Found: %cThis means that the message was already resolved | rejected | canceled. To avoid this error, please make sure that you are not resolving | rejecting | canceling the same message twice. Also make sure that you are not reporting progress after the message was processed. Remember each message can handle his one cancelation by adding a handler with the %cmessage.onCancel%c method. To now more about this method, please check the documentation at: %chttps://www.npmjs.com/package/easy-web-worker#ieasywebworkermessageipayload--null-iresult--void %cTrying to process message:";console.error(d,"color: darkorange; font-size: 12px; font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;","color: lightblue; font-size: 10px; font-weight: bold;","font-weight: bold; color: darkorange;",{messageId:t,status:{current:u,target:l},method:o,action:n})}},s=function(e){return function(r){a.has(e)||a.set(e,new Set);var t=a.get(e);return t.add(r),function(){return t.delete(r)}}};return{messageId:t,method:o,payload:n,getStatus:function(){return i},isPending:function(){return"pending"===i},resolve:function(e){return c("resolved",{resolved:{payload:void 0===e?[]:[e]}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])},reject:function(e){c("rejected",{rejected:{reason:e}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])},cancel:function(e){return c("worker_cancelation",{worker_cancelation:{reason:e}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])},reportProgress:function(e,r){c("progress",{progress:{percentage:e,payload:r}},arguments.length>2&&void 0!==arguments[2]?arguments[2]:[])},onResolve:s("onResolve"),onReject:s("onReject"),onCancel:s("onCancel"),onProgress:s("onProgress"),onFinalize:s("onFinalize")}}({method:s,messageId:o,payload:c.execution.payload});r.set(o,u),n.get(s||"")(u,e)}},{onMessage:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var o=r[0],i=r[1];if("string"==typeof o){var a=o,c=i;n.set(a,c)}else{var s=o;n.set("",s)}},close:function(){var e;(e=r.values(),function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(e){if("string"==typeof e)return t(e,r);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(e){return e.reject(new Error("worker closed"))})),self.close()},importScripts:function(){var e;(e=self).importScripts.apply(e,arguments)}}),i=o.close,a=o.onMessage,c=o.importScripts;this.close=i,this.onMessage=a,this.importScripts=c,e&&a(e)},r.createStaticEasyWebWorker=function(e){return new r.StaticEasyWebWorker(e)}},124:(e,r,t)=>{"use strict";var n=Object.create?function(e,r,t,n){void 0===n&&(n=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,o)}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]},o=function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||n(r,e,t)};Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=t(382);Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i.EasyWebWorker}}),o(t(382),r),o(t(600),r),o(t(41),r)},806:function(e){var r;r=()=>(()=>{"use strict";var e={931:(e,r)=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(){return n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,r,t){var n=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=s(e)););return e}(e,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(arguments.length<3?e:t):o.value}},n.apply(this,arguments)}function o(e){var r="function"==typeof Map?new Map:void 0;return o=function(e){if(null===e||(t=e,-1===Function.toString.call(t).indexOf("[native code]")))return e;var t;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return i(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},o(e)}function i(e,r,t){return i=a()?Reflect.construct.bind():function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&c(o,t.prototype),o},i.apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,r){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},c(e,r)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.CancelableAbortController=void 0;var u=function(e){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&c(e,r)}(f,e);var r,o,i,u,l=(i=f,u=a(),function(){var e,r=s(i);if(u){var n=s(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return function(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function f(){var e;return function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,f),(e=l.call(this))._subscriptions=new Set,e.signal.subscribe=function(){if(!e._subscriptions)throw new Error("AbortController was already aborted or disposed.");for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];var o=t[0],i=t[1],a=t[2],c="string"==typeof o?o:"abort",s="string"==typeof o?i:o,u="string"==typeof o?a:i;e.signal.addEventListener(c,s,u);var l=function(){e.signal.removeEventListener(c,s,u)};return e._subscriptions.add(l),l},e}return r=f,(o=[{key:"subscriptions",get:function(){var e;return Array.from(null!==(e=this._subscriptions)&&void 0!==e?e:[])}},{key:"abort",value:function(){n(s(f.prototype),"abort",this).call(this),this.dispose()}},{key:"dispose",value:function(){var e;null===(e=this._subscriptions)||void 0===e||e.forEach((function(e){return e()})),this._subscriptions=null}}])&&function(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(i=function(e){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===t(i)?i:String(i)),o)}var i}(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),f}(o(AbortController));r.CancelableAbortController=u},399:(e,r,t)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.CancelablePromise=void 0;var o,i=t(872),a=t(716);function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(){return s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,r,t){var n=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=d(e)););return e}(e,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(arguments.length<3?e:t):o.value}},s.apply(this,arguments)}function u(e){var r="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(t=e,-1===Function.toString.call(t).indexOf("[native code]")))return e;var t;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return l(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),p(n,e)},u(e)}function l(e,r,t){return l=f()?Reflect.construct.bind():function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&p(o,t.prototype),o},l.apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function p(e,r){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},p(e,r)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}var h=function(e){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&p(e,r)}(l,e);var r,t,i,a,u=(i=l,a=f(),function(){var e,r=d(i);if(a){var t=d(this).constructor;e=Reflect.construct(r,arguments,t)}else e=r.apply(this,arguments);return function(e,r){if(r&&("object"===n(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}(this,e)});function l(e){var r,t,n,i,a,f;return function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,l),(i=u.call(this,(function(e,r){a=e,f=r})))[o]=!0,i.status="pending",i.cancelCallbacks=new Set,i.ownCancelCallbacks=new Set,i.onProgressCallbacks=new Set,i.disposeCallbacks=function(){i.cancelCallbacks=new Set,i.ownCancelCallbacks=new Set,i.onProgressCallbacks=new Set},i.subscribeToOwnCancelEvent=function(e){return i.ownCancelCallbacks.add(e),function(){i.ownCancelCallbacks.delete(e)}},i.cancel=function(e){if("pending"!==i.status)return c(i);i.status="canceled";var r=void 0===e?new Error("Promise canceled"):e;return i.ownCancelCallbacks.forEach((function(e){return e(r)})),i.cancelCallbacks.forEach((function(e){return e(r)})),i._reject(r),i.disposeCallbacks(),c(i)},i.onCancel=function(e){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).signal;return i.cancelCallbacks.add(e),null==r||r.subscribe((function(){i.cancelCallbacks.delete(e)})),c(i)},i.onProgress=function(e){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).signal;return i.onProgressCallbacks.add(e),null==r||r.subscribe((function(){i.onProgressCallbacks.delete(e)})),c(i)},i.reportProgress=function(e,r){return i.onProgressCallbacks.forEach((function(t){return t(e,r)})),c(i)},i.createChildPromise=function(){var e,r,t=new l((function(t,n,o){e=t,r=n}));return t.onProgressCallbacks=i.onProgressCallbacks,t.onCancel((function(e){i.cancel(e)})),{promise:t,resolve:e,reject:r}},i._resolve=a,i._reject=f,e((function(e){i.status="resolved",i.disposeCallbacks(),i._resolve(e)}),(function(e){i.status="rejected",i.disposeCallbacks(),i._reject(e)}),{cancel:function(e){return i.cancel(e)},onCancel:function(e){return i.subscribeToOwnCancelEvent(e)},onProgress:function(e){return i.onProgress(e),function(){i.onProgressCallbacks.delete(e)}},reportProgress:function(e,r){i.reportProgress(e,r)}}),i.then=function(e,t){var n=i.createChildPromise(),o=n.promise,a=n.resolve,u=n.reject;return s((r=c(i),d(l.prototype)),"then",r).call(r,e,t).then(a,u),o},i.catch=function(e){var r=i.createChildPromise(),n=r.promise,o=r.resolve,a=r.reject;return s((t=c(i),d(l.prototype)),"catch",t).call(t,e).then(o,a),n},i.finally=function(e){var r=i.createChildPromise(),t=r.promise,o=r.resolve,a=r.reject;return s((n=c(i),d(l.prototype)),"finally",n).call(n,e).then(o,a),t},i}return r=l,t=[{key:"resolve",value:function(e){return new l((function(r){return r(e)}))}}],t&&function(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(i=function(e){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!==n(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===n(i)?i:String(i)),o)}var i}(r,t),Object.defineProperty(r,"prototype",{writable:!1}),l}(u(Promise));r.CancelablePromise=h,o=i.promise_identifier,h.reject=function(e){return new h((function(r,t){return t(e)}))},h.canceled=function(e){return new h((function(r,t,n){return(0,n.cancel)(e)}))},h.race=function(e){return new h((function(r,t,n){var o=n.onCancel,i=n.cancel;e.forEach((function(e){var n=(0,a.toCancelablePromise)(e);o((function(e){n.cancel(e)})),n.then(r,(function(e){"canceled"!==n.status?t(e):i(e)}))}))}))},h.all=function(e){return new h((function(r,t,n){var o=n.onCancel,i=n.cancel,c=new Map,s=e.length,u=0;e.forEach((function(e){var n=(0,a.toCancelablePromise)(e);c.set(n,null),o((function(e){n.cancel(e)})),n.then((function(e){u++,c.set(n,e),u===s&&r(Array.from(c.values()))}),(function(e){"canceled"!==n.status?t(e):i(e)}))}))}))},h.allSettled=function(e){return new h((function(r,t,n){var o=n.onCancel,i=new Map,c=e.length,s=0;e.forEach((function(e){var t=(0,a.toCancelablePromise)(e);i.set(t,null),o((function(e){t.cancel(e)})),t.then((function(e){i.set(t,{status:"fulfilled",value:e})}),(function(e){i.set(t,{status:"canceled"===t.status?"canceled":"rejected",reason:e})})).finally((function(){++s===c&&r(Array.from(i.values()))}))}))}))},h.prototype.constructor=Promise},716:(e,r,t)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.toCancelablePromise=r.isPromise=r.groupAsCancelablePromise=r.createDecoupledPromise=r.allSettledCancelable=void 0;var o=t(872),i=t(335),a=t(399);function c(){c=function(){return e};var e={},r=Object.prototype,t=r.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{l({},"")}catch(e){l=function(e,r,t){return e[r]=t}}function f(e,r,t,n){var i=r&&r.prototype instanceof h?r:h,a=Object.create(i.prototype),c=new x(n||[]);return o(a,"_invoke",{value:j(e,t,c)}),a}function p(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var d={};function h(){}function v(){}function y(){}var m={};l(m,a,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(C([])));b&&b!==r&&t.call(b,a)&&(m=b);var w=y.prototype=h.prototype=Object.create(m);function k(e){["next","throw","return"].forEach((function(r){l(e,r,(function(e){return this._invoke(r,e)}))}))}function P(e,r){function i(o,a,c,s){var u=p(e[o],e,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&t.call(f,"__await")?r.resolve(f.__await).then((function(e){i("next",e,c,s)}),(function(e){i("throw",e,c,s)})):r.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return i("throw",e,c,s)}))}s(u.arg)}var a;o(this,"_invoke",{value:function(e,t){function n(){return new r((function(r,n){i(e,t,r,n)}))}return a=a?a.then(n,n):n()}})}function j(e,r,t){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(t.method=o,t.arg=i;;){var a=t.delegate;if(a){var c=O(a,t);if(c){if(c===d)continue;return c}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if("suspendedStart"===n)throw n="completed",t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);n="executing";var s=p(e,r,t);if("normal"===s.type){if(n=t.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:t.done}}"throw"===s.type&&(n="completed",t.method="throw",t.arg=s.arg)}}}function O(e,r){var t=r.method,n=e.iterator[t];if(void 0===n)return r.delegate=null,"throw"===t&&e.iterator.return&&(r.method="return",r.arg=void 0,O(e,r),"throw"===r.method)||"return"!==t&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+t+"' method")),d;var o=p(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function _(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function r(){for(;++n<e.length;)if(t.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=void 0,r.done=!0,r};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return v.prototype=y,o(w,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:v,configurable:!0}),v.displayName=l(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===v||"GeneratorFunction"===(r.displayName||r.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,l(e,u,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},k(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(r,t,n,o,i){void 0===i&&(i=Promise);var a=new P(f(r,t,n,o),i);return e.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(w),l(w,u,"Generator"),l(w,a,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=C,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var r in this)"t"===r.charAt(0)&&t.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t,n){return a.type="throw",a.arg=e,r.next=t,n&&(r.method="next",r.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=t.call(i,"catchLoc"),s=t.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&t.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),d},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),_(t),d}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;_(t)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,t){return this.delegate={iterator:C(e),resultName:r,nextLoc:t},"next"===this.method&&(this.arg=void 0),d}},e}function s(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}r.createDecoupledPromise=function(){var e,r,t,n=new a.CancelablePromise((function(n,o,i){e=n,r=o,t=i}));return Object.assign(Object.assign({resolve:e,reject:r},t),{promise:n})};var u=function e(r){if((0,o.isCancelablePromise)(r))return r;if("function"==typeof r)return e(r());if(!f(r))return new a.CancelablePromise((function(e){return e(r)}));var t,n,i=new a.CancelablePromise((function(e,o,i){t=e,n=o,r.then(t,n)}));return i.onCancel((function(e){n(e)})),i};r.toCancelablePromise=u;var l=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.length)return null;var t,n=r.maxConcurrent,o=void 0===n?8:n,i=r.executeInOrder,c=void 0!==i&&i,l=r.beforeEachCallback,f=void 0===l?null:l,p=r.afterEachCallback,d=void 0===p?null:p,h=r.onQueueEmptyCallback,v=void 0===h?null:h,y=function(e){if(Array.isArray(e))return s(e)}(t=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,r){if(e){if("string"==typeof e)return s(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s(e,r):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),m=[];return new a.CancelablePromise((function(r,t,n){(function r(){if(y.length){var t=y.splice(0,o).map((function(r){var t="function"==typeof r?r():r;null==f||f();var o=u(t),i=n.onCancel((function(e){o.cancel(e)}));return o.then((function(r){var t,o;i(),m.push(r),null==d||d(r),n.reportProgress((null!==(t=m.length)&&void 0!==t?t:1)/(null!==(o=e.length)&&void 0!==o?o:1)*100)})),c?o.then((function(e){return e})):o}));return Promise.all(t).then((function(){return r()}))}})().then((function(){null==v||v(m),r(m)}))}))};r.groupAsCancelablePromise=l;var f=function(e){return Promise.resolve(e)===e};r.isPromise=f,r.allSettledCancelable=function(e){var r=[],t=e.map((function(e){var t=u(e);return r.push(t),(0,i.tryCatchPromise)((function(){return t})).then((function(e){return{error:e.error,result:e.result,promise:t}}))})),n=l(r);return new a.CancelablePromise((function(e,r,o){return i=void 0,a=c().mark((function r(){var i,a;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=o.onCancel(n.cancel),r.next=3,Promise.all(t);case 3:a=r.sent,i(),e(a);case 6:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(e,r){function t(e){try{o(a.next(e))}catch(e){r(e)}}function n(e){try{o(a.throw(e))}catch(e){r(e)}}function o(r){var o;r.done?e(r.value):(o=r.value,o instanceof i?o:new i((function(e){e(o)}))).then(t,n)}o((a=a.apply(void 0,[])).next())}));var i,a}))}},522:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0});var n=t(399);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===n[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return n[e]}}))}));var o=t(716);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===o[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))}));var i=t(931);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===i[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}}))}))},872:(e,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.promise_identifier=r.isCancelablePromise=void 0;var t=Symbol("promise_identifier");r.promise_identifier=t,r.isCancelablePromise=function(e){return!!(null==e?void 0:e[t])}},991:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={isCancelablePromise:!0};Object.defineProperty(r,"isCancelablePromise",{enumerable:!0,get:function(){return a.isCancelablePromise}});var o=t(522);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in r&&r[e]===o[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))}));var i=t(335);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in r&&r[e]===i[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}}))}));var a=t(872)},335:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0});var n=t(969);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===n[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return n[e]}}))}))},969:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0});var n=t(948);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===n[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return n[e]}}))}));var o=t(667);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in r&&r[e]===o[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))}))},948:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryCatchPromise=r.tryCatch=void 0;var n=t(872),o=t(522);r.tryCatch=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.defaultResult,n=void 0===t?null:t,o=r.exceptionHandlingType,i=void 0===o?"error":o;try{return{error:null,result:e()}}catch(e){return"ignore"!==i&&console[i](e),{error:e,result:n}}},r.tryCatchPromise=function(e,r){var t=r||{},i=t.defaultResult,a=void 0===i?null:i,c=t.exceptionHandlingType,s=void 0===c?"error":c,u=t.ignoreCancel,l=void 0===u||u,f=null,p=null,d=function(e){p=e,"ignore"!=s&&("canceled"===(null==f?void 0:f.status)&&l||console[s](p))};try{if((0,n.isCancelablePromise)(e))return(f=e).then((function(e){return{error:null,result:e,promise:f}})).catch((function(e){return d(e),{error:e,result:a,promise:f}}));var h=e();return void 0===h?Promise.reject(Error("tryCatchPromise: callback parameter must return a value () => promise")):(f=(0,n.isCancelablePromise)(h)?h:(0,o.toCancelablePromise)(h)).then((function(e){return{error:null,result:e,promise:f}})).catch((function(e){return d(e),{error:e,result:a,promise:f}}))}catch(e){return d(e),Promise.resolve({error:p,result:a,promise:f})}}},667:(e,r)=>{Object.defineProperty(r,"__esModule",{value:!0})}},r={};return function t(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return e[n](i,i.exports,t),i.exports}(991)})(),e.exports=r()}},r={},function t(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return e[n].call(i.exports,i,i.exports,t),i.exports}(124);var e,r}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-web-worker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "This is a library to easily handle and create web-workers, if you are a web developer and never tried this... do not wait any longer! Workers are an amazing option to improve user experience and make your webpages even greater",
|
|
5
5
|
"main": "lib/bundle.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -41,13 +41,15 @@
|
|
|
41
41
|
"homepage": "https://github.com/johnny-quesada-developer/easy-web-worker#readme",
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@babel/core": "^7.21.3",
|
|
44
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
44
45
|
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
|
|
46
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
|
|
45
47
|
"@babel/preset-env": "^7.20.2",
|
|
46
48
|
"@babel/preset-typescript": "^7.21.0",
|
|
47
49
|
"@types/jest": "^29.2.4",
|
|
48
50
|
"@types/node": "^20.11.0",
|
|
49
51
|
"babel-loader": "^9.1.2",
|
|
50
|
-
"cancelable-promise
|
|
52
|
+
"easy-cancelable-promise": "^1.0.1",
|
|
51
53
|
"jest": "^29.3.1",
|
|
52
54
|
"jsdom": "^16.4.0",
|
|
53
55
|
"ts-jest": "^29.1.1",
|
|
@@ -58,10 +60,10 @@
|
|
|
58
60
|
"webpack-cli": "^5.0.1"
|
|
59
61
|
},
|
|
60
62
|
"peerDependencies": {
|
|
61
|
-
"cancelable-promise
|
|
63
|
+
"easy-cancelable-promise": "^1.0.1"
|
|
62
64
|
},
|
|
63
65
|
"peerDependenciesMeta": {
|
|
64
|
-
"cancelable-promise
|
|
66
|
+
"easy-cancelable-promise": {
|
|
65
67
|
"optional": false
|
|
66
68
|
}
|
|
67
69
|
},
|