Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ipfs-repo-migrations

Package Overview
Dependencies
Maintainers
5
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipfs-repo-migrations - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="0.2.2"></a>
## [0.2.2](https://github.com/ipfs/js-ipfs-repo-migrations/compare/v0.2.1...v0.2.2) (2020-06-23)
### Bug Fixes
* **ci:** add empty commit to fix lint checks on master ([cf10410](https://github.com/ipfs/js-ipfs-repo-migrations/commit/cf10410))
<a name="0.2.1"></a>

@@ -2,0 +12,0 @@ ## [0.2.1](https://github.com/ipfs/js-ipfs-repo-migrations/compare/v0.2.0...v0.2.1) (2020-04-28)

3

dist/index.min.js
/*! For license information please see index.min.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IpfsRepoMigrations=t():e.IpfsRepoMigrations=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,r){"use strict";(function(e){var n=r(13),o=r(14),i=r(15);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return u(this,e,t,r)}function u(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=p(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(t,r),o=(e=a(e,n)).write(t,r);o!==n&&(e=e.slice(0,o));return e}(e,t,r):function(e,t){if(c.isBuffer(t)){var r=0|h(t.length);return 0===(e=a(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?a(e,0):p(e,t);if("Buffer"===t.type&&i(t.data))return p(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(f(t),e=a(e,t<0?0:0|h(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function p(e,t){var r=t.length<0?0:0|h(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return j(e).length;t=(""+t).toLowerCase(),n=!0}}function _(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,o){var i,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var f=-1;for(i=r;i<a;i++)if(u(e,i)===u(t,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===c)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){for(var l=!0,p=0;p<c;p++)if(u(e,i+p)!==u(t,p)){l=!1;break}if(l)return i}return-1}function v(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function w(e,t,r,n){return Y(j(t,e.length-r),e,r,n)}function b(e,t,r,n){return Y(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return b(e,t,r,n)}function A(e,t,r,n){return Y(V(t),e,r,n)}function C(e,t,r,n){return Y(function(e,t){for(var r,n,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,s,a,c,u=e[o],f=null,l=u>239?4:u>223?3:u>191?2:1;if(o+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&u)<<6|63&i)>127&&(f=c);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(c=(15&u)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(f=c)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,r){return u(null,e,t,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,r){return function(e,t,r,n){return f(t),t<=0?a(e,t):void 0!==r?"string"==typeof n?a(e,t).fill(r,n):a(e,t).fill(r):a(e,t)}(null,e,t,r)},c.allocUnsafe=function(e){return l(null,e)},c.allocUnsafeSlow=function(e){return l(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var s=e[r];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)d(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):_.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,r,n,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(i,s),u=this.slice(n,o),f=e.slice(t,r),l=0;l<a;++l)if(u[l]!==f[l]){i=u[l],s=f[l];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function I(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function T(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=M(e[i]);return o}function O(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function P(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-r,2);o<i;++o)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function F(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-r,4);o<i;++o)e[r+o]=t>>>8*(n?o:3-o)&255}function U(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,i){return i||U(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,i){return i||U(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=c.prototype;else{var o=t-e;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+e]}return r},c.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);x(this,e,t,r,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);x(this,e,t,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o,i=n-r;if(this===e&&r<t&&t<n)for(o=i-1;o>=0;--o)e[o+t]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=c.isBuffer(e)?e:j(new c(e,n).toString()),a=s.length;for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function M(e){return e<16?"0"+e.toString(16):e.toString(16)}function j(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function V(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}}).call(this,r(12))},function(e,t,r){"use strict";const n=r(5),o=r(21),i=r(6),s=r(7);t.Key=n,t.MemoryDatastore=o,t.utils=i,t.Errors=s},function(e,t,r){"use strict";(function(n){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(r){}!e&&void 0!==n&&"env"in n&&(e={npm_config_save_dev:"",npm_config_legacy_bundling:"",npm_config_dry_run:"",npm_package_engines_npm:">=6.0.0",NVM_INC:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/include/node",npm_config_viewer:"man",npm_config_only:"",npm_config_commit_hooks:"true",npm_config_browser:"",npm_package_gitHead:"0ed316a9429465d997e19f3fcf4b404babdf81b0",npm_config_also:"",npm_package_dependencies_datastore_fs:"^1.0.0",npm_config_sign_git_commit:"",npm_config_rollback:"true",TERM_PROGRAM:"vscode",NODE:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/bin/node",npm_config_usage:"",npm_config_audit:"true",INIT_CWD:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations",npm_package_devDependencies_sinon:"^7.5.0",npm_package_homepage:"https://github.com/ipfs/js-ipfs-repo-migrations",NVM_CD_FLAGS:"-q",npm_config_globalignorefile:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/etc/npmignore",TERM:"xterm-256color",SHELL:"/usr/local/bin/zsh",npm_config_shell:"/usr/local/bin/zsh",npm_config_maxsockets:"50",npm_config_init_author_url:"",npm_package_devDependencies_rimraf:"^3.0.0",npm_config_shrinkwrap:"true",npm_config_parseable:"",npm_config_metrics_registry:"https://registry.npmjs.org/",TMPDIR:"/var/folders/q9/wc5vzv2n1z310y7_l9kxmynh0000gn/T/",npm_config_timing:"",npm_config_init_license:"ISC",npm_package_scripts_release:'aegir release --docs "--test" "false"',npm_package_scripts_lint:"aegir lint",npm_config_if_present:"",npm_package_dependencies_debug:"^4.1.0",TERM_PROGRAM_VERSION:"1.44.2",npm_config_sign_git_tag:"",npm_config_init_author_email:"",npm_config_cache_max:"Infinity",npm_package_devDependencies_aegir:"^21.9.0",npm_config_preid:"",npm_config_long:"",npm_config_local_address:"",npm_config_git_tag_version:"true",npm_config_cert:"",TERM_SESSION_ID:"w0t0p0:98138C1A-D55C-4A82-ACCA-9E98F9317D98",npm_config_registry:"https://registry.npmjs.org/",npm_config_noproxy:"",npm_config_fetch_retries:"2",npm_package_repository_url:"git+https://github.com/ipfs/js-ipfs-repo-migrations.git",ZSH:"/Users/hugomrdias/.oh-my-zsh",npm_config_versions:"",npm_config_message:"%s",npm_config_key:"",npm_package_readmeFilename:"README.md",npm_package_description:"Migration framework for versioning of JS IPFS Repo",USER:"hugomrdias",NVM_DIR:"/Users/hugomrdias/.nvm",N_PREFIX:"/Users/hugomrdias/n",npm_package_license:"MIT",npm_config_globalconfig:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/etc/npmrc",npm_config_prefer_online:"",npm_config_logs_max:"10",npm_config_always_auth:"",npm_package_scripts_test_node:"aegir test --target node",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.EVUVYqPELq/Listeners",npm_package_dependencies_buffer:"^5.6.0",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",npm_execpath:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_style:"",npm_config_cache_lock_retries:"10",npm_package_scripts_coverage:"aegir coverage",npm_config_update_notifier:"true",npm_config_cafile:"",FZF_DEFAULT_OPTS:"--bind='ctrl-o:execute(code {})+abort'",PAGER:"less",VIRTUAL_ENV_DISABLE_PROMPT:"12",npm_config_heading:"npm",npm_config_audit_level:"low",LSCOLORS:"Gxfxcxdxbxegedabagacad",npm_config_searchlimit:"20",npm_config_read_only:"",npm_config_offline:"",npm_config_fetch_retry_mintimeout:"10000",npm_package_dependencies_interface_datastore:"~0.8.3",npm_config_json:"",npm_config_access:"",npm_config_argv:'{"remain":["--test","false"],"cooked":["run","release","--","--test","false"],"original":["run","release","--","--test","false"]}',AEGIR_GHTOKEN:"981983bbbc2ca7e6e69ab0ba31d03c93f0a331f9",PATH:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/aegir/node_modules/.bin:/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/node_modules/.bin:/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/.bin:/Users/hugomrdias/code/pl/node_modules/.bin:/Users/hugomrdias/code/node_modules/.bin:/Users/hugomrdias/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/hugomrdias/.nvm/versions/node/v12.16.2/bin:/Users/hugomrdias/.nvm/versions/node/v12.16.2/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/.bin:/Users/hugomrdias/.nvm/versions/node/v12.16.2/bin:/usr/local/opt/openssl/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/bin",npm_config_allow_same_version:"",npm_package_contributors_1_email:"hugomrdias@gmail.com",npm_config_https_proxy:"",npm_config_engine_strict:"",npm_config_description:"true",_:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/.bin/aegir",LaunchInstanceID:"BF153338-6DC4-49D0-94E9-B43421ED836B",npm_config_userconfig:"/Users/hugomrdias/.npmrc",npm_config_init_module:"/Users/hugomrdias/.npm-init.js",npm_config_cidr:"",npm_package_dependencies_yargs:"^14.2.0",PWD:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations",npm_config_user:"501",npm_config_node_version:"12.16.2",npm_package_bugs_url:"https://github.com/ipfs/js-ipfs-repo-migrations/issues/",npm_lifecycle_event:"release",npm_package_devDependencies_chai:"^4.2.0",npm_package_scripts_release_major:"aegir release --type major --docs",EDITOR:"code",npm_config_save:"true",npm_config_ignore_prepublish:"",npm_config_editor:"code",npm_config_auth_type:"legacy",npm_package_repository_type:"git",npm_package_keywords_0:"IPFS",npm_package_name:"ipfs-repo-migrations",LANG:"en_GB.UTF-8",npm_config_tag:"latest",npm_config_script_shell:"",npm_package_browser___src_repo_lock_js:"./src/repo/lock-memory.js",npm_package_keywords_1:"libp2p",ITERM_PROFILE:"Default",npm_config_progress:"true",npm_config_global:"",npm_config_before:"",npm_package_scripts_build:"aegir build",npm_package_keywords_2:"migrations",npm_config_searchstaleness:"900",npm_config_optional:"true",npm_config_ham_it_up:"",npm_package_contributors_0_email:"adam@uhlir.dev",npm_package_scripts_docs:"aegir docs",XPC_FLAGS:"0x0",npm_config_save_prod:"",npm_config_force:"",npm_config_bin_links:"true",npm_package_scripts_coverage_publish:"aegir-coverage --provider coveralls",npm_package_bin_jsipfs_migrations:"src/cli.js",npm_config_searchopts:"",npm_package_engines_node:">=10.0.0",npm_config_node_gyp:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_config_depth:"Infinity",npm_package_main:"src/index.js",npm_config_sso_poll_frequency:"500",npm_config_rebuild_bundle:"true",npm_package_version:"0.2.0",XPC_SERVICE_NAME:"0",npm_config_unicode:"true",SHLVL:"4",COLORFGBG:"15;0",HOME:"/Users/hugomrdias",npm_config_fetch_retry_maxtimeout:"60000",npm_package_scripts_test:"aegir test",APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL:"true",npm_config_tag_version_prefix:"v",npm_config_strict_ssl:"true",npm_config_sso_type:"oauth",npm_config_scripts_prepend_node_path:"warn-only",npm_config_save_prefix:"^",npm_config_loglevel:"notice",npm_config_ca:"",npm_package_devDependencies_ncp:"^2.0.0",npm_package_devDependencies_just_safe_set:"^2.1.0",LC_TERMINAL_VERSION:"3.3.9",npm_config_save_exact:"",npm_config_group:"20",npm_config_fetch_retry_factor:"10",npm_config_dev:"",npm_config_version:"",npm_config_prefer_offline:"",npm_config_cache_lock_stale:"60000",npm_package_browser_datastore_fs:"datastore-idb",npm_config_otp:"",npm_config_cache_min:"10",npm_package_dependencies_chalk:"^4.0.0",ITERM_SESSION_ID:"w0t0p0:98138C1A-D55C-4A82-ACCA-9E98F9317D98",npm_config_searchexclude:"",npm_config_cache:"/Users/hugomrdias/.npm",LOGNAME:"hugomrdias",LESS:"-R",npm_lifecycle_script:'aegir release --docs "--test" "false"',npm_config_color:"true",npm_package_devDependencies_chai_as_promised:"^7.1.1",npm_config_proxy:"",npm_config_package_lock:"true",npm_package_dependencies_proper_lockfile:"^4.1.1",LC_CTYPE:"UTF-8",npm_config_package_lock_only:"",npm_config_fund:"true",FZF_DEFAULT_COMMAND:"fd --type f --hidden --follow --exclude .git",npm_config_save_optional:"",npm_package_scripts_test_browser:"aegir test --target browser",NVM_BIN:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/bin",npm_config_ignore_scripts:"",npm_config_user_agent:"npm/6.14.4 node/v12.16.2 darwin x64",npm_package_devDependencies_dirty_chai:"^2.0.1",npm_config_cache_lock_wait:"10000",npm_package_files_2:"dist",PROMPT_EOL_MARK:"",npm_config_production:"",npm_package_dependencies_datastore_idb:"^1.0.2",npm_package_files_1:"src",LC_TERMINAL:"iTerm2",npm_config_send_metrics:"",npm_config_save_bundle:"",npm_package_files_0:"migrations",npm_config_umask:"0022",npm_config_node_options:"",npm_config_init_version:"1.0.0",npm_package_contributors_0_name:"Adam Uhlíř",npm_config_init_author_name:"",npm_config_git:"git",npm_config_scope:"",npm_package_scripts_new_migration:"./src/cli.js add",SECURITYSESSIONID:"186a6",npm_config_unsafe_perm:"true",npm_config_tmp:"/var/folders/q9/wc5vzv2n1z310y7_l9kxmynh0000gn/T",npm_config_onload_script:"",npm_node_execpath:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/bin/node",npm_config_prefix:"/Users/hugomrdias/.nvm/versions/node/v12.16.2",npm_config_link:"",npm_config_format_package_lock:"true",npm_package_contributors_1_name:"Hugo Dias",npm_package_dependencies_yargs_promise:"^1.1.0",npm_package_scripts_release_minor:"aegir release --type minor --docs",COLORTERM:"truecolor",NODE_ENV:"production"}.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(26)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r(25))},function(e,t,r){"use strict";class n extends Error{constructor(e){super(e),this.name="NonReversibleMigrationError",this.code="ERR_NON_REVERSIBLE_MIGRATION",this.message=e}}n.code="ERR_NON_REVERSIBLE_MIGRATION",t.NonReversibleMigrationError=n;class o extends Error{constructor(e){super(e),this.name="NotInitializedRepoError",this.code="ERR_NOT_INITIALIZED_REPO",this.message=e}}o.code="ERR_NOT_INITIALIZED_REPO",t.NotInitializedRepoError=o;class i extends Error{constructor(e){super(e),this.name="RequiredParameterError",this.code="ERR_REQUIRED_PARAMETER",this.message=e}}i.code="ERR_REQUIRED_PARAMETER",t.RequiredParameterError=i;class s extends Error{constructor(e){super(e),this.name="InvalidValueError",this.code="ERR_INVALID_VALUE",this.message=e}}s.code="ERR_INVALID_VALUE",t.InvalidValueError=s},function(e,t,r){"use strict";function n(e){return new i(e)}function o(e){var t,r;function n(t,r){try{var s=e[t](r),a=s.value,c=a instanceof i;Promise.resolve(c?a.wrapped:a).then((function(e){c?n("return"===t?"return":"next",e):o(s.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(u){o("throw",u)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,o){return new Promise((function(i,s){var a={key:e,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function i(e){this.wrapped=e}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)};const{Buffer:s}=r(0),{openDB:a,deleteDB:c}=r(17),{Key:u,Errors:f,utils:l}=r(1),{filter:p,sortAll:h}=l,g=e=>{if((e=>e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)(e)){let t=s.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return s.from(e)},_=e=>{const t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let n=0,o=e.length;n<o;n++)r[n]=e.charCodeAt(n);return t},d=function(){var e,t=(e=function*(e,t,r){const o=e.prefix?self.IDBKeyRange.bound(_(e.prefix),_(e.prefix+"ÿ"),!1,!0):void 0;let i=yield n(t.transaction(r).store.openCursor(o)),a=0;for(i&&e.offset&&e.offset>0&&(i=yield n(i.advance(e.offset)));i;){if(void 0!==e.limit&&e.limit===a)return;a++;const t=new u(s.from(i.key));if(e.keysOnly)yield{key:t};else{const e=s.from(i.value);yield{key:t,value:e}}i=yield n(i.continue())}},function(){return new o(e.apply(this,arguments))});return function(e,r,n){return t.apply(this,arguments)}}();e.exports=class{constructor(e,t={}){this.store=null,this.options=t,this.location=t.prefix+e,this.version=t.version||1}async open(){if(null!==this.store)return;const e=this.location;try{this.store=await a(this.location,this.version,{upgrade(t){t.createObjectStore(e)}})}catch(t){throw f.dbOpenFailedError(t)}}async put(e,t){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.store.put(this.location,t,e.toBuffer())}catch(r){throw f.dbWriteFailedError(r)}}async get(e){if(null===this.store)throw new Error("Datastore needs to be opened.");let t;try{t=await this.store.get(this.location,e.toBuffer())}catch(r){throw f.dbWriteFailedError(r)}if(!t)throw f.notFoundError();return g(t)}async has(e){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.get(e)}catch(t){if("ERR_NOT_FOUND"===t.code)return!1;throw t}return!0}async delete(e){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.store.delete(this.location,e.toBuffer())}catch(t){throw f.dbDeleteFailedError(t)}}batch(){const e=[],t=[];return{put(t,r){e.push([t.toBuffer(),r])},delete(e){t.push(e.toBuffer())},commit:async()=>{if(null===this.store)throw new Error("Datastore needs to be opened.");const r=this.store.transaction(this.location,"readwrite"),n=r.store;await Promise.all(e.map(e=>n.put(e[1],e[0]))),await Promise.all(t.map(e=>n.delete(e))),await r.done}}}query(e){if(null===this.store)throw new Error("Datastore needs to be opened.");let t=d(e,this.store,this.location);return Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>p(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>h(e,t),t)),t}close(){if(null===this.store)throw new Error("Datastore needs to be opened.");this.store.close(),this.store=null}destroy(){return c(this.location)}}},function(e,t,r){"use strict";const{Buffer:n}=r(0),{nanoid:o}=r(19),i=r(20),s=n.from("/"),a=s[0];class c{constructor(e,t){if("string"==typeof e?this._buf=n.from(e):n.isBuffer(e)&&(this._buf=e),null==t&&(t=!0),t&&this.clean(),0===this._buf.length||this._buf[0]!==a)throw new Error("Invalid key")}toString(e){return this._buf.toString(e||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return"[Key ".concat(this.toString(),"]")}static withNamespaces(e){return new u(e.join("/"))}static random(){return new u(o().replace(/-/g,""))}clean(){for(this._buf&&0!==this._buf.length||(this._buf=n.from("/")),this._buf[0]!==a&&(this._buf=n.concat([s,this._buf]));this._buf.length>1&&this._buf[this._buf.length-1]===a;)this._buf=this._buf.slice(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;n<t.length;n++){if(r.length<n+1)return!1;const e=t[n],o=r[n];if(e<o)return!0;if(e>o)return!1}return t.length<r.length}reverse(){return c.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){const e=this.namespaces();return e[e.length-1]}list(){return this.toString().split("/").slice(1)}type(){return function(e){const t=e.split(":");if(t.length<2)return"";return t.slice(0,-1).join(":")}(this.baseNamespace())}name(){return function(e){const t=e.split(":");return t[t.length-1]}(this.baseNamespace())}instance(e){return new u(this.toString()+":"+e)}path(){let e=this.parent().toString();return e.endsWith("/")||(e+="/"),e+=this.type(),new u(e)}parent(){const e=this.list();return 1===e.length?new u("/"):new u(e.slice(0,-1).join("/"))}child(e){return"/"===this.toString()?e:"/"===e.toString()?this:new u(this.toString()+e.toString(),!1)}isAncestorOf(e){return e.toString()!==this.toString()&&e.toString().startsWith(this.toString())}isDecendantOf(e){return e.toString()!==this.toString()&&this.toString().startsWith(e.toString())}isTopLevel(){return 1===this.list().length}concat(...e){return c.withNamespaces([...this.namespaces(),...(t=e.map(e=>e.namespaces()),[].concat(...t))]);var t}}const u=i(c,{className:"Key",symbolName:"@ipfs/interface-datastore/key"});e.exports=u},function(e,t,r){"use strict";function n(e){return new s(e)}function o(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r;function n(t,r){try{var i=e[t](r),a=i.value,c=a instanceof s;Promise.resolve(c?a.wrapped:a).then((function(e){c?n("return"===t?"return":"next",e):o(i.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(u){o("throw",u)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,o){return new Promise((function(i,s){var a={key:e,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function s(e){this.wrapped=e}function a(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)};const c=r(22);t.filter=(e,t)=>o((function*(){var r,o=!0,i=!1;try{for(var s,c,u=a(e);o=(s=yield n(u.next())).done,c=yield n(s.value),!o;o=!0){const e=c;(yield n(t(e)))&&(yield e)}}catch(f){i=!0,r=f}finally{try{o||null==u.return||(yield n(u.return()))}finally{if(i)throw r}}}))(),t.sortAll=(e,t)=>o((function*(){let r=[];var o,i=!0,s=!1;try{for(var c,u,f=a(e);i=(c=yield n(f.next())).done,u=yield n(c.value),!i;i=!0){const e=u;r.push(e)}}catch(l){s=!0,o=l}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}r=yield n(t(r));for(const e of r)yield e}))(),t.take=(e,t)=>o((function*(){if(t<=0)return;let r=0;var o,i=!0,s=!1;try{for(var c,u,f=a(e);i=(c=yield n(f.next())).done,u=yield n(c.value),!i;i=!0){const e=u;if(yield e,r++,r>=t)return}}catch(l){s=!0,o=l}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}}))(),t.map=(e,t)=>o((function*(){var r,o=!0,i=!1;try{for(var s,c,u=a(e);o=(s=yield n(u.next())).done,c=yield n(s.value),!o;o=!0){const e=c;yield t(e)}}catch(f){i=!0,r=f}finally{try{o||null==u.return||(yield n(u.return()))}finally{if(i)throw r}}}))(),t.replaceStartWith=function(e,t){const r=new RegExp("^"+t);return e.replace(r,"")},t.tmpdir=c},function(e,t,r){"use strict";const n=r(24);e.exports.dbOpenFailedError=e=>(e=e||new Error("Cannot open database"),n(e,"ERR_DB_OPEN_FAILED")),e.exports.dbDeleteFailedError=e=>(e=e||new Error("Delete failed"),n(e,"ERR_DB_DELETE_FAILED")),e.exports.dbWriteFailedError=e=>(e=e||new Error("Write failed"),n(e,"ERR_DB_WRITE_FAILED")),e.exports.notFoundError=e=>(e=e||new Error("Not Found"),n(e,"ERR_NOT_FOUND"))},function(e,t,r){e.exports=r(9)},function(e,t,r){"use strict";const n=r(10),o=r(11),i=r(28),s=r(3),a=r(2)("repo-migrations:migrator");function c(e){return e=e||n,Array.isArray(e)&&0!==e.length?e[e.length-1].version:0}function u(e,t,r,n=!1){let o=0;for(const i of e){if(i.version>r)break;if(i.version>t){if(n&&!i.revert)throw new s.NonReversibleMigrationError("It is not possible to revert to version ".concat(t," because migration version ").concat(i.version," is not reversible. Cancelling reversion."));o++}}if(o!==r-t)throw new s.InvalidValueError("The ipfs-repo-migrations package does not have all migration to migrate from version ".concat(t," to ").concat(r))}t.getCurrentRepoVersion=o.getVersion,t.errors=s,t.getLatestMigrationVersion=c,t.migrate=async function(e,t,{ignoreLock:r=!1,repoOptions:f,onProgress:l,isDryRun:p=!1,migrations:h}){if(h=h||n,l=l||(()=>{}),!e)throw new s.RequiredParameterError("Path argument is required!");if(!t)throw new s.RequiredParameterError("toVersion argument is required!");if(!Number.isInteger(t)||t<=0)throw new s.InvalidValueError("Version has to be positive integer!");const g=await o.getVersion(e);if(g===t)return void a("Nothing to migrate.");if(g>t)throw new s.InvalidValueError("Current repo's version (".concat(g,") is higher then toVersion (").concat(t,"), you probably wanted to revert it?"));let _;u(h,g,t),p||r||(_=await i.lock(g,e));try{let n=0;const i=t-g;for(const r of h){if(void 0!==t&&r.version>t)break;if(!(r.version<=g)){n++,a("Migrating version ".concat(r.version));try{p||await r.migrate(e,f)}catch(d){const t=r.version-1;throw a("An exception was raised during execution of migration. Setting the repo's version to last successfully migrated version: ".concat(t)),await o.setVersion(e,t),d.message="During migration to version ".concat(r.version," exception was raised: ").concat(d.message),d}l(r,n,i),a("Migrating to version ".concat(r.version," finished"))}}p||await o.setVersion(e,t||c(h)),a("Repo successfully migrated ",void 0!==t?"to version ".concat(t,"!"):"to latest version!")}finally{p||r||await _.close()}},t.revert=async function(e,t,{ignoreLock:r=!1,repoOptions:c,onProgress:f,isDryRun:l=!1,migrations:p}){if(p=p||n,f=f||(()=>{}),!e)throw new s.RequiredParameterError("Path argument is required!");if(!t)throw new s.RequiredParameterError("When reverting migrations, you have to specify to which version to revert!");if(!Number.isInteger(t)||t<=0)throw new s.InvalidValueError("Version has to be positive integer!");const h=await o.getVersion(e);if(h===t)return void a("Nothing to revert.");if(h<t)throw new s.InvalidValueError("Current repo's version (".concat(h,") is lower then toVersion (").concat(t,"), you probably wanted to migrate it?"));let g;u(p,t,h,!0),l||r||(g=await i.lock(h,e)),a("Reverting from version ".concat(h," to ").concat(t));try{let n=0;const i=h-t,s=p.slice().reverse();for(const r of s){if(r.version<=t)break;if(!(r.version>h)){n++,a("Reverting migration version ".concat(r.version));try{l||await r.revert(e,c)}catch(_){const t=r.version;throw a("An exception was raised during execution of migration. Setting the repo's version to last successfully reverted version: ".concat(t)),await o.setVersion(e,t),_.message="During reversion to version ".concat(r.version," exception was raised: ").concat(_.message),_}f(r,n,i),a("Reverting to version ".concat(r.version," finished"))}}l||await o.setVersion(e,t),a("All migrations successfully reverted to version ".concat(t,"!"))}finally{l||r||await g.close()}}},function(e,t,r){"use strict";const n={description:"Empty migration.",migrate:()=>{},revert:()=>{},empty:!0};e.exports=[Object.assign({},n,{version:7,revert:void 0}),Object.assign({},n,{version:6,revert:void 0}),Object.assign({},n,{version:5,revert:void 0}),Object.assign({},n,{version:4,revert:void 0}),Object.assign({},n,{version:3,revert:void 0}),Object.assign({},n,{version:2,revert:void 0}),Object.assign({},n,{version:1,revert:void 0})]},function(e,t,r){"use strict";const{Buffer:n}=r(0),o=r(3),i=r(16),s=r(4),a=new(0,r(1).Key)("version");t.getVersion=async function(e){if(!await i.isRepoInitialized(e))throw new o.NotInitializedRepoError("Repo in path ".concat(e," is not initialized!"));const t=new s(e,{extension:"",createIfMissing:!1});await t.open();const r=parseInt(await t.get(a));return await t.close(),r},t.setVersion=async function(e,t){const r=new s(e,{extension:"",createIfMissing:!1});await r.open(),await r.put(a,n.from(String(t))),await r.close()}},function(e,t,r){"use strict";var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(o){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=u(e),s=n[0],a=n[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=o[e.charCodeAt(r)]<<18|o[e.charCodeAt(r+1)]<<12|o[e.charCodeAt(r+2)]<<6|o[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===a&&(t=o[e.charCodeAt(r)]<<2|o[e.charCodeAt(r+1)]>>4,c[f++]=255&t);1===a&&(t=o[e.charCodeAt(r)]<<10|o[e.charCodeAt(r+1)]<<4|o[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],s=0,a=r-o;s<a;s+=16383)i.push(f(e,s,s+16383>a?a:s+16383));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)n[a]=s[a],o[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var o,i,s=[],a=t;a<r;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t,r){"use strict";t.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,u=c>>1,f=-7,l=r?o-1:0,p=r?-1:1,h=e[t+l];for(l+=p,i=h&(1<<-f)-1,h>>=-f,f+=a;f>0;i=256*i+e[t+l],l+=p,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=p,f-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=u}return(h?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var s,a,c,u=8*i-o-1,f=(1<<u)-1,l=f>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,g=n?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+l>=1?p/c:p*Math.pow(2,1-l))*c>=2&&(s++,c/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*c-1)*Math.pow(2,o),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;e[r+h]=255&a,h+=g,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;e[r+h]=255&s,h+=g,s/=256,u-=8);e[r+h-g]|=128*_}},function(e,t,r){"use strict";var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,r){"use strict";const n=r(4),o=r(2)("repo-migrations:repo:init"),i=r(1).Key,s=new i("/version"),a=new i("/config");t.isRepoInitialized=async function(e){let t;try{t=new n(e,{extension:"",createIfMissing:!1}),await t.open();const r=await t.has(s),i=await t.has(a);return!(!r||!i)||(o("Version entry present: ".concat(r)),o("Config entry present: ".concat(i)),!1)}catch(r){return o("While checking if repo is initialized error was thrown: "+r.message),!1}finally{void 0!==t&&await t.close()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteDB=function(e,{blocked:t}={}){const r=indexedDB.deleteDatabase(e);t&&r.addEventListener("blocked",()=>t());return(0,n.w)(r).then(()=>{})},t.openDB=function(e,t,{blocked:r,upgrade:o,blocking:i,terminated:s}={}){const a=indexedDB.open(e,t),c=(0,n.w)(a);o&&a.addEventListener("upgradeneeded",e=>{o((0,n.w)(a.result),e.oldVersion,e.newVersion,(0,n.w)(a.transaction))});r&&a.addEventListener("blocked",()=>r());return c.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",()=>i())}).catch(()=>{}),c},Object.defineProperty(t,"unwrap",{enumerable:!0,get:function(){return n.u}}),Object.defineProperty(t,"wrap",{enumerable:!0,get:function(){return n.w}});var n=r(18);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const s=["get","getKey","getAll","getAllKeys","count"],a=["put","add","delete","clear"],c=new Map;function u(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(c.get(t))return c.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,o=a.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!o&&!s.includes(r))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;n&&(s=s.index(t.shift()));const a=s[r](...t);return o&&await i.done,a};return c.set(t,i),i}(0,n.r)(e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{get:(t,r,n)=>u(t,r)||e.get(t,r,n),has:(t,r)=>!!u(t,r)||e.has(t,r)}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.r=function(e){l=e(l)},t.w=g,t.u=t.i=t.a=void 0;const n=(e,t)=>t.some(t=>e instanceof t);let o,i;t.i=n;const s=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,f=new WeakMap;t.a=f;let l={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return a.get(e);if("objectStoreNames"===t)return e.objectStoreNames||c.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return g(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(_(this),t),g(s.get(this))}:function(...t){return g(e.apply(_(this),t))}:function(t,...r){const n=e.call(_(this),t,...r);return c.set(n,t.sort?t.sort():[t]),g(n)}}function h(e){return"function"==typeof e?p(e):(e instanceof IDBTransaction&&function(e){if(a.has(e))return;const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});a.set(e,t)}(e),n(e,o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,l):e)}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(g(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&s.set(t,e)}).catch(()=>{}),f.set(t,e),t}(e);if(u.has(e))return u.get(e);const t=h(e);return t!==e&&(u.set(e,t),f.set(t,e)),t}const _=e=>f.get(e);t.u=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.random=t.urlAlphabet=t.customRandom=t.customAlphabet=t.nanoid=void 0;t.urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";let n=e=>crypto.getRandomValues(new Uint8Array(e));t.random=n;let o=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*n*t/e.length);return()=>{let i="";for(;;){let s=r(o),a=o;for(;a--;)if(i+=e[s[a]&n]||"",i.length===+t)return i}}};t.customRandom=o;t.customAlphabet=(e,t)=>o(e,t,n);t.nanoid=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t}},function(e,t,r){"use strict";e.exports=function(e,{className:t,symbolName:r}){const n=Symbol.for(r),o={[t]:class extends e{constructor(...e){super(...e),Object.defineProperty(this,n,{value:!0})}get[Symbol.toStringTag](){return t}}}[t];return o["is".concat(t)]=e=>!(!e||!e[n]),o},e.exports.proto=function(e,{className:t,symbolName:r,withoutNew:n}){const o=Symbol.for(r),i={[t]:function(...t){if(n&&!(this instanceof i))return new i(...t);const r=e.call(this,...t)||this;return r&&!r[o]&&Object.defineProperty(r,o,{value:!0}),r}}[t];return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,Object.defineProperty(i.prototype,Symbol.toStringTag,{get:()=>t}),i["is".concat(t)]=e=>!(!e||!e[o]),i}},function(e,t,r){"use strict";const{filter:n,sortAll:o,take:i,map:s}=r(6),a=r(5),c=r(7);e.exports=class{constructor(){this.data={}}async open(){}async put(e,t){this.data[e.toString()]=t}async get(e){if(!await this.has(e))throw c.notFoundError();return this.data[e.toString()]}async has(e){return void 0!==this.data[e.toString()]}async delete(e){delete this.data[e.toString()]}batch(){let e=[],t=[];return{put(t,r){e.push([t,r])},delete(e){t.push(e)},commit:async()=>{e.forEach(e=>{this.data[e[0].toString()]=e[1]}),e=[],t.forEach(e=>{delete this.data[e.toString()]}),t=[]}}}query(e){let t=Object.entries(this.data);if(t=s(t,e=>({key:new a(e[0]),value:e[1]})),null!=e.prefix&&(t=n(t,t=>t.key.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>n(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>o(e,t),t)),null!=e.offset){let r=0;t=n(t,()=>r++>=e.offset)}return null!=e.limit&&(t=i(t,e.limit)),!0===e.keysOnly&&(t=s(t,e=>({key:e.key}))),t}async close(){}}},function(e,t,r){"use strict";const n=r(23);e.exports=(e=(e=>e))=>e(n())},function(e,t,r){"use strict";for(var n=self.crypto||self.msCrypto,o="-_",i=36;i--;)o+=i.toString(36);for(i=36;i---10;)o+=i.toString(36).toUpperCase();e.exports=function(e){var t="",r=n.getRandomValues(new Uint8Array(e||21));for(i=e||21;i--;)t+=o[63&r[i]];return t}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n;if(!(e instanceof Error))throw new TypeError("Please pass an Error to err-code");if("object"==typeof t?r=t:null!=t&&(e.code=t),r)for(n in r)e[n]=r[n];return e}},function(e,t,r){"use strict";var n,o,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var u,f=[],l=!1,p=-1;function h(){l&&u&&(l=!1,u.length?f=u.concat(f):p=-1,f.length&&g())}function g(){if(!l){var e=c(h);l=!0;for(var t=f.length;t;){for(u=f,f=[];++p<t;)u&&u[p].run();p=-1,t=f.length}u=null,l=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function _(e,t){this.fun=e,this.array=t}function d(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];f.push(new _(e,t)),1!==f.length||l||c(g)},_.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=d,i.addListener=d,i.once=d,i.off=d,i.removeListener=d,i.removeAllListeners=d,i.emit=d,i.prependListener=d,i.prependOnceListener=d,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){let r;function s(...e){if(!s.enabled)return;const t=s,o=Number(new Date),i=o-(r||o);t.diff=i,t.prev=r,t.curr=o,r=o,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return r;a++;const i=n.formatters[o];if("function"==typeof i){const n=e[a];r=i.call(t,n),e.splice(a,1),a--}return r}),n.formatArgs.call(t,e),(t.log||n.log).apply(t,e)}return s.namespace=e,s.enabled=n.enabled(e),s.useColors=n.useColors(),s.color=t(e),s.destroy=o,s.extend=i,"function"==typeof n.init&&n.init(s),n.instances.push(s),s}function o(){const e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function i(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(s),...n.skips.map(s).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(t=0;t<o;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){const e=n.instances[t];e.enabled=n.enabled(e.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=r(27),Object.keys(e).forEach(t=>{n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}},function(e,t,r){"use strict";var n=1e3,o=6e4,i=60*o,s=24*i;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*o;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===r&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=s)return a(e,t,s,"day");if(t>=i)return a(e,t,i,"hour");if(t>=o)return a(e,t,o,"minute");if(t>=n)return a(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=s)return Math.round(e/s)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=o)return Math.round(e/o)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";const n=r(2)("repo-migrations:repo_mem_lock"),o={};t.lock=async function(e,t){const r=t+"/repo.lock";if(n("locking %s",r),!0===o[r])throw Error("There is already present lock for: ".concat(r));return o[r]=!0,{close(){o[r]&&(n("releasing lock %s",r),delete o[r])}}}}])}));
//# sourceMappingURL=index.min.js.map
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.IpfsRepoMigrations=e():t.IpfsRepoMigrations=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){"use strict";(function(t){var n=r(15),o=r(16),i=r(17);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|y(e,r),o=(t=a(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|p(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):h(t,e);if("Buffer"===e.type&&i(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=a(t,e<0?0:0|p(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|p(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return R(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===u)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){for(var l=!0,h=0;h<u;h++)if(c(t,i+h)!==c(e,h)){l=!1;break}if(l)return i}return-1}function m(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function b(t,e,r,n){return V(N(e,t.length-r),t,r,n)}function E(t,e,r,n){return V(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function A(t,e,r,n){return E(t,e,r,n)}function C(t,e,r,n){return V(Y(e),t,r,n)}function _(t,e,r,n){return V(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function R(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,u,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return c(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return l(null,t)},u.allocUnsafeSlow=function(t){return l(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):d.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),c=this.slice(n,o),f=t.slice(e,r),l=0;l<a;++l)if(c[l]!==f[l]){i=c[l],s=f[l];break}return i<s?-1:s<i?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return E(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return C(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function P(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function x(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=U(t[i]);return o}function O(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function k(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function D(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,i){return i||D(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,i){return i||D(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var o=e-t;r=new u(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):k(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);B(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);B(this,t,e,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):k(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=u.isBuffer(t)?t:N(new u(t,n).toString()),a=s.length;for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function Y(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(14))},function(t,e,r){"use strict";const n=r(5),o=r(23),i=r(8),s=r(9),a=r(7);e.Key=n,e.MemoryDatastore=o,e.utils=i,e.Errors=s,e.Adapter=a},function(t,e,r){"use strict";(function(n){e.log=function(...t){return"object"==typeof console&&console.log&&console.log(...t)},e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,o=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(n++,"%c"===t&&(o=n))}),e.splice(o,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(r){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(r){}!t&&void 0!==n&&"env"in n&&(t={NODE_ENV:"production"}.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=r(28)(e);const{formatters:o}=t.exports;o.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(27))},function(t,e,r){"use strict";class n extends Error{constructor(t){super(t),this.name="NonReversibleMigrationError",this.code="ERR_NON_REVERSIBLE_MIGRATION",this.message=t}}n.code="ERR_NON_REVERSIBLE_MIGRATION",e.NonReversibleMigrationError=n;class o extends Error{constructor(t){super(t),this.name="NotInitializedRepoError",this.code="ERR_NOT_INITIALIZED_REPO",this.message=t}}o.code="ERR_NOT_INITIALIZED_REPO",e.NotInitializedRepoError=o;class i extends Error{constructor(t){super(t),this.name="RequiredParameterError",this.code="ERR_REQUIRED_PARAMETER",this.message=t}}i.code="ERR_REQUIRED_PARAMETER",e.RequiredParameterError=i;class s extends Error{constructor(t){super(t),this.name="InvalidValueError",this.code="ERR_INVALID_VALUE",this.message=t}}s.code="ERR_INVALID_VALUE",e.InvalidValueError=s},function(t,e,r){"use strict";function n(t){return new i(t)}function o(t){var e,r;function n(e,r){try{var s=t[e](r),a=s.value,u=a instanceof i;Promise.resolve(u?a.wrapped:a).then((function(t){u?n("return"===e?"return":"next",t):o(s.done?"return":"normal",t)}),(function(t){n("throw",t)}))}catch(c){o("throw",c)}}function o(t,o){switch(t){case"return":e.resolve({value:o,done:!0});break;case"throw":e.reject(o);break;default:e.resolve({value:o,done:!1})}(e=e.next)?n(e.key,e.arg):r=null}this._invoke=function(t,o){return new Promise((function(i,s){var a={key:t,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(e=r=a,n(t,o))}))},"function"!=typeof t.return&&(this.return=void 0)}function i(t){this.wrapped=t}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(t){return this._invoke("next",t)},o.prototype.throw=function(t){return this._invoke("throw",t)},o.prototype.return=function(t){return this._invoke("return",t)};const{Buffer:s}=r(0),{openDB:a,deleteDB:u}=r(19),{Key:c,Errors:f,utils:l,Adapter:h}=r(1),{filter:p,sortAll:y}=l,d=t=>{if((t=>t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)(t)){let e=s.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(e=e.slice(t.byteOffset,t.byteOffset+t.byteLength)),e}return s.from(t)},g=t=>{const e=new ArrayBuffer(t.length),r=new Uint8Array(e);for(let n=0,o=t.length;n<o;n++)r[n]=t.charCodeAt(n);return e},w=function(){var t,e=(t=function*(t,e,r){const o=t.prefix?self.IDBKeyRange.bound(g(t.prefix),g(t.prefix+"ÿ"),!1,!0):void 0;let i=yield n(e.transaction(r).store.openCursor(o)),a=0;for(i&&t.offset&&t.offset>0&&(i=yield n(i.advance(t.offset)));i;){if(void 0!==t.limit&&t.limit===a)return;a++;const e=new c(s.from(i.key));if(t.keysOnly)yield{key:e};else{const t=s.from(i.value);yield{key:e,value:t}}i=yield n(i.continue())}},function(){return new o(t.apply(this,arguments))});return function(t,r,n){return e.apply(this,arguments)}}();t.exports=class extends h{constructor(t,e={}){super(),this.store=null,this.options=e,this.location=e.prefix+t,this.version=e.version||1}async open(){if(null!==this.store)return;const t=this.location;try{this.store=await a(this.location,this.version,{upgrade(e){e.createObjectStore(t)}})}catch(e){throw f.dbOpenFailedError(e)}}async put(t,e){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.store.put(this.location,e,t.toBuffer())}catch(r){throw f.dbWriteFailedError(r)}}async get(t){if(null===this.store)throw new Error("Datastore needs to be opened.");let e;try{e=await this.store.get(this.location,t.toBuffer())}catch(r){throw f.dbWriteFailedError(r)}if(!e)throw f.notFoundError();return d(e)}async has(t){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.get(t)}catch(e){if("ERR_NOT_FOUND"===e.code)return!1;throw e}return!0}async delete(t){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.store.delete(this.location,t.toBuffer())}catch(e){throw f.dbDeleteFailedError(e)}}batch(){const t=[],e=[];return{put(e,r){t.push([e.toBuffer(),r])},delete(t){e.push(t.toBuffer())},commit:async()=>{if(null===this.store)throw new Error("Datastore needs to be opened.");const r=this.store.transaction(this.location,"readwrite"),n=r.store;await Promise.all(t.map(t=>n.put(t[1],t[0]))),await Promise.all(e.map(t=>n.delete(t))),await r.done}}}query(t){if(null===this.store)throw new Error("Datastore needs to be opened.");let e=w(t,this.store,this.location);return Array.isArray(t.filters)&&(e=t.filters.reduce((t,e)=>p(t,e),e)),Array.isArray(t.orders)&&(e=t.orders.reduce((t,e)=>y(t,e),e)),e}close(){if(null===this.store)throw new Error("Datastore needs to be opened.");this.store.close(),this.store=null}destroy(){return u(this.location)}}},function(t,e,r){"use strict";const{Buffer:n}=r(0),{nanoid:o}=r(6),i=r(22),s=n.from("/"),a=s[0];class u{constructor(t,e){if("string"==typeof t?this._buf=n.from(t):n.isBuffer(t)&&(this._buf=t),null==e&&(e=!0),e&&this.clean(),0===this._buf.length||this._buf[0]!==a)throw new Error("Invalid key")}toString(t){return this._buf.toString(t||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(t){return new c(t.join("/"))}static random(){return new c(o().replace(/-/g,""))}clean(){for(this._buf&&0!==this._buf.length||(this._buf=n.from("/")),this._buf[0]!==a&&(this._buf=n.concat([s,this._buf]));this._buf.length>1&&this._buf[this._buf.length-1]===a;)this._buf=this._buf.slice(0,-1)}less(t){const e=this.list(),r=t.list();for(let n=0;n<e.length;n++){if(r.length<n+1)return!1;const t=e[n],o=r[n];if(t<o)return!0;if(t>o)return!1}return e.length<r.length}reverse(){return u.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){const t=this.namespaces();return t[t.length-1]}list(){return this.toString().split("/").slice(1)}type(){return function(t){const e=t.split(":");if(e.length<2)return"";return e.slice(0,-1).join(":")}(this.baseNamespace())}name(){return function(t){const e=t.split(":");return e[e.length-1]}(this.baseNamespace())}instance(t){return new c(this.toString()+":"+t)}path(){let t=this.parent().toString();return t.endsWith("/")||(t+="/"),t+=this.type(),new c(t)}parent(){const t=this.list();return 1===t.length?new c("/"):new c(t.slice(0,-1).join("/"))}child(t){return"/"===this.toString()?t:"/"===t.toString()?this:new c(this.toString()+t.toString(),!1)}isAncestorOf(t){return t.toString()!==this.toString()&&t.toString().startsWith(this.toString())}isDecendantOf(t){return t.toString()!==this.toString()&&this.toString().startsWith(t.toString())}isTopLevel(){return 1===this.list().length}concat(...t){return u.withNamespaces([...this.namespaces(),...(e=t.map(t=>t.namespaces()),[].concat(...e))]);var e}}const c=i(u,{className:"Key",symbolName:"@ipfs/interface-datastore/key"});t.exports=c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"urlAlphabet",{enumerable:!0,get:function(){return n.urlAlphabet}}),e.random=e.customRandom=e.customAlphabet=e.nanoid=void 0;var n=r(21);let o=t=>crypto.getRandomValues(new Uint8Array(t));e.random=o;let i=(t,e,r)=>{let n=(2<<Math.log(t.length-1)/Math.LN2)-1,o=-~(1.6*n*e/t.length);return()=>{let i="";for(;;){let s=r(o),a=o;for(;a--;)if(i+=t[s[a]&n]||"",i.length===+e)return i}}};e.customRandom=i;e.customAlphabet=(t,e)=>i(t,e,o);e.nanoid=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t));for(;t--;){let n=63&r[t];e+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return e}},function(t,e,r){"use strict";function n(t){return new s(t)}function o(t){return function(){return new i(t.apply(this,arguments))}}function i(t){var e,r;function n(e,r){try{var i=t[e](r),a=i.value,u=a instanceof s;Promise.resolve(u?a.wrapped:a).then((function(t){u?n("return"===e?"return":"next",t):o(i.done?"return":"normal",t)}),(function(t){n("throw",t)}))}catch(c){o("throw",c)}}function o(t,o){switch(t){case"return":e.resolve({value:o,done:!0});break;case"throw":e.reject(o);break;default:e.resolve({value:o,done:!1})}(e=e.next)?n(e.key,e.arg):r=null}this._invoke=function(t,o){return new Promise((function(i,s){var a={key:t,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(e=r=a,n(t,o))}))},"function"!=typeof t.return&&(this.return=void 0)}function s(t){this.wrapped=t}function a(t){var e;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(e=t[Symbol.asyncIterator]))return e.call(t);if(Symbol.iterator&&null!=(e=t[Symbol.iterator]))return e.call(t)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(t){return this._invoke("next",t)},i.prototype.throw=function(t){return this._invoke("throw",t)},i.prototype.return=function(t){return this._invoke("return",t)};const{filter:u,sortAll:c,take:f,map:l}=r(8),h=r(25);t.exports=class{async open(){}async close(){}async put(t,e,r={}){}putMany(t,e={}){var r=this;return o((function*(){var o,i=!0,s=!1;try{for(var u,c,f=a(t);i=(u=yield n(f.next())).done,c=yield n(u.value),!i;i=!0){const{key:t,value:o}=c;yield n(r.put(t,o,e)),yield{key:t,value:o}}}catch(l){s=!0,o=l}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}}))()}async get(t,e={}){}getMany(t,e={}){var r=this;return o((function*(){var o,i=!0,s=!1;try{for(var u,c,f=a(t);i=(u=yield n(f.next())).done,c=yield n(u.value),!i;i=!0){const t=c;yield r.get(t,e)}}catch(l){s=!0,o=l}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}}))()}async has(t){}async delete(t,e={}){}deleteMany(t,e={}){var r=this;return o((function*(){var o,i=!0,s=!1;try{for(var u,c,f=a(t);i=(u=yield n(f.next())).done,c=yield n(u.value),!i;i=!0){const t=c;yield n(r.delete(t,e)),yield t}}catch(l){s=!0,o=l}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}}))()}batch(){let t=[],e=[];return{put(e,r){t.push({key:e,value:r})},delete(t){e.push(t)},commit:async r=>{await h(this.putMany(t,r)),t=[],await h(this.deleteMany(e,r)),e=[]}}}_all(t,e){return o((function*(){}))()}query(t,e){var r=this;return o((function*(){let o=r._all(t,e);if(null!=t.prefix&&(o=u(o,e=>e.key.toString().startsWith(t.prefix))),Array.isArray(t.filters)&&(o=t.filters.reduce((t,e)=>u(t,e),o)),Array.isArray(t.orders)&&(o=t.orders.reduce((t,e)=>c(t,e),o)),null!=t.offset){let e=0;o=u(o,()=>e++>=t.offset)}null!=t.limit&&(o=f(o,t.limit)),!0===t.keysOnly&&(o=l(o,t=>({key:t.key}))),yield*function(t,e){var r={},n=!1;function o(r,o){return n=!0,o=new Promise((function(e){e(t[r](o))})),{done:!1,value:e(o)}}return"function"==typeof Symbol&&Symbol.iterator&&(r[Symbol.iterator]=function(){return this}),r.next=function(t){return n?(n=!1,t):o("next",t)},"function"==typeof t.throw&&(r.throw=function(t){if(n)throw n=!1,t;return o("throw",t)}),"function"==typeof t.return&&(r.return=function(t){return n?(n=!1,t):o("return",t)}),r}(a(o),n)}))()}}},function(t,e,r){"use strict";function n(t){return new s(t)}function o(t){return function(){return new i(t.apply(this,arguments))}}function i(t){var e,r;function n(e,r){try{var i=t[e](r),a=i.value,u=a instanceof s;Promise.resolve(u?a.wrapped:a).then((function(t){u?n("return"===e?"return":"next",t):o(i.done?"return":"normal",t)}),(function(t){n("throw",t)}))}catch(c){o("throw",c)}}function o(t,o){switch(t){case"return":e.resolve({value:o,done:!0});break;case"throw":e.reject(o);break;default:e.resolve({value:o,done:!1})}(e=e.next)?n(e.key,e.arg):r=null}this._invoke=function(t,o){return new Promise((function(i,s){var a={key:t,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(e=r=a,n(t,o))}))},"function"!=typeof t.return&&(this.return=void 0)}function s(t){this.wrapped=t}function a(t){var e;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(e=t[Symbol.asyncIterator]))return e.call(t);if(Symbol.iterator&&null!=(e=t[Symbol.iterator]))return e.call(t)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(t){return this._invoke("next",t)},i.prototype.throw=function(t){return this._invoke("throw",t)},i.prototype.return=function(t){return this._invoke("return",t)};const u=r(24);e.filter=(t,e)=>o((function*(){var r,o=!0,i=!1;try{for(var s,u,c=a(t);o=(s=yield n(c.next())).done,u=yield n(s.value),!o;o=!0){const t=u;(yield n(e(t)))&&(yield t)}}catch(f){i=!0,r=f}finally{try{o||null==c.return||(yield n(c.return()))}finally{if(i)throw r}}}))(),e.sortAll=(t,e)=>o((function*(){let r=[];var o,i=!0,s=!1;try{for(var u,c,f=a(t);i=(u=yield n(f.next())).done,c=yield n(u.value),!i;i=!0){const t=c;r.push(t)}}catch(l){s=!0,o=l}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}r=yield n(e(r));for(const t of r)yield t}))(),e.take=(t,e)=>o((function*(){if(e<=0)return;let r=0;var o,i=!0,s=!1;try{for(var u,c,f=a(t);i=(u=yield n(f.next())).done,c=yield n(u.value),!i;i=!0){const t=c;if(yield t,r++,r>=e)return}}catch(l){s=!0,o=l}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}}))(),e.map=(t,e)=>o((function*(){var r,o=!0,i=!1;try{for(var s,u,c=a(t);o=(s=yield n(c.next())).done,u=yield n(s.value),!o;o=!0){const t=u;yield e(t)}}catch(f){i=!0,r=f}finally{try{o||null==c.return||(yield n(c.return()))}finally{if(i)throw r}}}))(),e.replaceStartWith=function(t,e){const r=new RegExp("^"+e);return t.replace(r,"")},e.tmpdir=u},function(t,e,r){"use strict";const n=r(26);t.exports.dbOpenFailedError=t=>(t=t||new Error("Cannot open database"),n(t,"ERR_DB_OPEN_FAILED")),t.exports.dbDeleteFailedError=t=>(t=t||new Error("Delete failed"),n(t,"ERR_DB_DELETE_FAILED")),t.exports.dbWriteFailedError=t=>(t=t||new Error("Write failed"),n(t,"ERR_DB_WRITE_FAILED")),t.exports.notFoundError=t=>(t=t||new Error("Not Found"),n(t,"ERR_NOT_FOUND")),t.exports.abortedError=t=>(t=t||new Error("Aborted"),n(t,"ERR_ABORTED"))},function(t,e,r){t.exports=r(11)},function(t,e,r){"use strict";const n=r(12),o=r(13),i=r(30),s=r(3),a=r(2)("repo-migrations:migrator");function u(t){return t=t||n,Array.isArray(t)&&0!==t.length?t[t.length-1].version:0}function c(t,e,r,n=!1){let o=0;for(const i of t){if(i.version>r)break;if(i.version>e){if(n&&!i.revert)throw new s.NonReversibleMigrationError(`It is not possible to revert to version ${e} because migration version ${i.version} is not reversible. Cancelling reversion.`);o++}}if(o!==r-e)throw new s.InvalidValueError(`The ipfs-repo-migrations package does not have all migration to migrate from version ${e} to ${r}`)}e.getCurrentRepoVersion=o.getVersion,e.errors=s,e.getLatestMigrationVersion=u,e.migrate=async function(t,e,{ignoreLock:r=!1,repoOptions:f,onProgress:l,isDryRun:h=!1,migrations:p}){if(p=p||n,l=l||(()=>{}),!t)throw new s.RequiredParameterError("Path argument is required!");if(!e)throw new s.RequiredParameterError("toVersion argument is required!");if(!Number.isInteger(e)||e<=0)throw new s.InvalidValueError("Version has to be positive integer!");const y=await o.getVersion(t);if(y===e)return void a("Nothing to migrate.");if(y>e)throw new s.InvalidValueError(`Current repo's version (${y}) is higher then toVersion (${e}), you probably wanted to revert it?`);let d;c(p,y,e),h||r||(d=await i.lock(y,t));try{let n=0;const i=e-y;for(const r of p){if(void 0!==e&&r.version>e)break;if(!(r.version<=y)){n++,a("Migrating version "+r.version);try{h||await r.migrate(t,f)}catch(g){const e=r.version-1;throw a("An exception was raised during execution of migration. Setting the repo's version to last successfully migrated version: "+e),await o.setVersion(t,e),g.message=`During migration to version ${r.version} exception was raised: ${g.message}`,g}l(r,n,i),a(`Migrating to version ${r.version} finished`)}}h||await o.setVersion(t,e||u(p)),a("Repo successfully migrated ",void 0!==e?`to version ${e}!`:"to latest version!")}finally{h||r||await d.close()}},e.revert=async function(t,e,{ignoreLock:r=!1,repoOptions:u,onProgress:f,isDryRun:l=!1,migrations:h}){if(h=h||n,f=f||(()=>{}),!t)throw new s.RequiredParameterError("Path argument is required!");if(!e)throw new s.RequiredParameterError("When reverting migrations, you have to specify to which version to revert!");if(!Number.isInteger(e)||e<=0)throw new s.InvalidValueError("Version has to be positive integer!");const p=await o.getVersion(t);if(p===e)return void a("Nothing to revert.");if(p<e)throw new s.InvalidValueError(`Current repo's version (${p}) is lower then toVersion (${e}), you probably wanted to migrate it?`);let y;c(h,e,p,!0),l||r||(y=await i.lock(p,t)),a(`Reverting from version ${p} to ${e}`);try{let n=0;const i=p-e,s=h.slice().reverse();for(const r of s){if(r.version<=e)break;if(!(r.version>p)){n++,a("Reverting migration version "+r.version);try{l||await r.revert(t,u)}catch(d){const e=r.version;throw a("An exception was raised during execution of migration. Setting the repo's version to last successfully reverted version: "+e),await o.setVersion(t,e),d.message=`During reversion to version ${r.version} exception was raised: ${d.message}`,d}f(r,n,i),a(`Reverting to version ${r.version} finished`)}}l||await o.setVersion(t,e),a(`All migrations successfully reverted to version ${e}!`)}finally{l||r||await y.close()}}},function(t,e,r){"use strict";const n={description:"Empty migration.",migrate:()=>{},revert:()=>{},empty:!0};t.exports=[Object.assign({},n,{version:7,revert:void 0}),Object.assign({},n,{version:6,revert:void 0}),Object.assign({},n,{version:5,revert:void 0}),Object.assign({},n,{version:4,revert:void 0}),Object.assign({},n,{version:3,revert:void 0}),Object.assign({},n,{version:2,revert:void 0}),Object.assign({},n,{version:1,revert:void 0})]},function(t,e,r){"use strict";const{Buffer:n}=r(0),o=r(3),i=r(18),s=r(4),a=new(0,r(1).Key)("version");e.getVersion=async function(t){if(!await i.isRepoInitialized(t))throw new o.NotInitializedRepoError(`Repo in path ${t} is not initialized!`);const e=new s(t,{extension:"",createIfMissing:!1});await e.open();const r=parseInt(await e.get(a));return await e.close(),r},e.setVersion=async function(t,e){const r=new s(t,{extension:"",createIfMissing:!1});await r.open(),await r.put(a,n.from(String(e))),await r.close()}},function(t,e,r){"use strict";var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(o){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),s=n[0],a=n[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;2===a&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,u[f++]=255&e);1===a&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],s=0,a=r-o;s<a;s+=16383)i.push(f(t,s,s+16383>a?a:s+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],o[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var o,i,s=[],a=e;a<r;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e,r){"use strict";e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=c}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&a,p+=y,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[r+p]=255&s,p+=y,s/=256,c-=8);t[r+p-y]|=128*d}},function(t,e,r){"use strict";var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,r){"use strict";const n=r(4),o=r(2)("repo-migrations:repo:init"),i=r(1).Key,s=new i("/version"),a=new i("/config");e.isRepoInitialized=async function(t){let e;try{e=new n(t,{extension:"",createIfMissing:!1}),await e.open();const r=await e.has(s),i=await e.has(a);return!(!r||!i)||(o("Version entry present: "+r),o("Config entry present: "+i),!1)}catch(r){return o("While checking if repo is initialized error was thrown: "+r.message),!1}finally{void 0!==e&&await e.close()}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.deleteDB=function(t,{blocked:e}={}){const r=indexedDB.deleteDatabase(t);e&&r.addEventListener("blocked",()=>e());return(0,n.w)(r).then(()=>{})},e.openDB=function(t,e,{blocked:r,upgrade:o,blocking:i,terminated:s}={}){const a=indexedDB.open(t,e),u=(0,n.w)(a);o&&a.addEventListener("upgradeneeded",t=>{o((0,n.w)(a.result),t.oldVersion,t.newVersion,(0,n.w)(a.transaction))});r&&a.addEventListener("blocked",()=>r());return u.then(t=>{s&&t.addEventListener("close",()=>s()),i&&t.addEventListener("versionchange",()=>i())}).catch(()=>{}),u},Object.defineProperty(e,"unwrap",{enumerable:!0,get:function(){return n.u}}),Object.defineProperty(e,"wrap",{enumerable:!0,get:function(){return n.w}});var n=r(20);function o(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 i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const a=["get","getKey","getAll","getAllKeys","count"],u=["put","add","delete","clear"],c=new Map;function f(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(c.get(e))return c.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,o=u.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!o&&!a.includes(r))return;const i=async function(t,...e){const i=this.transaction(t,o?"readwrite":"readonly");let s=i.store;n&&(s=s.index(e.shift()));const a=await s[r](...e);return o&&await i.done,a};return c.set(e,i),i}(0,n.r)(t=>i(i({},t),{},{get:(e,r,n)=>f(e,r)||t.get(e,r,n),has:(e,r)=>!!f(e,r)||t.has(e,r)}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.r=function(t){l=t(l)},e.w=y,e.u=e.i=e.a=void 0;const n=(t,e)=>e.some(e=>t instanceof e);let o,i;e.i=n;const s=new WeakMap,a=new WeakMap,u=new WeakMap,c=new WeakMap,f=new WeakMap;e.a=f;let l={get(t,e,r){if(t instanceof IDBTransaction){if("done"===e)return a.get(t);if("objectStoreNames"===e)return t.objectStoreNames||u.get(t);if("store"===e)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return y(t[e])},set:(t,e,r)=>(t[e]=r,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function h(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(d(this),e),y(s.get(this))}:function(...e){return y(t.apply(d(this),e))}:function(e,...r){const n=t.call(d(this),e,...r);return u.set(n,e.sort?e.sort():[e]),y(n)}}function p(t){return"function"==typeof t?h(t):(t instanceof IDBTransaction&&function(t){if(a.has(t))return;const e=new Promise((e,r)=>{const n=()=>{t.removeEventListener("complete",o),t.removeEventListener("error",i),t.removeEventListener("abort",i)},o=()=>{e(),n()},i=()=>{r(t.error||new DOMException("AbortError","AbortError")),n()};t.addEventListener("complete",o),t.addEventListener("error",i),t.addEventListener("abort",i)});a.set(t,e)}(t),n(t,o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(t,l):t)}function y(t){if(t instanceof IDBRequest)return function(t){const e=new Promise((e,r)=>{const n=()=>{t.removeEventListener("success",o),t.removeEventListener("error",i)},o=()=>{e(y(t.result)),n()},i=()=>{r(t.error),n()};t.addEventListener("success",o),t.addEventListener("error",i)});return e.then(e=>{e instanceof IDBCursor&&s.set(e,t)}).catch(()=>{}),f.set(e,t),e}(t);if(c.has(t))return c.get(t);const e=p(t);return e!==t&&(c.set(t,e),f.set(e,t)),e}const d=t=>f.get(t);e.u=d},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.urlAlphabet=void 0;e.urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"},function(t,e,r){"use strict";t.exports=function(t,{className:e,symbolName:r}){const n=Symbol.for(r),o={[e]:class extends t{constructor(...t){super(...t),Object.defineProperty(this,n,{value:!0})}get[Symbol.toStringTag](){return e}}}[e];return o["is"+e]=t=>!(!t||!t[n]),o},t.exports.proto=function(t,{className:e,symbolName:r,withoutNew:n}){const o=Symbol.for(r),i={[e]:function(...e){if(n&&!(this instanceof i))return new i(...e);const r=t.call(this,...e)||this;return r&&!r[o]&&Object.defineProperty(r,o,{value:!0}),r}}[e];return i.prototype=Object.create(t.prototype),i.prototype.constructor=i,Object.defineProperty(i.prototype,Symbol.toStringTag,{get:()=>e}),i["is"+e]=t=>!(!t||!t[o]),i}},function(t,e,r){"use strict";const n=r(5),o=r(7),i=r(9);t.exports=class extends o{constructor(){super(),this.data={}}async put(t,e){this.data[t.toString()]=e}async get(t){if(!await this.has(t))throw i.notFoundError();return this.data[t.toString()]}async has(t){return void 0!==this.data[t.toString()]}async delete(t){delete this.data[t.toString()]}*_all(){yield*Object.entries(this.data).map(([t,e])=>({key:new n(t),value:e}))}}},function(t,e,r){"use strict";const{nanoid:n}=r(6);t.exports=(t=(t=>t))=>t(n())},function(t,e,r){"use strict";t.exports=async t=>{var e,r=!0,n=!1;try{for(var o,i=function(t){var e;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(e=t[Symbol.asyncIterator]))return e.call(t);if(Symbol.iterator&&null!=(e=t[Symbol.iterator]))return e.call(t)}throw new TypeError("Object is not async iterable")}(t);r=(o=await i.next()).done,await o.value,!r;r=!0){}}catch(s){n=!0,e=s}finally{try{r||null==i.return||await i.return()}finally{if(n)throw e}}}},function(t,e,r){"use strict";function n(t,e){for(const r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}t.exports=function(t,e,r){if(!t||"string"==typeof t)throw new TypeError("Please pass an Error to err-code");r||(r={}),"object"==typeof e&&(r=e,e=void 0),null!=e&&(r.code=e);try{return n(t,r)}catch(o){r.message=t.message,r.stack=t.stack;const e=function(){};return e.prototype=Object.create(Object.getPrototypeOf(t)),n(new e,r)}}},function(t,e,r){"use strict";var n,o,i=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var c,f=[],l=!1,h=-1;function p(){l&&c&&(l=!1,c.length?f=c.concat(f):h=-1,f.length&&y())}function y(){if(!l){var t=u(p);l=!0;for(var e=f.length;e;){for(c=f,f=[];++h<e;)c&&c[h].run();h=-1,e=f.length}c=null,l=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new d(t,e)),1!==f.length||l||u(y)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";t.exports=function(t){function e(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return n.colors[Math.abs(e)%n.colors.length]}function n(t){let r;function s(...t){if(!s.enabled)return;const e=s,o=Number(new Date),i=o-(r||o);e.diff=i,e.prev=r,e.curr=o,r=o,t[0]=n.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let a=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return r;a++;const i=n.formatters[o];if("function"==typeof i){const n=t[a];r=i.call(e,n),t.splice(a,1),a--}return r}),n.formatArgs.call(e,t);(e.log||n.log).apply(e,t)}return s.namespace=t,s.enabled=n.enabled(t),s.useColors=n.useColors(),s.color=e(t),s.destroy=o,s.extend=i,"function"==typeof n.init&&n.init(s),n.instances.push(s),s}function o(){const t=n.instances.indexOf(this);return-1!==t&&(n.instances.splice(t,1),!0)}function i(t,e){const r=n(this.namespace+(void 0===e?":":e)+t);return r.log=this.log,r}function s(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},n.disable=function(){const t=[...n.names.map(s),...n.skips.map(s).map(t=>"-"+t)].join(",");return n.enable(""),t},n.enable=function(t){let e;n.save(t),n.names=[],n.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),o=r.length;for(e=0;e<o;e++)r[e]&&("-"===(t=r[e].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")));for(e=0;e<n.instances.length;e++){const t=n.instances[e];t.enabled=n.enabled(t.namespace)}},n.enabled=function(t){if("*"===t[t.length-1])return!0;let e,r;for(e=0,r=n.skips.length;e<r;e++)if(n.skips[e].test(t))return!1;for(e=0,r=n.names.length;e<r;e++)if(n.names[e].test(t))return!0;return!1},n.humanize=r(29),Object.keys(t).forEach(e=>{n[e]=t[e]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=e,n.enable(n.load()),n}},function(t,e,r){"use strict";var n=1e3,o=6e4,i=60*o,s=24*i;function a(t,e,r,n){var o=e>=1.5*r;return Math.round(t/r)+" "+n+(o?"s":"")}t.exports=function(t,e){e=e||{};var r=typeof t;if("string"===r&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*o;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===r&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=s)return a(t,e,s,"day");if(e>=i)return a(t,e,i,"hour");if(e>=o)return a(t,e,o,"minute");if(e>=n)return a(t,e,n,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=s)return Math.round(t/s)+"d";if(e>=i)return Math.round(t/i)+"h";if(e>=o)return Math.round(t/o)+"m";if(e>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,r){"use strict";const n=r(2)("repo-migrations:repo_mem_lock"),o={};e.lock=async function(t,e){const r=e+"/repo.lock";if(n("locking %s",r),!0===o[r])throw Error("There is already present lock for: "+r);return o[r]=!0,{close(){o[r]&&(n("releasing lock %s",r),delete o[r])}}}}])}));
{
"name": "ipfs-repo-migrations",
"version": "0.2.1",
"version": "0.2.2",
"description": "Migration framework for versioning of JS IPFS Repo",

@@ -52,9 +52,9 @@ "keywords": [

"debug": "^4.1.0",
"interface-datastore": "~0.8.3",
"interface-datastore": "^1.0.4",
"proper-lockfile": "^4.1.1",
"yargs": "^14.2.0",
"yargs": "^15.3.1",
"yargs-promise": "^1.1.0"
},
"devDependencies": {
"aegir": "^21.9.0",
"aegir": "^25.0.0",
"chai": "^4.2.0",

@@ -66,3 +66,3 @@ "chai-as-promised": "^7.1.1",

"rimraf": "^3.0.0",
"sinon": "^7.5.0"
"sinon": "^9.0.2"
},

@@ -76,4 +76,5 @@ "engines": {

"Hugo Dias <hugomrdias@gmail.com>",
"Hector Sanjuan <code@hector.link>"
"Hector Sanjuan <code@hector.link>",
"Bryan Stenson <bryan.stenson@gmail.com>"
]
}

@@ -288,3 +288,3 @@ # Migration tool for JS IPFS Repo

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

@@ -291,0 +291,0 @@ ## License

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