New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@picovoice/web-utils

Package Overview
Dependencies
Maintainers
6
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@picovoice/web-utils - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

2

dist/esm/index.min.js
function t(t,e,r,n,o,a,i){try{var s=t[a](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function e(e){return function(){var r=this,n=arguments;return new Promise((function(o,a){var i=e.apply(r,n);function s(e){t(i,o,a,s,c,"next",e)}function c(e){t(i,o,a,s,c,"throw",e)}s(void 0)}))}}function r(t){var e={exports:{}};return t(e,e.exports),e.exports}var n=r((function(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),o=r((function(t){var e=n.default;function r(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
t.exports=r=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var n={},o=Object.prototype,a=o.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new k(n||[]);return a._invoke=function(t,e,r){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 I()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=b(i,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var h={};function _(){}function v(){}function d(){}var y={};f(y,s,(function(){return this}));var E=Object.getPrototypeOf,m=E&&E(E(T([])));m&&m!==o&&a.call(m,s)&&(y=m);var w=d.prototype=_.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,r){function n(o,i,s,c){var u=l(t[o],t,i);if("throw"!==u.type){var f=u.arg,p=f.value;return p&&"object"==e(p)&&a.call(p,"__await")?r.resolve(p.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):r.resolve(p).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,c)}))}c(u.arg)}var o;this._invoke=function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(a.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:I}}function I(){return{value:void 0,done:!0}}return v.prototype=d,f(w,"constructor",d),f(d,"constructor",v),v.displayName=f(d,u,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,f(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},n.awrap=function(t){return{__await:t}},g(x.prototype),f(x.prototype,c,(function(){return this})),n.AsyncIterator=x,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new x(p(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(w),f(w,u,"Generator"),f(w,s,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},n.values=T,k.prototype={constructor:k,reset:function(t){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(S),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}))();const a=new WeakMap;function i(t,e){return new Proxy(t,{get:(t,r)=>e(t[r])})}class s{constructor(){this.value=void 0,this.exports=null}getState(){return this.exports.asyncify_get_state()}assertNoneState(){let t=this.getState();if(0!==t)throw new Error(`Invalid async state ${t}, expected 0.`)}wrapImportFn(t){return(...e)=>{if(2===this.getState())return this.exports.asyncify_stop_rewind(),this.value;this.assertNoneState();let r=t(...e);if(!(n=r)||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof n.then)return r;var n;this.exports.asyncify_start_unwind(16),this.value=r}}wrapModuleImports(t){return i(t,(t=>"function"==typeof t?this.wrapImportFn(t):t))}wrapImports(t){if(void 0!==t)return i(t,((t=Object.create(null))=>this.wrapModuleImports(t)))}wrapExportFn(t){let e=a.get(t);return void 0!==e||(e=async(...e)=>{this.assertNoneState();let r=t(...e);for(;1===this.getState();)this.exports.asyncify_stop_unwind(),this.value=await this.value,this.assertNoneState(),this.exports.asyncify_start_rewind(16),r=t();return this.assertNoneState(),r},a.set(t,e)),e}wrapExports(t){let e=Object.create(null);for(let r in t){let n=t[r];"function"!=typeof n||r.startsWith("asyncify_")||(n=this.wrapExportFn(n)),Object.defineProperty(e,r,{enumerable:!0,value:n})}return a.set(t,e),e}init(t,e){const{exports:r}=t,n=r.memory||e.env&&e.env.memory;new Int32Array(n.buffer,16).set([24,1024]),this.exports=this.wrapExports(r),Object.setPrototypeOf(t,c.prototype)}}class c extends WebAssembly.Instance{constructor(t,e){let r=new s;super(t,r.wrapImports(e)),r.init(this,e)}get exports(){return a.get(super.exports)}}async function u(t,e){let r=new s,n=await WebAssembly.instantiate(t,r.wrapImports(e));return r.init(n instanceof WebAssembly.Instance?n:n.instance,e),n}async function f(t,e){let r=new s,n=await WebAssembly.instantiateStreaming(t,r.wrapImports(e));return r.init(n.instance,e),n}function p(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(c.prototype,"exports",{enumerable:!0});function d(){return new Promise((function(t,e){var r=self.indexedDB.open("pv_db",2);r.onerror=function(){e(r.error)},r.onsuccess=function(){t(r.result)},r.onupgradeneeded=function(){r.result.objectStoreNames.contains("pv_store")||r.result.createObjectStore("pv_store"),r.result.objectStoreNames.contains("pv_file")||r.result.createObjectStore("pv_file")}}))}var y=function(t){return new Promise((function(e,r){t.onerror=function(){r(t.error)},t.onsuccess=function(){e(t.result)}}))};function E(){var t,r,n,a,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(self.indexedDB)return{setItem:(a=e(o.mark((function t(e,r){var n,a;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:return n=t.sent,a=n.transaction("pv_store","readwrite").objectStore("pv_store").put(r,e),t.next=6,y(a);case 6:n.close();case 7:case"end":return t.stop()}}),t)}))),function(t,e){return a.apply(this,arguments)}),getItem:(n=e(o.mark((function t(e){var r,n,a;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:return r=t.sent,n=r.transaction("pv_store","readonly").objectStore("pv_store").get(e),t.next=6,y(n);case 6:return a=t.sent,r.close(),t.abrupt("return",a);case 9:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)}),removeItem:(r=e(o.mark((function t(e){var r,n;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:return r=t.sent,n=r.transaction("pv_store","readwrite").objectStore("pv_store").delete(e),t.next=6,y(n);case 6:r.close();case 7:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)}),exists:(t=e(o.mark((function t(e){var r,n,a;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:return r=t.sent,n=r.transaction("pv_store","readonly").objectStore("pv_store").count(e),t.next=6,y(n);case 6:return a=t.sent,r.close(),t.abrupt("return",a>0);case 9:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};if(i)throw new Error("IndexedDB is required but not available.");if(self.localStorage){var s=self.localStorage,c=s.setItem,u=s.getItem,f=s.removeItem,p=function(t){return null!==u(t)};return{setItem:c,getItem:u,removeItem:f,exists:p}}throw new Error("Cannot get a persistent storage object.")}function m(t,e){for(var r=e;0!==t[r];)r++;return new TextDecoder("utf-8").decode(t.subarray(e,r))}function w(t){for(var e=atob(t),r=new Uint8Array(e.length),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function g(t,e,r){for(var n="",o=0;o<e;o++)n+=String.fromCharCode(t[r+o]);return btoa(n)}function x(t){var e,r={},n=_(t.split("\r\n"));try{for(n.s();!(e=n.n()).done;){var o=e.value.split(": ");""!==o[0]&&(r[o[0]]=o[1])}}catch(t){n.e(t)}finally{n.f()}return r}function b(t){return P.apply(this,arguments)}function P(){return P=e(o.mark((function t(e){var r,n,a,i,s,c,u=arguments;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:5e3,a=new AbortController,i=h(h({},r),{},{signal:a.signal}),s=setTimeout((function(){a.abort()}),n),t.next=7,fetch(e,i);case 7:return c=t.sent,clearTimeout(s),t.abrupt("return",c);case 10:case"end":return t.stop()}}),t)}))),P.apply(this,arguments)}function S(t){if("string"!=typeof t||null==t)return!1;var e=t.trim();if(""===e)return!1;try{return btoa(atob(e))===e}catch(t){return!1}}function k(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var T=function(){function t(e,r,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),p(this,"_pageSize",65536),p(this,"_path",void 0),p(this,"_db",void 0),p(this,"_mode",void 0),p(this,"_meta",void 0),p(this,"_pagePtr",0),p(this,"_pageOffset",0),this._path=e,this._meta=r,this._db=n,this._mode=o}var r,n,a,i,s,c,u,f;return r=t,n=[{key:"close",value:(f=e(o.mark((function t(){return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._db.close();case 1:case"end":return t.stop()}}),t,this)}))),function(){return f.apply(this,arguments)})},{key:"read",value:(u=e(o.mark((function e(r,n){var a=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){if(void 0!==a._meta){if(a._isEOF){var i=new Error("EOF");return i.name="EndOfFile",void o(i)}var s=0,c=Math.min(r*n,a._meta.size),u=c-c%r,f=new Uint8Array(u),p=IDBKeyRange.bound("".concat(a._path,"-").concat(t.createPage(a._pagePtr)),"".concat(a._path,"-").concat(t.createPage(a._meta.numPages))),l=a._store,h=l.openCursor(p);h.onsuccess=function(){var t=h.result;if(t&&!a._isEOF){var e=Math.min(u-s,t.value.length-a._pageOffset);f.set(t.value.slice(a._pageOffset,a._pageOffset+e),s),s+=e,a._pageOffset+=e,a._pageOffset===a._pageSize&&(a._pagePtr+=1,a._pageOffset=0),s<u&&t.continue()}},l.transaction.onerror=function(){o(l.transaction.error)},l.transaction.oncomplete=function(){e(f.slice(0,s))}}else o(new Error("'".concat(a._path,"' doesn't exist.")))})));case 1:case"end":return e.stop()}}),e)}))),function(t,e){return u.apply(this,arguments)})},{key:"write",value:(c=e(o.mark((function e(r){var n=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){if("readonly"!==n._mode){var a=n._store,i=Math.ceil(r.length/n._pageSize),s={size:r.length,numPages:i},c=function(){a.add(s,n._path);for(var e=0;e<i;e++)a.add(r.slice(e*n._pageSize,(e+1)*n._pageSize),"".concat(n._path,"-").concat(t.createPage(e)))};if(n._meta){var u=n._meta.numPages,f=IDBKeyRange.bound(n._path,"".concat(n._path,"-").concat(t.createPage(u)));a.delete(f).onsuccess=function(){return c()}}else c();a.transaction.onerror=function(){o(a.transaction.error)},a.transaction.oncomplete=function(){n._meta=s,e()}}else o(new Error("Instance is readonly mode only."))})));case 1:case"end":return e.stop()}}),e)}))),function(t){return c.apply(this,arguments)})},{key:"seek",value:function(t,e){if(void 0===this._meta)throw new Error("'".concat(this._path,"' doesn't exist."));if(t<0){var r=new Error("EOF");throw r.name="EndOfFile",r}var n;if(0===e)n=Math.min(t,this._meta.size);else if(1===e){var o=this._pageSize*this._pagePtr+this._pageOffset;n=Math.min(o+t,this._meta.size)}else{if(2!==e)throw new Error("Invalid operation: ".concat(e,"."));n=Math.min(this._meta.size+t,this._meta.size)}this._pageOffset=n%this._pageSize,this._pagePtr=Math.floor(n/this._pageSize)}},{key:"tell",value:function(){return this._pagePtr*this._pageSize+this._pageOffset}},{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("pv_file",this._mode).objectStore("pv_file")}}],a=[{key:"open",value:function(r,n){if(!self.indexedDB)throw new Error("IndexedDB is not supported");return new Promise(function(){var a=e(o.mark((function e(a,i){var s,c,u;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d();case 2:s=e.sent,c=n.includes("r")?"readonly":"readwrite",(u=s.transaction("pv_file",c).objectStore("pv_file").get(r)).onerror=function(){i(u.error)},u.onsuccess=function(){void 0===u.result&&"readonly"===c?i("Instance is readonly mode but '".concat(r,"' doesn't exist.")):a(new t(r,u.result,s,c))};case 7:case"end":return e.stop()}}),e)})));return function(t,e){return a.apply(this,arguments)}}())}},{key:"remove",value:(s=e(o.mark((function r(n){var a=this;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(self.indexedDB){r.next=2;break}throw new Error("IndexedDB is not supported");case 2:return r.abrupt("return",new Promise(function(){var r=e(o.mark((function e(r,i){var s,c,u,f,p;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.open(n,"w");case 2:s=e.sent,c=s._meta.numPages,u=IDBKeyRange.bound(s._path,"".concat(s._path,"-").concat(t.createPage(c))),f=s._store,(p=f.delete(u)).onerror=function(){i(p.error)},p.onsuccess=function(){r()};case 9:case"end":return e.stop()}}),e)})));return function(t,e){return r.apply(this,arguments)}}()));case 3:case"end":return r.stop()}}),r)}))),function(t){return s.apply(this,arguments)})},{key:"exists",value:(i=e(o.mark((function t(e){var r;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(self.indexedDB){t.next=2;break}throw new Error("IndexedDB is not supported");case 2:return t.prev=2,t.next=5,this.open(e,"r");case 5:return r=t.sent,t.abrupt("return",void 0!==r._meta);case 9:return t.prev=9,t.t0=t.catch(2),t.abrupt("return",!1);case 12:case"end":return t.stop()}}),t,this,[[2,9]])}))),function(t){return i.apply(this,arguments)})},{key:"getPtr",value:function(e){return t._filePtrs.get(e)}},{key:"setPtr",value:function(e,r){t._filePtrs.set(e,r)}},{key:"removePtr",value:function(e){t._filePtrs.delete(e)}},{key:"createPage",value:function(t){return("000"+t).slice(-4)}}],n&&k(r.prototype,n),a&&k(r,a),Object.defineProperty(r,"prototype",{writable:!1}),t}();p(T,"_filePtrs",new Map);var I={args_get:function(t){return 0},args_sizes_get:function(t){return 0},environ_get:function(t){return 0},environ_sizes_get:function(t){return 0},clock_res_get:function(t){return 0},clock_time_get:function(t){return 0},fd_advise:function(t){return 0},fd_allocate:function(t){return 0},fd_close:function(t){return 0},fd_datasync:function(t){return 0},fd_fdstat_get:function(t){return 0},fd_fdstat_set_flags:function(t){return 0},fd_fdstat_set_rights:function(t){return 0},fd_filestat_get:function(t){return 0},fd_filestat_set_size:function(t){return 0},fd_filestat_set_times:function(t){return 0},fd_pread:function(t){return 0},fd_prestat_get:function(t){return 0},fd_prestat_dir_name:function(t){return 0},fd_pwrite:function(t){return 0},fd_read:function(t){return 0},fd_readdir:function(t){return 0},fd_renumber:function(t){return 0},fd_seek:function(t){return 0},fd_sync:function(t){return 0},fd_tell:function(t){return 0},fd_write:function(t){return 0},path_create_directory:function(t){return 0},path_filestat_get:function(t){return 0},path_filestat_set_times:function(t){return 0},path_link:function(t){return 0},path_open:function(t){return 0},path_readlink:function(t){return 0},path_remove_directory:function(t){return 0},path_rename:function(t){return 0},path_symlink:function(t){return 0},path_unlink_file:function(t){return 0},poll_oneoff:function(t){return 0},proc_exit:function(t){return 0},proc_raise:function(t){return 0},sched_yield:function(t){return 0},random_get:function(t){return 0},sock_recv:function(t){return 0},sock_send:function(t){return 0},sock_shutdown:function(t){return 0}};function L(t,e){return O.apply(this,arguments)}function O(){return O=e(o.mark((function t(r,n){var a,i,s,c,p,l,h,_,v,d,y,P,S,k,L,O,A,M,N,B,j,R,Y;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=new Uint8Array(r.buffer),i=new Int32Array(r.buffer),s=E(),c=function(t){console.log(m(a,t))},p=function(t,e,r){if(0===t){var n=m(a,r);throw new Error("assertion failed at line ".concat(e,' in "').concat(n,'"'))}},l=function(){return Date.now()/1e3},h=function(){var t=e(o.mark((function t(e,r,n,s,c,u,f,p,l){var h,_,v,d,y,E,w,g,P,S,k;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return h=m(a,e),_=m(a,r),v=m(a,n),d=m(a,s),y=m(a,c),E=x(d),t.prev=6,t.next=9,b("https://"+_+v,{method:h,headers:E,body:y},u);case 9:w=t.sent,P=w.status,t.next=16;break;case 13:t.prev=13,t.t0=t.catch(6),P=0;case 16:if(void 0===w){t.next=36;break}return t.prev=17,t.next=20,w.text();case 20:g=t.sent,t.next=27;break;case 23:t.prev=23,t.t1=t.catch(17),g="",P=1;case 27:return t.next=29,Y(Int8Array.BYTES_PER_ELEMENT,(g.length+1)*Int8Array.BYTES_PER_ELEMENT);case 29:if(0!==(S=t.sent)){t.next=32;break}throw new Error("malloc failed: Cannot allocate memory");case 32:for(i[p/Int32Array.BYTES_PER_ELEMENT]=g.length+1,i[f/Int32Array.BYTES_PER_ELEMENT]=S,k=0;k<g.length;k++)a[S+k]=g.charCodeAt(k);a[S+g.length]=0;case 36:i[l/Int32Array.BYTES_PER_ELEMENT]=P;case 37:case"end":return t.stop()}}),t,null,[[6,13],[17,23]])})));return function(e,r,n,o,a,i,s,c,u){return t.apply(this,arguments)}}(),_=function(){var t=e(o.mark((function t(e,r,n,c){var u,f,p,l;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=m(a,e),t.prev=1,t.next=4,s.getItem(u);case 4:return f=t.sent,p=w(f),t.next=8,Y(Uint8Array.BYTES_PER_ELEMENT,p.length*Uint8Array.BYTES_PER_ELEMENT);case 8:if(0!==(l=t.sent)){t.next=11;break}throw new Error("malloc failed: Cannot allocate memory");case 11:i[r/Int32Array.BYTES_PER_ELEMENT]=p.byteLength,i[n/Int32Array.BYTES_PER_ELEMENT]=l,a.set(p,l),i[c/Int32Array.BYTES_PER_ELEMENT]=1,t.next=20;break;case 17:t.prev=17,t.t0=t.catch(1),i[c/Int32Array.BYTES_PER_ELEMENT]=0;case 20:case"end":return t.stop()}}),t,null,[[1,17]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),v=function(){var t=e(o.mark((function t(e,r,n,c){var u,f;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=m(a,e),f=g(a,r,n),t.prev=2,t.next=5,s.setItem(u,f);case 5:i[c/Int32Array.BYTES_PER_ELEMENT]=1,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),i[c/Int32Array.BYTES_PER_ELEMENT]=0;case 11:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),d=function(){var t=e(o.mark((function t(e,r,n){var c,u;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=m(a,e),t.prev=1,t.next=4,s.exists(c);case 4:u=t.sent,a[r]=u?1:0,i[n/Int32Array.BYTES_PER_ELEMENT]=1,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),i[n/Int32Array.BYTES_PER_ELEMENT]=0;case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,r,n){return t.apply(this,arguments)}}(),y=function(){var t=e(o.mark((function t(e,r){var n;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=m(a,e),t.prev=1,t.next=4,s.removeItem(n);case 4:i[r/Int32Array.BYTES_PER_ELEMENT]=1,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),i[r/Int32Array.BYTES_PER_ELEMENT]=0;case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e,r){return t.apply(this,arguments)}}(),P=function(){var t=e(o.mark((function t(e){var r,n,s;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=void 0!==navigator.userAgent?navigator.userAgent:"unknown",t.next=3,Y(Uint8Array.BYTES_PER_ELEMENT,(r.length+1)*Uint8Array.BYTES_PER_ELEMENT);case 3:if(0!==(n=t.sent)){t.next=6;break}throw new Error("malloc failed: Cannot allocate memory");case 6:for(i[e/Int32Array.BYTES_PER_ELEMENT]=n,s=0;s<r.length;s++)a[n+s]=r.charCodeAt(s);a[n+r.length]=0;case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),S=function(){var t=e(o.mark((function t(e){var r,n,s,c;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null!==(r=self.origin)&&void 0!==r?r:self.location.origin,t.next=3,Y(Uint8Array.BYTES_PER_ELEMENT,(n.length+1)*Uint8Array.BYTES_PER_ELEMENT);case 3:if(0!==(s=t.sent)){t.next=6;break}throw new Error("malloc failed: Cannot allocate memory");case 6:for(i[e/Int32Array.BYTES_PER_ELEMENT]=s,c=0;c<n.length;c++)a[s+c]=n.charCodeAt(c);a[s+n.length]=0;case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),k=function(){var t=e(o.mark((function t(e,r,n,s){var c,u,f;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=m(a,r),u=m(a,n),t.prev=2,t.next=5,T.open(c,u);case 5:f=t.sent,T.setPtr(e,f),i[s/Int32Array.BYTES_PER_ELEMENT]=0,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(2),i[s/Int32Array.BYTES_PER_ELEMENT]=-1;case 13:case"end":return t.stop()}}),t,null,[[2,10]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),L=function(){var t=e(o.mark((function t(e,r){var n;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,T.getPtr(e);case 3:return n=t.sent,t.next=6,n.close();case 6:i[r/Int32Array.BYTES_PER_ELEMENT]=0,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),i[r/Int32Array.BYTES_PER_ELEMENT]=-1;case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(e,r){return t.apply(this,arguments)}}(),O=function(){var t=e(o.mark((function t(e,r,n,s,c){var u,f;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,T.getPtr(e);case 3:return u=t.sent,t.next=6,u.read(n,s);case 6:f=t.sent,a.set(f,r),i[c/Int32Array.BYTES_PER_ELEMENT]=f.length/n,t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),i[c/Int32Array.BYTES_PER_ELEMENT]=-1;case 14:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e,r,n,o,a){return t.apply(this,arguments)}}(),A=function(t,e,r,n){try{T.getPtr(t).seek(e,r),i[n/Int32Array.BYTES_PER_ELEMENT]=0}catch(t){i[n/Int32Array.BYTES_PER_ELEMENT]=-1}},M=function(t,e){try{var r=T.getPtr(t);i[e/Int32Array.BYTES_PER_ELEMENT]=r.tell()}catch(t){i[e/Int32Array.BYTES_PER_ELEMENT]=-1}},N=function(){var t=e(o.mark((function t(e,r){var n;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=m(a,e),t.prev=1,t.next=4,T.remove(n);case 4:i[r/Int32Array.BYTES_PER_ELEMENT]=0,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),i[r/Int32Array.BYTES_PER_ELEMENT]=-1;case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e,r){return t.apply(this,arguments)}}(),B={wasi_snapshot_preview1:I,env:{memory:r,pv_console_log_wasm:c,pv_assert_wasm:p,pv_time_wasm:l,pv_https_request_wasm:h,pv_file_load_wasm:_,pv_file_save_wasm:v,pv_file_exists_wasm:d,pv_file_delete_wasm:y,pv_get_browser_info:P,pv_get_origin_info:S,pv_file_open_wasm:k,pv_file_close_wasm:L,pv_file_read_wasm:O,pv_file_seek_wasm:A,pv_file_tell_wasm:M,pv_file_remove_wasm:N}},!(n instanceof Promise)){t.next=26;break}return t.next=23,f(n,B);case 23:j=t.sent.instance,t.next=30;break;case 26:return R=w(n),t.next=29,u(R,B);case 29:j=t.sent.instance;case 30:return Y=j.exports.aligned_alloc,t.abrupt("return",j.exports);case 32:case"end":return t.stop()}}),t)}))),O.apply(this,arguments)}var A={DB_NAME:"pv_db",DB_VERSION:2,STORE_NAME:"pv_store",PV_FILE_STORE:"pv_file"};export{T as PvFile,g as arrayBufferToBase64AtIndex,m as arrayBufferToStringAtIndex,w as base64ToUint8Array,L as buildWasm,A as dbConfig,b as fetchWithTimeout,d as getDB,E as getPvStorage,S as isAccessKeyValid,x as stringHeaderToObject};
t.exports=r=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var n={},o=Object.prototype,a=o.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new k(n||[]);return a._invoke=function(t,e,r){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 I()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=b(i,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var h={};function _(){}function v(){}function d(){}var y={};f(y,s,(function(){return this}));var E=Object.getPrototypeOf,m=E&&E(E(T([])));m&&m!==o&&a.call(m,s)&&(y=m);var w=d.prototype=_.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,r){function n(o,i,s,c){var u=l(t[o],t,i);if("throw"!==u.type){var f=u.arg,p=f.value;return p&&"object"==e(p)&&a.call(p,"__await")?r.resolve(p.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):r.resolve(p).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,c)}))}c(u.arg)}var o;this._invoke=function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(a.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:I}}function I(){return{value:void 0,done:!0}}return v.prototype=d,f(w,"constructor",d),f(d,"constructor",v),v.displayName=f(d,u,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,f(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},n.awrap=function(t){return{__await:t}},g(x.prototype),f(x.prototype,c,(function(){return this})),n.AsyncIterator=x,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new x(p(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(w),f(w,u,"Generator"),f(w,s,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},n.values=T,k.prototype={constructor:k,reset:function(t){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(S),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}))();const a=new WeakMap;function i(t,e){return new Proxy(t,{get:(t,r)=>e(t[r])})}class s{constructor(){this.value=void 0,this.exports=null}getState(){return this.exports.asyncify_get_state()}assertNoneState(){let t=this.getState();if(0!==t)throw new Error(`Invalid async state ${t}, expected 0.`)}wrapImportFn(t){return(...e)=>{if(2===this.getState())return this.exports.asyncify_stop_rewind(),this.value;this.assertNoneState();let r=t(...e);if(!(n=r)||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof n.then)return r;var n;this.exports.asyncify_start_unwind(16),this.value=r}}wrapModuleImports(t){return i(t,(t=>"function"==typeof t?this.wrapImportFn(t):t))}wrapImports(t){if(void 0!==t)return i(t,((t=Object.create(null))=>this.wrapModuleImports(t)))}wrapExportFn(t){let e=a.get(t);return void 0!==e||(e=async(...e)=>{this.assertNoneState();let r=t(...e);for(;1===this.getState();)this.exports.asyncify_stop_unwind(),this.value=await this.value,this.assertNoneState(),this.exports.asyncify_start_rewind(16),r=t();return this.assertNoneState(),r},a.set(t,e)),e}wrapExports(t){let e=Object.create(null);for(let r in t){let n=t[r];"function"!=typeof n||r.startsWith("asyncify_")||(n=this.wrapExportFn(n)),Object.defineProperty(e,r,{enumerable:!0,value:n})}return a.set(t,e),e}init(t,e){const{exports:r}=t,n=r.memory||e.env&&e.env.memory;new Int32Array(n.buffer,16).set([24,1024]),this.exports=this.wrapExports(r),Object.setPrototypeOf(t,c.prototype)}}class c extends WebAssembly.Instance{constructor(t,e){let r=new s;super(t,r.wrapImports(e)),r.init(this,e)}get exports(){return a.get(super.exports)}}async function u(t,e){let r=new s,n=await WebAssembly.instantiate(t,r.wrapImports(e));return r.init(n instanceof WebAssembly.Instance?n:n.instance,e),n}async function f(t,e){let r=new s,n=await WebAssembly.instantiateStreaming(t,r.wrapImports(e));return r.init(n.instance,e),n}function p(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(c.prototype,"exports",{enumerable:!0});function d(){return new Promise((function(t,e){var r=self.indexedDB.open("pv_db",2);r.onerror=function(){e(r.error)},r.onsuccess=function(){t(r.result)},r.onupgradeneeded=function(){r.result.objectStoreNames.contains("pv_store")||r.result.createObjectStore("pv_store"),r.result.objectStoreNames.contains("pv_file")||r.result.createObjectStore("pv_file")}}))}var y=function(t){return new Promise((function(e,r){t.onerror=function(){r(t.error)},t.onsuccess=function(){e(t.result)}}))};function E(){var t,r,n,a,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(self.indexedDB)return{setItem:(a=e(o.mark((function t(e,r){var n,a;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:return n=t.sent,a=n.transaction("pv_store","readwrite").objectStore("pv_store").put(r,e),t.next=6,y(a);case 6:n.close();case 7:case"end":return t.stop()}}),t)}))),function(t,e){return a.apply(this,arguments)}),getItem:(n=e(o.mark((function t(e){var r,n,a;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:return r=t.sent,n=r.transaction("pv_store","readonly").objectStore("pv_store").get(e),t.next=6,y(n);case 6:return a=t.sent,r.close(),t.abrupt("return",a);case 9:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)}),removeItem:(r=e(o.mark((function t(e){var r,n;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:return r=t.sent,n=r.transaction("pv_store","readwrite").objectStore("pv_store").delete(e),t.next=6,y(n);case 6:r.close();case 7:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)}),exists:(t=e(o.mark((function t(e){var r,n,a;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:return r=t.sent,n=r.transaction("pv_store","readonly").objectStore("pv_store").count(e),t.next=6,y(n);case 6:return a=t.sent,r.close(),t.abrupt("return",a>0);case 9:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};if(i)throw new Error("IndexedDB is required but not available.");if(self.localStorage){var s=self.localStorage,c=s.setItem,u=s.getItem,f=s.removeItem,p=function(t){return null!==u(t)};return{setItem:c,getItem:u,removeItem:f,exists:p}}throw new Error("Cannot get a persistent storage object.")}function m(t,e){for(var r=e;0!==t[r];)r++;return new TextDecoder("utf-8").decode(t.subarray(e,r))}function w(t){for(var e=atob(t),r=new Uint8Array(e.length),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function g(t,e,r){for(var n="",o=0;o<e;o++)n+=String.fromCharCode(t[r+o]);return btoa(n)}function x(t){var e,r={},n=_(t.split("\r\n"));try{for(n.s();!(e=n.n()).done;){var o=e.value.split(": ");""!==o[0]&&(r[o[0]]=o[1])}}catch(t){n.e(t)}finally{n.f()}return r}function b(t){return P.apply(this,arguments)}function P(){return P=e(o.mark((function t(e){var r,n,a,i,s,c,u=arguments;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:5e3,a=new AbortController,i=h(h({},r),{},{signal:a.signal}),s=setTimeout((function(){a.abort()}),n),t.next=7,fetch(e,i);case 7:return c=t.sent,clearTimeout(s),t.abrupt("return",c);case 10:case"end":return t.stop()}}),t)}))),P.apply(this,arguments)}function S(t){if("string"!=typeof t||null==t)return!1;var e=t.trim();if(""===e)return!1;try{return btoa(atob(e))===e}catch(t){return!1}}function k(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var T=function(){function t(e,r,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),p(this,"_pageSize",65536),p(this,"_path",void 0),p(this,"_db",void 0),p(this,"_mode",void 0),p(this,"_meta",void 0),p(this,"_pagePtr",0),p(this,"_pageOffset",0),this._path=e,this._meta=r,this._db=n,this._mode=o}var r,n,a,i,s,c,u,f;return r=t,n=[{key:"close",value:(f=e(o.mark((function t(){return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._db.close();case 1:case"end":return t.stop()}}),t,this)}))),function(){return f.apply(this,arguments)})},{key:"read",value:(u=e(o.mark((function e(r,n){var a=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){if(void 0!==a._meta){if(a._isEOF){var i=new Error("EOF");return i.name="EndOfFile",void o(i)}var s=0,c=Math.min(r*n,a._meta.size),u=c-c%r,f=new Uint8Array(u),p=IDBKeyRange.bound("".concat(a._path,"-").concat(t.createPage(a._pagePtr)),"".concat(a._path,"-").concat(t.createPage(a._meta.numPages))),l=a._store,h=l.openCursor(p);h.onsuccess=function(){var t=h.result;if(t&&!a._isEOF){var e=Math.min(u-s,t.value.length-a._pageOffset);f.set(t.value.slice(a._pageOffset,a._pageOffset+e),s),s+=e,a._pageOffset+=e,a._pageOffset===a._pageSize&&(a._pagePtr+=1,a._pageOffset=0),s<u&&t.continue()}},l.transaction.onerror=function(){o(l.transaction.error)},l.transaction.oncomplete=function(){e(f.slice(0,s))}}else o(new Error("'".concat(a._path,"' doesn't exist.")))})));case 1:case"end":return e.stop()}}),e)}))),function(t,e){return u.apply(this,arguments)})},{key:"write",value:(c=e(o.mark((function e(r){var n=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){if("readonly"!==n._mode){var a=n._store,i=Math.ceil(r.length/n._pageSize),s={size:r.length,numPages:i},c=function(){a.add(s,n._path);for(var e=0;e<i;e++)a.add(r.slice(e*n._pageSize,(e+1)*n._pageSize),"".concat(n._path,"-").concat(t.createPage(e)))};if(n._meta){var u=n._meta.numPages,f=IDBKeyRange.bound(n._path,"".concat(n._path,"-").concat(t.createPage(u)));a.delete(f).onsuccess=function(){return c()}}else c();a.transaction.onerror=function(){o(a.transaction.error)},a.transaction.oncomplete=function(){n._meta=s,e()}}else o(new Error("Instance is readonly mode only."))})));case 1:case"end":return e.stop()}}),e)}))),function(t){return c.apply(this,arguments)})},{key:"seek",value:function(t,e){if(void 0===this._meta)throw new Error("'".concat(this._path,"' doesn't exist."));if(t<0){var r=new Error("EOF");throw r.name="EndOfFile",r}var n;if(0===e)n=Math.min(t,this._meta.size);else if(1===e){var o=this._pageSize*this._pagePtr+this._pageOffset;n=Math.min(o+t,this._meta.size)}else{if(2!==e)throw new Error("Invalid operation: ".concat(e,"."));n=Math.min(this._meta.size+t,this._meta.size)}this._pageOffset=n%this._pageSize,this._pagePtr=Math.floor(n/this._pageSize)}},{key:"tell",value:function(){return this._pagePtr*this._pageSize+this._pageOffset}},{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("pv_file",this._mode).objectStore("pv_file")}}],a=[{key:"open",value:function(r,n){if(!self.indexedDB)throw new Error("IndexedDB is not supported");return new Promise(function(){var a=e(o.mark((function e(a,i){var s,c,u;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d();case 2:s=e.sent,c=n.includes("r")?"readonly":"readwrite",(u=s.transaction("pv_file",c).objectStore("pv_file").get(r)).onerror=function(){i(u.error)},u.onsuccess=function(){void 0===u.result&&"readonly"===c?i("Instance is readonly mode but '".concat(r,"' doesn't exist.")):a(new t(r,u.result,s,c))};case 7:case"end":return e.stop()}}),e)})));return function(t,e){return a.apply(this,arguments)}}())}},{key:"remove",value:(s=e(o.mark((function r(n){var a=this;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(self.indexedDB){r.next=2;break}throw new Error("IndexedDB is not supported");case 2:return r.abrupt("return",new Promise(function(){var r=e(o.mark((function e(r,i){var s,c,u,f,p;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.open(n,"w");case 2:s=e.sent,c=s._meta.numPages,u=IDBKeyRange.bound(s._path,"".concat(s._path,"-").concat(t.createPage(c))),f=s._store,(p=f.delete(u)).onerror=function(){i(p.error)},p.onsuccess=function(){r()};case 9:case"end":return e.stop()}}),e)})));return function(t,e){return r.apply(this,arguments)}}()));case 3:case"end":return r.stop()}}),r)}))),function(t){return s.apply(this,arguments)})},{key:"exists",value:(i=e(o.mark((function t(e){var r;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(self.indexedDB){t.next=2;break}throw new Error("IndexedDB is not supported");case 2:return t.prev=2,t.next=5,this.open(e,"r");case 5:return r=t.sent,t.abrupt("return",void 0!==r._meta);case 9:return t.prev=9,t.t0=t.catch(2),t.abrupt("return",!1);case 12:case"end":return t.stop()}}),t,this,[[2,9]])}))),function(t){return i.apply(this,arguments)})},{key:"getPtr",value:function(e){return t._filePtrs.get(e)}},{key:"setPtr",value:function(e,r){t._filePtrs.set(e,r)}},{key:"removePtr",value:function(e){t._filePtrs.delete(e)}},{key:"createPage",value:function(t){return("000"+t).slice(-4)}}],n&&k(r.prototype,n),a&&k(r,a),Object.defineProperty(r,"prototype",{writable:!1}),t}();p(T,"_filePtrs",new Map);var I={args_get:function(t){return 0},args_sizes_get:function(t){return 0},environ_get:function(t){return 0},environ_sizes_get:function(t){return 0},clock_res_get:function(t){return 0},clock_time_get:function(t){return 0},fd_advise:function(t){return 0},fd_allocate:function(t){return 0},fd_close:function(t){return 0},fd_datasync:function(t){return 0},fd_fdstat_get:function(t){return 0},fd_fdstat_set_flags:function(t){return 0},fd_fdstat_set_rights:function(t){return 0},fd_filestat_get:function(t){return 0},fd_filestat_set_size:function(t){return 0},fd_filestat_set_times:function(t){return 0},fd_pread:function(t){return 0},fd_prestat_get:function(t){return 0},fd_prestat_dir_name:function(t){return 0},fd_pwrite:function(t){return 0},fd_read:function(t){return 0},fd_readdir:function(t){return 0},fd_renumber:function(t){return 0},fd_seek:function(t){return 0},fd_sync:function(t){return 0},fd_tell:function(t){return 0},fd_write:function(t){return 0},path_create_directory:function(t){return 0},path_filestat_get:function(t){return 0},path_filestat_set_times:function(t){return 0},path_link:function(t){return 0},path_open:function(t){return 0},path_readlink:function(t){return 0},path_remove_directory:function(t){return 0},path_rename:function(t){return 0},path_symlink:function(t){return 0},path_unlink_file:function(t){return 0},poll_oneoff:function(t){return 0},proc_exit:function(t){return 0},proc_raise:function(t){return 0},sched_yield:function(t){return 0},random_get:function(t){return 0},sock_recv:function(t){return 0},sock_send:function(t){return 0},sock_shutdown:function(t){return 0}};function L(t,e){return O.apply(this,arguments)}function O(){return O=e(o.mark((function t(r,n){var a,i,s,c,p,l,h,_,v,d,y,P,S,k,L,O,A,M,N,B,j,R,Y,z,D;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=new Uint8Array(r.buffer),i=new Int32Array(r.buffer),s=E(),c=function(t){console.log(m(a,t))},p=function(t,e,r){if(0===t){var n=m(a,r);throw new Error("assertion failed at line ".concat(e,' in "').concat(n,'"'))}},l=function(){return Date.now()/1e3},h=function(){var t=e(o.mark((function t(e,r,n,s,c,u,f,p,l){var h,_,v,d,y,E,w,g,P,S,k;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return h=m(a,e),_=m(a,r),v=m(a,n),d=m(a,s),y=m(a,c),E=x(d),t.prev=6,t.next=9,b("https://"+_+v,{method:h,headers:E,body:y},u);case 9:w=t.sent,P=w.status,t.next=16;break;case 13:t.prev=13,t.t0=t.catch(6),P=0;case 16:if(void 0===w){t.next=36;break}return t.prev=17,t.next=20,w.text();case 20:g=t.sent,t.next=27;break;case 23:t.prev=23,t.t1=t.catch(17),g="",P=1;case 27:return t.next=29,D(Int8Array.BYTES_PER_ELEMENT,(g.length+1)*Int8Array.BYTES_PER_ELEMENT);case 29:if(0!==(S=t.sent)){t.next=32;break}throw new Error("malloc failed: Cannot allocate memory");case 32:for(i[p/Int32Array.BYTES_PER_ELEMENT]=g.length+1,i[f/Int32Array.BYTES_PER_ELEMENT]=S,k=0;k<g.length;k++)a[S+k]=g.charCodeAt(k);a[S+g.length]=0;case 36:i[l/Int32Array.BYTES_PER_ELEMENT]=P;case 37:case"end":return t.stop()}}),t,null,[[6,13],[17,23]])})));return function(e,r,n,o,a,i,s,c,u){return t.apply(this,arguments)}}(),_=function(){var t=e(o.mark((function t(e,r,n,c){var u,f,p,l;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=m(a,e),t.prev=1,t.next=4,s.getItem(u);case 4:return f=t.sent,p=w(f),t.next=8,D(Uint8Array.BYTES_PER_ELEMENT,p.length*Uint8Array.BYTES_PER_ELEMENT);case 8:if(0!==(l=t.sent)){t.next=11;break}throw new Error("malloc failed: Cannot allocate memory");case 11:i[r/Int32Array.BYTES_PER_ELEMENT]=p.byteLength,i[n/Int32Array.BYTES_PER_ELEMENT]=l,a.set(p,l),i[c/Int32Array.BYTES_PER_ELEMENT]=1,t.next=20;break;case 17:t.prev=17,t.t0=t.catch(1),i[c/Int32Array.BYTES_PER_ELEMENT]=0;case 20:case"end":return t.stop()}}),t,null,[[1,17]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),v=function(){var t=e(o.mark((function t(e,r,n,c){var u,f;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=m(a,e),f=g(a,r,n),t.prev=2,t.next=5,s.setItem(u,f);case 5:i[c/Int32Array.BYTES_PER_ELEMENT]=1,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),i[c/Int32Array.BYTES_PER_ELEMENT]=0;case 11:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),d=function(){var t=e(o.mark((function t(e,r,n){var c,u;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=m(a,e),t.prev=1,t.next=4,s.exists(c);case 4:u=t.sent,a[r]=u?1:0,i[n/Int32Array.BYTES_PER_ELEMENT]=1,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),i[n/Int32Array.BYTES_PER_ELEMENT]=0;case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,r,n){return t.apply(this,arguments)}}(),y=function(){var t=e(o.mark((function t(e,r){var n;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=m(a,e),t.prev=1,t.next=4,s.removeItem(n);case 4:i[r/Int32Array.BYTES_PER_ELEMENT]=1,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),i[r/Int32Array.BYTES_PER_ELEMENT]=0;case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e,r){return t.apply(this,arguments)}}(),P=function(){var t=e(o.mark((function t(e){var r,n,s;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=void 0!==navigator.userAgent?navigator.userAgent:"unknown",t.next=3,D(Uint8Array.BYTES_PER_ELEMENT,(r.length+1)*Uint8Array.BYTES_PER_ELEMENT);case 3:if(0!==(n=t.sent)){t.next=6;break}throw new Error("malloc failed: Cannot allocate memory");case 6:for(i[e/Int32Array.BYTES_PER_ELEMENT]=n,s=0;s<r.length;s++)a[n+s]=r.charCodeAt(s);a[n+r.length]=0;case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),S=function(){var t=e(o.mark((function t(e){var r,n,s,c;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null!==(r=self.origin)&&void 0!==r?r:self.location.origin,t.next=3,D(Uint8Array.BYTES_PER_ELEMENT,(n.length+1)*Uint8Array.BYTES_PER_ELEMENT);case 3:if(0!==(s=t.sent)){t.next=6;break}throw new Error("malloc failed: Cannot allocate memory");case 6:for(i[e/Int32Array.BYTES_PER_ELEMENT]=s,c=0;c<n.length;c++)a[s+c]=n.charCodeAt(c);a[s+n.length]=0;case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),k=function(){var t=e(o.mark((function t(e,r,n,s){var c,u,f;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=m(a,r),u=m(a,n),t.prev=2,t.next=5,T.open(c,u);case 5:f=t.sent,T.setPtr(e,f),i[s/Int32Array.BYTES_PER_ELEMENT]=0,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(2),i[s/Int32Array.BYTES_PER_ELEMENT]=-1;case 13:case"end":return t.stop()}}),t,null,[[2,10]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),L=function(){var t=e(o.mark((function t(e,r){var n;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,T.getPtr(e);case 3:return n=t.sent,t.next=6,n.close();case 6:i[r/Int32Array.BYTES_PER_ELEMENT]=0,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),i[r/Int32Array.BYTES_PER_ELEMENT]=-1;case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(e,r){return t.apply(this,arguments)}}(),O=function(){var t=e(o.mark((function t(e,r,n,s,c){var u,f;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,T.getPtr(e);case 3:return u=t.sent,t.next=6,u.read(n,s);case 6:f=t.sent,a.set(f,r),i[c/Int32Array.BYTES_PER_ELEMENT]=f.length/n,t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),i[c/Int32Array.BYTES_PER_ELEMENT]=-1;case 14:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e,r,n,o,a){return t.apply(this,arguments)}}(),A=function(t,e,r,n){try{T.getPtr(t).seek(e,r),i[n/Int32Array.BYTES_PER_ELEMENT]=0}catch(t){i[n/Int32Array.BYTES_PER_ELEMENT]=-1}},M=function(t,e){try{var r=T.getPtr(t);i[e/Int32Array.BYTES_PER_ELEMENT]=r.tell()}catch(t){i[e/Int32Array.BYTES_PER_ELEMENT]=-1}},N=function(){var t=e(o.mark((function t(e,r){var n;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=m(a,e),t.prev=1,t.next=4,T.remove(n);case 4:i[r/Int32Array.BYTES_PER_ELEMENT]=0,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),i[r/Int32Array.BYTES_PER_ELEMENT]=-1;case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e,r){return t.apply(this,arguments)}}(),B={wasi_snapshot_preview1:I,env:{memory:r,pv_console_log_wasm:c,pv_assert_wasm:p,pv_time_wasm:l,pv_https_request_wasm:h,pv_file_load_wasm:_,pv_file_save_wasm:v,pv_file_exists_wasm:d,pv_file_delete_wasm:y,pv_get_browser_info:P,pv_get_origin_info:S,pv_file_open_wasm:k,pv_file_close_wasm:L,pv_file_read_wasm:O,pv_file_seek_wasm:A,pv_file_tell_wasm:M,pv_file_remove_wasm:N}},!(n instanceof Promise)){t.next=38;break}if(!f){t.next=27;break}return t.next=24,f(n,B);case 24:j=t.sent.instance,t.next=36;break;case 27:return t.next=29,n;case 29:return R=t.sent,t.next=32,R.arrayBuffer();case 32:return Y=t.sent,t.next=35,u(new Uint8Array(Y),B);case 35:j=t.sent.instance;case 36:t.next=42;break;case 38:return z=w(n),t.next=41,u(z,B);case 41:j=t.sent.instance;case 42:return D=j.exports.aligned_alloc,t.abrupt("return",j.exports);case 44:case"end":return t.stop()}}),t)}))),O.apply(this,arguments)}var A={DB_NAME:"pv_db",DB_VERSION:2,STORE_NAME:"pv_store",PV_FILE_STORE:"pv_file"};export{T as PvFile,g as arrayBufferToBase64AtIndex,m as arrayBufferToStringAtIndex,w as base64ToUint8Array,L as buildWasm,A as dbConfig,b as fetchWithTimeout,d as getDB,E as getPvStorage,S as isAccessKeyValid,x as stringHeaderToObject};
var WebUtils=function(t){"use strict";function e(t,e,r,n,o,a,i){try{var s=t[a](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function r(t){return function(){var r=this,n=arguments;return new Promise((function(o,a){var i=t.apply(r,n);function s(t){e(i,o,a,s,c,"next",t)}function c(t){e(i,o,a,s,c,"throw",t)}s(void 0)}))}}function n(t){var e={exports:{}};return t(e,e.exports),e.exports}var o=n((function(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),a=n((function(t){var e=o.default;function r(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
t.exports=r=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var n={},o=Object.prototype,a=o.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new T(n||[]);return a._invoke=function(t,e,r){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 I()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=b(i,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var h={};function _(){}function v(){}function d(){}var y={};f(y,s,(function(){return this}));var E=Object.getPrototypeOf,m=E&&E(E(k([])));m&&m!==o&&a.call(m,s)&&(y=m);var w=d.prototype=_.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,r){function n(o,i,s,c){var u=l(t[o],t,i);if("throw"!==u.type){var f=u.arg,p=f.value;return p&&"object"==e(p)&&a.call(p,"__await")?r.resolve(p.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):r.resolve(p).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,c)}))}c(u.arg)}var o;this._invoke=function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function k(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(a.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:I}}function I(){return{value:void 0,done:!0}}return v.prototype=d,f(w,"constructor",d),f(d,"constructor",v),v.displayName=f(d,u,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,f(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},n.awrap=function(t){return{__await:t}},g(x.prototype),f(x.prototype,c,(function(){return this})),n.AsyncIterator=x,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new x(p(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(w),f(w,u,"Generator"),f(w,s,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},n.values=k,T.prototype={constructor:T,reset:function(t){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(S),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports})),i=a();const s=new WeakMap;function c(t,e){return new Proxy(t,{get:(t,r)=>e(t[r])})}class u{constructor(){this.value=void 0,this.exports=null}getState(){return this.exports.asyncify_get_state()}assertNoneState(){let t=this.getState();if(0!==t)throw new Error(`Invalid async state ${t}, expected 0.`)}wrapImportFn(t){return(...e)=>{if(2===this.getState())return this.exports.asyncify_stop_rewind(),this.value;this.assertNoneState();let r=t(...e);if(!(n=r)||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof n.then)return r;var n;this.exports.asyncify_start_unwind(16),this.value=r}}wrapModuleImports(t){return c(t,(t=>"function"==typeof t?this.wrapImportFn(t):t))}wrapImports(t){if(void 0!==t)return c(t,((t=Object.create(null))=>this.wrapModuleImports(t)))}wrapExportFn(t){let e=s.get(t);return void 0!==e||(e=async(...e)=>{this.assertNoneState();let r=t(...e);for(;1===this.getState();)this.exports.asyncify_stop_unwind(),this.value=await this.value,this.assertNoneState(),this.exports.asyncify_start_rewind(16),r=t();return this.assertNoneState(),r},s.set(t,e)),e}wrapExports(t){let e=Object.create(null);for(let r in t){let n=t[r];"function"!=typeof n||r.startsWith("asyncify_")||(n=this.wrapExportFn(n)),Object.defineProperty(e,r,{enumerable:!0,value:n})}return s.set(t,e),e}init(t,e){const{exports:r}=t,n=r.memory||e.env&&e.env.memory;new Int32Array(n.buffer,16).set([24,1024]),this.exports=this.wrapExports(r),Object.setPrototypeOf(t,f.prototype)}}class f extends WebAssembly.Instance{constructor(t,e){let r=new u;super(t,r.wrapImports(e)),r.init(this,e)}get exports(){return s.get(super.exports)}}async function p(t,e){let r=new u,n=await WebAssembly.instantiate(t,r.wrapImports(e));return r.init(n instanceof WebAssembly.Instance?n:n.instance,e),n}async function l(t,e){let r=new u,n=await WebAssembly.instantiateStreaming(t,r.wrapImports(e));return r.init(n.instance,e),n}function h(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){h(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function d(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(f.prototype,"exports",{enumerable:!0});var E="pv_db",m="pv_store",w="pv_file";function g(){return new Promise((function(t,e){var r=self.indexedDB.open(E,2);r.onerror=function(){e(r.error)},r.onsuccess=function(){t(r.result)},r.onupgradeneeded=function(){r.result.objectStoreNames.contains(m)||r.result.createObjectStore(m),r.result.objectStoreNames.contains(w)||r.result.createObjectStore(w)}}))}var x=function(t){return new Promise((function(e,r){t.onerror=function(){r(t.error)},t.onsuccess=function(){e(t.result)}}))};function b(){var t,e,n,o,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(self.indexedDB)return{setItem:(o=r(i.mark((function t(e,r){var n,o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g();case 2:return n=t.sent,o=n.transaction(m,"readwrite").objectStore(m).put(r,e),t.next=6,x(o);case 6:n.close();case 7:case"end":return t.stop()}}),t)}))),function(t,e){return o.apply(this,arguments)}),getItem:(n=r(i.mark((function t(e){var r,n,o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g();case 2:return r=t.sent,n=r.transaction(m,"readonly").objectStore(m).get(e),t.next=6,x(n);case 6:return o=t.sent,r.close(),t.abrupt("return",o);case 9:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)}),removeItem:(e=r(i.mark((function t(e){var r,n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g();case 2:return r=t.sent,n=r.transaction(m,"readwrite").objectStore(m).delete(e),t.next=6,x(n);case 6:r.close();case 7:case"end":return t.stop()}}),t)}))),function(t){return e.apply(this,arguments)}),exists:(t=r(i.mark((function t(e){var r,n,o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g();case 2:return r=t.sent,n=r.transaction(m,"readonly").objectStore(m).count(e),t.next=6,x(n);case 6:return o=t.sent,r.close(),t.abrupt("return",o>0);case 9:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};if(a)throw new Error("IndexedDB is required but not available.");if(self.localStorage){var s=self.localStorage,c=s.setItem,u=s.getItem,f=s.removeItem,p=function(t){return null!==u(t)};return{setItem:c,getItem:u,removeItem:f,exists:p}}throw new Error("Cannot get a persistent storage object.")}function P(t,e){for(var r=e;0!==t[r];)r++;return new TextDecoder("utf-8").decode(t.subarray(e,r))}function S(t){for(var e=atob(t),r=new Uint8Array(e.length),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function T(t,e,r){for(var n="",o=0;o<e;o++)n+=String.fromCharCode(t[r+o]);return btoa(n)}function k(t){var e,r={},n=d(t.split("\r\n"));try{for(n.s();!(e=n.n()).done;){var o=e.value.split(": ");""!==o[0]&&(r[o[0]]=o[1])}}catch(t){n.e(t)}finally{n.f()}return r}function I(t){return A.apply(this,arguments)}function A(){return A=r(i.mark((function t(e){var r,n,o,a,s,c,u=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:5e3,o=new AbortController,a=v(v({},r),{},{signal:o.signal}),s=setTimeout((function(){o.abort()}),n),t.next=7,fetch(e,a);case 7:return c=t.sent,clearTimeout(s),t.abrupt("return",c);case 10:case"end":return t.stop()}}),t)}))),A.apply(this,arguments)}function L(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var O=function(){function t(e,r,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,"_pageSize",65536),h(this,"_path",void 0),h(this,"_db",void 0),h(this,"_mode",void 0),h(this,"_meta",void 0),h(this,"_pagePtr",0),h(this,"_pageOffset",0),this._path=e,this._meta=r,this._db=n,this._mode=o}var e,n,o,a,s,c,u,f;return e=t,n=[{key:"close",value:(f=r(i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._db.close();case 1:case"end":return t.stop()}}),t,this)}))),function(){return f.apply(this,arguments)})},{key:"read",value:(u=r(i.mark((function e(r,n){var o=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){if(void 0!==o._meta){if(o._isEOF){var i=new Error("EOF");return i.name="EndOfFile",void a(i)}var s=0,c=Math.min(r*n,o._meta.size),u=c-c%r,f=new Uint8Array(u),p=IDBKeyRange.bound("".concat(o._path,"-").concat(t.createPage(o._pagePtr)),"".concat(o._path,"-").concat(t.createPage(o._meta.numPages))),l=o._store,h=l.openCursor(p);h.onsuccess=function(){var t=h.result;if(t&&!o._isEOF){var e=Math.min(u-s,t.value.length-o._pageOffset);f.set(t.value.slice(o._pageOffset,o._pageOffset+e),s),s+=e,o._pageOffset+=e,o._pageOffset===o._pageSize&&(o._pagePtr+=1,o._pageOffset=0),s<u&&t.continue()}},l.transaction.onerror=function(){a(l.transaction.error)},l.transaction.oncomplete=function(){e(f.slice(0,s))}}else a(new Error("'".concat(o._path,"' doesn't exist.")))})));case 1:case"end":return e.stop()}}),e)}))),function(t,e){return u.apply(this,arguments)})},{key:"write",value:(c=r(i.mark((function e(r){var n=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){if("readonly"!==n._mode){var a=n._store,i=Math.ceil(r.length/n._pageSize),s={size:r.length,numPages:i},c=function(){a.add(s,n._path);for(var e=0;e<i;e++)a.add(r.slice(e*n._pageSize,(e+1)*n._pageSize),"".concat(n._path,"-").concat(t.createPage(e)))};if(n._meta){var u=n._meta.numPages,f=IDBKeyRange.bound(n._path,"".concat(n._path,"-").concat(t.createPage(u)));a.delete(f).onsuccess=function(){return c()}}else c();a.transaction.onerror=function(){o(a.transaction.error)},a.transaction.oncomplete=function(){n._meta=s,e()}}else o(new Error("Instance is readonly mode only."))})));case 1:case"end":return e.stop()}}),e)}))),function(t){return c.apply(this,arguments)})},{key:"seek",value:function(t,e){if(void 0===this._meta)throw new Error("'".concat(this._path,"' doesn't exist."));if(t<0){var r=new Error("EOF");throw r.name="EndOfFile",r}var n;if(0===e)n=Math.min(t,this._meta.size);else if(1===e){var o=this._pageSize*this._pagePtr+this._pageOffset;n=Math.min(o+t,this._meta.size)}else{if(2!==e)throw new Error("Invalid operation: ".concat(e,"."));n=Math.min(this._meta.size+t,this._meta.size)}this._pageOffset=n%this._pageSize,this._pagePtr=Math.floor(n/this._pageSize)}},{key:"tell",value:function(){return this._pagePtr*this._pageSize+this._pageOffset}},{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(w,this._mode).objectStore(w)}}],o=[{key:"open",value:function(e,n){if(!self.indexedDB)throw new Error("IndexedDB is not supported");return new Promise(function(){var o=r(i.mark((function r(o,a){var s,c,u;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,g();case 2:s=r.sent,c=n.includes("r")?"readonly":"readwrite",(u=s.transaction(w,c).objectStore(w).get(e)).onerror=function(){a(u.error)},u.onsuccess=function(){void 0===u.result&&"readonly"===c?a("Instance is readonly mode but '".concat(e,"' doesn't exist.")):o(new t(e,u.result,s,c))};case 7:case"end":return r.stop()}}),r)})));return function(t,e){return o.apply(this,arguments)}}())}},{key:"remove",value:(s=r(i.mark((function e(n){var o=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(self.indexedDB){e.next=2;break}throw new Error("IndexedDB is not supported");case 2:return e.abrupt("return",new Promise(function(){var e=r(i.mark((function e(r,a){var s,c,u,f,p;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.open(n,"w");case 2:s=e.sent,c=s._meta.numPages,u=IDBKeyRange.bound(s._path,"".concat(s._path,"-").concat(t.createPage(c))),f=s._store,(p=f.delete(u)).onerror=function(){a(p.error)},p.onsuccess=function(){r()};case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)}))),function(t){return s.apply(this,arguments)})},{key:"exists",value:(a=r(i.mark((function t(e){var r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(self.indexedDB){t.next=2;break}throw new Error("IndexedDB is not supported");case 2:return t.prev=2,t.next=5,this.open(e,"r");case 5:return r=t.sent,t.abrupt("return",void 0!==r._meta);case 9:return t.prev=9,t.t0=t.catch(2),t.abrupt("return",!1);case 12:case"end":return t.stop()}}),t,this,[[2,9]])}))),function(t){return a.apply(this,arguments)})},{key:"getPtr",value:function(e){return t._filePtrs.get(e)}},{key:"setPtr",value:function(e,r){t._filePtrs.set(e,r)}},{key:"removePtr",value:function(e){t._filePtrs.delete(e)}},{key:"createPage",value:function(t){return("000"+t).slice(-4)}}],n&&L(e.prototype,n),o&&L(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();h(O,"_filePtrs",new Map);var M={args_get:function(t){return 0},args_sizes_get:function(t){return 0},environ_get:function(t){return 0},environ_sizes_get:function(t){return 0},clock_res_get:function(t){return 0},clock_time_get:function(t){return 0},fd_advise:function(t){return 0},fd_allocate:function(t){return 0},fd_close:function(t){return 0},fd_datasync:function(t){return 0},fd_fdstat_get:function(t){return 0},fd_fdstat_set_flags:function(t){return 0},fd_fdstat_set_rights:function(t){return 0},fd_filestat_get:function(t){return 0},fd_filestat_set_size:function(t){return 0},fd_filestat_set_times:function(t){return 0},fd_pread:function(t){return 0},fd_prestat_get:function(t){return 0},fd_prestat_dir_name:function(t){return 0},fd_pwrite:function(t){return 0},fd_read:function(t){return 0},fd_readdir:function(t){return 0},fd_renumber:function(t){return 0},fd_seek:function(t){return 0},fd_sync:function(t){return 0},fd_tell:function(t){return 0},fd_write:function(t){return 0},path_create_directory:function(t){return 0},path_filestat_get:function(t){return 0},path_filestat_set_times:function(t){return 0},path_link:function(t){return 0},path_open:function(t){return 0},path_readlink:function(t){return 0},path_remove_directory:function(t){return 0},path_rename:function(t){return 0},path_symlink:function(t){return 0},path_unlink_file:function(t){return 0},poll_oneoff:function(t){return 0},proc_exit:function(t){return 0},proc_raise:function(t){return 0},sched_yield:function(t){return 0},random_get:function(t){return 0},sock_recv:function(t){return 0},sock_send:function(t){return 0},sock_shutdown:function(t){return 0}};function B(){return B=r(i.mark((function t(e,n){var o,a,s,c,u,f,h,_,v,d,y,E,m,w,g,x,A,L,B,N,j,R,Y;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=new Uint8Array(e.buffer),a=new Int32Array(e.buffer),s=b(),c=function(t){console.log(P(o,t))},u=function(t,e,r){if(0===t){var n=P(o,r);throw new Error("assertion failed at line ".concat(e,' in "').concat(n,'"'))}},f=function(){return Date.now()/1e3},h=function(){var t=r(i.mark((function t(e,r,n,s,c,u,f,p,l){var h,_,v,d,y,E,m,w,g,x,b;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return h=P(o,e),_=P(o,r),v=P(o,n),d=P(o,s),y=P(o,c),E=k(d),t.prev=6,t.next=9,I("https://"+_+v,{method:h,headers:E,body:y},u);case 9:m=t.sent,g=m.status,t.next=16;break;case 13:t.prev=13,t.t0=t.catch(6),g=0;case 16:if(void 0===m){t.next=36;break}return t.prev=17,t.next=20,m.text();case 20:w=t.sent,t.next=27;break;case 23:t.prev=23,t.t1=t.catch(17),w="",g=1;case 27:return t.next=29,Y(Int8Array.BYTES_PER_ELEMENT,(w.length+1)*Int8Array.BYTES_PER_ELEMENT);case 29:if(0!==(x=t.sent)){t.next=32;break}throw new Error("malloc failed: Cannot allocate memory");case 32:for(a[p/Int32Array.BYTES_PER_ELEMENT]=w.length+1,a[f/Int32Array.BYTES_PER_ELEMENT]=x,b=0;b<w.length;b++)o[x+b]=w.charCodeAt(b);o[x+w.length]=0;case 36:a[l/Int32Array.BYTES_PER_ELEMENT]=g;case 37:case"end":return t.stop()}}),t,null,[[6,13],[17,23]])})));return function(e,r,n,o,a,i,s,c,u){return t.apply(this,arguments)}}(),_=function(){var t=r(i.mark((function t(e,r,n,c){var u,f,p,l;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=P(o,e),t.prev=1,t.next=4,s.getItem(u);case 4:return f=t.sent,p=S(f),t.next=8,Y(Uint8Array.BYTES_PER_ELEMENT,p.length*Uint8Array.BYTES_PER_ELEMENT);case 8:if(0!==(l=t.sent)){t.next=11;break}throw new Error("malloc failed: Cannot allocate memory");case 11:a[r/Int32Array.BYTES_PER_ELEMENT]=p.byteLength,a[n/Int32Array.BYTES_PER_ELEMENT]=l,o.set(p,l),a[c/Int32Array.BYTES_PER_ELEMENT]=1,t.next=20;break;case 17:t.prev=17,t.t0=t.catch(1),a[c/Int32Array.BYTES_PER_ELEMENT]=0;case 20:case"end":return t.stop()}}),t,null,[[1,17]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),v=function(){var t=r(i.mark((function t(e,r,n,c){var u,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=P(o,e),f=T(o,r,n),t.prev=2,t.next=5,s.setItem(u,f);case 5:a[c/Int32Array.BYTES_PER_ELEMENT]=1,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),a[c/Int32Array.BYTES_PER_ELEMENT]=0;case 11:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),d=function(){var t=r(i.mark((function t(e,r,n){var c,u;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=P(o,e),t.prev=1,t.next=4,s.exists(c);case 4:u=t.sent,o[r]=u?1:0,a[n/Int32Array.BYTES_PER_ELEMENT]=1,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),a[n/Int32Array.BYTES_PER_ELEMENT]=0;case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,r,n){return t.apply(this,arguments)}}(),y=function(){var t=r(i.mark((function t(e,r){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=P(o,e),t.prev=1,t.next=4,s.removeItem(n);case 4:a[r/Int32Array.BYTES_PER_ELEMENT]=1,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),a[r/Int32Array.BYTES_PER_ELEMENT]=0;case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e,r){return t.apply(this,arguments)}}(),E=function(){var t=r(i.mark((function t(e){var r,n,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=void 0!==navigator.userAgent?navigator.userAgent:"unknown",t.next=3,Y(Uint8Array.BYTES_PER_ELEMENT,(r.length+1)*Uint8Array.BYTES_PER_ELEMENT);case 3:if(0!==(n=t.sent)){t.next=6;break}throw new Error("malloc failed: Cannot allocate memory");case 6:for(a[e/Int32Array.BYTES_PER_ELEMENT]=n,s=0;s<r.length;s++)o[n+s]=r.charCodeAt(s);o[n+r.length]=0;case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=r(i.mark((function t(e){var r,n,s,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null!==(r=self.origin)&&void 0!==r?r:self.location.origin,t.next=3,Y(Uint8Array.BYTES_PER_ELEMENT,(n.length+1)*Uint8Array.BYTES_PER_ELEMENT);case 3:if(0!==(s=t.sent)){t.next=6;break}throw new Error("malloc failed: Cannot allocate memory");case 6:for(a[e/Int32Array.BYTES_PER_ELEMENT]=s,c=0;c<n.length;c++)o[s+c]=n.charCodeAt(c);o[s+n.length]=0;case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),w=function(){var t=r(i.mark((function t(e,r,n,s){var c,u,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=P(o,r),u=P(o,n),t.prev=2,t.next=5,O.open(c,u);case 5:f=t.sent,O.setPtr(e,f),a[s/Int32Array.BYTES_PER_ELEMENT]=0,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(2),a[s/Int32Array.BYTES_PER_ELEMENT]=-1;case 13:case"end":return t.stop()}}),t,null,[[2,10]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),g=function(){var t=r(i.mark((function t(e,r){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,O.getPtr(e);case 3:return n=t.sent,t.next=6,n.close();case 6:a[r/Int32Array.BYTES_PER_ELEMENT]=0,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),a[r/Int32Array.BYTES_PER_ELEMENT]=-1;case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(e,r){return t.apply(this,arguments)}}(),x=function(){var t=r(i.mark((function t(e,r,n,s,c){var u,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,O.getPtr(e);case 3:return u=t.sent,t.next=6,u.read(n,s);case 6:f=t.sent,o.set(f,r),a[c/Int32Array.BYTES_PER_ELEMENT]=f.length/n,t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),a[c/Int32Array.BYTES_PER_ELEMENT]=-1;case 14:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e,r,n,o,a){return t.apply(this,arguments)}}(),A=function(t,e,r,n){try{O.getPtr(t).seek(e,r),a[n/Int32Array.BYTES_PER_ELEMENT]=0}catch(t){a[n/Int32Array.BYTES_PER_ELEMENT]=-1}},L=function(t,e){try{var r=O.getPtr(t);a[e/Int32Array.BYTES_PER_ELEMENT]=r.tell()}catch(t){a[e/Int32Array.BYTES_PER_ELEMENT]=-1}},B=function(){var t=r(i.mark((function t(e,r){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=P(o,e),t.prev=1,t.next=4,O.remove(n);case 4:a[r/Int32Array.BYTES_PER_ELEMENT]=0,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),a[r/Int32Array.BYTES_PER_ELEMENT]=-1;case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e,r){return t.apply(this,arguments)}}(),N={wasi_snapshot_preview1:M,env:{memory:e,pv_console_log_wasm:c,pv_assert_wasm:u,pv_time_wasm:f,pv_https_request_wasm:h,pv_file_load_wasm:_,pv_file_save_wasm:v,pv_file_exists_wasm:d,pv_file_delete_wasm:y,pv_get_browser_info:E,pv_get_origin_info:m,pv_file_open_wasm:w,pv_file_close_wasm:g,pv_file_read_wasm:x,pv_file_seek_wasm:A,pv_file_tell_wasm:L,pv_file_remove_wasm:B}},!(n instanceof Promise)){t.next=26;break}return t.next=23,l(n,N);case 23:j=t.sent.instance,t.next=30;break;case 26:return R=S(n),t.next=29,p(R,N);case 29:j=t.sent.instance;case 30:return Y=j.exports.aligned_alloc,t.abrupt("return",j.exports);case 32:case"end":return t.stop()}}),t)}))),B.apply(this,arguments)}var N={DB_NAME:E,DB_VERSION:2,STORE_NAME:m,PV_FILE_STORE:w};return t.PvFile=O,t.arrayBufferToBase64AtIndex=T,t.arrayBufferToStringAtIndex=P,t.base64ToUint8Array=S,t.buildWasm=function(t,e){return B.apply(this,arguments)},t.dbConfig=N,t.fetchWithTimeout=I,t.getDB=g,t.getPvStorage=b,t.isAccessKeyValid=function(t){if("string"!=typeof t||null==t)return!1;var e=t.trim();if(""===e)return!1;try{return btoa(atob(e))===e}catch(t){return!1}},t.stringHeaderToObject=k,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
t.exports=r=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var n={},o=Object.prototype,a=o.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new T(n||[]);return a._invoke=function(t,e,r){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 I()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=b(i,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var h={};function _(){}function v(){}function d(){}var y={};f(y,s,(function(){return this}));var E=Object.getPrototypeOf,m=E&&E(E(k([])));m&&m!==o&&a.call(m,s)&&(y=m);var w=d.prototype=_.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,r){function n(o,i,s,c){var u=l(t[o],t,i);if("throw"!==u.type){var f=u.arg,p=f.value;return p&&"object"==e(p)&&a.call(p,"__await")?r.resolve(p.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):r.resolve(p).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,c)}))}c(u.arg)}var o;this._invoke=function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function k(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(a.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:I}}function I(){return{value:void 0,done:!0}}return v.prototype=d,f(w,"constructor",d),f(d,"constructor",v),v.displayName=f(d,u,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,f(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},n.awrap=function(t){return{__await:t}},g(x.prototype),f(x.prototype,c,(function(){return this})),n.AsyncIterator=x,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new x(p(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(w),f(w,u,"Generator"),f(w,s,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},n.values=k,T.prototype={constructor:T,reset:function(t){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(S),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports})),i=a();const s=new WeakMap;function c(t,e){return new Proxy(t,{get:(t,r)=>e(t[r])})}class u{constructor(){this.value=void 0,this.exports=null}getState(){return this.exports.asyncify_get_state()}assertNoneState(){let t=this.getState();if(0!==t)throw new Error(`Invalid async state ${t}, expected 0.`)}wrapImportFn(t){return(...e)=>{if(2===this.getState())return this.exports.asyncify_stop_rewind(),this.value;this.assertNoneState();let r=t(...e);if(!(n=r)||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof n.then)return r;var n;this.exports.asyncify_start_unwind(16),this.value=r}}wrapModuleImports(t){return c(t,(t=>"function"==typeof t?this.wrapImportFn(t):t))}wrapImports(t){if(void 0!==t)return c(t,((t=Object.create(null))=>this.wrapModuleImports(t)))}wrapExportFn(t){let e=s.get(t);return void 0!==e||(e=async(...e)=>{this.assertNoneState();let r=t(...e);for(;1===this.getState();)this.exports.asyncify_stop_unwind(),this.value=await this.value,this.assertNoneState(),this.exports.asyncify_start_rewind(16),r=t();return this.assertNoneState(),r},s.set(t,e)),e}wrapExports(t){let e=Object.create(null);for(let r in t){let n=t[r];"function"!=typeof n||r.startsWith("asyncify_")||(n=this.wrapExportFn(n)),Object.defineProperty(e,r,{enumerable:!0,value:n})}return s.set(t,e),e}init(t,e){const{exports:r}=t,n=r.memory||e.env&&e.env.memory;new Int32Array(n.buffer,16).set([24,1024]),this.exports=this.wrapExports(r),Object.setPrototypeOf(t,f.prototype)}}class f extends WebAssembly.Instance{constructor(t,e){let r=new u;super(t,r.wrapImports(e)),r.init(this,e)}get exports(){return s.get(super.exports)}}async function p(t,e){let r=new u,n=await WebAssembly.instantiate(t,r.wrapImports(e));return r.init(n instanceof WebAssembly.Instance?n:n.instance,e),n}async function l(t,e){let r=new u,n=await WebAssembly.instantiateStreaming(t,r.wrapImports(e));return r.init(n.instance,e),n}function h(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){h(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function d(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(f.prototype,"exports",{enumerable:!0});var E="pv_db",m="pv_store",w="pv_file";function g(){return new Promise((function(t,e){var r=self.indexedDB.open(E,2);r.onerror=function(){e(r.error)},r.onsuccess=function(){t(r.result)},r.onupgradeneeded=function(){r.result.objectStoreNames.contains(m)||r.result.createObjectStore(m),r.result.objectStoreNames.contains(w)||r.result.createObjectStore(w)}}))}var x=function(t){return new Promise((function(e,r){t.onerror=function(){r(t.error)},t.onsuccess=function(){e(t.result)}}))};function b(){var t,e,n,o,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(self.indexedDB)return{setItem:(o=r(i.mark((function t(e,r){var n,o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g();case 2:return n=t.sent,o=n.transaction(m,"readwrite").objectStore(m).put(r,e),t.next=6,x(o);case 6:n.close();case 7:case"end":return t.stop()}}),t)}))),function(t,e){return o.apply(this,arguments)}),getItem:(n=r(i.mark((function t(e){var r,n,o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g();case 2:return r=t.sent,n=r.transaction(m,"readonly").objectStore(m).get(e),t.next=6,x(n);case 6:return o=t.sent,r.close(),t.abrupt("return",o);case 9:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)}),removeItem:(e=r(i.mark((function t(e){var r,n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g();case 2:return r=t.sent,n=r.transaction(m,"readwrite").objectStore(m).delete(e),t.next=6,x(n);case 6:r.close();case 7:case"end":return t.stop()}}),t)}))),function(t){return e.apply(this,arguments)}),exists:(t=r(i.mark((function t(e){var r,n,o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g();case 2:return r=t.sent,n=r.transaction(m,"readonly").objectStore(m).count(e),t.next=6,x(n);case 6:return o=t.sent,r.close(),t.abrupt("return",o>0);case 9:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};if(a)throw new Error("IndexedDB is required but not available.");if(self.localStorage){var s=self.localStorage,c=s.setItem,u=s.getItem,f=s.removeItem,p=function(t){return null!==u(t)};return{setItem:c,getItem:u,removeItem:f,exists:p}}throw new Error("Cannot get a persistent storage object.")}function P(t,e){for(var r=e;0!==t[r];)r++;return new TextDecoder("utf-8").decode(t.subarray(e,r))}function S(t){for(var e=atob(t),r=new Uint8Array(e.length),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function T(t,e,r){for(var n="",o=0;o<e;o++)n+=String.fromCharCode(t[r+o]);return btoa(n)}function k(t){var e,r={},n=d(t.split("\r\n"));try{for(n.s();!(e=n.n()).done;){var o=e.value.split(": ");""!==o[0]&&(r[o[0]]=o[1])}}catch(t){n.e(t)}finally{n.f()}return r}function I(t){return A.apply(this,arguments)}function A(){return A=r(i.mark((function t(e){var r,n,o,a,s,c,u=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:5e3,o=new AbortController,a=v(v({},r),{},{signal:o.signal}),s=setTimeout((function(){o.abort()}),n),t.next=7,fetch(e,a);case 7:return c=t.sent,clearTimeout(s),t.abrupt("return",c);case 10:case"end":return t.stop()}}),t)}))),A.apply(this,arguments)}function L(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var O=function(){function t(e,r,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,"_pageSize",65536),h(this,"_path",void 0),h(this,"_db",void 0),h(this,"_mode",void 0),h(this,"_meta",void 0),h(this,"_pagePtr",0),h(this,"_pageOffset",0),this._path=e,this._meta=r,this._db=n,this._mode=o}var e,n,o,a,s,c,u,f;return e=t,n=[{key:"close",value:(f=r(i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._db.close();case 1:case"end":return t.stop()}}),t,this)}))),function(){return f.apply(this,arguments)})},{key:"read",value:(u=r(i.mark((function e(r,n){var o=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){if(void 0!==o._meta){if(o._isEOF){var i=new Error("EOF");return i.name="EndOfFile",void a(i)}var s=0,c=Math.min(r*n,o._meta.size),u=c-c%r,f=new Uint8Array(u),p=IDBKeyRange.bound("".concat(o._path,"-").concat(t.createPage(o._pagePtr)),"".concat(o._path,"-").concat(t.createPage(o._meta.numPages))),l=o._store,h=l.openCursor(p);h.onsuccess=function(){var t=h.result;if(t&&!o._isEOF){var e=Math.min(u-s,t.value.length-o._pageOffset);f.set(t.value.slice(o._pageOffset,o._pageOffset+e),s),s+=e,o._pageOffset+=e,o._pageOffset===o._pageSize&&(o._pagePtr+=1,o._pageOffset=0),s<u&&t.continue()}},l.transaction.onerror=function(){a(l.transaction.error)},l.transaction.oncomplete=function(){e(f.slice(0,s))}}else a(new Error("'".concat(o._path,"' doesn't exist.")))})));case 1:case"end":return e.stop()}}),e)}))),function(t,e){return u.apply(this,arguments)})},{key:"write",value:(c=r(i.mark((function e(r){var n=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){if("readonly"!==n._mode){var a=n._store,i=Math.ceil(r.length/n._pageSize),s={size:r.length,numPages:i},c=function(){a.add(s,n._path);for(var e=0;e<i;e++)a.add(r.slice(e*n._pageSize,(e+1)*n._pageSize),"".concat(n._path,"-").concat(t.createPage(e)))};if(n._meta){var u=n._meta.numPages,f=IDBKeyRange.bound(n._path,"".concat(n._path,"-").concat(t.createPage(u)));a.delete(f).onsuccess=function(){return c()}}else c();a.transaction.onerror=function(){o(a.transaction.error)},a.transaction.oncomplete=function(){n._meta=s,e()}}else o(new Error("Instance is readonly mode only."))})));case 1:case"end":return e.stop()}}),e)}))),function(t){return c.apply(this,arguments)})},{key:"seek",value:function(t,e){if(void 0===this._meta)throw new Error("'".concat(this._path,"' doesn't exist."));if(t<0){var r=new Error("EOF");throw r.name="EndOfFile",r}var n;if(0===e)n=Math.min(t,this._meta.size);else if(1===e){var o=this._pageSize*this._pagePtr+this._pageOffset;n=Math.min(o+t,this._meta.size)}else{if(2!==e)throw new Error("Invalid operation: ".concat(e,"."));n=Math.min(this._meta.size+t,this._meta.size)}this._pageOffset=n%this._pageSize,this._pagePtr=Math.floor(n/this._pageSize)}},{key:"tell",value:function(){return this._pagePtr*this._pageSize+this._pageOffset}},{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(w,this._mode).objectStore(w)}}],o=[{key:"open",value:function(e,n){if(!self.indexedDB)throw new Error("IndexedDB is not supported");return new Promise(function(){var o=r(i.mark((function r(o,a){var s,c,u;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,g();case 2:s=r.sent,c=n.includes("r")?"readonly":"readwrite",(u=s.transaction(w,c).objectStore(w).get(e)).onerror=function(){a(u.error)},u.onsuccess=function(){void 0===u.result&&"readonly"===c?a("Instance is readonly mode but '".concat(e,"' doesn't exist.")):o(new t(e,u.result,s,c))};case 7:case"end":return r.stop()}}),r)})));return function(t,e){return o.apply(this,arguments)}}())}},{key:"remove",value:(s=r(i.mark((function e(n){var o=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(self.indexedDB){e.next=2;break}throw new Error("IndexedDB is not supported");case 2:return e.abrupt("return",new Promise(function(){var e=r(i.mark((function e(r,a){var s,c,u,f,p;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.open(n,"w");case 2:s=e.sent,c=s._meta.numPages,u=IDBKeyRange.bound(s._path,"".concat(s._path,"-").concat(t.createPage(c))),f=s._store,(p=f.delete(u)).onerror=function(){a(p.error)},p.onsuccess=function(){r()};case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)}))),function(t){return s.apply(this,arguments)})},{key:"exists",value:(a=r(i.mark((function t(e){var r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(self.indexedDB){t.next=2;break}throw new Error("IndexedDB is not supported");case 2:return t.prev=2,t.next=5,this.open(e,"r");case 5:return r=t.sent,t.abrupt("return",void 0!==r._meta);case 9:return t.prev=9,t.t0=t.catch(2),t.abrupt("return",!1);case 12:case"end":return t.stop()}}),t,this,[[2,9]])}))),function(t){return a.apply(this,arguments)})},{key:"getPtr",value:function(e){return t._filePtrs.get(e)}},{key:"setPtr",value:function(e,r){t._filePtrs.set(e,r)}},{key:"removePtr",value:function(e){t._filePtrs.delete(e)}},{key:"createPage",value:function(t){return("000"+t).slice(-4)}}],n&&L(e.prototype,n),o&&L(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();h(O,"_filePtrs",new Map);var B={args_get:function(t){return 0},args_sizes_get:function(t){return 0},environ_get:function(t){return 0},environ_sizes_get:function(t){return 0},clock_res_get:function(t){return 0},clock_time_get:function(t){return 0},fd_advise:function(t){return 0},fd_allocate:function(t){return 0},fd_close:function(t){return 0},fd_datasync:function(t){return 0},fd_fdstat_get:function(t){return 0},fd_fdstat_set_flags:function(t){return 0},fd_fdstat_set_rights:function(t){return 0},fd_filestat_get:function(t){return 0},fd_filestat_set_size:function(t){return 0},fd_filestat_set_times:function(t){return 0},fd_pread:function(t){return 0},fd_prestat_get:function(t){return 0},fd_prestat_dir_name:function(t){return 0},fd_pwrite:function(t){return 0},fd_read:function(t){return 0},fd_readdir:function(t){return 0},fd_renumber:function(t){return 0},fd_seek:function(t){return 0},fd_sync:function(t){return 0},fd_tell:function(t){return 0},fd_write:function(t){return 0},path_create_directory:function(t){return 0},path_filestat_get:function(t){return 0},path_filestat_set_times:function(t){return 0},path_link:function(t){return 0},path_open:function(t){return 0},path_readlink:function(t){return 0},path_remove_directory:function(t){return 0},path_rename:function(t){return 0},path_symlink:function(t){return 0},path_unlink_file:function(t){return 0},poll_oneoff:function(t){return 0},proc_exit:function(t){return 0},proc_raise:function(t){return 0},sched_yield:function(t){return 0},random_get:function(t){return 0},sock_recv:function(t){return 0},sock_send:function(t){return 0},sock_shutdown:function(t){return 0}};function M(){return M=r(i.mark((function t(e,n){var o,a,s,c,u,f,h,_,v,d,y,E,m,w,g,x,A,L,M,N,j,R,Y,D,z;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=new Uint8Array(e.buffer),a=new Int32Array(e.buffer),s=b(),c=function(t){console.log(P(o,t))},u=function(t,e,r){if(0===t){var n=P(o,r);throw new Error("assertion failed at line ".concat(e,' in "').concat(n,'"'))}},f=function(){return Date.now()/1e3},h=function(){var t=r(i.mark((function t(e,r,n,s,c,u,f,p,l){var h,_,v,d,y,E,m,w,g,x,b;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return h=P(o,e),_=P(o,r),v=P(o,n),d=P(o,s),y=P(o,c),E=k(d),t.prev=6,t.next=9,I("https://"+_+v,{method:h,headers:E,body:y},u);case 9:m=t.sent,g=m.status,t.next=16;break;case 13:t.prev=13,t.t0=t.catch(6),g=0;case 16:if(void 0===m){t.next=36;break}return t.prev=17,t.next=20,m.text();case 20:w=t.sent,t.next=27;break;case 23:t.prev=23,t.t1=t.catch(17),w="",g=1;case 27:return t.next=29,z(Int8Array.BYTES_PER_ELEMENT,(w.length+1)*Int8Array.BYTES_PER_ELEMENT);case 29:if(0!==(x=t.sent)){t.next=32;break}throw new Error("malloc failed: Cannot allocate memory");case 32:for(a[p/Int32Array.BYTES_PER_ELEMENT]=w.length+1,a[f/Int32Array.BYTES_PER_ELEMENT]=x,b=0;b<w.length;b++)o[x+b]=w.charCodeAt(b);o[x+w.length]=0;case 36:a[l/Int32Array.BYTES_PER_ELEMENT]=g;case 37:case"end":return t.stop()}}),t,null,[[6,13],[17,23]])})));return function(e,r,n,o,a,i,s,c,u){return t.apply(this,arguments)}}(),_=function(){var t=r(i.mark((function t(e,r,n,c){var u,f,p,l;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=P(o,e),t.prev=1,t.next=4,s.getItem(u);case 4:return f=t.sent,p=S(f),t.next=8,z(Uint8Array.BYTES_PER_ELEMENT,p.length*Uint8Array.BYTES_PER_ELEMENT);case 8:if(0!==(l=t.sent)){t.next=11;break}throw new Error("malloc failed: Cannot allocate memory");case 11:a[r/Int32Array.BYTES_PER_ELEMENT]=p.byteLength,a[n/Int32Array.BYTES_PER_ELEMENT]=l,o.set(p,l),a[c/Int32Array.BYTES_PER_ELEMENT]=1,t.next=20;break;case 17:t.prev=17,t.t0=t.catch(1),a[c/Int32Array.BYTES_PER_ELEMENT]=0;case 20:case"end":return t.stop()}}),t,null,[[1,17]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),v=function(){var t=r(i.mark((function t(e,r,n,c){var u,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=P(o,e),f=T(o,r,n),t.prev=2,t.next=5,s.setItem(u,f);case 5:a[c/Int32Array.BYTES_PER_ELEMENT]=1,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),a[c/Int32Array.BYTES_PER_ELEMENT]=0;case 11:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),d=function(){var t=r(i.mark((function t(e,r,n){var c,u;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=P(o,e),t.prev=1,t.next=4,s.exists(c);case 4:u=t.sent,o[r]=u?1:0,a[n/Int32Array.BYTES_PER_ELEMENT]=1,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),a[n/Int32Array.BYTES_PER_ELEMENT]=0;case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,r,n){return t.apply(this,arguments)}}(),y=function(){var t=r(i.mark((function t(e,r){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=P(o,e),t.prev=1,t.next=4,s.removeItem(n);case 4:a[r/Int32Array.BYTES_PER_ELEMENT]=1,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),a[r/Int32Array.BYTES_PER_ELEMENT]=0;case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e,r){return t.apply(this,arguments)}}(),E=function(){var t=r(i.mark((function t(e){var r,n,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=void 0!==navigator.userAgent?navigator.userAgent:"unknown",t.next=3,z(Uint8Array.BYTES_PER_ELEMENT,(r.length+1)*Uint8Array.BYTES_PER_ELEMENT);case 3:if(0!==(n=t.sent)){t.next=6;break}throw new Error("malloc failed: Cannot allocate memory");case 6:for(a[e/Int32Array.BYTES_PER_ELEMENT]=n,s=0;s<r.length;s++)o[n+s]=r.charCodeAt(s);o[n+r.length]=0;case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=r(i.mark((function t(e){var r,n,s,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null!==(r=self.origin)&&void 0!==r?r:self.location.origin,t.next=3,z(Uint8Array.BYTES_PER_ELEMENT,(n.length+1)*Uint8Array.BYTES_PER_ELEMENT);case 3:if(0!==(s=t.sent)){t.next=6;break}throw new Error("malloc failed: Cannot allocate memory");case 6:for(a[e/Int32Array.BYTES_PER_ELEMENT]=s,c=0;c<n.length;c++)o[s+c]=n.charCodeAt(c);o[s+n.length]=0;case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),w=function(){var t=r(i.mark((function t(e,r,n,s){var c,u,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=P(o,r),u=P(o,n),t.prev=2,t.next=5,O.open(c,u);case 5:f=t.sent,O.setPtr(e,f),a[s/Int32Array.BYTES_PER_ELEMENT]=0,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(2),a[s/Int32Array.BYTES_PER_ELEMENT]=-1;case 13:case"end":return t.stop()}}),t,null,[[2,10]])})));return function(e,r,n,o){return t.apply(this,arguments)}}(),g=function(){var t=r(i.mark((function t(e,r){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,O.getPtr(e);case 3:return n=t.sent,t.next=6,n.close();case 6:a[r/Int32Array.BYTES_PER_ELEMENT]=0,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),a[r/Int32Array.BYTES_PER_ELEMENT]=-1;case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(e,r){return t.apply(this,arguments)}}(),x=function(){var t=r(i.mark((function t(e,r,n,s,c){var u,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,O.getPtr(e);case 3:return u=t.sent,t.next=6,u.read(n,s);case 6:f=t.sent,o.set(f,r),a[c/Int32Array.BYTES_PER_ELEMENT]=f.length/n,t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),a[c/Int32Array.BYTES_PER_ELEMENT]=-1;case 14:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e,r,n,o,a){return t.apply(this,arguments)}}(),A=function(t,e,r,n){try{O.getPtr(t).seek(e,r),a[n/Int32Array.BYTES_PER_ELEMENT]=0}catch(t){a[n/Int32Array.BYTES_PER_ELEMENT]=-1}},L=function(t,e){try{var r=O.getPtr(t);a[e/Int32Array.BYTES_PER_ELEMENT]=r.tell()}catch(t){a[e/Int32Array.BYTES_PER_ELEMENT]=-1}},M=function(){var t=r(i.mark((function t(e,r){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=P(o,e),t.prev=1,t.next=4,O.remove(n);case 4:a[r/Int32Array.BYTES_PER_ELEMENT]=0,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),a[r/Int32Array.BYTES_PER_ELEMENT]=-1;case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e,r){return t.apply(this,arguments)}}(),N={wasi_snapshot_preview1:B,env:{memory:e,pv_console_log_wasm:c,pv_assert_wasm:u,pv_time_wasm:f,pv_https_request_wasm:h,pv_file_load_wasm:_,pv_file_save_wasm:v,pv_file_exists_wasm:d,pv_file_delete_wasm:y,pv_get_browser_info:E,pv_get_origin_info:m,pv_file_open_wasm:w,pv_file_close_wasm:g,pv_file_read_wasm:x,pv_file_seek_wasm:A,pv_file_tell_wasm:L,pv_file_remove_wasm:M}},!(n instanceof Promise)){t.next=38;break}if(!l){t.next=27;break}return t.next=24,l(n,N);case 24:j=t.sent.instance,t.next=36;break;case 27:return t.next=29,n;case 29:return R=t.sent,t.next=32,R.arrayBuffer();case 32:return Y=t.sent,t.next=35,p(new Uint8Array(Y),N);case 35:j=t.sent.instance;case 36:t.next=42;break;case 38:return D=S(n),t.next=41,p(D,N);case 41:j=t.sent.instance;case 42:return z=j.exports.aligned_alloc,t.abrupt("return",j.exports);case 44:case"end":return t.stop()}}),t)}))),M.apply(this,arguments)}var N={DB_NAME:E,DB_VERSION:2,STORE_NAME:m,PV_FILE_STORE:w};return t.PvFile=O,t.arrayBufferToBase64AtIndex=T,t.arrayBufferToStringAtIndex=P,t.base64ToUint8Array=S,t.buildWasm=function(t,e){return M.apply(this,arguments)},t.dbConfig=N,t.fetchWithTimeout=I,t.getDB=g,t.getPvStorage=b,t.isAccessKeyValid=function(t){if("string"!=typeof t||null==t)return!1;var e=t.trim();if(""===e)return!1;try{return btoa(atob(e))===e}catch(t){return!1}},t.stringHeaderToObject=k,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
{
"name": "@picovoice/web-utils",
"version": "1.1.4",
"version": "1.1.5",
"description": "Picovoice web utility functions",

@@ -5,0 +5,0 @@ "author": "Picovoice",

@@ -433,3 +433,9 @@ /*

if (wasm instanceof Promise) {
instance = (await Asyncify.instantiateStreaming(wasm, importObject)).instance;
if (Asyncify.instantiateStreaming) {
instance = (await Asyncify.instantiateStreaming(wasm, importObject)).instance;
} else {
const response = await wasm;
const data = await response.arrayBuffer();
instance = (await Asyncify.instantiate(new Uint8Array(data), importObject)).instance;
}
} else {

@@ -436,0 +442,0 @@ const wasmCodeArray = base64ToUint8Array(wasm);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc