@picovoice/cheetah-web
Version:
Cheetah Speech-to-Text engine for web browsers (via WebAssembly)
1 lines • 4.64 MB
JavaScript
function A(A,I,C,g,B,Q,E){try{var R=A[Q](E),U=R.value}catch(A){return void C(A)}R.done?I(U):Promise.resolve(U).then(g,B)}function I(I){return function(){var C=this,g=arguments;return new Promise((function(B,Q){var E=I.apply(C,g);function R(I){A(E,B,Q,R,U,"next",I)}function U(I){A(E,B,Q,R,U,"throw",I)}R(void 0)}))}}function C(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}function g(A){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},g(A)}function B(A){var I=function(A,I){if("object"!==g(A)||null===A)return A;var C=A[Symbol.toPrimitive];if(void 0!==C){var B=C.call(A,I||"default");if("object"!==g(B))return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===I?String:Number)(A)}(A,"string");return"symbol"===g(I)?I:String(I)}function Q(A,I){for(var C=0;C<I.length;C++){var g=I[C];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(A,B(g.key),g)}}function E(A,I,C){return I&&Q(A.prototype,I),C&&Q(A,C),Object.defineProperty(A,"prototype",{writable:!1}),A}function R(A,I,C){return(I=B(I))in A?Object.defineProperty(A,I,{value:C,enumerable:!0,configurable:!0,writable:!0}):A[I]=C,A}function U(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var w={exports:{}},F={exports:{}};!function(A){function I(C){return A.exports=I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},A.exports.__esModule=!0,A.exports.default=A.exports,I(C)}A.exports=I,A.exports.__esModule=!0,A.exports.default=A.exports}(F);var D=F.exports;!function(A){var I=D.default;function C(){A.exports=C=function(){return B},A.exports.__esModule=!0,A.exports.default=A.exports;var g,B={},Q=Object.prototype,E=Q.hasOwnProperty,R=Object.defineProperty||function(A,I,C){A[I]=C.value},U="function"==typeof Symbol?Symbol:{},w=U.iterator||"@@iterator",F=U.asyncIterator||"@@asyncIterator",D=U.toStringTag||"@@toStringTag";function i(A,I,C){return Object.defineProperty(A,I,{value:C,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{i({},"")}catch(g){i=function(A,I,C){return A[I]=C}}function G(A,I,C,g){var B=I&&I.prototype instanceof l?I:l,Q=Object.create(B.prototype),E=new V(g||[]);return R(Q,"_invoke",{value:j(A,C,E)}),Q}function M(A,I,C){try{return{type:"normal",arg:A.call(I,C)}}catch(A){return{type:"throw",arg:A}}}B.wrap=G;var y="suspendedStart",o="suspendedYield",J="executing",c="completed",h={};function l(){}function s(){}function N(){}var Y={};i(Y,w,(function(){return this}));var S=Object.getPrototypeOf,Z=S&&S(S(b([])));Z&&Z!==Q&&E.call(Z,w)&&(Y=Z);var K=N.prototype=l.prototype=Object.create(Y);function k(A){["next","throw","return"].forEach((function(I){i(A,I,(function(A){return this._invoke(I,A)}))}))}function H(A,C){function g(B,Q,R,U){var w=M(A[B],A,Q);if("throw"!==w.type){var F=w.arg,D=F.value;return D&&"object"==I(D)&&E.call(D,"__await")?C.resolve(D.__await).then((function(A){g("next",A,R,U)}),(function(A){g("throw",A,R,U)})):C.resolve(D).then((function(A){F.value=A,R(F)}),(function(A){return g("throw",A,R,U)}))}U(w.arg)}var B;R(this,"_invoke",{value:function(A,I){function Q(){return new C((function(C,B){g(A,I,C,B)}))}return B=B?B.then(Q,Q):Q()}})}function j(A,I,C){var B=y;return function(Q,E){if(B===J)throw new Error("Generator is already running");if(B===c){if("throw"===Q)throw E;return{value:g,done:!0}}for(C.method=Q,C.arg=E;;){var R=C.delegate;if(R){var U=L(R,C);if(U){if(U===h)continue;return U}}if("next"===C.method)C.sent=C._sent=C.arg;else if("throw"===C.method){if(B===y)throw B=c,C.arg;C.dispatchException(C.arg)}else"return"===C.method&&C.abrupt("return",C.arg);B=J;var w=M(A,I,C);if("normal"===w.type){if(B=C.done?c:o,w.arg===h)continue;return{value:w.arg,done:C.done}}"throw"===w.type&&(B=c,C.method="throw",C.arg=w.arg)}}}function L(A,I){var C=I.method,B=A.iterator[C];if(B===g)return I.delegate=null,"throw"===C&&A.iterator.return&&(I.method="return",I.arg=g,L(A,I),"throw"===I.method)||"return"!==C&&(I.method="throw",I.arg=new TypeError("The iterator does not provide a '"+C+"' method")),h;var Q=M(B,A.iterator,I.arg);if("throw"===Q.type)return I.method="throw",I.arg=Q.arg,I.delegate=null,h;var E=Q.arg;return E?E.done?(I[A.resultName]=E.value,I.next=A.nextLoc,"return"!==I.method&&(I.method="next",I.arg=g),I.delegate=null,h):E:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,h)}function d(A){var I={tryLoc:A[0]};1 in A&&(I.catchLoc=A[1]),2 in A&&(I.finallyLoc=A[2],I.afterLoc=A[3]),this.tryEntries.push(I)}function a(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function V(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(d,this),this.reset(!0)}function b(A){if(A||""===A){var C=A[w];if(C)return C.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var B=-1,Q=function I(){for(;++B<A.length;)if(E.call(A,B))return I.value=A[B],I.done=!1,I;return I.value=g,I.done=!0,I};return Q.next=Q}}throw new TypeError(I(A)+" is not iterable")}return s.prototype=N,R(K,"constructor",{value:N,configurable:!0}),R(N,"constructor",{value:s,configurable:!0}),s.displayName=i(N,D,"GeneratorFunction"),B.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===s||"GeneratorFunction"===(I.displayName||I.name))},B.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,N):(A.__proto__=N,i(A,D,"GeneratorFunction")),A.prototype=Object.create(K),A},B.awrap=function(A){return{__await:A}},k(H.prototype),i(H.prototype,F,(function(){return this})),B.AsyncIterator=H,B.async=function(A,I,C,g,Q){void 0===Q&&(Q=Promise);var E=new H(G(A,I,C,g),Q);return B.isGeneratorFunction(I)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},k(K),i(K,D,"Generator"),i(K,w,(function(){return this})),i(K,"toString",(function(){return"[object Generator]"})),B.keys=function(A){var I=Object(A),C=[];for(var g in I)C.push(g);return C.reverse(),function A(){for(;C.length;){var g=C.pop();if(g in I)return A.value=g,A.done=!1,A}return A.done=!0,A}},B.values=b,V.prototype={constructor:V,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(a),!A)for(var I in this)"t"===I.charAt(0)&&E.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=g)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var I=this;function C(C,B){return R.type="throw",R.arg=A,I.next=C,B&&(I.method="next",I.arg=g),!!B}for(var B=this.tryEntries.length-1;B>=0;--B){var Q=this.tryEntries[B],R=Q.completion;if("root"===Q.tryLoc)return C("end");if(Q.tryLoc<=this.prev){var U=E.call(Q,"catchLoc"),w=E.call(Q,"finallyLoc");if(U&&w){if(this.prev<Q.catchLoc)return C(Q.catchLoc,!0);if(this.prev<Q.finallyLoc)return C(Q.finallyLoc)}else if(U){if(this.prev<Q.catchLoc)return C(Q.catchLoc,!0)}else{if(!w)throw new Error("try statement without catch or finally");if(this.prev<Q.finallyLoc)return C(Q.finallyLoc)}}}},abrupt:function(A,I){for(var C=this.tryEntries.length-1;C>=0;--C){var g=this.tryEntries[C];if(g.tryLoc<=this.prev&&E.call(g,"finallyLoc")&&this.prev<g.finallyLoc){var B=g;break}}B&&("break"===A||"continue"===A)&&B.tryLoc<=I&&I<=B.finallyLoc&&(B=null);var Q=B?B.completion:{};return Q.type=A,Q.arg=I,B?(this.method="next",this.next=B.finallyLoc,h):this.complete(Q)},complete:function(A,I){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&I&&(this.next=I),h},finish:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var C=this.tryEntries[I];if(C.finallyLoc===A)return this.complete(C.completion,C.afterLoc),a(C),h}},catch:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var C=this.tryEntries[I];if(C.tryLoc===A){var g=C.completion;if("throw"===g.type){var B=g.arg;a(C)}return B}}throw new Error("illegal catch attempt")},delegateYield:function(A,I,C){return this.delegate={iterator:b(A),resultName:I,nextLoc:C},"next"===this.method&&(this.arg=g),h}},B}A.exports=C,A.exports.__esModule=!0,A.exports.default=A.exports}(w);var i=(0,w.exports)(),G=i;try{regeneratorRuntime=i}catch(A){"object"==typeof globalThis?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}var M=U(G);const y=new Error("request for lock canceled");var o=function(A,I,C,g){return new(C||(C=Promise))((function(B,Q){function E(A){try{U(g.next(A))}catch(A){Q(A)}}function R(A){try{U(g.throw(A))}catch(A){Q(A)}}function U(A){var I;A.done?B(A.value):(I=A.value,I instanceof C?I:new C((function(A){A(I)}))).then(E,R)}U((g=g.apply(A,I||[])).next())}))};class J{constructor(A,I=y){this._value=A,this._cancelError=I,this._weightedQueues=[],this._weightedWaiters=[]}acquire(A=1){if(A<=0)throw new Error(`invalid weight ${A}: must be positive`);return new Promise(((I,C)=>{this._weightedQueues[A-1]||(this._weightedQueues[A-1]=[]),this._weightedQueues[A-1].push({resolve:I,reject:C}),this._dispatch()}))}runExclusive(A,I=1){return o(this,void 0,void 0,(function*(){const[C,g]=yield this.acquire(I);try{return yield A(C)}finally{g()}}))}waitForUnlock(A=1){if(A<=0)throw new Error(`invalid weight ${A}: must be positive`);return new Promise((I=>{this._weightedWaiters[A-1]||(this._weightedWaiters[A-1]=[]),this._weightedWaiters[A-1].push(I),this._dispatch()}))}isLocked(){return this._value<=0}getValue(){return this._value}setValue(A){this._value=A,this._dispatch()}release(A=1){if(A<=0)throw new Error(`invalid weight ${A}: must be positive`);this._value+=A,this._dispatch()}cancel(){this._weightedQueues.forEach((A=>A.forEach((A=>A.reject(this._cancelError))))),this._weightedQueues=[]}_dispatch(){var A;for(let I=this._value;I>0;I--){const C=null===(A=this._weightedQueues[I-1])||void 0===A?void 0:A.shift();if(!C)continue;const g=this._value,B=I;this._value-=I,I=this._value+1,C.resolve([g,this._newReleaser(B)])}this._drainUnlockWaiters()}_newReleaser(A){let I=!1;return()=>{I||(I=!0,this.release(A))}}_drainUnlockWaiters(){for(let A=this._value;A>0;A--)this._weightedWaiters[A-1]&&(this._weightedWaiters[A-1].forEach((A=>A())),this._weightedWaiters[A-1]=[])}}var c=function(A,I,C,g){return new(C||(C=Promise))((function(B,Q){function E(A){try{U(g.next(A))}catch(A){Q(A)}}function R(A){try{U(g.throw(A))}catch(A){Q(A)}}function U(A){var I;A.done?B(A.value):(I=A.value,I instanceof C?I:new C((function(A){A(I)}))).then(E,R)}U((g=g.apply(A,I||[])).next())}))};class h{constructor(A){this._semaphore=new J(1,A)}acquire(){return c(this,void 0,void 0,(function*(){const[,A]=yield this._semaphore.acquire();return A}))}runExclusive(A){return this._semaphore.runExclusive((()=>A()))}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}function l(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var s={exports:{}},N={exports:{}};!function(A){function I(C){return A.exports=I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},A.exports.__esModule=!0,A.exports.default=A.exports,I(C)}A.exports=I,A.exports.__esModule=!0,A.exports.default=A.exports}(N);var Y=N.exports;!function(A){var I=Y.default;function C(){A.exports=C=function(){return B},A.exports.__esModule=!0,A.exports.default=A.exports;var g,B={},Q=Object.prototype,E=Q.hasOwnProperty,R=Object.defineProperty||function(A,I,C){A[I]=C.value},U="function"==typeof Symbol?Symbol:{},w=U.iterator||"@@iterator",F=U.asyncIterator||"@@asyncIterator",D=U.toStringTag||"@@toStringTag";function i(A,I,C){return Object.defineProperty(A,I,{value:C,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{i({},"")}catch(g){i=function(A,I,C){return A[I]=C}}function G(A,I,C,g){var B=I&&I.prototype instanceof l?I:l,Q=Object.create(B.prototype),E=new V(g||[]);return R(Q,"_invoke",{value:j(A,C,E)}),Q}function M(A,I,C){try{return{type:"normal",arg:A.call(I,C)}}catch(A){return{type:"throw",arg:A}}}B.wrap=G;var y="suspendedStart",o="suspendedYield",J="executing",c="completed",h={};function l(){}function s(){}function N(){}var Y={};i(Y,w,(function(){return this}));var S=Object.getPrototypeOf,Z=S&&S(S(b([])));Z&&Z!==Q&&E.call(Z,w)&&(Y=Z);var K=N.prototype=l.prototype=Object.create(Y);function k(A){["next","throw","return"].forEach((function(I){i(A,I,(function(A){return this._invoke(I,A)}))}))}function H(A,C){function g(B,Q,R,U){var w=M(A[B],A,Q);if("throw"!==w.type){var F=w.arg,D=F.value;return D&&"object"==I(D)&&E.call(D,"__await")?C.resolve(D.__await).then((function(A){g("next",A,R,U)}),(function(A){g("throw",A,R,U)})):C.resolve(D).then((function(A){F.value=A,R(F)}),(function(A){return g("throw",A,R,U)}))}U(w.arg)}var B;R(this,"_invoke",{value:function(A,I){function Q(){return new C((function(C,B){g(A,I,C,B)}))}return B=B?B.then(Q,Q):Q()}})}function j(A,I,C){var B=y;return function(Q,E){if(B===J)throw new Error("Generator is already running");if(B===c){if("throw"===Q)throw E;return{value:g,done:!0}}for(C.method=Q,C.arg=E;;){var R=C.delegate;if(R){var U=L(R,C);if(U){if(U===h)continue;return U}}if("next"===C.method)C.sent=C._sent=C.arg;else if("throw"===C.method){if(B===y)throw B=c,C.arg;C.dispatchException(C.arg)}else"return"===C.method&&C.abrupt("return",C.arg);B=J;var w=M(A,I,C);if("normal"===w.type){if(B=C.done?c:o,w.arg===h)continue;return{value:w.arg,done:C.done}}"throw"===w.type&&(B=c,C.method="throw",C.arg=w.arg)}}}function L(A,I){var C=I.method,B=A.iterator[C];if(B===g)return I.delegate=null,"throw"===C&&A.iterator.return&&(I.method="return",I.arg=g,L(A,I),"throw"===I.method)||"return"!==C&&(I.method="throw",I.arg=new TypeError("The iterator does not provide a '"+C+"' method")),h;var Q=M(B,A.iterator,I.arg);if("throw"===Q.type)return I.method="throw",I.arg=Q.arg,I.delegate=null,h;var E=Q.arg;return E?E.done?(I[A.resultName]=E.value,I.next=A.nextLoc,"return"!==I.method&&(I.method="next",I.arg=g),I.delegate=null,h):E:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,h)}function d(A){var I={tryLoc:A[0]};1 in A&&(I.catchLoc=A[1]),2 in A&&(I.finallyLoc=A[2],I.afterLoc=A[3]),this.tryEntries.push(I)}function a(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function V(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(d,this),this.reset(!0)}function b(A){if(A||""===A){var C=A[w];if(C)return C.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var B=-1,Q=function I(){for(;++B<A.length;)if(E.call(A,B))return I.value=A[B],I.done=!1,I;return I.value=g,I.done=!0,I};return Q.next=Q}}throw new TypeError(I(A)+" is not iterable")}return s.prototype=N,R(K,"constructor",{value:N,configurable:!0}),R(N,"constructor",{value:s,configurable:!0}),s.displayName=i(N,D,"GeneratorFunction"),B.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===s||"GeneratorFunction"===(I.displayName||I.name))},B.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,N):(A.__proto__=N,i(A,D,"GeneratorFunction")),A.prototype=Object.create(K),A},B.awrap=function(A){return{__await:A}},k(H.prototype),i(H.prototype,F,(function(){return this})),B.AsyncIterator=H,B.async=function(A,I,C,g,Q){void 0===Q&&(Q=Promise);var E=new H(G(A,I,C,g),Q);return B.isGeneratorFunction(I)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},k(K),i(K,D,"Generator"),i(K,w,(function(){return this})),i(K,"toString",(function(){return"[object Generator]"})),B.keys=function(A){var I=Object(A),C=[];for(var g in I)C.push(g);return C.reverse(),function A(){for(;C.length;){var g=C.pop();if(g in I)return A.value=g,A.done=!1,A}return A.done=!0,A}},B.values=b,V.prototype={constructor:V,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(a),!A)for(var I in this)"t"===I.charAt(0)&&E.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=g)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var I=this;function C(C,B){return R.type="throw",R.arg=A,I.next=C,B&&(I.method="next",I.arg=g),!!B}for(var B=this.tryEntries.length-1;B>=0;--B){var Q=this.tryEntries[B],R=Q.completion;if("root"===Q.tryLoc)return C("end");if(Q.tryLoc<=this.prev){var U=E.call(Q,"catchLoc"),w=E.call(Q,"finallyLoc");if(U&&w){if(this.prev<Q.catchLoc)return C(Q.catchLoc,!0);if(this.prev<Q.finallyLoc)return C(Q.finallyLoc)}else if(U){if(this.prev<Q.catchLoc)return C(Q.catchLoc,!0)}else{if(!w)throw new Error("try statement without catch or finally");if(this.prev<Q.finallyLoc)return C(Q.finallyLoc)}}}},abrupt:function(A,I){for(var C=this.tryEntries.length-1;C>=0;--C){var g=this.tryEntries[C];if(g.tryLoc<=this.prev&&E.call(g,"finallyLoc")&&this.prev<g.finallyLoc){var B=g;break}}B&&("break"===A||"continue"===A)&&B.tryLoc<=I&&I<=B.finallyLoc&&(B=null);var Q=B?B.completion:{};return Q.type=A,Q.arg=I,B?(this.method="next",this.next=B.finallyLoc,h):this.complete(Q)},complete:function(A,I){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&I&&(this.next=I),h},finish:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var C=this.tryEntries[I];if(C.finallyLoc===A)return this.complete(C.completion,C.afterLoc),a(C),h}},catch:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var C=this.tryEntries[I];if(C.tryLoc===A){var g=C.completion;if("throw"===g.type){var B=g.arg;a(C)}return B}}throw new Error("illegal catch attempt")},delegateYield:function(A,I,C){return this.delegate={iterator:b(A),resultName:I,nextLoc:C},"next"===this.method&&(this.arg=g),h}},B}A.exports=C,A.exports.__esModule=!0,A.exports.default=A.exports}(s);var S=(0,s.exports)(),Z=S;try{regeneratorRuntime=S}catch(A){"object"==typeof globalThis?globalThis.regeneratorRuntime=S:Function("r","regeneratorRuntime = r")(S)}var K=l(Z);function k(A,I,C,g){return new(C||(C=Promise))((function(B,Q){function E(A){try{U(g.next(A))}catch(A){Q(A)}}function R(A){try{U(g.throw(A))}catch(A){Q(A)}}function U(A){var I;A.done?B(A.value):(I=A.value,I instanceof C?I:new C((function(A){A(I)}))).then(E,R)}U((g=g.apply(A,I||[])).next())}))}function H(A,I){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,I){return A.__proto__=I,A},H(A,I)}function j(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),I&&H(A,I)}function L(A){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},L(A)}function d(A,I){if(I&&("object"===L(I)||"function"==typeof I))return I;if(void 0!==I)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}function a(A){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},a(A)}function V(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}function b(A){var I=function(A,I){if("object"!==L(A)||null===A)return A;var C=A[Symbol.toPrimitive];if(void 0!==C){var g=C.call(A,I||"default");if("object"!==L(g))return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===I?String:Number)(A)}(A,"string");return"symbol"===L(I)?I:String(I)}function X(A,I){for(var C=0;C<I.length;C++){var g=I[C];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(A,b(g.key),g)}}function n(A,I,C){return I&&X(A.prototype,I),C&&X(A,C),Object.defineProperty(A,"prototype",{writable:!1}),A}var m=function(){function A(){V(this,A),this._path=""}return n(A,[{key:"meta",get:function(){if(void 0!==this._meta)return Object.assign({version:0},this._meta)}},{key:"pageSize",get:function(){}}],[{key:"getPtr",value:function(I){if(A._filePtrs.has(I))return A._filePtrs.get(I);throw new Error("File instance not found.")}},{key:"setPtr",value:function(I,C){A._filePtrs.set(I,C)}},{key:"removePtr",value:function(I){A._filePtrs.delete(I)}}]),A}();function W(A){var I=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var C,g=a(A);if(I){var B=a(this).constructor;C=Reflect.construct(g,arguments,B)}else C=g.apply(this,arguments);return d(this,C)}}m._filePtrs=new Map;var t="pv_file";var f=function(){function A(){V(this,A),this._pos=0,this._data=new Uint8Array}return n(A,[{key:"get",value:function(A){if(!(this._pos>=this._data.length)){var I=this._data.slice(this._pos,this._pos+A);return this._pos+=A,I}}},{key:"set",value:function(A,I){this._pos=A,this._data=I}},{key:"clear",value:function(){this._pos=0,this._data=new Uint8Array}}]),A}(),T=function(A){j(C,m);var I=W(C);function C(A,g,B,Q){var E;return V(this,C),(E=I.call(this))._pageSize=524288,E._pagePtr=0,E._pageOffset=0,E._path=A,E._meta=g,E._db=B,E._mode=Q,E._cache=new f,E}return n(C,[{key:"pageSize",get:function(){return this._pageSize}},{key:"close",value:function(){return k(this,void 0,void 0,K.mark((function A(){return K.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this._db.close();case 1:case"end":return A.stop()}}),A,this)})))}},{key:"read",value:function(A,I){return k(this,void 0,void 0,K.mark((function g(){var B=this;return K.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return g.abrupt("return",new Promise((function(g,Q){if(B.exists()){if(B._isEOF){var E=new Error("EOF");return E.name="EndOfFile",void Q(E)}var R=0,U=Math.min(A*I,B._meta.size),w=U-U%A,F=new Uint8Array(w),D=B._cache.get(w);if(D){if(R+=D.length,B._pageOffset+=D.length,B._pageOffset===B._pageSize&&(B._pagePtr+=1,B._pageOffset=0),w===R)return void g(D);F.set(D)}var i=IDBKeyRange.bound("".concat(B._path,"-").concat(C.createPage(B._pagePtr)),"".concat(B._path,"-").concat(C.createPage(B._pagePtr+Math.floor(w/B._pageSize)+1))),G=B._store,M=G.openCursor(i);M.onsuccess=function(){var A,I,C=M.result;if(C&&!B._isEOF){var g=Math.min(w-R,C.value.length-B._pageOffset);F.set(C.value.slice(B._pageOffset,B._pageOffset+g),R),R+=g,B._pageOffset+=g,B._pageOffset===B._pageSize&&(B._pagePtr+=1,B._pageOffset=0),R<w?C.continue():(0!==B._pageOffset?B._cache.set(B._pageOffset,C.value):B._cache.clear(),(null===(A=G.transaction)||void 0===A?void 0:A.commit)&&(null===(I=G.transaction)||void 0===I||I.commit()))}},G.transaction.onerror=function(){Q(G.transaction.error)},G.transaction.oncomplete=function(){g(F.slice(0,R))}}else Q(new Error("'".concat(B._path,"' doesn't exist.")))})));case 1:case"end":return g.stop()}}),g)})))}},{key:"write",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return k(this,void 0,void 0,K.mark((function g(){var B=this;return K.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return g.abrupt("return",new Promise((function(g,Q){return k(B,void 0,void 0,K.mark((function B(){var E,R,U,w,F,D,i,G,M,y,o,J=this;return K.wrap((function(B){for(;;)switch(B.prev=B.next){case 0:if("readonly"!==this._mode){B.next=3;break}return Q(new Error("Instance is readonly mode only.")),B.abrupt("return");case 3:if(!("number"!=typeof I&&I<=0)){B.next=6;break}return Q(new Error("Version should be a positive number")),B.abrupt("return");case 6:return U=this._store,w=function(){return new Promise((function(A){var I=U.get("".concat(J._path,"-").concat(C.createPage(J._pagePtr)));I.onsuccess=function(){void 0!==I.result?A(I.result.slice(0,J._pageOffset)):A(new Uint8Array(0))}}))},B.next=10,w();case 10:for(F=B.sent,(D=new Uint8Array(F.length+A.length)).set(F),D.set(A,F.length),i=this._pagePtr*this._pageSize+D.length,G={size:i,numPages:Math.ceil(i/this._pageSize),version:I,pageSize:this._pageSize},U.put(G,this._path),M=Math.ceil(D.length/this._pageSize),y=0;y<M;y++)U.put(D.slice(y*this._pageSize,(y+1)*this._pageSize),"".concat(this._path,"-").concat(C.createPage(this._pagePtr+y)));this.exists()&&G.numPages<this._meta.numPages&&(o=IDBKeyRange.bound("".concat(this._path,"-").concat(C.createPage(G.numPages)),"".concat(this._path,"-").concat(C.createPage(this._meta.numPages)),!0),U.delete(o)),(null===(E=U.transaction)||void 0===E?void 0:E.commit)&&(null===(R=U.transaction)||void 0===R||R.commit()),U.transaction.onerror=function(){Q(U.transaction.error)},U.transaction.oncomplete=function(){J._meta=G,J.seek(0,2),g()};case 23:case"end":return B.stop()}}),B,this)})))})));case 1:case"end":return g.stop()}}),g)})))}},{key:"seek",value:function(A,I){if(!this.exists()&&"readonly"===this._mode)throw new Error("'".concat(this._path,"' doesn't exist."));if(!this.exists())throw new Error("'".concat(this._path,"' doesn't exist."));if(A<0){var C=new Error("EOF");throw C.name="EndOfFile",C}var g;if(0===I)g=Math.min(A,this._meta.size);else if(1===I){var B=this._pageSize*this._pagePtr+this._pageOffset;g=Math.min(B+A,this._meta.size)}else{if(2!==I)throw new Error("Invalid operation: ".concat(I,"."));g=Math.min(this._meta.size+A,this._meta.size)}this._pageOffset=g%this._pageSize,this._pagePtr=Math.floor(g/this._pageSize),this._cache.clear()}},{key:"tell",value:function(){return this.exists()?this._pagePtr*this._pageSize+this._pageOffset:-1}},{key:"remove",value:function(){return k(this,void 0,void 0,K.mark((function A(){var I=this;return K.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,g){return k(I,void 0,void 0,K.mark((function I(){var B,Q,E,R,U=this;return K.wrap((function(I){for(;;)switch(I.prev=I.next){case 0:if(this.exists()){I.next=3;break}return g(new Error("ENOENT")),I.abrupt("return");case 3:B=this._meta.numPages,Q=IDBKeyRange.bound(this._path,"".concat(this._path,"-").concat(C.createPage(B))),E=this._store,(R=E.delete(Q)).onerror=function(){g(R.error)},R.onsuccess=function(){U._meta=void 0,U._pageOffset=0,U._pagePtr=0,A()};case 9:case"end":return I.stop()}}),I,this)})))})));case 1:case"end":return A.stop()}}),A)})))}},{key:"exists",value:function(){return void 0!==this._meta}},{key:"_isEOF",get:function(){return this._pagePtr>=this._meta.numPages-1&&this._pageOffset>=this._meta.size%this._pageSize}},{key:"_store",get:function(){return this._db.transaction(t,this._mode).objectStore(t)}}],[{key:"open",value:function(A,I){var g=this;if(!self.indexedDB){var B=new Error("IndexedDB is not supported");throw B.name="IndexedDBNotSupported",B}return new Promise((function(B,Q){return k(g,void 0,void 0,K.mark((function g(){var E,R,U;return K.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return g.prev=0,g.next=3,new Promise((function(A,I){var C=self.indexedDB.open("pv_db",3);C.onerror=function(){I(C.error)},C.onsuccess=function(){A(C.result)},C.onupgradeneeded=function(){C.result.objectStoreNames.contains(t)||C.result.createObjectStore(t)}}));case 3:E=g.sent,(R=E.transaction(t,"readwrite").objectStore(t).get(A)).onerror=function(){Q(R.error)},R.onsuccess=function(){var g=R.result,U=I.includes("r")?"readonly":"readwrite";if(void 0===g&&"readonly"===U){var w=new Error("'".concat(A,"' doesn't exist."));return w.name="FileNotExists",void Q(w)}var F=new C(A,g,E,U);I.includes("a")&&F.seek(0,2),B(F)},g.next=12;break;case 9:g.prev=9,g.t0=g.catch(0),"InvalidStateError"===g.t0.name?((U=new Error("IndexedDB is not supported")).name="IndexedDBNotSupported",Q(U)):Q(g.t0);case 12:case"end":return g.stop()}}),g,null,[[0,9]])})))}))}},{key:"createPage",value:function(A){return("00000"+A).slice(-6)}}]),C}();function e(A){var I=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var C,g=a(A);if(I){var B=a(this).constructor;C=Reflect.construct(g,arguments,B)}else C=g.apply(this,arguments);return d(this,C)}}var p=function(A){j(C,m);var I=e(C);function C(A,g,B,Q){var E;return V(this,C),(E=I.call(this))._pos=0,E._path=A,E._meta=g,E._mode=Q,E}return n(C,[{key:"close",value:function(){}},{key:"read",value:function(A,I){if(!this.exists())throw new Error("'".concat(this._path,"' doesn't exist."));if(this._isEOF){var C=new Error("EOF");throw C.name="EndOfFile",C}var g=Math.min(A*I,this._file.length-this._pos),B=g-g%A,Q=new Uint8Array(B);return Q.set(this._file.slice(this._pos,this._pos+B),0),this._pos+=B,Q}},{key:"write",value:function(A){var I=new Uint8Array(this._pos+A.length);void 0!==this._file?(I.set(this._file.slice(0,this._pos)),I.set(A,this._pos)):I.set(A),this._file=I,this._pos+=A.length}},{key:"seek",value:function(A,I){if(!this.exists()&&"readonly"===this._mode)throw new Error("'".concat(this._path,"' doesn't exist."));if(!this.exists())throw new Error("'".concat(this._path,"' doesn't exist."));if(A<0){var C=new Error("EOF");throw C.name="EndOfFile",C}var g;if(0===I)g=Math.min(A,this._file.length);else if(1===I)g=Math.min(this._pos+A,this._file.length);else{if(2!==I)throw new Error("Invalid operation: ".concat(I,"."));g=Math.min(this._file.length+A,this._file.length)}this._pos=g}},{key:"tell",value:function(){return this.exists()?this._pos:-1}},{key:"remove",value:function(){return k(this,void 0,void 0,K.mark((function A(){return K.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.exists()){A.next=2;break}throw new Error("ENOENT");case 2:C._memFiles.delete(this._path),this._pos=0;case 4:case"end":return A.stop()}}),A,this)})))}},{key:"exists",value:function(){return void 0!==this._file}},{key:"_isEOF",get:function(){return this._pos>=this._file.length}},{key:"_file",get:function(){return C._memFiles.get(this._path)},set:function(A){C._memFiles.set(this._path,A)}}],[{key:"open",value:function(A,I){var g=C._memFiles.get(A),B=I.includes("r")?"readonly":"readwrite";if(void 0===g&&"readonly"===B){var Q=new Error("'".concat(A,"' doesn't exist."));throw Q.name="FileNotExists",Q}var E=new C(A,void 0,void 0,B);return I.includes("a")&&E.seek(0,2),E}}]),C}();function u(A,I){for(var C=I;0!==A[C];)C++;return new TextDecoder("utf-8").decode(A.slice(I,C))}function P(A){for(var I=atob(A),C=new Uint8Array(I.length),g=0;g<I.length;g++)C[g]=I.charCodeAt(g);return C}function x(A){if("string"!=typeof A)return!1;var I=A.trim();if(""===I)return!1;try{return btoa(atob(I))===I}catch(A){return!1}}function O(A,I){return k(this,void 0,void 0,K.mark((function C(){var g;return K.wrap((function(C){for(;;)switch(C.prev=C.next){case 0:return C.prev=0,C.next=3,T.open(A,I);case 3:return C.abrupt("return",C.sent);case 6:if(C.prev=6,C.t0=C.catch(0),"IndexedDBNotSupported"===C.t0.name?console.warn("IndexedDB is not supported. Fallback to in-memory storage."):"FileNotExists"!==C.t0.name&&console.warn("Unable to access IndexedDB (".concat(C.t0.toString(),"). Fallback to in-memory storage.")),!("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope)){C.next=16;break}if("FileNotExists"!==C.t0.name){C.next=12;break}throw C.t0;case 12:throw console.error("In-memory storage cannot be used inside a worker."),(g=new Error("Failed to start PvFile: ".concat(C.t0.toString()))).name="PvFileNotSupported",g;case 16:return C.abrupt("return",p.open(A,I));case 17:case"end":return C.stop()}}),C,null,[[0,6]])})))}function z(A,I,C,g){return k(this,void 0,void 0,K.mark((function B(){var Q;return K.wrap((function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=2,O(A,"w");case 2:if(Q=B.sent,!(C||void 0===Q.meta||g>Q.meta.version||Q.meta.pageSize!==Q.pageSize)){B.next=6;break}return B.next=6,Q.write(P(I),g);case 6:case"end":return B.stop()}}),B)})))}p._memFiles=new Map;var v=5e3,r=2;function q(A,I,C,g,B){return k(this,void 0,void 0,K.mark((function Q(){var E,R,U,w,F,D,i,G;return K.wrap((function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,O(A,"w");case 2:if(E=Q.sent,!(C||void 0===E.meta||g>E.meta.version||E.meta.pageSize!==E.pageSize)){Q.next=43;break}if(!(B<0)){Q.next=6;break}throw Error("numFetchRetries must be a positive number");case 6:R=r,U=function(A){return new Promise((function(I){setTimeout(I,A)}))},w=B+1,F=null;case 10:if(!(w>0)){Q.next=38;break}return F=null,Q.prev=12,Q.next=15,fetch(I,{cache:"no-cache"});case 15:if(!(D=Q.sent).ok){Q.next=23;break}return Q.next=19,D.arrayBuffer();case 19:return i=Q.sent,Q.next=22,E.write(new Uint8Array(i),g);case 22:return Q.abrupt("return");case 23:return Q.next=25,D.text();case 25:G=Q.sent,F=new Error("Error response returned while fetching model from '".concat(I,"': ").concat(G)),Q.next=32;break;case 29:Q.prev=29,Q.t0=Q.catch(12),F=new Error("Failed to fetch model from '".concat(I,"': ").concat(Q.t0.message));case 32:return w--,Q.next=35,U(R);case 35:R=Math.min(v,R*r),Q.next=10;break;case 38:if(null===F){Q.next=42;break}throw F;case 42:throw new Error("Unexpected error encountered while fetching model from '".concat(I,"'"));case 43:case"end":return Q.stop()}}),Q,null,[[12,29]])})))}function _(A){return k(this,void 0,void 0,K.mark((function I(){var C,g,B,Q,E,R,U,w,F;return K.wrap((function(I){for(;;)switch(I.prev=I.next){case 0:if(null!=A){I.next=2;break}throw new Error("The model is undefined / empty");case 2:if(C=A.base64,g=A.publicPath,B=A.customWritePath,Q=A.forceWrite,E=void 0!==Q&&Q,R=A.version,U=void 0===R?1:R,w=A.numFetchRetries,F=void 0===w?0:w,null!=B){I.next=5;break}throw new Error("The customWritePath of the provided model is undefined / empty");case 5:if(null==C){I.next=10;break}return I.next=8,z(B,C,E,U);case 8:case 13:I.next=16;break;case 10:if(null==g){I.next=15;break}return I.next=13,q(B,g,E,U,F);case 15:throw new Error("The provided model doesn't contain a valid publicPath or base64 value");case 16:return I.abrupt("return",B);case 17:case"end":return I.stop()}}),I)})))}function $(A,I){(null==I||I>A.length)&&(I=A.length);for(var C=0,g=new Array(I);C<I;C++)g[C]=A[C];return g}function AA(A,I){if(A){if("string"==typeof A)return $(A,I);var C=Object.prototype.toString.call(A).slice(8,-1);return"Object"===C&&A.constructor&&(C=A.constructor.name),"Map"===C||"Set"===C?Array.from(A):"Arguments"===C||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(C)?$(A,I):void 0}}function IA(A,I){return function(A){if(Array.isArray(A))return A}(A)||function(A,I){var C=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=C){var g,B,Q,E,R=[],U=!0,w=!1;try{if(Q=(C=C.call(A)).next,0===I){if(Object(C)!==C)return;U=!1}else for(;!(U=(g=Q.call(C)).done)&&(R.push(g.value),R.length!==I);U=!0);}catch(A){w=!0,B=A}finally{try{if(!U&&null!=C.return&&(E=C.return(),Object(E)!==E))return}finally{if(w)throw B}}return R}}(A,I)||AA(A,I)||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.")}()}var CA,gA,BA,QA=(gA="undefined"!=typeof document?null===(CA=document.currentScript)||void 0===CA?void 0:CA.src:void 0,function(){var A,C,B=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},Q=new Promise((function(I,g){A=I,C=g})),E="object"==("undefined"==typeof window?"undefined":g(window)),R="function"==typeof importScripts;function U(A){return U="function"==typeof Symbol&&"symbol"==g(Symbol.iterator)?function(A){return g(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":g(A)},U(A)}function w(A){var I=function(A,I){if("object"!=U(A)||!A)return A;var C=A[Symbol.toPrimitive];if(void 0!==C){var g=C.call(A,I||"default");if("object"!=U(g))return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===I?String:Number)(A)}(A,"string");return"symbol"==U(I)?I:I+""}function F(A,I,C){return(I=w(I))in A?Object.defineProperty(A,I,{value:C,enumerable:!0,configurable:!0,writable:!0}):A[I]=C,A}function D(A,I,C,g,B,Q,E){try{var R=A[Q](E),U=R.value}catch(A){return void C(A)}R.done?I(U):Promise.resolve(U).then(g,B)}function i(A){return function(){var I=this,C=arguments;return new Promise((function(g,B){var Q=A.apply(I,C);function E(A){D(Q,g,B,E,R,"next",A)}function R(A){D(Q,g,B,E,R,"throw",A)}E(void 0)}))}}function G(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}"object"==("undefined"==typeof process?"undefined":g(process))&&"object"==g(process.versions)&&process.versions.node;var y={exports:{}},o={exports:{}};!function(A){function I(C){return A.exports=I="function"==typeof Symbol&&"symbol"==g(Symbol.iterator)?function(A){return g(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":g(A)},A.exports.__esModule=!0,A.exports.default=A.exports,I(C)}A.exports=I,A.exports.__esModule=!0,A.exports.default=A.exports}(o);var J=o.exports;G(J),function(A){var I=J.default;function C(){A.exports=C=function(){return B},A.exports.__esModule=!0,A.exports.default=A.exports;var g,B={},Q=Object.prototype,E=Q.hasOwnProperty,R=Object.defineProperty||function(A,I,C){A[I]=C.value},U="function"==typeof Symbol?Symbol:{},w=U.iterator||"@@iterator",F=U.asyncIterator||"@@asyncIterator",D=U.toStringTag||"@@toStringTag";function i(A,I,C){return Object.defineProperty(A,I,{value:C,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{i({},"")}catch(g){i=function(A,I,C){return A[I]=C}}function G(A,I,C,g){var B=I&&I.prototype instanceof l?I:l,Q=Object.create(B.prototype),E=new V(g||[]);return R(Q,"_invoke",{value:j(A,C,E)}),Q}function M(A,I,C){try{return{type:"normal",arg:A.call(I,C)}}catch(A){return{type:"throw",arg:A}}}B.wrap=G;var y="suspendedStart",o="suspendedYield",J="executing",c="completed",h={};function l(){}function s(){}function N(){}var Y={};i(Y,w,(function(){return this}));var S=Object.getPrototypeOf,Z=S&&S(S(b([])));Z&&Z!==Q&&E.call(Z,w)&&(Y=Z);var K=N.prototype=l.prototype=Object.create(Y);function k(A){["next","throw","return"].forEach((function(I){i(A,I,(function(A){return this._invoke(I,A)}))}))}function H(A,C){function g(B,Q,R,U){var w=M(A[B],A,Q);if("throw"!==w.type){var F=w.arg,D=F.value;return D&&"object"==I(D)&&E.call(D,"__await")?C.resolve(D.__await).then((function(A){g("next",A,R,U)}),(function(A){g("throw",A,R,U)})):C.resolve(D).then((function(A){F.value=A,R(F)}),(function(A){return g("throw",A,R,U)}))}U(w.arg)}var B;R(this,"_invoke",{value:function(A,I){function Q(){return new C((function(C,B){g(A,I,C,B)}))}return B=B?B.then(Q,Q):Q()}})}function j(A,I,C){var B=y;return function(Q,E){if(B===J)throw Error("Generator is already running");if(B===c){if("throw"===Q)throw E;return{value:g,done:!0}}for(C.method=Q,C.arg=E;;){var R=C.delegate;if(R){var U=L(R,C);if(U){if(U===h)continue;return U}}if("next"===C.method)C.sent=C._sent=C.arg;else if("throw"===C.method){if(B===y)throw B=c,C.arg;C.dispatchException(C.arg)}else"return"===C.method&&C.abrupt("return",C.arg);B=J;var w=M(A,I,C);if("normal"===w.type){if(B=C.done?c:o,w.arg===h)continue;return{value:w.arg,done:C.done}}"throw"===w.type&&(B=c,C.method="throw",C.arg=w.arg)}}}function L(A,I){var C=I.method,B=A.iterator[C];if(B===g)return I.delegate=null,"throw"===C&&A.iterator.return&&(I.method="return",I.arg=g,L(A,I),"throw"===I.method)||"return"!==C&&(I.method="throw",I.arg=new TypeError("The iterator does not provide a '"+C+"' method")),h;var Q=M(B,A.iterator,I.arg);if("throw"===Q.type)return I.method="throw",I.arg=Q.arg,I.delegate=null,h;var E=Q.arg;return E?E.done?(I[A.resultName]=E.value,I.next=A.nextLoc,"return"!==I.method&&(I.method="next",I.arg=g),I.delegate=null,h):E:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,h)}function d(A){var I={tryLoc:A[0]};1 in A&&(I.catchLoc=A[1]),2 in A&&(I.finallyLoc=A[2],I.afterLoc=A[3]),this.tryEntries.push(I)}function a(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function V(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(d,this),this.reset(!0)}function b(A){if(A||""===A){var C=A[w];if(C)return C.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var B=-1,Q=function I(){for(;++B<A.length;)if(E.call(A,B))return I.value=A[B],I.done=!1,I;return I.value=g,I.done=!0,I};return Q.next=Q}}throw new TypeError(I(A)+" is not iterable")}return s.prototype=N,R(K,"constructor",{value:N,configurable:!0}),R(N,"constructor",{value:s,configurable:!0}),s.displayName=i(N,D,"GeneratorFunction"),B.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===s||"GeneratorFunction"===(I.displayName||I.name))},B.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,N):(A.__proto__=N,i(A,D,"GeneratorFunction")),A.prototype=Object.create(K),A},B.awrap=function(A){return{__await:A}},k(H.prototype),i(H.prototype,F,(function(){return this})),B.AsyncIterator=H,B.async=function(A,I,C,g,Q){void 0===Q&&(Q=Promise);var E=new H(G(A,I,C,g),Q);return B.isGeneratorFunction(I)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},k(K),i(K,D,"Generator"),i(K,w,(function(){return this})),i(K,"toString",(function(){return"[object Generator]"})),B.keys=function(A){var I=Object(A),C=[];for(var g in I)C.push(g);return C.reverse(),function A(){for(;C.length;){var g=C.pop();if(g in I)return A.value=g,A.done=!1,A}return A.done=!0,A}},B.values=b,V.prototype={constructor:V,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(a),!A)for(var I in this)"t"===I.charAt(0)&&E.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=g)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var I=this;function C(C,B){return R.type="throw",R.arg=A,I.next=C,B&&(I.method="next",I.arg=g),!!B}for(var B=this.tryEntries.length-1;B>=0;--B){var Q=this.tryEntries[B],R=Q.completion;if("root"===Q.tryLoc)return C("end");if(Q.tryLoc<=this.prev){var U=E.call(Q,"catchLoc"),w=E.call(Q,"finallyLoc");if(U&&w){if(this.prev<Q.catchLoc)return C(Q.catchLoc,!0);if(this.prev<Q.finallyLoc)return C(Q.finallyLoc)}else if(U){if(this.prev<Q.catchLoc)return C(Q.catchLoc,!0)}else{if(!w)throw Error("try statement without catch or finally");if(this.prev<Q.finallyLoc)return C(Q.finallyLoc)}}}},abrupt:function(A,I){for(var C=this.tryEntries.length-1;C>=0;--C){var g=this.tryEntries[C];if(g.tryLoc<=this.prev&&E.call(g,"finallyLoc")&&this.prev<g.finallyLoc){var B=g;break}}B&&("break"===A||"continue"===A)&&B.tryLoc<=I&&I<=B.finallyLoc&&(B=null);var Q=B?B.completion:{};return Q.type=A,Q.arg=I,B?(this.method="next",this.next=B.finallyLoc,h):this.complete(Q)},complete:function(A,I){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&I&&(this.next=I),h},finish:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var C=this.tryEntries[I];if(C.finallyLoc===A)return this.complete(C.completion,C.afterLoc),a(C),h}},catch:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var C=this.tryEntries[I];if(C.tryLoc===A){var g=C.completion;if("throw"===g.type){var B=g.arg;a(C)}return B}}throw Error("illegal catch attempt")},delegateYield:function(A,I,C){return this.delegate={iterator:b(A),resultName:I,nextLoc:C},"next"===this.method&&(this.arg=g),h}},B}A.exports=C,A.exports.__esModule=!0,A.exports.default=A.exports}(y);var c=y.exports;G(c);var h=c(),l=h;try{regeneratorRuntime=h}catch(A){"object"===("undefined"==typeof globalThis?"undefined":g(globalThis))?globalThis.regeneratorRuntime=h:Function("r","regeneratorRuntime = r")(h)}var s=G(l);function N(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}function Y(A,I){for(var C=0;C<I.length;C++){var g=I[C];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(A,w(g.key),g)}}function S(A,I,C){return I&&Y(A.prototype,I),C&&Y(A,C),Object.defineProperty(A,"prototype",{writable:!1}),A}function Z(A,I){var C=Object.keys(A);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(A);I&&(g=g.filter((function(I){return Object.getOwnPropertyDescriptor(A,I).enumerable}))),C.push.apply(C,g)}return C}var K=function(){function A(){N(this,A),this._path=""}return S(A,[{key:"meta",get:function(){if(void 0!==this._meta)return function(A){for(var I=1;I<arguments.length;I++){var C=null!=arguments[I]?arguments[I]:{};I%2?Z(Object(C),!0).forEach((function(I){F(A,I,C[I])})):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(C)):Z(Object(C)).forEach((function(I){Object.defineProperty(A,I,Object.getOwnPropertyDescriptor(C,I))}))}return A}({version:0},this._meta)}},{key:"pageSize",get:function(){}}],[{key:"getPtr",value:function(I){if(A._filePtrs.has(I))return A._filePtrs.get(I);throw new Error("File instance not found.")}},{key:"setPtr",value:function(I,C){A._filePtrs.set(I,C)}},{key:"removePtr",value:function(I){A._filePtrs.delete(I)}}])}();function k(A,I){if(I&&("object"==U(I)||"function"==typeof I))return I;if(void 0!==I)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}function H(A){return H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},H(A)}function j(A,I){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,I){return A.__proto__=I,A},j(A,I)}function L(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),I&&j(A,I)}function d(A,I,C){return I=H(I),k(A,a()?Reflect.construct(I,C||[],H(A).constructor):I.apply(A,C))}function a(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(A){}return(a=function(){return!!A})()}K._filePtrs=new Map;var V="pv_file",b=S((function A(){N(this,A),this._pos=0,this._data=new Uint8Array}),[{key:"get",value:function(A){if(!(this._pos>=this._data.length)){var I=this._data.slice(this._pos,this._pos+A);return this._pos+=A,I}}},{key:"set",value:function(A,I){this._pos=A,this._data=I}},{key:"clear",value:function(){this._pos=0,this._data=new Uint8Array}}]),X=function(A){function I(A,C,g,B){var Q;return N(this,I),(Q=d(this,I))._pageSize=524288,Q._pagePtr=0,Q._pageOffset=0,Q._path=A,Q._meta=C,Q._db=g,Q._mode=B,Q._cache=new b,Q}return L(I,A),S(I,[{key:"pageSize",get:function(){return this._pageSize}},{key:"close",value:(Q=i(s.mark((function A(){return s.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this._db.close();case 1:case"end":return A.stop()}}),A,this)}))),function(){return Q.apply(this,arguments)})},{key:"read",value:(B=i(s.mark((function A(C,g){var B=this;return s.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,Q){if(B.exists()){if(B._isEOF){var E=new Error("EOF");return E.name="EndOfFile",void Q(E)}var R=0,U=Math.min(C*g,B._meta.size),w=U-U%C,F=new Uint8Array(w),D=B._cache.get(w);if(D){if(R+=D.length,B._pageOffset+=D.length,B._pageOffset===B._pageSize&&(B._pagePtr+=1,B._pageOffset=0),w===R)return void A(D);F.set(D)}var i=IDBKeyRange.bound("".concat(B._path,"-").concat(I.createPage(B._pagePtr)),"".concat(B._path,"-").concat(I.createPage(B._pagePtr+Math.floor(w/B._pageSize)+1))),G=B._store,M=G.openCursor(i);M.onsuccess=function(){var A=M.result;if(A&&!B._isEOF){var I,C,g=Math.min(w-R,A.value.length-B._pageOffset);F.set(A.value.slice(B._pageOffset,B._pageOffset+g),R),R+=g,B._pageOffset+=g,B._pageOffset===B._pageSize&&(B._pagePtr+=1,B._pageOffset=0),R<w?A.continue():(0!==B._pageOffset?B._cache.set(B._pageOffset,A.value):B._cache.clear(),null!==(I=G.transaction)&&void 0!==I&&I.commit&&(null===(C=G.transaction)||void 0===C||C.commit()))}},G.transaction.onerror=function(){Q(G.transaction.error)},G.transaction.oncomplete=function(){A(F.slice(0,R))}}else Q(new Error("'".concat(B._path,"' doesn't exist.")))})));case 1:case"end":return A.stop()}}),A)}))),function(A,I){return B.apply(this,arguments)})},{key:"write",value:(g=i(s.mark((function A(C){var g,B=this,Q=arguments;return s.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return g=Q.length>1&&void 0!==Q[1]?Q[1]:1,A.abrupt("return",new Promise(function(){var A=i(s.mark((function A(Q,E){var R,U,w,F,D,i,G,M,y,o,J;return s.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if("readonly"!==B._mode){A.next=3;break}return E(new Error("Instance is readonly mode only.")),A.abrupt("return");case 3:if(!("number"!=typeof g&&g<=0)){A.next=6;break}return E(new Error("Version should be a positive number")),A.abrupt("