evm-contracts-tools 0.0.39 → 0.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evm-contract-call/evm-contract-call.js +2 -0
- package/dist/evm-contract-deployment-address/evm-contract-deployment-address.js +2 -0
- package/dist/evm-contract-deployment-networks/evm-contract-deployment-networks.js +2 -0
- package/dist/evm-contract-deployment-versions/evm-contract-deployment-versions.js +2 -0
- package/dist/evm-contract-deployments-dir/evm-contract-deployments-dir.js +2 -0
- package/dist/evm-contracts-tools/evm-contracts-tools.js +2 -0
- package/dist/libevm-contract-call/libevm-contract-call.js +2 -0
- package/dist/libevm-contract-deployment-address/libevm-contract-deployment-address.js +2 -0
- package/dist/libevm-contract-deployment-networks/libevm-contract-deployment-networks.js +2 -0
- package/dist/libevm-contract-deployment-versions/libevm-contract-deployment-versions.js +2 -0
- package/dist/libevm-contract-deployments-dir/libevm-contract-deployments-dir.js +2 -0
- package/package.json +12 -10
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see evm-contract-deployment-address.js.LICENSE.txt */
|
|
2
|
+
(()=>{var e={825(e,t,n){const r=n(368),i=(r._dirname,r._file_exists),o=r._homedir_get,a=r._json_read,s=r._lib_get,u=r._msg_info,f=r._msg_error,l=(r._path_join,r._range,n(419)._evm_contract_deployments_dir),c=(n(822),_libevm_contract_deployment_networks_module._evm_contract_deployment_networks);function d(e,t,n,r,o,s){let u,l,c,d,h;void 0!==s&&""!=s||(s="bash"),"bash"==s&&(u="sh"),"json"==s?u="json":(d=`Unknown configuration format ${s}'.`,f(d,1));const p=[n,r];for(h of(c=!1,p))if(l=`${e}/${t}/${h}/config.${u}`,i(l)){c=!0;break}c||(d=`No network '${n}' deployment configuration for contract '${t}' found at path '${e}'.`,f(d,1));const g=a(g),y=g["contract-address"][o];return""!=y&&null!=y||(d=`No '${t}' version '${o}' contract deployment specified for network '${n}' for directory at path '${e}'.`,f(d,1)),y}function h(e,t,n,r){let i,a;return i=[c],_app_check(_app),"undefined"!=typeof _type&&""!=_type||(_type="system"),"system"==_type?a=s():"user"==_type&&(a=`${o()}/.config`),`${a}/${_app}/deployments`}n(515)._evm_chains_info,e.exports={_default_deployments_dir_get,_evm_contract_deployment_address:function(e,t,n,r,i,o,a){let s,p,g,y,_,m,w,b,v,E;for(y of("n"==o?(""==r&&(E="A target application needs to be specified with option '-a' if not enabling user-defined deployments with '-u' and specifying a deployments directory path with '-d'.",f(E,1)),v=l(target_app),a!=system_deployments_dir&&(E="To set a custom deployments directory path you need to enable the user-defined deployments switch with '-u'."+f(E,1))):"y"==o?(""!=r&&(b=l(r,o)),a!=b?(E=`Using custom deployments directory path '${a}'.`,u(E)):_user_deployments_check()):(E="The 'user-defined' switch argument must be can be 'y' or 'n'.",f(E,1)),"y"==n&&(e=c(`${a}/${_target_contract}`,n)),e))w="",_=[a,_target_contract,y,w],h.apply(null,_),g.push([a,_target_contract,m,w,i]);for(y of t)m="",_=[a,_target_contract,m,y],h.apply(null,_),g.push([a,_target_contract,m,w,i]);for(s of _contract_address_args)p=d.apply(null,s),_contract_addresses.push(p)},_networks_all_auto_detect:function(){let e;e="n",target_networks.length<1&&network_ids.length<1&&(e="y"),"undefined"!=typeof networks_all&&""!=networks_all||(networks_all=e)}}},822(e,t,n){const r=n(368),i=(r._dirname,r._file_exists,r._homedir_get,r._json_read,r._lib_get,r._ls),o=(r._msg_info,r._msg_error,r._path_join,r._range,r._stat);n(419)._evm_contract_deployments_dir,n(515)._evm_chains_info,e.exports={_evm_contract_deployment_networks:function(e,t,n,r){let a;return console.log(e),a=function(e){let t,n,r;const a=[],s=i(e);for(t of s)r=`${e}/${t}`,n=_is_dir(r),n?a.push(t):(_msg_warning("there shouldn't be a file into this directory."),o(_file_info));return a}(e),console.log(a),a}}},419(e,t,n){const r=n(368),i=r._homedir_get,o=r._lib_get,a=(r._msg_info,r._msg_error);function s(e){let t,n;const r=typeof e;"undefined"!=r&&""!=e||(n="No application specified.",t=!0),console.log(e),"string"!=r&&(n="Application argument must be of type string.",t=!0),t&&a(n,1)}function u(e,t){let n;return s(e),void 0!==t&&""!=t||(t="system"),"system"==t?n=o():"user"==t&&(n=`${i()}/.config`),`${n}/${e}/deployments`}e.exports={_default_deployments_dir_get:u,_evm_contract_deployments_dir:function(e,t){let n,r;return s(e),"n"==t||"n"==t?r="system":(_msg="User level argument must be can be 'y' or 'n'.",a(_msg,1)),n=u(e,r),n}}},526(e,t){"use strict";t.toByteArray=function(e){var t,n,o=function(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}(e),a=o[0],s=o[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),f=0,l=s>0?a-4:a;for(n=0;n<l;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[f++]=255&t),1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,f=r-i;s<f;s+=a)o.push(u(e,s,s+a>f?f:s+a));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=o[a],r[o.charCodeAt(a)]=a;function s(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(s(r));return i.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},287(e,t,n){"use strict";const r=n(526),i=n(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return f(e,t,n)}function f(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=s(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(V(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(V(e,ArrayBuffer)||e&&V(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(V(e,SharedArrayBuffer)||e&&V(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),s(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),n=s(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||V(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return x(this,t,n);case"base64":return R(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function _(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,r,i){let o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function f(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;o<s;o++)if(f(e,o)===f(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===u)return r*a}else-1!==r&&(o-=o-r),r=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){let n=!0;for(let r=0;r<u;r++)if(f(e,o+r)!==f(t,r)){n=!1;break}if(n)return o}return-1}function b(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let a;for(r>o/2&&(r=o/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(X(r))return a;e[n+a]=r}return a}function v(e,t,n,r){return H(z(t,e.length-n),e,n,r)}function E(e,t,n,r){return H(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return H(q(t),e,n,r)}function k(e,t,n,r){return H(function(e,t){let n,r,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function R(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(u=(31&t)<<6|63&n,u>127&&(o=u));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(u=(15&t)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(u=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=A));return n}(r)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,n){return f(e,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?s(e):void 0!==t?"string"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)}(e,t,n)},u.allocUnsafe=function(e){return c(e)},u.allocUnsafeSlow=function(e){return c(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(V(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),V(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.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}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=u.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(V(t,Uint8Array))i+t.length>r.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)_(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(V(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(o,a),f=this.slice(r,i),l=e.slice(t,n);for(let e=0;e<s;++e)if(f[e]!==l[e]){o=f[e],a=l[e];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function O(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function x(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function L(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=J[e[r]];return i}function j(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function C(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function $(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function I(e,t,n,r,i){W(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function U(e,t,n,r,i){W(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){const n=this.length;(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);const r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=K(function(e){Y(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),u.prototype.readBigUInt64BE=K(function(e){Y(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=K(function(e){Y(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),u.prototype.readBigInt64BE=K(function(e){Y(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||$(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||$(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||$(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||$(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||$(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||$(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||$(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=K(function(e,t=0){return I(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=K(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);$(this,e,t,n,r-1,-r)}let i=0,o=1,a=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);$(this,e,t,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||$(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||$(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||$(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||$(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||$(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=K(function(e,t=0){return I(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=K(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,r),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%a]}return this};const F={};function P(e,t,n){F[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function W(e,t,n,r,i,o){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new F.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){Y(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||Z(t,e.length-(n+1))}(r,i,o)}function Y(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function Z(e,t,n){if(Math.floor(e)!==e)throw Y(e,n),new F.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}P("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),P("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),P("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=D(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r},RangeError);const G=/[^+/0-9A-Za-z-_]/g;function z(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function V(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function K(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},368(e,t,n){const r=n(70),i=r._argv_get,o=r._argv_url_get,a=r._child_process_spawn_get,s=a(),u=a("async"),f=(0,r._process_exit_get)(),l=(0,r._process_cwd_get)(),c=l,d=r._yargv_get,h=n(314),p=h._basename,g=h._dirname,y=(h._file_append,h._file_exists,h._path_join),_=h._stat;function m(e,t){let n;return void 0===t||""==t?n=`${e}: {_msg}`:"string"!=typeof t&&""==t||(n=`[${t}] ${e}: {_msg}`),n}function w(e){let t;"n"==quiet&&(_template=m("WARNING",app_name),t=_template.replaceAll("{_msg}",e),console.warn(t))}function b(e){let t;"undefined"!=typeof quiet&&""!=quiet||(quiet="y"),"n"==quiet&&(t=m("INFO",app_name).replaceAll("{_msg}",e),console.log(t))}function v(e,t){let n,r;"undefined"==typeof app_name||app_name,t=String(t),n=m("ERROR",app_name),r=n.replaceAll("{_msg}",e),"1"===t?(console.error(r),f(1)):"0"===t&&console.warn(r)}function E(e,t){let n;return void 0===t&&(t=e,e=0),n=t-e,n<0?(_msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),[]):Array(n).keys().map(t=>t+e)}function S(e){return new Promise(t=>setTimeout(t,e))}e.exports={_argv_get:i,_argv_url_get:o,_app_name_get:function(){let e;return e=p("/index.js"),e},_basename:h._basename,_cat:h._cat,_cmdline_check:function(e){let t,n,r;return"undefined"==typeof window&&(t=i(),n=t[1],void 0===n&&(n=t.$0),r=p(n),r==e)},_dirname:g,_echo:function(e){console.log(e)},_error_display:function(e){let t;"object"==typeof error?(t="error"in e&&null!=e.error&&"message"in e.error?e.error.message:"shortMessage"in e?e.shortMessage:e,console.error(e)):(t=e,console.error(e)),v(t,0)},_ext_rm:h._ext_rm,_dir_exists:h._dir_exists,_file_append:h._file_append,_file_exists:h._file_exists,_file_read:h._file_read,_file_write:h._file_write,_fs_worker_new:h._fs_worker_new,_fs_worker_start:h._fs_worker_start,_get_date_human:function(){const e=new Date;return`${e.getFullYear()}-${e.getMonth()}-${e.getDay()}T${e.getHours()}:${e.getMinutes()}+0000`},_globals:function(){app_name="",quiet="y"},_homedir_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&(n.g.global,n.g),"undefined"!=typeof window&&(e="/home/user"),e},_json_display:h._json_display,_json_read:h._json_read,_lib_get:async function(){let e;return new Set,"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e="/usr/lib"),e},_ls:h._ls,_mkdir:h._mkdir,_mktemp:h._mktemp,_msg_info:b,_msg_error:v,_msg_warning:w,_msg_info_obj:function(e,t){let n;n=`${e}: '${t}'`,b(n)},_mv:h._mv,_path_join:y,_printf:function(e){"undefined"==typeof window&&(_stdout=process.stdout),"undefined"!=typeof window&&(_stdout=n(310)),_stdout.write(e)},_process_exit:f,_process_cwd:l,_pwd:c,_range:E,_rm:h._rm,_run:async function(e,t,n,r,i,o){let a,f,l;void 0!==t&&""!=t&&t!=[]||(f="No command given in input.",v(f,1));const c=t[0],d=t.slice(1,t.length);if(void 0!==e&&""!=e||(e="sync"),void 0!==n&&""!=n||(n=""),void 0!==r&&""!=r||(r="0"),void 0!==i&&""!=i||(i="spawn"),void 0!==o&&""!=o||(o=""),f=`Running '${c}' with arguments '${d}'.`,b(f),l="","async"==e){const e=function(e){l+=e.toString()},t=function(e){let t,n;return 0!=e?(n=`Process exited with code '${e}'`,v(n,1)):(n="Process exited normally.",b(n)),t=l.split("\n"),t},n=u(c,d);return n.stdout.on("data",e),n.on("close",t),a=l.split("\n"),b(a.length),a}if("sync"==e){if("spawn"==i)return a=s(c,d,{encoding:"utf-8"}).stdout.split("\n"),a;if("native"==i){if(0<r){_msg_timeout=`Timeout of length '${r}' ms reached for task '${n}'.`,_time_over=!1;try{if(new Promise((e,t)=>{setTimeout(()=>{},r,"hurr")}),""!=o){if(l=await Promise.race([S(r),c[o].apply(c,d)]),void 0===l)throw _msg_timeout}else l=await c.apply(c,d)}catch(e){_time_over=!0}return _time_over?void w(_msg_timeout):l}l=await c[o].apply(c,d)}}},_seq:function(e,t){let n,r;if(r=[],t<e)return _msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),r;for(n of(void 0===t&&(t=e,e=1),E(e,t+1)))r.push(n);return r},_sleep:S,_stat:_,_yargv_get:d}},314(e,t,n){const r=n(70),i=r._os_tmpdir_get,o=(0,r._process_exit_get)(),a=n(962),s=a.readdirSync,u=a.existsSync,f=a.appendFileSync,l=a.readFileSync,c=a.writeFileSync,d=(a.isDir,a.fsWorkerNew),h=a.fsWorkerStart,p=a.mkdtempSync,g=a.statSync,y=JSON.parse,_=JSON.stringify,m=n(843),w=m.basename,b=m.dirname,v=m.join,E=m.parse;function S(e,t){return void 0!==t&&t!={}&&""!=t||(t={encoding:"utf8",flag:"r"}),l(e,t)}function k(e){let t;return t=v.apply(null,e),t}e.exports={_basename:function(e){let t;return t=w(e),t},_cat:S,_dirname:function(e){let t;return t=b(e),t},_ext_rm:function(e){let t,n,r;return t=E(e).dir,n=E(e).name,r=[t,n],k(r)},_dir_exists:a.isDir,_file_append:function(e,t,n){const r=[e,t];void 0!==n&&n!={}&&""!=n&&r.push(n),f.apply(null,r)},_file_exists:function(e){let t,n;return n=!1,t=u(e),t&&(n=!0),n},_file_read:S,_file_write:function(e,t,n){c(e,t)},_fs_worker_new:d,_fs_worker_start:h,_json_display:_,_json_read:function(e){let t,n;return t=S(e),n=y(t),n},_ls:function(e){return s.apply(null,[e])},_mkdir:a.mkdirSync,_mktemp:async function(e,t){const n=typeof t;if(void 0!==e&&""!=e||(e=`${i()}/tmp.`),"undefined"!=n&&""!=t&&"true"!=t||(t=!0),"false"==t&&(t=!1),t)try{return p(e)}catch(e){throw e}else _msg="It only supports creating temporary directories.",console.error(_msg),o(1)},_mv:a.renameSync,_path_join:k,_rm:a.rmSync,_stat:g}},70(e,t,n){function r(e){let t,n,r,i,o,a,s,u,f;void 0===e&&(s="Getting all values.",_msg_info("Getting all values."),e=""),t=[],a=window.location,u=a.search.substring(1),r=u.split("&");for(let a=0;a<r.length;a++)n=r[a],o=n.split("="),i=o[0],i!=e&&""!=e||(f=o[1],t.push(f));return t}e.exports={_argv_get:function(e){let t;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(t=r()),t},_argv_url_get:r,_child_process_spawn_get:function(e){let t;return void 0!==e&&""!=e||(e="sync"),"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(t=function(e,t,n){return n}),t},_os_tmpdir_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(){return"/tmp"}),e},_process_exit_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(e){return e}),e},_process_cwd_get:function(){let e;return e="undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"==typeof n?process.cwd:function(){return"."},e},_yargv_get:function(e){let t;const r={},i={};void 0!==e&&e!={}&&""!=e||(e={booleans:[],string:!0});const o=e.booleans;if("undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g){const a=n(Object(function(){const e=new Error("Cannot find module 'yargs'");throw e.code="MODULE_NOT_FOUND",e}()));_yargs_helpers_module=n(Object(function(){const e=new Error("Cannot find module 'yargs/helpers'");throw e.code="MODULE_NOT_FOUND",e}()));const s=_yargs_helpers_module.hideBin;if("string"in e&&e.string&&(r._={type:"string",string:!0},i["parse-numbers"]=!1,i["parse-positional-numbers"]=!1),o.length>0)for(t of o)r[t]={demand:!1,default:!1,type:"boolean"};return 0<o.length||e.string?a(s(process.argv)).parserConfiguration(i).options(r).string("_").parse():a(s(process.argv))}}}},511(e,t,n){const r=n(14);function i(e){const t=_path_join(["/","chains",`${e}.json`]);return _json_read(t)}function o(){const e=_path_join(["/","chains","chains.json"]);return _json_read(e)}_json_read=r._json_read,_path_join=r._path_join,e.exports={_data_get:function(e){let t;return t=void 0===e||""==e?o():i(e),t},_data_split_get:i,_data_unified_get:o}},14(e,t,n){const r=n(744),i=r._argv_get,o=r._argv_url_get,a=r._child_process_spawn_get,s=a(),u=a("async"),f=(0,r._process_exit_get)(),l=(0,r._process_cwd_get)(),c=l,d=r._yargv_get,h=n(496),p=h._basename,g=h._dirname,y=(h._file_append,h._file_exists,h._path_join),_=h._stat;function m(e,t){let n;return void 0===t||""==t?n=`${e}: {_msg}`:"string"!=typeof t&&""==t||(n=`[${t}] ${e}: {_msg}`),n}function w(e){let t;"n"==quiet&&(_template=m("WARNING",app_name),t=_template.replaceAll("{_msg}",e),console.warn(t))}function b(e){let t;"undefined"!=typeof quiet&&""!=quiet||(quiet="y"),"n"==quiet&&(t=m("INFO",app_name).replaceAll("{_msg}",e),console.log(t))}function v(e,t){let n,r;"undefined"==typeof app_name||app_name,t=String(t),n=m("ERROR",app_name),r=n.replaceAll("{_msg}",e),"1"===t?(console.error(r),f(1)):"0"===t&&console.warn(r)}function E(e,t){let n;return void 0===t&&(t=e,e=0),n=t-e,n<0?(_msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),[]):Array(n).keys().map(t=>t+e)}function S(e){return new Promise(t=>setTimeout(t,e))}e.exports={_argv_get:i,_argv_url_get:o,_app_name_get:function(){let e;return e=p("/index.js"),e},_basename:h._basename,_cat:h._cat,_cmdline_check:function(e){let t,n,r;return"undefined"==typeof window&&(t=i(),n=t[1],void 0===n&&(n=t.$0),r=p(n),r==e)},_dirname:g,_echo:function(e){console.log(e)},_error_display:function(e){let t;"object"==typeof error?(t="error"in e&&null!=e.error&&"message"in e.error?e.error.message:"shortMessage"in e?e.shortMessage:e,console.error(e)):(t=e,console.error(e)),v(t,0)},_ext_rm:h._ext_rm,_dir_exists:h._dir_exists,_file_append:h._file_append,_file_exists:h._file_exists,_file_read:h._file_read,_file_write:h._file_write,_fs_worker_new:h._fs_worker_new,_fs_worker_start:h._fs_worker_start,_get_date_human:function(){const e=new Date;return`${e.getFullYear()}-${e.getMonth()}-${e.getDay()}T${e.getHours()}:${e.getMinutes()}+0000`},_globals:function(){app_name="",quiet="y"},_homedir_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&(n.g.global,n.g),"undefined"!=typeof window&&(e="/home/user"),e},_json_display:h._json_display,_json_read:h._json_read,_lib_get:async function(){let e;return new Set,"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e="/usr/lib"),e},_ls:h._ls,_mkdir:h._mkdir,_mktemp:h._mktemp,_msg_info:b,_msg_error:v,_msg_warning:w,_msg_info_obj:function(e,t){let n;n=`${e}: '${t}'`,b(n)},_mv:h._mv,_path_join:y,_printf:function(e){"undefined"==typeof window&&(_stdout=process.stdout),"undefined"!=typeof window&&(_stdout=n(310)),_stdout.write(e)},_process_exit:f,_process_cwd:l,_pwd:c,_range:E,_rm:h._rm,_run:async function(e,t,n,r,i,o){let a,f,l;void 0!==t&&""!=t&&t!=[]||(f="No command given in input.",v(f,1));const c=t[0],d=t.slice(1,t.length);if(void 0!==e&&""!=e||(e="sync"),void 0!==n&&""!=n||(n=""),void 0!==r&&""!=r||(r="0"),void 0!==i&&""!=i||(i="spawn"),void 0!==o&&""!=o||(o=""),f=`Running '${c}' with arguments '${d}'.`,b(f),l="","async"==e){const e=function(e){l+=e.toString()},t=function(e){let t,n;return 0!=e?(n=`Process exited with code '${e}'`,v(n,1)):(n="Process exited normally.",b(n)),t=l.split("\n"),t},n=u(c,d);return n.stdout.on("data",e),n.on("close",t),a=l.split("\n"),b(a.length),a}if("sync"==e){if("spawn"==i)return a=s(c,d,{encoding:"utf-8"}).stdout.split("\n"),a;if("native"==i){if(0<r){_msg_timeout=`Timeout of length '${r}' ms reached for task '${n}'.`,_time_over=!1;try{if(new Promise((e,t)=>{setTimeout(()=>{},r,"hurr")}),""!=o){if(l=await Promise.race([S(r),c[o].apply(c,d)]),void 0===l)throw _msg_timeout}else l=await c.apply(c,d)}catch(e){_time_over=!0}return _time_over?void w(_msg_timeout):l}l=await c[o].apply(c,d)}}},_seq:function(e,t){let n,r;if(r=[],t<e)return _msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),r;for(n of(void 0===t&&(t=e,e=1),E(e,t+1)))r.push(n);return r},_sleep:S,_stat:_,_yargv_get:d}},496(e,t,n){const r=n(744),i=r._os_tmpdir_get,o=(0,r._process_exit_get)(),a=n(962),s=a.readdirSync,u=a.existsSync,f=a.appendFileSync,l=a.readFileSync,c=a.writeFileSync,d=(a.isDir,a.fsWorkerNew),h=a.fsWorkerStart,p=a.mkdtempSync,g=a.statSync,y=JSON.parse,_=JSON.stringify,m=n(843),w=m.basename,b=m.dirname,v=m.join,E=m.parse;function S(e,t){return void 0!==t&&t!={}&&""!=t||(t={encoding:"utf8",flag:"r"}),l(e,t)}function k(e){let t;return t=v.apply(null,e),t}e.exports={_basename:function(e){let t;return t=w(e),t},_cat:S,_dirname:function(e){let t;return t=b(e),t},_ext_rm:function(e){let t,n,r;return t=E(e).dir,n=E(e).name,r=[t,n],k(r)},_dir_exists:fs_module.isDir,_file_append:function(e,t,n){const r=[e,t];void 0!==n&&n!={}&&""!=n&&r.push(n),f.apply(null,r)},_file_exists:function(e){let t,n;return n=!1,t=u(e),t&&(n=!0),n},_file_read:S,_file_write:function(e,t,n){c(e,t)},_fs_worker_new:d,_fs_worker_start:h,_json_display:_,_json_read:function(e){let t,n;return t=S(e),n=y(t),n},_ls:function(e){return s.apply(null,[e])},_mkdir:a.mkdirSync,_mktemp:async function(e,t){const n=typeof t;if(void 0!==e&&""!=e||(e=`${i()}/tmp.`),"undefined"!=n&&""!=t&&"true"!=t||(t=!0),"false"==t&&(t=!1),t)try{return p(e)}catch(e){throw e}else _msg="It only supports creating temporary directories.",console.error(_msg),o(1)},_mv:a.renameSync,_path_join:k,_rm:a.rmSync,_stat:g}},744(e,t,n){function r(e){let t,n,r,i,o,a,s,u,f;void 0===e&&(s="Getting all values.",_msg_info("Getting all values."),e=""),t=[],a=window.location,u=a.search.substring(1),r=u.split("&");for(let a=0;a<r.length;a++)n=r[a],o=n.split("="),i=o[0],i!=e&&""!=e||(f=o[1],t.push(f));return t}e.exports={_argv_get:function(e){let t;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(t=r()),t},_argv_url_get:r,_child_process_spawn_get:function(e){let t;return void 0!==e&&""!=e||(e="sync"),"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(t=function(e,t,n){return n}),t},_os_tmpdir_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(){return"/tmp"}),e},_process_exit_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(e){return e}),e},_process_cwd_get:function(){let e;return e="undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"==typeof n?process.cwd:function(){return"."},e},_yargv_get:function(e){let t;const r={},i={};void 0!==e&&e!={}&&""!=e||(e={booleans:[],string:!0});const o=e.booleans;if("undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g){const a=n(Object(function(){const e=new Error("Cannot find module 'yargs'");throw e.code="MODULE_NOT_FOUND",e}()));_yargs_helpers_module=n(Object(function(){const e=new Error("Cannot find module 'yargs/helpers'");throw e.code="MODULE_NOT_FOUND",e}()));const s=_yargs_helpers_module.hideBin;if("string"in e&&e.string&&(r._={type:"string",string:!0},i["parse-numbers"]=!1,i["parse-positional-numbers"]=!1),o.length>0)for(t of o)r[t]={demand:!1,default:!1,type:"boolean"};return 0<o.length||e.string?a(s(process.argv)).parserConfiguration(i).options(r).string("_").parse():a(s(process.argv))}}}},7(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,o,a,f;if(s(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,f=l,console&&console.warn&&console.warn(f)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){r.once&&e.removeEventListener(t,i),n(o)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var f=u.length,l=p(u,f);for(n=0;n<f;++n)r(l[n],this,t)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,c(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,c(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,o,a;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},515(e,t,n){const r=n(684);_homedir_get=r._homedir_get,_file_exists=r._file_exists,_json_read=r._json_read,_lib_get=r._lib_get,_msg_info=r._msg_info,_msg_error=r._msg_error,_path_join=r._path_join,_range=r._range;const i=n(511)._data_get;function o(e,t,n){let r,i,o;if(void 0!==e&&""!=e||(e="n"),void 0!==t&&""!=t||(t=""),void 0!==n&&""!=n||(""!=t?n="split":""==t&&(n="unified")),o=`Getting path for chain with chain id '${t}' with privilege user set to '${e}' in format '${n}'.`,_msg_info(o),"unified"==n?r="chains.json":"split"==n&&(r=`${t}.json`),"y"==e){const e=_homedir_get();i=_path_join([e,".config","evm-chains",r]);const t=_file_exists(i);1==t?(o=`Found database '${i}'.`,_msg_info(o)):0==t?(o=`Database '${i}' not found`,_msg_info(o)):(o="wat",_msg_error(o))}else if("n"==e){const e=_lib_get();o=`Found system libraries directory '${e}'.`,i=_path_join([e,"evm-chains",r])}else o=`Input variable '_user' must be a boolean. _user value is '${e}'.`,_msg_error(o,0);return i}function a(e,t,n,r,a){let s;void 0!==e&&""!=e||_msg_error("Network's ChainID not specified.",1),void 0!==t&&""!=t||(t="kirsh"),void 0!==n&&""!=n||(n=o("n")),void 0===a&&(a=["node","system"]),void 0!==r&&""!=r||(r="y");const u=function(e,t,n,r,a){let s,u,f,l;for(f of(void 0!==a&&a!=[]&&""!=a||(a=["node","system"]),void 0!==n&&""!=n||(n="n"),void 0!==r&&""!=r||(r="split"),void 0!==t&&""!=t||(t=o(n,e,r)),a))if("node"==f){for(s of(l="Getting data from 'ethereum-data' module.",_msg_info(l),u=i(e),l=`Displaying data for chain '${e}' of type '${a}'.`,_msg_info(l),u))if(s.chainId==e)return s}else if("system"==f){_file_exists(t);const n=_json_read(t);for(s of(l=`Displaying data for chain '${e}' of type '${a}'.`,_msg_info(l),n))if(s.chainId==e)return s;l=`Network '${e}' not found.`,_msg_error(l,1)}}(Number(e),n,r,a);if("kirsh"==t)return u.rpc[0];s="Unknown selection method.",_msg_error("Unknown selection method.",1)}function s(e){_file_exists(e)||_msg_error(`Database at '${e}' does not exist.`,1)}function u(e,t,n,r,i,o,a){let s,u,f,l,c,d,h,p;if(c=n,"id"==t?(l="chainId",d=a,p=`Getting data for filter key: '${l}' and value '${d}'.`,_msg_info(p)):"testnet"==t&&(p="Like I have to agg a tag.",_msg_info(p)),"id"==n?c="chainId":"rpc"==n&&(c=n),"y"==o)return f=function(e){console.log(e)}(c),p=`Showing results for all networks with filter '${f}'.`,_msg_info(p),s=_json_read(e),p=`Showing results for all networks with filter '${f}'.`,_msg_info(p),s;if("n"==o){for(u of(h=[],p=`Showing results for chain '${a}' in database '${e}' with filter '${c}'.`,_msg_info(p),s=_json_read(e),p=`Database '${e}' contains '${s.length}' items.`,_msg_info(p),s))if(u[l]==a&&(h.push(u),"kirsh"==r))break;return p=`Total results returned for '${e}' are '${h.length}'.`,_msg_info(p),h}}function f(e,t,n,r,o,a,f,l,c){let d,h,p,g,y,_,m;if(_=0,"offline"==t){for(p of n)if("node"==p){for(g of(d=[],m=i(e),m))if(g.chainId==e&&(d.push(g),"kirsh"==a))break}else if("system"==p){for(h of(y=`Getting data from databases '${c}'`,_msg_info(y),c))if(y=`Looking in '${h}'.`,_msg_info(y),s(h),"amount"!=r)d=u(h,r,o,a,0,l,e);else if("amount"==r&&(d=_json_read(h),_=d.length,"kirsh"==a))break;if("amount"!=r)_=d.length,0==d.length&&(y=`No results found for network '${e}'.`,_msg_error(y,0));else if("amount"==r)return y=`Found '${_}' networks.`,_msg_info(y),_}for(g of(m=[],d))if(g.chainId==e&&(m.push(g[o]),"all"!=a))break;d=m,_=d.length,y=`Found '${_}' networks in database '${h}'.`,_msg_info(y)}else"online"==t&&(y="About to implement it probably.",_msg_error(y,1));return d}function l(e){"id"==e&&_msg_info(`Setting value for type '${e}'.`)}e.exports={_data_get:i,_db_paths_auto_detect:function(e){let t,n,r;"y"==user_level?(t="y",n="n"):"n"==user_level&&(t="n",n="y");const i=o(t,"","unified"),a=o(t,e,"split"),s=o(n,"","unified"),u=o(n,e,"split");_file_exists(a)?(db_paths.push(a),r=`Found database '${a}', adding.`,_msg_info(r)):_file_exists(a)?(r="wat",_msg_error(r,1)):(r=`Default per-network database '${a}' not found, trying '${i}'.`,_msg_info(r)),_file_exists(i)?(db_paths.push(i),r=`Found database '${i}', adding.`,_msg_info(r)):(r=`Default unified database '${a}' not found, trying '${i}'.`,_msg_info(r)),_file_exists(u)?(db_paths.push(u),r=`Found database '${u}', adding.`,_msg_info(r)):(r=`Fallback per-network database '${u}' not found, trying '${s}'.`,_msg_info(r)),_file_exists(s)?(db_paths.push(s),r=`Found database '${s}', adding.`,_msg_info(r)):(r=`Fallback database '${u}' does not exist.`,_msg_error(r,0)),0==db_paths.length&&(r="Found no databases!",_msg_info(r))},_db_types_auto_detect:function(e){0==db_types.length&&db_types.push("node"),db_paths.length>0&&db_types.push("system")},_evm_chains_db_path_get:o,_evm_chains_info:function(e,t,n,r,i,o,a,s,u,c){let d,h,p;if("get"==e){const e=[],s=f(u,r,i,t,n,o,0,a,c);if("rpc"==n){for(h of s)for(p of h)if("y"==a?e.push(p):"n"==a&&(p.includes("API_KEY")||e.push(p)),"kirsh"==o)break;return e}if("name"==n)return s;if("id"==n)return s;if("explorers"==n){for(h of s)for(d of h)if(e.push(d.url),"kirsh"==o)break;return e}}else"set"==e?l(t):_msg_error(`Unknown command '${e}'.`,1)},_evm_chains_info_get:f,_evm_chains_info_set:l,_input_type_auto_detect:function(){""==input_type&&(isNaN(target_chain)?input_type="name":input_type="id")},_rpc_backend_get:a,_rpc_backends_get:function(e,t,n){let r,i,s;null==t&&(t="kirsh"),null==n&&(n=o("n"));const u=[];for(r of e)i=[r,t,n],s=a.apply(null,i),u.push(s);return u}}},684(e,t,n){const r=n(514),i=r._argv_get,o=r._argv_url_get,a=r._child_process_spawn_get,s=a(),u=a("async"),f=(0,r._process_exit_get)(),l=(0,r._process_cwd_get)(),c=l,d=r._yargv_get,h=n(558),p=h._basename,g=h._dirname,y=(h._file_append,h._file_exists,h._path_join),_=h._stat;function m(e,t){let n;return void 0===t||""==t?n=`${e}: {_msg}`:"string"!=typeof t&&""==t||(n=`[${t}] ${e}: {_msg}`),n}function w(e){let t;"n"==quiet&&(_template=m("WARNING",app_name),t=_template.replaceAll("{_msg}",e),console.warn(t))}function b(e){let t;"undefined"!=typeof quiet&&""!=quiet||(quiet="y"),"n"==quiet&&(t=m("INFO",app_name).replaceAll("{_msg}",e),console.log(t))}function v(e,t){let n,r;"undefined"==typeof app_name||app_name,t=String(t),n=m("ERROR",app_name),r=n.replaceAll("{_msg}",e),"1"===t?(console.error(r),f(1)):"0"===t&&console.warn(r)}function E(e,t){let n;return void 0===t&&(t=e,e=0),n=t-e,n<0?(_msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),[]):Array(n).keys().map(t=>t+e)}function S(e){return new Promise(t=>setTimeout(t,e))}e.exports={_argv_get:i,_argv_url_get:o,_app_name_get:function(){let e;return e=p("/index.js"),e},_basename:h._basename,_cat:h._cat,_cmdline_check:function(e){let t,n,r;return"undefined"==typeof window&&(t=i(),n=t[1],void 0===n&&(n=t.$0),r=p(n),r==e)},_dirname:g,_echo:function(e){console.log(e)},_error_display:function(e){let t;"object"==typeof error?(t="error"in e&&null!=e.error&&"message"in e.error?e.error.message:"shortMessage"in e?e.shortMessage:e,console.error(e)):(t=e,console.error(e)),v(t,0)},_ext_rm:h._ext_rm,_dir_exists:h._dir_exists,_file_append:h._file_append,_file_exists:h._file_exists,_file_read:h._file_read,_file_write:h._file_write,_fs_worker_new:h._fs_worker_new,_fs_worker_start:h._fs_worker_start,_get_date_human:function(){const e=new Date;return`${e.getFullYear()}-${e.getMonth()}-${e.getDay()}T${e.getHours()}:${e.getMinutes()}+0000`},_globals:function(){app_name="",quiet="y"},_homedir_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&(n.g.global,n.g),"undefined"!=typeof window&&(e="/home/user"),e},_json_display:h._json_display,_json_read:h._json_read,_lib_get:async function(){let e;return new Set,"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e="/usr/lib"),e},_ls:h._ls,_mkdir:h._mkdir,_mktemp:h._mktemp,_msg_info:b,_msg_error:v,_msg_warning:w,_msg_info_obj:function(e,t){let n;n=`${e}: '${t}'`,b(n)},_mv:h._mv,_path_join:y,_printf:function(e){"undefined"==typeof window&&(_stdout=process.stdout),"undefined"!=typeof window&&(_stdout=n(310)),_stdout.write(e)},_process_exit:f,_process_cwd:l,_pwd:c,_range:E,_rm:h._rm,_run:async function(e,t,n,r,i,o){let a,f,l;void 0!==t&&""!=t&&t!=[]||(f="No command given in input.",v(f,1));const c=t[0],d=t.slice(1,t.length);if(void 0!==e&&""!=e||(e="sync"),void 0!==n&&""!=n||(n=""),void 0!==r&&""!=r||(r="0"),void 0!==i&&""!=i||(i="spawn"),void 0!==o&&""!=o||(o=""),f=`Running '${c}' with arguments '${d}'.`,b(f),l="","async"==e){const e=function(e){l+=e.toString()},t=function(e){let t,n;return 0!=e?(n=`Process exited with code '${e}'`,v(n,1)):(n="Process exited normally.",b(n)),t=l.split("\n"),t},n=u(c,d);return n.stdout.on("data",e),n.on("close",t),a=l.split("\n"),b(a.length),a}if("sync"==e){if("spawn"==i)return a=s(c,d,{encoding:"utf-8"}).stdout.split("\n"),a;if("native"==i){if(0<r){_msg_timeout=`Timeout of length '${r}' ms reached for task '${n}'.`,_time_over=!1;try{if(new Promise((e,t)=>{setTimeout(()=>{},r,"hurr")}),""!=o){if(l=await Promise.race([S(r),c[o].apply(c,d)]),void 0===l)throw _msg_timeout}else l=await c.apply(c,d)}catch(e){_time_over=!0}return _time_over?void w(_msg_timeout):l}l=await c[o].apply(c,d)}}},_seq:function(e,t){let n,r;if(r=[],t<e)return _msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),r;for(n of(void 0===t&&(t=e,e=1),E(e,t+1)))r.push(n);return r},_sleep:S,_stat:_,_yargv_get:d}},558(e,t,n){const r=n(514),i=r._os_tmpdir_get,o=(0,r._process_exit_get)(),a=n(962),s=a.readdirSync,u=a.existsSync,f=a.appendFileSync,l=a.readFileSync,c=a.writeFileSync,d=(a.isDir,a.fsWorkerNew),h=a.fsWorkerStart,p=a.mkdtempSync,g=a.statSync,y=JSON.parse,_=JSON.stringify,m=n(843),w=m.basename,b=m.dirname,v=m.join,E=m.parse;function S(e,t){return void 0!==t&&t!={}&&""!=t||(t={encoding:"utf8",flag:"r"}),l(e,t)}function k(e){let t;return t=v.apply(null,e),t}e.exports={_basename:function(e){let t;return t=w(e),t},_cat:S,_dirname:function(e){let t;return t=b(e),t},_ext_rm:function(e){let t,n,r;return t=E(e).dir,n=E(e).name,r=[t,n],k(r)},_dir_exists:fs_module.isDir,_file_append:function(e,t,n){const r=[e,t];void 0!==n&&n!={}&&""!=n&&r.push(n),f.apply(null,r)},_file_exists:function(e){let t,n;return n=!1,t=u(e),t&&(n=!0),n},_file_read:S,_file_write:function(e,t,n){c(e,t)},_fs_worker_new:d,_fs_worker_start:h,_json_display:_,_json_read:function(e){let t,n;return t=S(e),n=y(t),n},_ls:function(e){return s.apply(null,[e])},_mkdir:a.mkdirSync,_mktemp:async function(e,t){const n=typeof t;if(void 0!==e&&""!=e||(e=`${i()}/tmp.`),"undefined"!=n&&""!=t&&"true"!=t||(t=!0),"false"==t&&(t=!1),t)try{return p(e)}catch(e){throw e}else _msg="It only supports creating temporary directories.",console.error(_msg),o(1)},_mv:a.renameSync,_path_join:k,_rm:a.rmSync,_stat:g}},514(e,t,n){function r(e){let t,n,r,i,o,a,s,u,f;void 0===e&&(s="Getting all values.",_msg_info("Getting all values."),e=""),t=[],a=window.location,u=a.search.substring(1),r=u.split("&");for(let a=0;a<r.length;a++)n=r[a],o=n.split("="),i=o[0],i!=e&&""!=e||(f=o[1],t.push(f));return t}e.exports={_argv_get:function(e){let t;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(t=r()),t},_argv_url_get:r,_child_process_spawn_get:function(e){let t;return void 0!==e&&""!=e||(e="sync"),"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(t=function(e,t,n){return n}),t},_os_tmpdir_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(){return"/tmp"}),e},_process_exit_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(e){return e}),e},_process_cwd_get:function(){let e;return e="undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"==typeof n?process.cwd:function(){return"."},e},_yargv_get:function(e){let t;const r={},i={};void 0!==e&&e!={}&&""!=e||(e={booleans:[],string:!0});const o=e.booleans;if("undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g){const a=n(Object(function(){const e=new Error("Cannot find module 'yargs'");throw e.code="MODULE_NOT_FOUND",e}()));_yargs_helpers_module=n(Object(function(){const e=new Error("Cannot find module 'yargs/helpers'");throw e.code="MODULE_NOT_FOUND",e}()));const s=_yargs_helpers_module.hideBin;if("string"in e&&e.string&&(r._={type:"string",string:!0},i["parse-numbers"]=!1,i["parse-positional-numbers"]=!1),o.length>0)for(t of o)r[t]={demand:!1,default:!1,type:"boolean"};return 0<o.length||e.string?a(s(process.argv)).parserConfiguration(i).options(r).string("_").parse():a(s(process.argv))}}}},251(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,f=u>>1,l=-7,c=n?i-1:0,d=n?-1:1,h=e[t+c];for(c+=d,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+e[t+c],c+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+c],c+=d,l-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=f}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,f=8*o-i-1,l=(1<<f)-1,c=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?d/u:d*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=l?(s=0,a=l):a+c>=1?(s=(t*u-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[n+h]=255&a,h+=p,a/=256,f-=8);e[n+h-p]|=128*g}},698(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},10(e,t,n){const r=n(516),i=n(866),o=n(12);function a(e){let t;return void 0===e&&(e="fs-worker.js"),t=new i(e),t}_file=o.file,_read_stream_create=function(e,t){return _file(e).createReader()},e.exports=r,e.exports.fsWorkerNew=a,e.exports.fsWorkerStart=async function(e,t,n){let r,i,o,s;return void 0===e&&(e="fs-worker.js"),"Number"!=typeof t&&(t=10485760),"Number"!=typeof t&&(n=10485760),i=_fs.connectSyncAgent,s=a(e),o={worker:s,bufferLength:t,opTimeout:n},r=i(o),r},e.exports.createReadStream=_read_stream_create,e.exports.createWriteStream=function(e,t){return _file(e).createWriter()},e.exports.mkdtemp=r.mkTemp,e.exports.mkdtempSync=r.mkTempSync,e.exports.readdirSync=function(e){const t=_fs.readDirSync;return _return=t.apply(null,[e]).unwrap(),_return},e.exports.renameSync=function(e){const t=_fs.moveSync;return _return=t.apply(null,e).unwrap(),_return},e.exports.rmSync=function(e){const t=_fs.removeSync;return _return=t.apply(null,e).unwrap(),_return}},48(e){"use strict";var t={};function n(e,n,r){r||(r=Error);var i=function(e){var t,r;function i(t,r,i){return e.call(this,function(e,t,r){return"string"==typeof n?n:n(e,t,r)}(t,r,i))||this}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(e,t,n){var i,o,a,s,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(r(t,"type"));else{var f=("number"!=typeof u&&(u=0),u+1>(s=e).length||-1===s.indexOf(".",u)?"argument":"property");a='The "'.concat(e,'" ').concat(f," ").concat(i," ").concat(r(t,"type"))}return a+". Received type ".concat(typeof n)},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},382(e,t,n){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var i=n(412),o=n(708);n(698)(f,i);for(var a=r(o.prototype),s=0;s<a.length;s++){var u=a[s];f.prototype[u]||(f.prototype[u]=o.prototype[u])}function f(e){if(!(this instanceof f))return new f(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||process.nextTick(c,this)}function c(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},600(e,t,n){"use strict";e.exports=i;var r=n(610);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(698)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},412(e,t,n){"use strict";var r;e.exports=k,k.ReadableState=S,n(7).EventEmitter;var i,o=function(e,t){return e.listeners(t).length},a=n(345),s=n(287).Buffer,u=(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},f=n(838);i=f&&f.debuglog?f.debuglog("stream"):function(){};var l,c,d,h=n(726),p=n(896),g=n(291).getHighWaterMark,y=n(48).F,_=y.ERR_INVALID_ARG_TYPE,m=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,b=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(698)(k,a);var v=p.errorOrDestroy,E=["error","close","destroy","pause","resume"];function S(e,t,i){r=r||n(382),e=e||{},"boolean"!=typeof i&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=n(141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function k(e){if(r=r||n(382),!(this instanceof k))return new k(e);var t=this instanceof r;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function R(e,t,n,r,o){i("readableAddChunk",t);var a,f=e._readableState;if(null===t)f.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}}(e,f);else if(o||(a=function(e,t){var n,r;return r=t,s.isBuffer(r)||r instanceof u||"string"==typeof t||void 0===t||e.objectMode||(n=new _("chunk",["string","Buffer","Uint8Array"],t)),n}(f,t)),a)v(e,a);else if(f.objectMode||t&&t.length>0)if("string"==typeof t||f.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)f.endEmitted?v(e,new b):T(e,f,t,!0);else if(f.ended)v(e,new m);else{if(f.destroyed)return!1;f.reading=!1,f.decoder&&!n?(t=f.decoder.write(t),f.objectMode||0!==t.length?T(e,f,t,!1):j(e,f)):T(e,f,t,!1)}else r||(f.reading=!1,j(e,f));return!f.ended&&(f.length<f.highWaterMark||0===f.length)}function T(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&x(e)),j(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=p.destroy,k.prototype._undestroy=p.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=s.from(e,t),t=""),n=!0),R(this,e,t,!1,n)},k.prototype.unshift=function(e){return R(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){l||(l=n(141).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var A=1073741824;function O(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=A?e=A:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(L,e))}function L(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,M(e)}function j(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(C,e,t))}function C(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(i("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function $(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){i("readable nexttick read 0"),e.read(0)}function U(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function N(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(F,t,e))}function F(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function P(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}k.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):x(this),null;if(0===(e=O(e,t))&&t.ended)return 0===t.length&&N(this),null;var r,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=O(n,t))),null===(r=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&N(this)),null!==r&&this.emit("data",r),r},k.prototype._read=function(e){v(this,new w("_read()"))},k.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,i("pipe count=%d opts=%j",r.pipesCount,t);var a=t&&!1===t.end||e===process.stdout||e===process.stderr?p:s;function s(){i("onend"),e.end()}r.endEmitted?process.nextTick(a):n.once("end",a),e.on("unpipe",function t(o,a){i("onunpipe"),o===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i("cleanup"),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",c),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",p),n.removeListener("data",l),f=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||u())});var u=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,M(e))}}(n);e.on("drain",u);var f=!1;function l(t){i("ondata");var o=e.write(t);i("dest.write",o),!1===o&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==P(r.pipes,e))&&!f&&(i("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function c(t){i("onerror",t),p(),e.removeListener("error",c),0===o(e,"error")&&v(e,t)}function d(){e.removeListener("finish",h),p()}function h(){i("onfinish"),e.removeListener("close",d),p()}function p(){i("unpipe"),n.unpipe(e)}return n.on("data",l),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",c),e.once("close",d),e.once("finish",h),e.emit("pipe",n),r.flowing||(i("pipe resume"),n.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=P(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},k.prototype.on=function(e,t){var n=a.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,i("on readable",r.length,r.reading),r.length?x(this):r.reading||process.nextTick(I,this))),n},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick($,this),n},k.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick($,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(U,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",function(){if(i("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){i("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<E.length;a++)e.on(E[a],this.emit.bind(this,E[a]));return this._read=function(t){i("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===c&&(c=n(955)),c(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=B,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===d&&(d=n(157)),d(k,e,t)})},610(e,t,n){"use strict";e.exports=l;var r=n(48).F,i=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n(382);function f(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new o);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:f.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",c)}function c(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,n){d(e,t,n)})}function d(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}n(698)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,n){n(new i("_transform()"))},l.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,function(e){t(e)})}},708(e,t,n){"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(void 0),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=k,k.WritableState=S;var o,a={deprecate:n(643)},s=n(345),u=n(287).Buffer,f=(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},l=n(896),c=n(291).getHighWaterMark,d=n(48).F,h=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,_=d.ERR_STREAM_DESTROYED,m=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,b=d.ERR_UNKNOWN_ENCODING,v=l.errorOrDestroy;function E(){}function S(e,t,o){i=i||n(382),e=e||{},"boolean"!=typeof o&&(o=t instanceof i),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=c(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(L,e,t),e._writableState.errorEmitted=!0,v(e,r)):(i(r),e._writableState.errorEmitted=!0,v(e,r),L(e,t))}(e,n,r,t,i);else{var o=O(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||A(e,n),r?process.nextTick(T,e,n,o,i):T(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function k(e){var t=this instanceof(i=i||n(382));if(!t&&!o.call(k,this))return new k(e);this._writableState=new S(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function R(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function T(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),L(e,t)}function A(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,o=new Array(i),a=t.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)o[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;o.allBuffers=u,R(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var f=n.chunk,l=n.encoding,c=n.callback;if(R(e,t,!1,t.objectMode?1:f.length,f,l,c),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function O(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final(function(n){t.pendingcb--,n&&v(e,n),t.prefinished=!0,e.emit("prefinish"),L(e,t)})}function L(e,t){var n=O(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(x,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(698)(k,s),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!o.call(this,e)||this===k&&e&&e._writableState instanceof S}})):o=function(e){return e instanceof this},k.prototype.pipe=function(){v(this,new y)},k.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,a=!i.objectMode&&(r=e,u.isBuffer(r)||r instanceof f);return a&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=E),i.ending?function(e,t){var n=new w;v(e,n),process.nextTick(t,n)}(this,n):(a||function(e,t,n,r){var i;return null===n?i=new m:"string"==typeof n||t.objectMode||(i=new h("chunk",["string","Buffer"],n)),!i||(v(e,i),process.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,n)),t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else R(e,t,!1,s,r,i,o);return f}(this,i,a,e,t,n)),o},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},k.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new b(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,n){n(new p("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,L(e,t),n&&(t.finished?process.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=l.destroy,k.prototype._undestroy=l.undestroy,k.prototype._destroy=function(e,t){t(e)}},955(e,t,n){"use strict";var r;function i(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(238),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),c=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[d].read();null!==n&&(e[l]=null,e[a]=null,e[s]=null,t(h(n,!1)))}}function g(e){process.nextTick(p,e)}var y=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((i(r={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[f])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise(function(t,n){process.nextTick(function(){e[u]?n(e[u]):t(h(void 0,!0))})});var n,r=this[l];if(r)n=new Promise(function(e,t){return function(n,r){e.then(function(){t[f]?n(h(void 0,!0)):t[c](n,r)},r)}}(r,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(h(i,!1));n=new Promise(this[c])}return this[l]=n,n}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var e=this;return new Promise(function(t,n){e[d].destroy(null,function(e){e?n(e):t(h(void 0,!0))})})}),r),y);e.exports=function(e){var t,n=Object.create(_,(i(t={},d,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,f,{value:e._readableState.endEmitted,writable:!0}),i(t,c,{value:function(e,t){var r=n[d].read();r?(n[l]=null,n[a]=null,n[s]=null,e(h(r,!1))):(n[a]=e,n[s]=t)},writable:!0}),t));return n[l]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[l]=null,n[a]=null,n[s]=null,t(e)),void(n[u]=e)}var r=n[a];null!==r&&(n[l]=null,n[a]=null,n[s]=null,r(h(void 0,!0))),n[f]=!0}),e.on("readable",g.bind(null,n)),n}},726(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var u=n(287).Buffer,f=n(340).inspect,l=f&&f.custom||"inspect";function c(e,t,n){u.prototype.copy.call(e,t,n)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,(n=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t=u.allocUnsafe(e>>>0),n=this.head,r=0;n;)c(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0===(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:l,value:function(e,t){return f(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},896(e){"use strict";function t(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var o=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!i&&e?o._writableState?o._writableState.errorEmitted?process.nextTick(n,o):(o._writableState.errorEmitted=!0,process.nextTick(t,o,e)):process.nextTick(t,o,e):i?(process.nextTick(n,o),i(e)):process.nextTick(n,o)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}},238(e,t,n){"use strict";var r=n(48).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,o){if("function"==typeof n)return e(t,null,n);n||(n={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(o||i);var a=n.readable||!1!==n.readable&&t.readable,s=n.writable||!1!==n.writable&&t.writable,u=function(){t.writable||l()},f=t._writableState&&t._writableState.finished,l=function(){s=!1,f=!0,a||o.call(t)},c=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,c=!0,s||o.call(t)},h=function(e){o.call(t,e)},p=function(){var e;return a&&!c?(t._readableState&&t._readableState.ended||(e=new r),o.call(t,e)):s&&!f?(t._writableState&&t._writableState.ended||(e=new r),o.call(t,e)):void 0},g=function(){t.req.on("finish",l)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",l),t.on("abort",p),t.req?g():t.on("request",g)):s&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",d),t.on("finish",l),!1!==n.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},157(e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},758(e,t,n){"use strict";var r,i=n(48).F,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function f(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,c=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var d=t.map(function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",function(){s=!0}),void 0===r&&(r=n(238)),r(e,{readable:t,writable:i},function(e){if(e)return o(e);s=!0,o()});var u=!1;return function(t){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}(e,o,i>0,function(e){l||(l=e),e&&d.forEach(u),o||(d.forEach(u),c(l))})});return t.reduce(f)}},291(e,t,n){"use strict";var r=n(48).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},345(e,t,n){e.exports=n(7).EventEmitter},861(e,t,n){var r=n(287),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},310(e,t,n){e.exports=i;var r=n(7).EventEmitter;function i(){r.call(this)}n(698)(i,r),i.Readable=n(412),i.Writable=n(708),i.Duplex=n(382),i.Transform=n(610),i.PassThrough=n(600),i.finished=n(238),i.pipeline=n(758),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function f(e){if(l(),0===r.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",f),e.removeListener("error",f),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",f),e.on("error",f),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e}},141(e,t,n){"use strict";var r=n(861).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=f,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=c,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function f(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=a(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=a(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=a(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},962(e,t,n){function r(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(){let e;try{e=n(10)}catch(e){console.log(e);const t="Error importing the '@themartiancompany/opfs' module as 'opfs'. If you got this error while bundling a webpack for a project depending on this module double check its 'webpack.config.js' file or whether the 'opfs' module is listed in developer dependencies and install them.I'm sorry for this inconvenience but Node packagement system does not currently distinguish 'development' from 'build' dependencies.";throw console.error(t),e}return e}()),e}const i=r();i.isDirSync=function(e){return!(void 0).statSync(e).isFile()},i.isDir=i.isDirSync,e.exports=i,e.exports.getModule=function(e){let t;if(""==_module_name||"undefined"==typeof _module_name)t=r();else if("opfs"==_module_name)t=_opfs_module_auto_detect();else{if("fs"!=_module_name){const e="Unknown file system module "+`'${_module_name}'.`.const;throw _error={msg:e},console.error(e),_error}t=n(Object(function(){const e=new Error("Cannot find module 'node:fs'");throw e.code="MODULE_NOT_FOUND",e}())),t.fsWorkerStart=function(e){let t;return t=e.fsWorkerStart,void 0===t&&(t=function(){}),t}(t)}return t}},643(e,t,n){function r(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},866(){},340(){},838(){},12(e,t){!function(e){"use strict";var t,n,r,i,o,a,s,u,f,l,c,d,h=e=>{throw TypeError(e)},p=(e,t,n)=>t.has(e)||h("Cannot "+n),g=(e,t,n)=>(p(e,t,"read from private field"),n?n.call(e):t.get(e)),y=(e,t,n)=>t.has(e)?h("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_=(e,t,n,r)=>(p(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);const m="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIHUobil7aWYobj09PSIvIilyZXR1cm57cGFyZW50Om51bGwsbmFtZToiIn07Y29uc3QgZT1uLnNwbGl0KCIvIikuZmlsdGVyKGk9PmkubGVuZ3RoPjApO2lmKGUubGVuZ3RoPT09MCl0aHJvdyBFcnJvcigiSW52YWxpZCBwYXRoIik7Y29uc3QgYT1lW2UubGVuZ3RoLTFdLHI9Ii8iK2Uuc2xpY2UoMCwtMSkuam9pbigiLyIpO3JldHVybntuYW1lOmEscGFyZW50OnJ9fWFzeW5jIGZ1bmN0aW9uIHcobixlKXtjb25zdHtwYXJlbnQ6YSxuYW1lOnJ9PXUobik7aWYoYT09bnVsbClyZXR1cm4gYXdhaXQgbmF2aWdhdG9yLnN0b3JhZ2UuZ2V0RGlyZWN0b3J5KCk7Y29uc3QgaT1hLnNwbGl0KCIvIikuZmlsdGVyKHQ9PnQubGVuZ3RoPjApO3RyeXtsZXQgdD1hd2FpdCBuYXZpZ2F0b3Iuc3RvcmFnZS5nZXREaXJlY3RvcnkoKTtmb3IoY29uc3QgcyBvZiBpKXQ9YXdhaXQgdC5nZXREaXJlY3RvcnlIYW5kbGUocyx7Y3JlYXRlOmUuY3JlYXRlfSk7aWYoZS5pc0ZpbGUpcmV0dXJuIGF3YWl0IHQuZ2V0RmlsZUhhbmRsZShyLHtjcmVhdGU6ZS5jcmVhdGV9KX1jYXRjaCh0KXtpZih0Lm5hbWU9PT0iTm90Rm91bmRFcnJvciIpcmV0dXJuIG51bGw7dGhyb3cgdH19Y29uc3QgZj17fTtzZWxmLm9ubWVzc2FnZT1hc3luYyBuPT57dmFyIGk7Y29uc3R7ZXZ0VHlwZTplLGFyZ3M6YX09bi5kYXRhO2xldCByPWZbYS5maWxlSWRdO3RyeXtsZXQgdDtjb25zdCBzPVtdO2lmKGU9PT0icmVnaXN0ZXIiKXtjb25zdCBsPWF3YWl0IHcoYS5maWxlUGF0aCx7Y3JlYXRlOiEwLGlzRmlsZTohMH0pO2lmKGw9PW51bGwpdGhyb3cgRXJyb3IoYG5vdCBmb3VuZCBmaWxlOiAke2EuZmlsZUlkfWApO3I9YXdhaXQgbC5jcmVhdGVTeW5jQWNjZXNzSGFuZGxlKHttb2RlOmEubW9kZX0pLGZbYS5maWxlSWRdPXJ9ZWxzZSBpZihlPT09ImNsb3NlIilhd2FpdCByLmNsb3NlKCksZGVsZXRlIGZbYS5maWxlSWRdO2Vsc2UgaWYoZT09PSJ0cnVuY2F0ZSIpYXdhaXQgci50cnVuY2F0ZShhLm5ld1NpemUpO2Vsc2UgaWYoZT09PSJ3cml0ZSIpe2NvbnN0e2RhdGE6bCxvcHRzOm99PW4uZGF0YS5hcmdzO3Q9YXdhaXQgci53cml0ZShsLG8pfWVsc2UgaWYoZT09PSJyZWFkIil7Y29uc3R7b2Zmc2V0Omwsc2l6ZTpvfT1uLmRhdGEuYXJncyxnPW5ldyBVaW50OEFycmF5KG8pLGQ9YXdhaXQgci5yZWFkKGcse2F0Omx9KSxjPWcuYnVmZmVyO3Q9ZD09PW8/YzooKGk9Yy50cmFuc2Zlcik9PW51bGw/dm9pZCAwOmkuY2FsbChjLGQpKT8/Yy5zbGljZSgwLGQpLHMucHVzaCh0KX1lbHNlIGU9PT0iZ2V0U2l6ZSI/dD1hd2FpdCByLmdldFNpemUoKTplPT09ImZsdXNoIiYmYXdhaXQgci5mbHVzaCgpO3NlbGYucG9zdE1lc3NhZ2Uoe2V2dFR5cGU6ImNhbGxiYWNrIixjYklkOm4uZGF0YS5jYklkLHJldHVyblZhbDp0fSxzKX1jYXRjaCh0KXtjb25zdCBzPXQ7c2VsZi5wb3N0TWVzc2FnZSh7ZXZ0VHlwZToidGhyb3dFcnJvciIsY2JJZDpuLmRhdGEuY2JJZCxlcnJNc2c6cy5uYW1lKyI6ICIrcy5tZXNzYWdlK2AKYCtKU09OLnN0cmluZ2lmeShuLmRhdGEpfSl9fX0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPW9wZnMtd29ya2VyLUY0UldscWNfLmpzLm1hcAo=",w=typeof self<"u"&&self.Blob&&new Blob([(b=m,Uint8Array.from(atob(b),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var b;function v(e){let t;try{if(t=w&&(self.URL||self.webkitURL).createObjectURL(w),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;base64,"+m,{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}async function E(e,t,n){const r=function(){if(S.length<3){const t=e();return S.push(t),t}{const e=S[k];return k=(k+1)%S.length,e}function e(){const e=new v;let t=0,n={};return e.onmessage=({data:e})=>{var t,r;"callback"===e.evtType?null==(t=n[e.cbId])||t.resolve(e.returnVal):"throwError"===e.evtType&&(null==(r=n[e.cbId])||r.reject(Error(e.errMsg))),delete n[e.cbId]},async function(r,i,o=[]){t+=1;const a=new Promise((e,r)=>{n[t]={resolve:e,reject:r}});return e.postMessage({cbId:t,evtType:r,args:i},o),a}}}();return await r("register",{fileId:e,filePath:t,mode:n}),{read:async(t,n)=>await r("read",{fileId:e,offset:t,size:n}),write:async(t,n)=>await r("write",{fileId:e,data:t,opts:n},[ArrayBuffer.isView(t)?t.buffer:t]),close:async()=>await r("close",{fileId:e}),truncate:async t=>await r("truncate",{fileId:e,newSize:t}),getSize:async()=>await r("getSize",{fileId:e}),flush:async()=>await r("flush",{fileId:e})}}const S=[];let k=0;function R(e){if("/"===e)return{parent:null,name:""};const t=e.split("/").filter(e=>e.length>0);if(0===t.length)throw Error("Invalid path");return{name:t[t.length-1],parent:"/"+t.slice(0,-1).join("/")}}async function T(e,t){const{parent:n,name:r}=R(e);if(null==n)return await navigator.storage.getDirectory();const i=n.split("/").filter(e=>e.length>0);try{let e=await navigator.storage.getDirectory();for(const n of i)e=await e.getDirectoryHandle(n,{create:t.create});return t.isFile?await e.getFileHandle(r,{create:t.create}):await e.getDirectoryHandle(r,{create:t.create})}catch(e){if("NotFoundError"===e.name)return null;throw e}}async function A(e){const{parent:t,name:n}=R(e);if(null==t){const e=await navigator.storage.getDirectory();for await(const t of e.keys())await e.removeEntry(t,{recursive:!0});return}const r=await T(t,{create:!1,isFile:!1});if(null!=r)try{await r.removeEntry(n,{recursive:!0})}catch(e){if("NotFoundError"===e.name)return;throw e}}function O(e,t){return`${e}/${t}`.replace("//","/")}function x(e){return new L(e)}t=new WeakMap,n=new WeakMap,r=new WeakMap;let L=class e{constructor(e){y(this,t),y(this,n),y(this,r),_(this,t,e);const{parent:i,name:o}=R(e);_(this,n,o),_(this,r,i)}get kind(){return"dir"}get name(){return g(this,n)}get path(){return g(this,t)}get parent(){return null==g(this,r)?null:x(g(this,r))}async create(){return await T(g(this,t),{create:!0,isFile:!1}),x(g(this,t))}async exists(){return await T(g(this,t),{create:!1,isFile:!1})instanceof FileSystemDirectoryHandle}async remove(e={}){for(const t of await this.children())try{await t.remove(e)}catch(e){console.warn(e)}try{await A(g(this,t))}catch(e){console.warn(e)}}async children(){const e=await T(g(this,t),{create:!1,isFile:!1});if(null==e)return[];const n=[];for await(const r of e.values())n.push(("file"===r.kind?C:x)(O(g(this,t),r.name)));return n}async copyTo(t){if(!await this.exists())throw Error(`dir ${this.path} not exists`);if(t instanceof e){const e=await t.exists()?x(O(t.path,this.name)):t;return await e.create(),await Promise.all((await this.children()).map(t=>t.copyTo(e))),e}if(t instanceof FileSystemDirectoryHandle)return await Promise.all((await this.children()).map(async e=>{"file"===e.kind?await e.copyTo(await t.getFileHandle(e.name,{create:!0})):await e.copyTo(await t.getDirectoryHandle(e.name,{create:!0}))})),null;throw Error("Illegal target type")}async moveTo(e){const t=await this.copyTo(e);return await this.remove(),t}};const j=new Map;function C(e,t="rw"){if("rw"===t){const n=j.get(e)??new U(e,t);return j.set(e,n),n}return new U(e,t)}async function $(e,t,n={overwrite:!0}){if(t instanceof U)return void await $(e,await t.stream(),n);const r=await(e instanceof U?e:C(e,"rw")).createWriter();try{if(n.overwrite&&await r.truncate(0),t instanceof ReadableStream){const e=t.getReader();for(;;){const{done:t,value:n}=await e.read();if(t)break;await r.write(n)}}else await r.write(t)}catch(e){throw e}finally{await r.close()}}let I=0;i=new WeakMap,o=new WeakMap,a=new WeakMap,s=new WeakMap,u=new WeakMap,f=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap;let U=class e{constructor(e,t){y(this,i),y(this,o),y(this,a),y(this,s),y(this,u),y(this,f,0),y(this,l,async()=>{}),y(this,c,(()=>{let e=null;return()=>(_(this,f,g(this,f)+1),null!=e||(e=new Promise(async(t,n)=>{try{const n=await E(g(this,u),g(this,i),g(this,s));_(this,l,async()=>{null!=e&&(e=null,_(this,f,0),await n.close().catch(console.error))}),t([n,async()=>{_(this,f,g(this,f)-1),!(g(this,f)>0)&&(e=null,await n.close())}])}catch(e){n(e)}})),e)})()),y(this,d,!1),_(this,u,++I),_(this,i,e),_(this,s,{r:"read-only",rw:"readwrite","rw-unsafe":"readwrite-unsafe"}[t]);const{parent:n,name:r}=R(e);if(null==n)throw Error("Invalid path");_(this,a,r),_(this,o,n)}get kind(){return"file"}get path(){return g(this,i)}get name(){return g(this,a)}get parent(){return null==g(this,o)?null:x(g(this,o))}async createWriter(){if("read-only"===g(this,s))throw Error("file is read-only");if(g(this,d))throw Error("Other writer have not been closed");_(this,d,!0);try{const e=new TextEncoder,[t,n]=await g(this,c).call(this);let r=await t.getSize(),i=!1;return{write:async(n,o={})=>{if(i)throw Error("Writer is closed");const a="string"==typeof n?e.encode(n):n,s=o.at??r,u=a.byteLength;return r=s+u,await t.write(a,{at:s})},truncate:async e=>{if(i)throw Error("Writer is closed");await t.truncate(e),r>e&&(r=e)},flush:async()=>{if(i)throw Error("Writer is closed");await t.flush()},close:async()=>{if(i)throw Error("Writer is closed");i=!0,_(this,d,!1),await n()}}}catch(e){throw _(this,d,!1),e}}async createReader(){const[e,t]=await g(this,c).call(this);let n=!1,r=0;return{read:async(t,i={})=>{if(n)throw Error("Reader is closed");const o=i.at??r,a=await e.read(o,t);return r=o+a.byteLength,a},getSize:async()=>{if(n)throw Error("Reader is closed");return await e.getSize()},close:async()=>{n||(n=!0,await t())}}}async text(){return(new TextDecoder).decode(await this.arrayBuffer())}async arrayBuffer(){const e=await T(g(this,i),{create:!1,isFile:!0});return null==e?new ArrayBuffer(0):(await e.getFile()).arrayBuffer()}async stream(){const e=await this.getOriginFile();return null==e?new ReadableStream({pull:e=>{e.close()}}):e.stream()}async getOriginFile(){var e;return null==(e=await T(g(this,i),{create:!1,isFile:!0}))?void 0:e.getFile()}async getSize(){const e=await T(g(this,i),{create:!1,isFile:!0});return null==e?0:(await e.getFile()).size}async exists(){return await T(g(this,i),{create:!1,isFile:!0})instanceof FileSystemFileHandle}async remove(e={}){if(!0===e.force)return await g(this,l).call(this),await A(g(this,i)),void j.delete(g(this,i));if(g(this,f)>0)throw Error("exists unclosed reader/writer");await A(g(this,i))}async copyTo(t){if(t instanceof e)return t.path===this.path?this:(await $(t,this),t);if(t instanceof L){if(!await this.exists())throw Error(`file ${this.path} not exists`);return await this.copyTo(C(O(t.path,this.name)))}if(t instanceof FileSystemFileHandle)return await(await this.stream()).pipeTo(await t.createWritable()),null;throw Error("Illegal target type")}async moveTo(e){const t=await this.copyTo(e);return await this.remove(),t}};const M="/.opfs-tools-temp-dir";async function B(e){try{if("file"===e.kind){if(!await e.exists())return!0;const t=await e.createWriter();await t.truncate(0),await t.close(),await e.remove()}else await e.remove();return!0}catch(e){return console.warn(e),!1}}const N=[];let F=!1;(async function(){var e;!0!==globalThis.__opfs_tools_tmpfile_init__&&(globalThis.__opfs_tools_tmpfile_init__=!0,null!=globalThis.FileSystemDirectoryHandle&&null!=globalThis.FileSystemFileHandle&&null!=(null==(e=globalThis.navigator)?void 0:e.storage.getDirectory)&&(setInterval(async()=>{for(const e of await x(M).children()){const t=/^\d+-(\d+)$/.exec(e.name);(null==t||Date.now()-Number(t[1])>2592e5)&&await B(e)}},6e4),await async function(){if(null==globalThis.localStorage)return;const e="OPFS_TOOLS_EXPIRES_TMP_FILES";F||(F=!0,globalThis.addEventListener("unload",()=>{0!==N.length&&localStorage.setItem(e,`${localStorage.getItem(e)??""},${N.join(",")}`)}));let t=localStorage.getItem(e)??"";for(const e of t.split(","))0!==e.length&&await B(C(`${M}/${e}`))&&(t=t.replace(e,""));localStorage.setItem(e,t.replace(/,{2,}/g,","))}()))})(),e.dir=x,e.file=C,e.rollfile=function(e,t){let n=C(e),r=0,i=n.createWriter(),o=n.createReader();return{append:async e=>{const n=await i;r+=await n.write(e),r>=t&&await(async e=>{const t=await(await o).read(r,{at:Math.round(.3*r)});r=await e.write(t,{at:0}),await e.truncate(r)})(n)},text:n.text.bind(n),remove:async()=>{await(await o).close(),await(await i).close(),await n.remove()},getSize:async()=>r}},e.tmpfile=function(){const e=`${Math.random().toString().slice(2)}-${Date.now()}`;return N.push(e),C(`${M}/${e}`)},e.write=$,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}(t)},516(e,t,n){"use strict";n.r(t),n.d(t,{ABORT_ERROR:()=>T,CURRENT_DIR:()=>Xe,NOT_FOUND_ERROR:()=>He,ROOT_DIR:()=>Ve,TIMEOUT_ERROR:()=>A,TMP_DIR:()=>Je,appendFile:()=>Rt,appendFileSync:()=>wn,assertAbsolutePath:()=>Ke,assertFileUrl:()=>Qe,connectSyncAgent:()=>an,copy:()=>Tt,copySync:()=>bn,createFile:()=>gt,createFileSync:()=>ln,deleteTemp:()=>It,deleteTempSync:()=>Sn,downloadFile:()=>Et,emptyDir:()=>At,emptyDirSync:()=>vn,exists:()=>Ot,existsSync:()=>En,generateTempPath:()=>ut,getFileDataByHandle:()=>pt,getSyncMessenger:()=>sn,isDirectoryHandle:()=>dt,isFileHandle:()=>ct,isFileHandleLike:()=>ht,isOPFSSupported:()=>Yt,isTempPath:()=>ft,mkTemp:()=>$t,mkTempSync:()=>kn,mkdir:()=>yt,mkdirSync:()=>cn,move:()=>xt,moveSync:()=>dn,pruneTemp:()=>Ut,pruneTempSync:()=>Rn,readBlobFile:()=>Lt,readBlobFileSync:()=>Tn,readDir:()=>_t,readDirSync:()=>hn,readFile:()=>mt,readFileSync:()=>pn,readJsonFile:()=>jt,readJsonFileSync:()=>An,readTextFile:()=>Ct,readTextFileSync:()=>On,remove:()=>wt,removeSync:()=>gn,setSyncMessenger:()=>un,startSyncAgent:()=>on,stat:()=>bt,statSync:()=>yn,toFileSystemHandleLike:()=>lt,unzip:()=>Bt,unzipFromUrl:()=>Nt,unzipSync:()=>xn,uploadFile:()=>Ft,writeFile:()=>vt,writeFileSync:()=>mn,zip:()=>Dt,zipFromUrl:()=>Wt,zipSync:()=>Ln});function r(e,t){if(!e)throw new Error("Invariant failed")}function i(e){if("string"!=typeof e)throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function o(e,t){if(e.length<=1)return e;let n=e.length;for(let r=e.length-1;r>0&&t(e.charCodeAt(r));r--)n=r;return e.slice(0,n)}function a(e){return 47===e}function s(e){return e=function(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function u(e){e instanceof URL&&(e=s(e)),function(e){i(e),e.length}(e);let t=-1,n=!1;for(let r=e.length-1;r>=1;--r)if(a(e.charCodeAt(r))){if(n){t=r;break}}else n=!0;return-1===t?a(e.charCodeAt(0))?"/":".":o(e.slice(0,t),a)}function f(e,t=""){e instanceof URL&&(e=s(e)),function(e,t){if(i(e),0===e.length)return e;if("string"!=typeof t)throw new TypeError(`Suffix must be a string, received "${JSON.stringify(t)}"`)}(e,t);const n=function(e,t,n=0){let r=!1,i=e.length;for(let o=e.length-1;o>=n;--o)if(t(e.charCodeAt(o))){if(r){n=o+1;break}}else r||(r=!0,i=o+1);return e.slice(n,i)}(e,a),r=o(n,a);return t?function(e,t){if(t.length>=e.length)return e;const n=e.length-t.length;for(let r=t.length-1;r>=0;--r)if(e.charCodeAt(n+r)!==t.charCodeAt(r))return e;return e.slice(0,-t.length)}(r,t):r}function l(e,...t){if(void 0===e)return".";e instanceof URL&&(e=s(e)),(t=e?[e,...t]:t).forEach(e=>i(e));const n=t.filter(e=>e.length>0).join("/");return""===n?".":function(e){e instanceof URL&&(e=s(e)),function(e){i(e),e.length}(e);const t=a(e.charCodeAt(0)),n=a(e.charCodeAt(e.length-1));return e=function(e,t,n,r){let i,o="",a=0,s=-1,u=0;for(let f=0;f<=e.length;++f){if(f<e.length)i=e.charCodeAt(f);else{if(r(i))break;i=47}if(r(i)){if(s===f-1||1===u);else if(s!==f-1&&2===u){if(o.length<2||2!==a||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2)){if(o.length>2){const e=o.lastIndexOf(n);-1===e?(o="",a=0):(o=o.slice(0,e),a=o.length-1-o.lastIndexOf(n)),s=f,u=0;continue}if(2===o.length||1===o.length){o="",a=0,s=f,u=0;continue}}t&&(o.length>0?o+=`${n}..`:o="..",a=2)}else o.length>0?o+=n+e.slice(s+1,f):o=e.slice(s+1,f),a=f-s-1;s=f,u=0}else 46===i&&-1!==u?++u:u=-1}return o}(e,!t,"/",a),0!==e.length||t||(e="."),e.length>0&&n&&(e+="/"),t?`/${e}`:e}(n)}function c(e){e instanceof URL&&(e=s(e)),i(e);let t=-1,n=0,r=-1,o=!0,u=0;for(let i=e.length-1;i>=0;--i){const s=e.charCodeAt(i);if(a(s)){if(!o){n=i+1;break}}else-1===r&&(o=!1,r=i+1),46===s?-1===t?t=i:1!==u&&(u=1):-1!==t&&(u=-1)}return-1===t||-1===r||0===u||1===u&&t===r-1&&t===n+1?"":e.slice(t,r)}const d=Symbol("Option kind"),h=Symbol("Result kind"),p=Promise.resolve(!0),g=Promise.resolve(!1);function y(e){const t=Object.freeze({[Symbol.toStringTag]:"Option",[d]:"Some",*[Symbol.iterator](){yield e},toString:()=>`Some(${e})`,isSome:()=>!0,isNone:()=>!1,isSomeAnd:t=>t(e),isSomeAndAsync:t=>Promise.resolve(t(e)),isNoneOr:t=>t(e),isNoneOrAsync:t=>Promise.resolve(t(e)),expect:t=>e,unwrap:()=>e,unwrapOr:t=>e,unwrapOrElse:t=>e,unwrapOrElseAsync:t=>Promise.resolve(e),okOr:t=>w(e),okOrElse:t=>w(e),transpose:()=>(S(e),e.isOk()?w(y(e.unwrap())):b(e.unwrapErr())),filter:n=>n(e)?t:_,flatten:()=>(E(e),e),map:t=>y(t(e)),mapOr:(t,n)=>n(e),mapOrElse:(t,n)=>n(e),zip:t=>(E(t),t.isSome()?y([e,t.unwrap()]):_),zipWith:(t,n)=>(E(t),t.isSome()?y(n(e,t.unwrap())):_),unzip(){const t=e;if(!Array.isArray(t)||2!==t.length)throw new TypeError("Option::unzip() requires a 2-element tuple, received "+(Array.isArray(t)?`array with ${t.length} elements`:typeof t));const[n,r]=t;return[y(n),y(r)]},reduce:(n,r)=>(E(n),n.isSome()?y(r(e,n.unwrap())):t),and:e=>(E(e),e),andThen:t=>t(e),andThenAsync:t=>Promise.resolve(t(e)),or:e=>t,orElse:e=>t,orElseAsync:e=>Promise.resolve(t),xor:e=>(E(e),e.isSome()?_:t),inspect:n=>(n(e),t),eq:t=>(E(t),t.isSome()&&t.unwrap()===e)});return t}const _=Object.freeze({[Symbol.toStringTag]:"Option",[d]:"None",*[Symbol.iterator](){},toString:()=>"None",isSome:()=>!1,isNone:()=>!0,isSomeAnd:e=>!1,isSomeAndAsync:e=>g,isNoneOr:e=>!0,isNoneOrAsync:e=>p,expect(e){throw new TypeError(e)},unwrap(){throw new TypeError("Option::unwrap() called on a `None` value")},unwrapOr:e=>e,unwrapOrElse:e=>e(),unwrapOrElseAsync:e=>Promise.resolve(e()),okOr:e=>b(e),okOrElse:e=>b(e()),transpose:()=>w(_),filter:e=>_,flatten:()=>_,map:e=>_,mapOr:(e,t)=>e,mapOrElse:(e,t)=>e(),zip:e=>_,zipWith:(e,t)=>_,unzip:()=>[_,_],reduce:(e,t)=>(E(e),e),and:e=>_,andThen:e=>_,andThenAsync:e=>m,or:e=>(E(e),e),orElse:e=>e(),orElseAsync:e=>Promise.resolve(e()),xor:e=>(E(e),e.isSome()?e:_),inspect:e=>_,eq:e=>(E(e),e===_)}),m=Promise.resolve(_);function w(e){const t=Object.freeze({[Symbol.toStringTag]:"Result",[h]:"Ok",*[Symbol.iterator](){yield e},toString:()=>`Ok(${e})`,isOk:()=>!0,isErr:()=>!1,isOkAnd:t=>t(e),isOkAndAsync:t=>Promise.resolve(t(e)),isErrAnd:e=>!1,isErrAndAsync:e=>g,expect:t=>e,unwrap:()=>e,unwrapOr:t=>e,unwrapOrElse:t=>e,unwrapOrElseAsync:t=>Promise.resolve(e),expectErr(t){throw new TypeError(`${t}: ${e}`)},unwrapErr(){throw new TypeError("Result::unwrapErr() called on an `Ok` value")},intoOk:()=>e,intoErr(){throw new TypeError("Result::intoErr() called on an `Ok` value")},ok:()=>y(e),err:()=>_,transpose:()=>(E(e),e.isSome()?y(w(e.unwrap())):_),map:t=>w(t(e)),mapErr:e=>t,mapOr:(t,n)=>n(e),mapOrElse:(t,n)=>n(e),flatten:()=>(S(e),e),and:e=>(S(e),e),or:e=>t,andThen:t=>t(e),andThenAsync:t=>Promise.resolve(t(e)),orElse:e=>t,orElseAsync:e=>Promise.resolve(t),inspect:n=>(n(e),t),inspectErr:e=>t,eq:t=>(S(t),t.isOk()&&t.unwrap()===e),asOk:()=>t,asErr(){throw new TypeError("Result::asErr() called on an `Ok` value")},andTryAsync(t){try{const n=t(e);return Promise.resolve(n).then(w,b)}catch(e){return Promise.resolve(b(e))}},orTryAsync:e=>Promise.resolve(t)});return t}function b(e){const t=Object.freeze({[Symbol.toStringTag]:"Result",[h]:"Err",*[Symbol.iterator](){},toString:()=>`Err(${e})`,isOk:()=>!1,isErr:()=>!0,isOkAnd:e=>!1,isOkAndAsync:e=>g,isErrAnd:t=>t(e),isErrAndAsync:t=>Promise.resolve(t(e)),expect(t){throw new TypeError(`${t}: ${e}`)},unwrap(){throw new TypeError("Result::unwrap() called on an `Err` value")},unwrapOr:e=>e,unwrapOrElse:t=>t(e),unwrapOrElseAsync:t=>Promise.resolve(t(e)),expectErr:t=>e,unwrapErr:()=>e,intoOk(){throw new TypeError("Result::intoOk() called on an `Err` value")},intoErr:()=>e,ok:()=>_,err:()=>y(e),transpose:()=>y(t),map:e=>t,mapErr:t=>b(t(e)),mapOr:(e,t)=>e,mapOrElse:(t,n)=>t(e),flatten:()=>t,and:e=>t,or:e=>(S(e),e),andThen:e=>t,andThenAsync:e=>Promise.resolve(t),orElse:t=>t(e),orElseAsync:t=>Promise.resolve(t(e)),inspect:e=>t,inspectErr:n=>(n(e),t),eq:t=>(S(t),t.isErr()&&t.unwrapErr()===e),asOk(){throw new TypeError("Result::asOk() called on an `Err` value")},asErr:()=>t,andTryAsync:e=>Promise.resolve(t),orTryAsync(t){try{const n=t(e);return Promise.resolve(n).then(w,b)}catch(e){return Promise.resolve(b(e))}}});return t}function v(e){try{return null===e?"null":void 0===e?"undefined":"object"==typeof e?Object.prototype.toString.call(e):String(e)}catch{return"[unable to stringify]"}}function E(e){if(!function(e){return null!=e&&"object"==typeof e&&d in e}(e))throw new TypeError(`Expected an Option, but received: ${v(e)}`)}function S(e){if(!function(e){return null!=e&&"object"==typeof e&&h in e}(e))throw new TypeError(`Expected a Result, but received: ${v(e)}`)}const k=w(!1),R=w(),T="AbortError",A="TimeoutError";var O=class extends Error{name="FetchError";status;constructor(e,t){super(e),this.status=t}};function x(e,t){const n=function(e){if(e instanceof URL)return e;try{return new URL(e,"undefined"!=typeof location?location.href:void 0)}catch{throw new TypeError(`Invalid URL: ${e}`)}}(e),r=t??{},{retries:i,delay:o,when:a,onRetry:s}=function(e){const{responseType:t,timeout:n,retry:r=0,onProgress:i,onChunk:o}=e;if(null!=t){const e=["text","arraybuffer","blob","json","bytes","stream"];if(!e.includes(t))throw new TypeError(`responseType must be one of ${e.join(", ")} but received ${t}`)}if(null!=n){if("number"!=typeof n)throw new TypeError("timeout must be a number but received "+typeof n);if(n<=0)throw new Error(`timeout must be a number greater than 0 but received ${n}`)}if(null!=i&&"function"!=typeof i)throw new TypeError("onProgress callback must be a function but received "+typeof i);if(null!=o&&"function"!=typeof o)throw new TypeError("onChunk callback must be a function but received "+typeof o);let a,s,u=0,f=0;if("number"==typeof r?u=r:r&&"object"==typeof r&&(u=r.retries??0,f=r.delay??0,a=r.when,s=r.onRetry),!Number.isInteger(u))throw new TypeError(`Retry count must be an integer but received ${u}`);if(u<0)throw new Error(`Retry count must be non-negative but received ${u}`);if("number"==typeof f){if(f<0)throw new Error(`Retry delay must be a non-negative number but received ${f}`)}else if("function"!=typeof f)throw new TypeError("Retry delay must be a number or a function but received "+typeof f);if(null!=a&&!Array.isArray(a)&&"function"!=typeof a)throw new TypeError("Retry when condition must be an array of status codes or a function but received "+typeof a);if(null!=s&&"function"!=typeof s)throw new TypeError("Retry onRetry callback must be a function but received "+typeof s);return{retries:u,delay:f,when:a,onRetry:s}}(r),{abortable:u=!1,responseType:f,timeout:l,onProgress:c,onChunk:d,...h}=r,p=h.signal;let g;u&&(g=new AbortController);const y=(e,t)=>"AbortError"!==e.name&&(a?Array.isArray(a)?e instanceof O&&a.includes(e.status):a(e,t):!(e instanceof O)),_=e=>"function"==typeof o?o(e):o,m=()=>{const e=[];p&&e.push(p),g&&e.push(g.signal),"number"==typeof l&&e.push(function(e){if("function"==typeof AbortSignal.timeout)return AbortSignal.timeout(e);const t=new AbortController,n=function(){const e="The operation timed out.";try{return new DOMException(e,A)}catch{const t=new Error(e);return t.name=A,t}}(),r=setTimeout(()=>{t.abort(n)},e);return"function"==typeof r?.unref&&r.unref(),t.signal}(l)),e.length>0&&(h.signal=1===e.length?e[0]:function(e){if("function"==typeof AbortSignal.any)return AbortSignal.any(e);const t=new AbortController;for(const n of e)if(n.aborted)return t.abort(n.reason),t.signal;const n=e=>{t.abort(e.target.reason)};for(const t of e)t.addEventListener("abort",n);return t.signal.addEventListener("abort",()=>{for(const t of e)t.removeEventListener("abort",n)}),t.signal}(e))},v=async()=>{m();try{const e=await fetch(n,h);return e.ok?await E(e):(e.body?.cancel().catch(()=>{}),b(new O(e.statusText,e.status)))}catch(e){return b(e instanceof Error?e:j(e))}},E=async e=>{switch(e.body&&(c||d)&&(async e=>{let t,n=0;if(c){const n=e.headers.get("content-length");if(null==n)try{c(b(new Error("No content-length in response headers")))}catch{}else t=Number.parseInt(n,10)}const r=e.clone().body;try{for await(const e of r){if(d)try{d(e)}catch{}if(c&&null!=t){n+=e.byteLength;try{c(w({totalByteLength:t,completedByteLength:n}))}catch{}}}}catch{}})(e),f){case"json":if(null==e.body)return w(null);try{return w(await e.json())}catch{return b(new Error("Response is invalid json while responseType is json"))}case"text":return w(await e.text());case"bytes":return"function"==typeof e.bytes?w(await e.bytes()):w(new Uint8Array(await e.arrayBuffer()));case"arraybuffer":return w(await e.arrayBuffer());case"blob":return w(await e.blob());case"stream":return w(e.body);default:return w(e)}},S=(async()=>{let e,t=0;do{if(t>0){if(g?.signal.aborted)return b(g.signal.reason);const n=_(t);if(n>0&&(await L(n),g?.signal.aborted))return b(g.signal.reason);try{s?.(e,t)}catch{}}const n=await v();if(n.isOk())return n;e=n.unwrapErr(),t++}while(t<=i&&y(e,t));return b(e)})();return u&&g?{abort(e){e instanceof Error?g.abort(e):null!=e?g.abort(j(e)):g.abort()},get aborted(){return g.signal.aborted},get result(){return S}}:S}function L(e){return new Promise(t=>setTimeout(t,e))}function j(e){const t=new Error("string"==typeof e?e:String(e));return t.name=T,t.cause=e,t}var C={},$=Uint8Array,I=Uint16Array,U=Int32Array,M=new $([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),B=new $([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),N=new $([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),F=function(e,t){for(var n=new I(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new U(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},P=F(M,2),D=P.b,W=P.r;D[28]=258,W[258]=28;for(var Y=F(B,0),Z=Y.b,G=Y.r,z=new I(32768),q=0;q<32768;++q){var H=(43690&q)>>1|(21845&q)<<1;H=(61680&(H=(52428&H)>>2|(13107&H)<<2))>>4|(3855&H)<<4,z[q]=((65280&H)>>8|(255&H)<<8)>>1}var V=function(e,t,n){for(var r=e.length,i=0,o=new I(t);i<r;++i)e[i]&&++o[e[i]-1];var a,s=new I(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new I(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var f=i<<4|e[i],l=t-e[i],c=s[e[i]-1]++<<l,d=c|(1<<l)-1;c<=d;++c)a[z[c]>>u]=f}else for(a=new I(r),i=0;i<r;++i)e[i]&&(a[i]=z[s[e[i]-1]++]>>15-e[i]);return a},X=new $(288);for(q=0;q<144;++q)X[q]=8;for(q=144;q<256;++q)X[q]=9;for(q=256;q<280;++q)X[q]=7;for(q=280;q<288;++q)X[q]=8;var J=new $(32);for(q=0;q<32;++q)J[q]=5;var K=V(X,9,0),Q=V(X,9,1),ee=V(J,5,0),te=V(J,5,1),ne=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},re=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},ie=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},oe=function(e){return(e+7)/8|0},ae=function(e,t,n){return(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length),new $(e.subarray(t,n))},se=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ue=function(e,t,n){var r=new Error(t||se[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,ue),!n)throw r;return r},fe=function(e,t,n,r){var i=e.length,o=r?r.length:0;if(!i||t.f&&!t.l)return n||new $(0);var a=!n,s=a||2!=t.i,u=t.i;a&&(n=new $(3*i));var f=function(e){var t=n.length;if(e>t){var r=new $(Math.max(2*t,e));r.set(n),n=r}},l=t.f||0,c=t.p||0,d=t.b||0,h=t.l,p=t.d,g=t.m,y=t.n,_=8*i;do{if(!h){l=re(e,c,1);var m=re(e,c+1,3);if(c+=3,!m){var w=e[(L=oe(c)+4)-4]|e[L-3]<<8,b=L+w;if(b>i){u&&ue(0);break}s&&f(d+w),n.set(e.subarray(L,b),d),t.b=d+=w,t.p=c=8*b,t.f=l;continue}if(1==m)h=Q,p=te,g=9,y=5;else if(2==m){var v=re(e,c,31)+257,E=re(e,c+10,15)+4,S=v+re(e,c+5,31)+1;c+=14;for(var k=new $(S),R=new $(19),T=0;T<E;++T)R[N[T]]=re(e,c+3*T,7);c+=3*E;var A=ne(R),O=(1<<A)-1,x=V(R,A,1);for(T=0;T<S;){var L,j=x[re(e,c,O)];if(c+=15&j,(L=j>>4)<16)k[T++]=L;else{var C=0,I=0;for(16==L?(I=3+re(e,c,3),c+=2,C=k[T-1]):17==L?(I=3+re(e,c,7),c+=3):18==L&&(I=11+re(e,c,127),c+=7);I--;)k[T++]=C}}var U=k.subarray(0,v),F=k.subarray(v);g=ne(U),y=ne(F),h=V(U,g,1),p=V(F,y,1)}else ue(1);if(c>_){u&&ue(0);break}}s&&f(d+131072);for(var P=(1<<g)-1,W=(1<<y)-1,Y=c;;Y=c){var G=(C=h[ie(e,c)&P])>>4;if((c+=15&C)>_){u&&ue(0);break}if(C||ue(2),G<256)n[d++]=G;else{if(256==G){Y=c,h=null;break}var z=G-254;if(G>264){var q=M[T=G-257];z=re(e,c,(1<<q)-1)+D[T],c+=q}var H=p[ie(e,c)&W],X=H>>4;if(H||ue(3),c+=15&H,F=Z[X],X>3&&(q=B[X],F+=ie(e,c)&(1<<q)-1,c+=q),c>_){u&&ue(0);break}s&&f(d+131072);var J=d+z;if(d<F){var K=o-F,ee=Math.min(F,J);for(K+d<0&&ue(3);d<ee;++d)n[d]=r[K+d]}for(;d<J;++d)n[d]=n[d-F]}}t.l=h,t.p=Y,t.b=d,t.f=l,h&&(l=1,t.m=g,t.d=p,t.n=y)}while(!l);return d!=n.length&&a?ae(n,0,d):n.subarray(0,d)},le=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},ce=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},de=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:we,l:0};if(1==i){var a=new $(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],u=n[1],f=0,l=1,c=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=i-1;)s=n[n[f].f<n[c].f?f++:c++],u=n[f!=l&&n[f].f<n[c].f?f++:c++],n[l++]={s:-1,f:s.f+u.f,l:s,r:u};var d=o[0].s;for(r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var h=new I(d+1),p=he(n[l-1],h,0);if(p>t){r=0;var g=0,y=p-t,_=1<<y;for(o.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});r<i;++r){var m=o[r].s;if(!(h[m]>t))break;g+=_-(1<<p-h[m]),h[m]=t}for(g>>=y;g>0;){var w=o[r].s;h[w]<t?g-=1<<t-h[w]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;h[b]==t&&(--h[b],++g)}p=t}return{t:new $(h),l:p}},he=function(e,t,n){return-1==e.s?Math.max(he(e.l,t,n+1),he(e.r,t,n+1)):t[e.s]=n},pe=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new I(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return{c:n.subarray(0,r),n:t}},ge=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},ye=function(e,t,n){var r=n.length,i=oe(t+2);e[i]=255&r,e[i+1]=r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},_e=function(e,t,n,r,i,o,a,s,u,f,l){le(t,l++,n),++i[256];for(var c=de(i,15),d=c.t,h=c.l,p=de(o,15),g=p.t,y=p.l,_=pe(d),m=_.c,w=_.n,b=pe(g),v=b.c,E=b.n,S=new I(19),k=0;k<m.length;++k)++S[31&m[k]];for(k=0;k<v.length;++k)++S[31&v[k]];for(var R=de(S,7),T=R.t,A=R.l,O=19;O>4&&!T[N[O-1]];--O);var x,L,j,C,$=f+5<<3,U=ge(i,X)+ge(o,J)+a,F=ge(i,d)+ge(o,g)+a+14+3*O+ge(S,T)+2*S[16]+3*S[17]+7*S[18];if(u>=0&&$<=U&&$<=F)return ye(t,l,e.subarray(u,u+f));if(le(t,l,1+(F<U)),l+=2,F<U){x=V(d,h,0),L=d,j=V(g,y,0),C=g;var P=V(T,A,0);for(le(t,l,w-257),le(t,l+5,E-1),le(t,l+10,O-4),l+=14,k=0;k<O;++k)le(t,l+3*k,T[N[k]]);l+=3*O;for(var D=[m,v],W=0;W<2;++W){var Y=D[W];for(k=0;k<Y.length;++k){var Z=31&Y[k];le(t,l,P[Z]),l+=T[Z],Z>15&&(le(t,l,Y[k]>>5&127),l+=Y[k]>>12)}}}else x=K,L=X,j=ee,C=J;for(k=0;k<s;++k){var G=r[k];if(G>255){ce(t,l,x[257+(Z=G>>18&31)]),l+=L[Z+257],Z>7&&(le(t,l,G>>23&31),l+=M[Z]);var z=31&G;ce(t,l,j[z]),l+=C[z],z>3&&(ce(t,l,G>>5&8191),l+=B[z])}else ce(t,l,x[G]),l+=L[G]}return ce(t,l,x[256]),l+L[256]},me=new U([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),we=new $(0),be=function(e,t,n,r,i,o){var a=o.z||e.length,s=new $(r+a+5*(1+Math.ceil(a/7e3))+i),u=s.subarray(r,s.length-i),f=o.l,l=7&(o.r||0);if(t){l&&(u[0]=o.r>>3);for(var c=me[t-1],d=c>>13,h=8191&c,p=(1<<n)-1,g=o.p||new I(32768),y=o.h||new I(p+1),_=Math.ceil(n/3),m=2*_,w=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<m)&p},b=new U(25e3),v=new I(288),E=new I(32),S=0,k=0,R=o.i||0,T=0,A=o.w||0,O=0;R+2<a;++R){var x=w(R),L=32767&R,j=y[x];if(g[L]=j,y[x]=L,A<=R){var C=a-R;if((S>7e3||T>24576)&&(C>423||!f)){l=_e(e,u,0,b,v,E,k,T,O,R-O,l),T=S=k=0,O=R;for(var N=0;N<286;++N)v[N]=0;for(N=0;N<30;++N)E[N]=0}var F=2,P=0,D=h,Y=L-j&32767;if(C>2&&x==w(R-Y))for(var Z=Math.min(d,C)-1,z=Math.min(32767,R),q=Math.min(258,C);Y<=z&&--D&&L!=j;){if(e[R+F]==e[R+F-Y]){for(var H=0;H<q&&e[R+H]==e[R+H-Y];++H);if(H>F){if(F=H,P=Y,H>Z)break;var V=Math.min(Y,H-2),X=0;for(N=0;N<V;++N){var J=R-Y+N&32767,K=J-g[J]&32767;K>X&&(X=K,j=J)}}}Y+=(L=j)-(j=g[L])&32767}if(P){b[T++]=268435456|W[F]<<18|G[P];var Q=31&W[F],ee=31&G[P];k+=M[Q]+B[ee],++v[257+Q],++E[ee],A=R+F,++S}else b[T++]=e[R],++v[e[R]]}}for(R=Math.max(R,A);R<a;++R)b[T++]=e[R],++v[e[R]];l=_e(e,u,f,b,v,E,k,T,O,R-O,l),f||(o.r=7&l|u[l/8|0]<<3,l-=7,o.h=y,o.p=g,o.i=R,o.w=A)}else{for(R=o.w||0;R<a+f;R+=65535){var te=R+65535;te>=a&&(u[l/8|0]=f,te=a),l=ye(u,l+1,e.subarray(R,te))}o.i=a}return ae(s,0,r+oe(l)+i)},ve=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&-306674912)^n>>>1;e[t]=n}return e}(),Ee=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),a=new $(o.length+e.length);a.set(o),a.set(e,o.length),e=a,i.w=o.length}return be(e,null==t.level?6:t.level,null==t.mem?i.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,n,r,i)},Se=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},ke=function(e,t,n){for(var r=e(),i=e.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<r.length;++a){var s=r[a],u=o[a];if("function"==typeof s){t+=";"+u+"=";var f=s.toString();if(s.prototype)if(-1!=f.indexOf("[native code]")){var l=f.indexOf(" ",8)+1;t+=f.slice(l,f.indexOf("(",l))}else for(var c in t+=f,s.prototype)t+=";"+u+".prototype."+c+"="+s.prototype[c].toString();else t+=f}else n[u]=s}return t},Re=[],Te=function(){return[$,I,U,M,B,N,D,Z,Q,te,z,se,V,ne,re,ie,oe,ae,ue,fe,Me,Oe,xe]},Ae=function(){return[$,I,U,M,B,N,W,G,K,X,ee,J,z,me,we,V,le,ce,de,he,pe,ge,ye,_e,oe,ae,be,Ee,Ue,Oe]},Oe=function(e){return postMessage(e,[e.buffer])},xe=function(e){return e&&{out:e.size&&new $(e.size),dictionary:e.dictionary}},Le=function(e,t,n,r,i,o){var a=function(e,t,n,r){if(!Re[n]){for(var i="",o={},a=e.length-1,s=0;s<a;++s)i=ke(e[s],i,o);Re[n]={c:ke(e[a],i,o),e:o}}var u=Se({},Re[n].e);return function(e,t,n,r,i){var o=new Worker(C[t]||(C[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(e){var t=e.data,n=t.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],i(r,null)}else i(null,t)},o.postMessage(n,r),o}(Re[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,u,function(e){var t=[];for(var n in e)e[n].buffer&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t}(u),r)}(n,r,i,function(e,t){a.terminate(),o(e,t)});return a.postMessage([e,t],t.consume?[e.buffer]:[]),function(){a.terminate()}},je=function(e,t){return e[t]|e[t+1]<<8},Ce=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},$e=function(e,t){return Ce(e,t)+4294967296*Ce(e,t+4)},Ie=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Ue(e,t){return Ee(e,t||{},0,0)}function Me(e,t){return fe(e,{i:2},t&&t.out,t&&t.dictionary)}var Be=function(e,t,n,r){for(var i in e){var o=e[i],a=t+i,s=r;Array.isArray(o)&&(s=Se(r,o[1]),o=o[0]),ArrayBuffer.isView(o)?n[a]=[o,s]:(n[a+="/"]=[new $(0),s],Be(o,a,n,r))}},Ne="undefined"!=typeof TextEncoder&&new TextEncoder,Fe="undefined"!=typeof TextDecoder&&new TextDecoder;try{Fe.decode(we,{stream:!0})}catch(e){}function Pe(e,t){if(t){for(var n=new $(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Ne)return Ne.encode(e);var i=e.length,o=new $(e.length+(e.length>>1)),a=0,s=function(e){o[a++]=e};for(r=0;r<i;++r){if(a+5>o.length){var u=new $(a+8+(i-r<<1));u.set(o),o=u}var f=e.charCodeAt(r);f<128||t?s(f):f<2048?(s(192|f>>6),s(128|63&f)):f>55295&&f<57344?(s(240|(f=65536+(1047552&f)|1023&e.charCodeAt(++r))>>18),s(128|f>>12&63),s(128|f>>6&63),s(128|63&f)):(s(224|f>>12),s(128|f>>6&63),s(128|63&f))}return ae(o,0,a)}function De(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(Fe)return Fe.decode(e);var i=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:ae(e,n-1)};i?3==i?(r=((15&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|r>>10,56320|1023&r)):t+=1&i?String.fromCharCode((31&r)<<6|63&e[n++]):String.fromCharCode((15&r)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(r)}}(e),o=i.s;return(n=i.r).length&&ue(8),o}var We=function(e,t,n,r,i,o,a){var s=4294967295==i,u=4294967295==o,f=4294967295==a,l=t+n;if(r&&s+u+f){for(;t+4<l;t+=4+je(e,t+2))if(1==je(e,t))return[s?$e(e,t+4+8*u):i,u?$e(e,t+4):o,f?$e(e,t+4+8*(u+s)):a,1];r<2&&ue(13)}return[i,o,a,0]},Ye=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&ue(9),t+=r+4}return t},Ze=function(e,t,n,r,i,o,a,s){var u=r.length,f=n.extra,l=s&&s.length,c=Ye(f);Ie(e,t,null!=a?33639248:67324752),t+=4,null!=a&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(o<0&&8),e[t++]=i&&8,e[t++]=255&n.compression,e[t++]=n.compression>>8;var d=new Date(null==n.mtime?Date.now():n.mtime),h=d.getFullYear()-1980;if((h<0||h>119)&&ue(10),Ie(e,t,h<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),t+=4,-1!=o&&(Ie(e,t,n.crc),Ie(e,t+4,o<0?-o-2:o),Ie(e,t+8,n.size)),Ie(e,t+12,u),Ie(e,t+14,c),t+=16,null!=a&&(Ie(e,t,l),Ie(e,t+6,n.attrs),Ie(e,t+10,a),t+=14),e.set(r,t),t+=u,c)for(var p in f){var g=f[p],y=g.length;Ie(e,t,+p),Ie(e,t+2,y),e.set(g,t+4),t+=4+y}return l&&(e.set(s,t),t+=l),t};function Ge(e,t,n){n||(n=t,t={}),"function"!=typeof n&&ue(7);var r={};Be(e,"",r,t);var i=Object.keys(r),o=i.length,a=0,s=0,u=o,f=new Array(o),l=[],c=function(){for(var e=0;e<l.length;++e)l[e]()},d=function(e,t){ze(function(){n(e,t)})};ze(function(){d=n});var h=function(){var e=new $(s+22),t=a,n=s-a;s=0;for(var r=0;r<u;++r){var i=f[r];try{var o=i.c.length;Ze(e,s,i,i.f,i.u,o);var l=30+i.f.length+Ye(i.extra),c=s+l;e.set(i.c,c),Ze(e,a,i,i.f,i.u,o,s,i.m),a+=16+l+(i.m?i.m.length:0),s=c+o}catch(e){return d(e,null)}}(function(e,t,n,r,i){Ie(e,t,101010256),Ie(e,t+8,n),Ie(e,t+10,n),Ie(e,t+12,r),Ie(e,t+16,i)})(e,a,f.length,n,t),d(null,e)};o||h();for(var p=function(e){var t=i[e],n=r[t],u=n[0],p=n[1],g=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=ve[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}}(),y=u.length;g.p(u);var _=Pe(t),m=_.length,w=p.comment,b=w&&Pe(w),v=b&&b.length,E=Ye(p.extra),S=0==p.level?0:8,k=function(n,r){if(n)c(),d(n,null);else{var i=r.length;f[e]=Se(p,{size:y,crc:g.d(),c:r,f:_,m:b,u:m!=t.length||b&&w.length!=v,compression:S}),a+=30+m+E+i,s+=76+2*(m+E)+(v||0)+i,--o||h()}};if(m>65535&&k(ue(11,0,1),null),S)if(y<16e4)try{k(null,Ue(u,p))}catch(e){k(e,null)}else l.push(function(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&ue(7),Le(e,t,[Ae],function(e){return Oe(Ue(e.data[0],e.data[1]))},0,n)}(u,p,k));else k(null,u)},g=0;g<u;++g)p(g);return c}var ze="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(e){e()};class qe{resolve;reject;promise;constructor(){if("function"==typeof Promise.withResolvers){const{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.promise=e,this.resolve=t,this.reject=n}else this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}const He="NotFoundError",Ve="/",Xe=".",Je="/tmp";function Ke(e){r("string"==typeof e),r(e[0]===Ve)}function Qe(e){r("string"==typeof e)}let et;function tt(e){return e===Ve}async function nt(e,t,n){try{return w(await e.getDirectoryHandle(t,n))}catch(n){const r=n,i=new Error(`${r.name}: ${r.message} When get child directory '${t}' from directory '${e.name||Ve}'.`);return i.name=r.name,b(i)}}async function rt(e,t){let n=await async function(){return et??=await navigator.storage.getDirectory(),et}();if(tt(e))return w(n);let r=e.slice(1);for(;r;){let e="";const i=r.indexOf("/");if(-1===i)e=r,r="";else if(e=r.slice(0,i),r=r.slice(i+1),0===i)continue;const o=await nt(n,e,t);if(o.isErr())return o;n=o.unwrap()}return w(n)}async function it(e,t){const n=t?.create??!1,r=u(e),i=f(e);return(await rt(r,{create:n})).andThenAsync(e=>async function(e,t,n){try{return w(await e.getFileHandle(t,n))}catch(n){const r=n,i=new Error(`${r.name}: ${r.message} When get child file '${t}' from directory '${e.name||Ve}'.`);return i.name=r.name,b(i)}}(e,i,{create:n}))}function ot(e){return e.name===He}async function at(e){const t=(await Promise.all(e)).find(e=>e.isErr());return t??R}function st(){const e=new Error;return e.name=T,e}function ut(e){const{isDirectory:t=!1,basename:n="tmp",extname:r=""}=e??{},i=t?"":r;return l(Je,`${n?`${n}-`:""}${crypto.randomUUID()}${i}`)}function ft(e){return e.startsWith(`${Je}/`)}async function lt(e){const{name:t,kind:n}=e;if(ct(e)){const r=await e.getFile(),{size:i,lastModified:o,type:a}=r;return{name:t,kind:n,type:a,size:i,lastModified:o}}return{name:t,kind:n}}function ct(e){return"file"===e.kind}function dt(e){return"directory"===e.kind}function ht(e){return"file"===e.kind}async function pt(e){const t=await e.getFile(),n=await t.arrayBuffer();return new Uint8Array(n)}async function gt(e){return Ke(e),(await it(e,{create:!0})).and(R)}async function yt(e){return Ke(e),(await rt(e,{create:!0})).and(R)}async function _t(e,t){async function*n(r,i){const o=r.entries();for await(const[a,s]of o){const o=i===e?a:l(i,a);yield{path:o,handle:s},dt(s)&&t?.recursive&&(yield*n(await r.getDirectoryHandle(a),o))}}return Ke(e),(await rt(e)).andThen(t=>w(n(t,e)))}async function mt(e,t){return Ke(e),(await it(e)).andThenAsync(async e=>{const n=await e.getFile();switch(t?.encoding){case"blob":return w(n);case"utf8":return w(await n.text());default:return w(await n.arrayBuffer())}})}async function wt(e){Ke(e);const t=u(e),n=f(e),r=await rt(t);return(await r.andThenAsync(async e=>{try{tt(t)&&tt(n)?await e.remove({recursive:!0}):await e.removeEntry(n,{recursive:!0})}catch(e){return b(e)}return R})).orElse(e=>ot(e)?R:b(e))}async function bt(e){Ke(e);const t=u(e),n=f(e),r=await rt(t);return n?r.andThenAsync(async t=>{for await(const[e,r]of t.entries())if(e===n)return w(r);const r=new Error(`${He}: '${n}' does not exist. Full path is '${e}'.`);return r.name=He,b(r)}):r}async function vt(e,t,n){Ke(e);const{append:r=!1,create:i=!0}=n??{};return(await it(e,{create:i})).andThenAsync(async e=>{const n=await e.createWritable({keepExistingData:r}),i={type:"write",data:t};if(r){const{size:t}=await e.getFile();i.position=t}return await n.write(i),await n.close(),R})}function Et(e,t,n){let r,i;Qe(e),i=!1,"string"==typeof t?Ke(t):(n=t,t=ut({extname:c(e)}),i=!0),r=!1;const o=x(e,{redirect:"follow",...n,abortable:!0}),a=(async()=>(await o.response).andThenAsync(async e=>{const n=await e.blob();return r?b(st()):(await vt(t,n)).and(w(e))}))();return{abort(e){r=!0,o.abort(e)},get aborted(){return r},get response(){return i?a.then(e=>e.map(e=>({tempFilePath:t,rawResponse:e}))):a}}}async function St(e,t){const n=u(t);return(await rt(n,{create:!0})).andThenAsync(async n=>{const r=f(t);try{return await e.move(n,r),R}catch(e){return b(e)}})}async function kt(e,t,n,r=!0){return Ke(t),(await bt(e)).andThenAsync(async i=>{let o;o=!1;const a=await bt(t);if(a.isErr()){if(!ot(a.unwrapErr()))return a.asErr()}else{o=!0;const e=a.unwrap();if(!(ct(i)&&ct(e)||dt(i)&&dt(e)))return b(new Error("Both 'srcPath' and 'destPath' must both be a file or directory."))}return ct(i)?r||!o?await n(i,t):R:(await _t(e,{recursive:!0})).andThenAsync(async e=>{const i=[yt(t)];for await(const{path:a,handle:s}of e){const e=l(t,a);let u=!1;if(o){const t=await Ot(e);if(t.isErr()){i.push(Promise.resolve(t.asErr()));continue}u=t.unwrap()}const f=ct(s)?r||!u?n(s,e):Promise.resolve(R):yt(e);i.push(f)}return at(i)})})}function Rt(e,t){return vt(e,t,{append:!0})}async function Tt(e,t,n){const{overwrite:r=!0}=n??{};return kt(e,t,async(e,t)=>await vt(t,await e.getFile()),r)}async function At(e){const t=await _t(e);if(t.isErr())return ot(t.unwrapErr())?yt(e):t.asErr();const n=[];for await(const{path:r}of t.unwrap())n.push(wt(l(e,r)));return at(n)}async function Ot(e,t){const{isDirectory:n=!1,isFile:i=!1}=t??{};r(!(n&&i));const o=await bt(e);return o.andThen(e=>w(!(n&&ct(e)||i&&dt(e)))).orElse(e=>ot(e)?k:o.asErr())}async function xt(e,t,n){const{overwrite:r=!0}=n??{};return(await kt(e,t,St,r)).andThenAsync(()=>wt(e))}function Lt(e){return mt(e,{encoding:"blob"})}async function jt(e){return(await Ct(e)).andThenAsync(async e=>{try{return w(JSON.parse(e))}catch(e){return b(e)}})}function Ct(e){return mt(e,{encoding:"utf8"})}async function $t(e){const{isDirectory:t=!1}=e??{},n=ut(e);return(await(t?yt:gt)(n)).and(w(n))}function It(){return wt(Je)}async function Ut(e){return r(e instanceof Date),(await _t(Je,{recursive:!0})).andThenAsync(async t=>{try{for await(const{handle:n}of t)ct(n)&&(await n.getFile()).lastModified<=e.getTime()&&await n.remove()}catch(e){return b(e)}return R})}async function Mt(e,t){const n=new Uint8Array(e),r=new qe;return function(e,t,n){n||(n=t,t={}),"function"!=typeof n&&ue(7);var r=[],i=function(){for(var e=0;e<r.length;++e)r[e]()},o={},a=function(e,t){ze(function(){n(e,t)})};ze(function(){a=n});for(var s=e.length-22;101010256!=Ce(e,s);--s)if(!s||e.length-s>65558)return a(ue(13,0,1),null),i;var u=je(e,s+8);if(u){var f=u,l=Ce(e,s+16),c=117853008==Ce(e,s-20);if(c){var d=Ce(e,s-12);(c=101075792==Ce(e,d))&&(f=u=Ce(e,d+32),l=Ce(e,d+48))}for(var h=t&&t.filter,p=function(t){var n=function(e,t,n){var r=je(e,t+28),i=je(e,t+30),o=De(e.subarray(t+46,t+46+r),!(2048&je(e,t+8))),a=t+46+r,s=We(e,a,i,n,Ce(e,t+20),Ce(e,t+24),Ce(e,t+42)),u=s[0],f=s[1],l=s[2];return[je(e,t+10),u,f,o,a+i+je(e,t+32),l]}(e,l,c),s=n[0],f=n[1],d=n[2],p=n[3],g=n[4],y=n[5],_=function(e,t){return t+30+je(e,t+26)+je(e,t+28)}(e,y);l=g;var m=function(e,t){e?(i(),a(e,null)):(t&&(o[p]=t),--u||a(null,o))};if(!h||h({name:p,size:f,originalSize:d,compression:s}))if(s)if(8==s){var w=e.subarray(_,_+f);if(d<524288||f>.8*d)try{m(null,Me(w,{out:new $(d)}))}catch(e){m(e,null)}else r.push(function(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&ue(7),Le(e,t,[Te],function(e){return Oe(Me(e.data[0],xe(e.data[1])))},1,n)}(w,{size:d},m))}else m(ue(14,"unknown compression type "+s,1),null);else m(null,ae(e,_,_+f));else m(null,null)},g=0;g<f;++g)p()}else a(null,{})}(n,async(e,n)=>{if(e)return void r.resolve(b(e));const i=[];for(const e in n)"/"!==e.at(-1)&&i.push(vt(l(t,e),n[e]));r.resolve(at(i))}),await r.promise}async function Bt(e,t){return Ke(t),(await mt(e)).andThenAsync(e=>Mt(e,t))}async function Nt(e,t,n){return Qe(e),Ke(t),(await x(e,{redirect:"follow",...n,responseType:"arraybuffer",abortable:!1})).andThenAsync(e=>Mt(e,t))}function Ft(e,t,n){let r,i;Qe(t),r=!1;const o=(async()=>(await Lt(e)).andThenAsync(async o=>{if(r)return b(st());const{filename:a=f(e),...s}=n??{},u=new FormData;return u.append(a,o,a),i=x(t,{method:"POST",...s,abortable:!0,body:u}),i.response}))();return{abort(e){r=!0,i?.abort(e)},get aborted(){return r},get response(){return o}}}async function Pt(e,t){const n=new qe;return Ge(e,{consume:!0},async(e,r)=>{if(e)n.resolve(b(e));else if(t){const e=await vt(t,r);n.resolve(e)}else n.resolve(w(r))}),await n.promise}async function Dt(e,t,n){return"string"==typeof t?Ke(t):(n=t,t=void 0),(await bt(e)).andThenAsync(async r=>{const i=f(e),o={};if(ct(r)){const e=await pt(r);o[i]=e}else{const t=await _t(e,{recursive:!0});if(t.isErr())return t.asErr();const r=n?.preserveRoot??!0;for await(const{path:e,handle:n}of t.unwrap())if(ct(n)){const t=r?l(i,e):e,a=await pt(n);o[t]=a}}return Pt(o,t)})}async function Wt(e,t,n){return Qe(e),"string"==typeof t?Ke(t):(n=t,t=void 0),(await x(e,{redirect:"follow",...n,responseType:"arraybuffer",abortable:!1})).andThenAsync(n=>{const r={};return r[f(e)]=new Uint8Array(n),Pt(r,t)})}function Yt(){return"function"==typeof navigator?.storage?.getDirectory}function Zt(e){return e?{name:e.name,message:e.message}:e}async function Gt(e){const t=await e.arrayBuffer();return{name:e.name,type:e.type,lastModified:e.lastModified,size:t.byteLength,data:t}}let zt=1e3;var qt=(e=>(e[e.createFile=0]="createFile",e[e.mkdir=1]="mkdir",e[e.move=2]="move",e[e.readDir=3]="readDir",e[e.remove=4]="remove",e[e.stat=5]="stat",e[e.writeFile=6]="writeFile",e[e.appendFile=7]="appendFile",e[e.copy=8]="copy",e[e.emptyDir=9]="emptyDir",e[e.exists=10]="exists",e[e.deleteTemp=11]="deleteTemp",e[e.mkTemp=12]="mkTemp",e[e.pruneTemp=13]="pruneTemp",e[e.readBlobFile=14]="readBlobFile",e[e.unzip=15]="unzip",e[e.zip=16]="zip",e))(qt||{});let Ht,Vt;function Xt(e){const t=JSON.stringify(e);return(Ht??=new TextEncoder,Ht).encode(t)}function Jt(e){const t=Kt(e);return JSON.parse(t)}function Kt(e){return(Vt??=new TextDecoder,Vt).decode(e)}class Qt{i32a;u8a;headerLength=16;maxDataLength;constructor(e){this.i32a=new Int32Array(e),this.u8a=new Uint8Array(e),this.maxDataLength=e.byteLength-this.headerLength}}async function en(e,t){const{i32a:n,u8a:r,headerLength:i,maxDataLength:o}=e;for(;1!==Atomics.load(n,1););const a=n[2],s=r.slice(i,i+a);let u=await t(s);const f=u.byteLength;if(f>o){const e=`Response is too large: ${f} > ${o}. Consider grow the size of SharedArrayBuffer.`;if(u=Xt([{name:"RangeError",message:e}]),u.byteLength>o)throw Atomics.store(n,1,0),new RangeError(e)}n[2]=u.byteLength,r.set(u,i),Atomics.store(n,1,0),Atomics.store(n,0,0)}const tn={[qt.createFile]:gt,[qt.mkdir]:yt,[qt.move]:xt,[qt.readDir]:_t,[qt.remove]:wt,[qt.stat]:bt,[qt.writeFile]:vt,[qt.appendFile]:Rt,[qt.copy]:Tt,[qt.emptyDir]:At,[qt.exists]:Ot,[qt.deleteTemp]:It,[qt.mkTemp]:$t,[qt.pruneTemp]:Ut,[qt.readBlobFile]:Lt,[qt.unzip]:Bt,[qt.zip]:Dt};let nn,rn;function on(){if("undefined"!=typeof window)throw new Error("Only can use in worker");if(nn)throw new Error("Worker messenger already started");addEventListener("message",e=>{const t=e.data;if(!(t instanceof SharedArrayBuffer))throw new TypeError("Only can post SharedArrayBuffer to Worker");nn=new Qt(t),postMessage(!0),async function(){for(;;)try{await en(nn,async e=>{const[t,...n]=Jt(e);let r;t===qt.writeFile||t===qt.appendFile?Array.isArray(n[1])&&(n[1]=new Uint8Array(n[1])):t===qt.pruneTemp&&(n[0]=new Date(n[0]));const i=tn[t];try{const e=await i(...n);if(e.isErr())r=Xt([Zt(e.unwrapErr())]);else{let n;if(t===qt.readBlobFile){const t=e.unwrap(),r=await Gt(t);n={...r,data:[...new Uint8Array(r.data)]}}else if(t===qt.readDir){const t=e.unwrap(),r=[];for await(const{path:e,handle:n}of t){const t=await lt(n);r.push({path:e,handle:t})}n=r}else if(t===qt.stat){const t=e.unwrap();n=await lt(t)}else if(t===qt.zip){const t=e.unwrap();n=t instanceof Uint8Array?[...t]:t}else n=e.unwrap();r=Xt([null,n])}}catch(e){r=Xt([Zt(e)])}return r})}catch(e){console.error(e instanceof Error?e.stack:e)}}()})}function an(e){if("undefined"==typeof window)throw new Error("Only can use in main thread");if(rn)throw new Error("Main messenger already started");return new Promise(t=>{const{worker:n,bufferLength:i=1048576,opTimeout:o=1e3}=e;r(n instanceof Worker||n instanceof URL||"string"==typeof n&&n),r(i>16&&i%4==0),r(Number.isInteger(o)&&o>0),zt=o;const a=n instanceof Worker?n:new Worker(n),s=new SharedArrayBuffer(i);a.addEventListener("message",e=>{e.data&&(rn=new Qt(s),t())}),a.postMessage(s)})}function sn(){return rn}function un(e){r(null!=e),rn=e}function fn(e,...t){if(!rn)return b(new Error("Worker not initialized. Come back later."));const n=Xt([e,...t]);try{const e=Jt(function(e,t){const{i32a:n,u8a:r,headerLength:i,maxDataLength:o}=e,a=t.byteLength;if(a>o)throw new RangeError(`Request is too large: ${a} > ${o}. Consider grow the size of SharedArrayBuffer.`);Atomics.store(n,0,1),n[2]=a,r.set(t,i),Atomics.store(n,1,1),function(e){const t=Date.now();for(;!e();)if(Date.now()-t>zt){const e=new Error("Operating Timeout");throw e.name=A,e}}(()=>0===Atomics.load(n,0));const s=n[2];return r.slice(i,i+s)}(rn,n)),t=e[0],r=t?b(function(e){const t=new Error(e.message);return t.name=e.name,t}(t)):w(e[1]??void 0);return r}catch(e){return b(e)}}function ln(e){return fn(qt.createFile,e)}function cn(e){return fn(qt.mkdir,e)}function dn(e,t,n){return fn(qt.move,e,t,n)}function hn(e,t){return fn(qt.readDir,e,t)}function pn(e,t){return fn(qt.readBlobFile,e).map(e=>{const n=new Uint8Array(e.data);switch(e.data=n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength),t?.encoding){case"blob":return e;case"utf8":return Kt(new Uint8Array(e.data));default:return e.data}})}function gn(e){return fn(qt.remove,e)}function yn(e){return fn(qt.stat,e)}function _n(e){return e instanceof ArrayBuffer?[...new Uint8Array(e)]:ArrayBuffer.isView(e)?[...new Uint8Array(e.buffer)]:e}function mn(e,t,n){return fn(qt.writeFile,e,_n(t),n)}function wn(e,t){return fn(qt.appendFile,e,_n(t))}function bn(e,t,n){return fn(qt.copy,e,t,n)}function vn(e){return fn(qt.emptyDir,e)}function En(e,t){return fn(qt.exists,e,t)}function Sn(){return fn(qt.deleteTemp)}function kn(e){return fn(qt.mkTemp,e)}function Rn(e){return fn(qt.pruneTemp,e)}function Tn(e){return pn(e,{encoding:"blob"})}function An(e){return On(e).andThen(e=>{try{return w(JSON.parse(e))}catch(e){return b(e)}})}function On(e){return pn(e,{encoding:"utf8"})}function xn(e,t){return fn(qt.unzip,e,t)}function Ln(e,t,n){return fn(qt.zip,e,t,n).map(e=>e?new Uint8Array(e):e)}},843(e,t,n){"use strict";n.d(t,{basename:()=>y,dirname:()=>m,join:()=>v,parse:()=>E});const r=function(){const e=globalThis,t=e.Deno?.build?.os;return"string"==typeof t?"windows"===t:e.navigator?.platform?.startsWith("Win")??e.process?.platform?.startsWith("win")??!1}();function i(e){if("string"!=typeof e)throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function o(e,t){if(t.length>=e.length)return e;const n=e.length-t.length;for(let r=t.length-1;r>=0;--r)if(e.charCodeAt(n+r)!==t.charCodeAt(r))return e;return e.slice(0,-t.length)}function a(e,t,n=0){let r=!1,i=e.length;for(let o=e.length-1;o>=n;--o)if(t(e.charCodeAt(o))){if(r){n=o+1;break}}else r||(r=!0,i=o+1);return e.slice(n,i)}function s(e,t){if(i(e),0===e.length)return e;if("string"!=typeof t)throw new TypeError(`Suffix must be a string, received "${JSON.stringify(t)}"`)}function u(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function f(e){return e=u(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function l(e,t){if(e.length<=1)return e;let n=e.length;for(let r=e.length-1;r>0&&t(e.charCodeAt(r));r--)n=r;return e.slice(0,n)}function c(e){return 47===e}function d(e){return 47===e}function h(e){return 47===e||92===e}function p(e){return e>=97&&e<=122||e>=65&&e<=90}function g(e){e=u(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}function y(e,t=""){return r?function(e,t=""){e instanceof URL&&(e=g(e)),s(e,t);let n=0;e.length>=2&&p(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(n=2);const r=l(a(e,h,n),h);return t?o(r,t):r}(e,t):function(e,t=""){e instanceof URL&&(e=f(e)),s(e,t);const n=l(a(e,c),c);return t?o(n,t):n}(e,t)}function _(e){if(i(e),0===e.length)return"."}function m(e){return r?function(e){e instanceof URL&&(e=g(e)),_(e);const t=e.length;let n=-1,r=-1,i=!0,o=0;const a=e.charCodeAt(0);if(t>1)if(h(a)){if(n=o=1,h(e.charCodeAt(1))){let r=2,i=r;for(;r<t&&!h(e.charCodeAt(r));++r);if(r<t&&r!==i){for(i=r;r<t&&h(e.charCodeAt(r));++r);if(r<t&&r!==i){for(i=r;r<t&&!h(e.charCodeAt(r));++r);if(r===t)return e;r!==i&&(n=o=r+1)}}}}else p(a)&&58===e.charCodeAt(1)&&(n=o=2,t>2&&h(e.charCodeAt(2))&&(n=o=3));else if(h(a))return e;for(let n=t-1;n>=o;--n)if(h(e.charCodeAt(n))){if(!i){r=n;break}}else i=!1;if(-1===r){if(-1===n)return".";r=n}return l(e.slice(0,r),d)}(e):function(e){e instanceof URL&&(e=f(e)),_(e);let t=-1,n=!1;for(let r=e.length-1;r>=1;--r)if(c(e.charCodeAt(r))){if(n){t=r;break}}else n=!0;return-1===t?c(e.charCodeAt(0))?"/":".":l(e.slice(0,t),c)}(e)}function w(e){if(i(e),0===e.length)return"."}function b(e,t,n,r){let i,o="",a=0,s=-1,u=0;for(let f=0;f<=e.length;++f){if(f<e.length)i=e.charCodeAt(f);else{if(r(i))break;i=47}if(r(i)){if(s===f-1||1===u);else if(s!==f-1&&2===u){if(o.length<2||2!==a||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2)){if(o.length>2){const e=o.lastIndexOf(n);-1===e?(o="",a=0):(o=o.slice(0,e),a=o.length-1-o.lastIndexOf(n)),s=f,u=0;continue}if(2===o.length||1===o.length){o="",a=0,s=f,u=0;continue}}t&&(o.length>0?o+=`${n}..`:o="..",a=2)}else o.length>0?o+=n+e.slice(s+1,f):o=e.slice(s+1,f),a=f-s-1;s=f,u=0}else 46===i&&-1!==u?++u:u=-1}return o}function v(e,...t){return r?function(e,...t){if(e instanceof URL&&(e=g(e)),(t=e?[e,...t]:t).forEach(e=>i(e)),t=t.filter(e=>e.length>0),0===t.length)return".";let n=!0,r=0;const o=t[0];if(h(o.charCodeAt(0))){++r;const e=o.length;e>1&&h(o.charCodeAt(1))&&(++r,e>2&&(h(o.charCodeAt(2))?++r:n=!1))}let a=t.join("\\");if(n){for(;r<a.length&&h(a.charCodeAt(r));++r);r>=2&&(a=`\\${a.slice(r)}`)}return function(e){e instanceof URL&&(e=g(e)),w(e);const t=e.length;let n,r=0,i=!1;const o=e.charCodeAt(0);if(t>1)if(h(o))if(i=!0,h(e.charCodeAt(1))){let i=2,o=i;for(;i<t&&!h(e.charCodeAt(i));++i);if(i<t&&i!==o){const a=e.slice(o,i);for(o=i;i<t&&h(e.charCodeAt(i));++i);if(i<t&&i!==o){for(o=i;i<t&&!h(e.charCodeAt(i));++i);if(i===t)return`\\\\${a}\\${e.slice(o)}\\`;i!==o&&(n=`\\\\${a}\\${e.slice(o,i)}`,r=i)}}}else r=1;else p(o)&&58===e.charCodeAt(1)&&(n=e.slice(0,2),r=2,t>2&&h(e.charCodeAt(2))&&(i=!0,r=3));else if(h(o))return"\\";let a;return a=r<t?b(e.slice(r),!i,"\\",h):"",0!==a.length||i||(a="."),a.length>0&&h(e.charCodeAt(t-1))&&(a+="\\"),void 0===n?i?a.length>0?`\\${a}`:"\\":a:i?a.length>0?`${n}\\${a}`:`${n}\\`:n+a}(a)}(e,...t):function(e,...t){if(void 0===e)return".";e instanceof URL&&(e=f(e)),(t=e?[e,...t]:t).forEach(e=>i(e));const n=t.filter(e=>e.length>0).join("/");return""===n?".":function(e){e instanceof URL&&(e=f(e)),w(e);const t=c(e.charCodeAt(0)),n=c(e.charCodeAt(e.length-1));return 0!==(e=b(e,!t,"/",c)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?`/${e}`:e}(n)}(e,...t)}function E(e){return r?function(e){i(e);const t={root:"",dir:"",base:"",ext:"",name:""},n=e.length;if(0===n)return t;let r=0,o=e.charCodeAt(0);if(n>1){if(h(o)){if(r=1,h(e.charCodeAt(1))){let t=2,i=t;for(;t<n&&!h(e.charCodeAt(t));++t);if(t<n&&t!==i){for(i=t;t<n&&h(e.charCodeAt(t));++t);if(t<n&&t!==i){for(i=t;t<n&&!h(e.charCodeAt(t));++t);t===n?r=t:t!==i&&(r=t+1)}}}}else if(p(o)&&58===e.charCodeAt(1)){if(r=2,!(n>2))return t.root=t.dir=e,t;if(h(e.charCodeAt(2))){if(3===n)return t.root=t.dir=e,t.base="\\",t;r=3}}}else if(h(o))return t.root=t.dir=e,t.base="\\",t;r>0&&(t.root=e.slice(0,r));let a=-1,s=r,u=-1,f=!0,l=e.length-1,c=0;for(;l>=r;--l)if(o=e.charCodeAt(l),h(o)){if(!f){s=l+1;break}}else-1===u&&(f=!1,u=l+1),46===o?-1===a?a=l:1!==c&&(c=1):-1!==a&&(c=-1);return-1===a||-1===u||0===c||1===c&&a===u-1&&a===s+1?-1!==u&&(t.base=t.name=e.slice(s,u)):(t.name=e.slice(s,a),t.base=e.slice(s,u),t.ext=e.slice(a,u)),t.base=t.base||"\\",t.dir=s>0&&s!==r?e.slice(0,s-1):t.root,t}(e):function(e){i(e);const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=c(e.charCodeAt(0));let r;n?(t.root="/",r=1):r=0;let o=-1,a=0,s=-1,u=!0,f=e.length-1,d=0;for(;f>=r;--f){const t=e.charCodeAt(f);if(c(t)){if(!u){a=f+1;break}}else-1===s&&(u=!1,s=f+1),46===t?-1===o?o=f:1!==d&&(d=1):-1!==o&&(d=-1)}return-1===o||-1===s||0===d||1===d&&o===s-1&&o===a+1?(-1!==s&&(t.base=t.name=0===a&&n?e.slice(1,s):e.slice(a,s)),t.base=t.base||"/"):(0===a&&n?(t.name=e.slice(1,o),t.base=e.slice(1,s)):(t.name=e.slice(a,o),t.base=e.slice(a,s)),t.ext=e.slice(o,s)),a>0?t.dir=l(e.slice(0,a-1),c):n&&(t.dir="/"),t}(e)}}};const t={};function n(r){const i=t[r];if(void 0!==i)return i.exports;const o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var i=t[r++],o=t[r++];n.o(e,i)?0===o&&r++:0===o?Object.defineProperty(e,i,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,i,{enumerable:!0,get:o})}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};const r=n(368),i=r._argv_get,o=r._argv_url_get,a=r._cmdline_check,s=r._get_date_human,u=r._msg_info,f=r._msg_error,l=(r._printf,r._process_exit),c=n(825)._evm_contract_deployment_address;async function d(e){""!=resolve_date&&"undefined"!=typeof resolve_date||(resolve_date=s()),_networks_all_auto_detect(),""==user_level&&(user_level="n")}function h(e){let t;const n=["","Returns an EVM network's contract deployment address","","Usage:","",` ${app_name}`," [options]"," <target-contract>",""," networks:"," All those supported"," by 'evm-chains-info'.",""," options:",""," -n, --network <network> EVM network name."," -i, --chain-id <number> EVM network id (chain ID)."," -A, --networks-all Returns address for all"," available networks.",` Default: '${networks_all}`," -V, --contract-version <version> Contract version.",` Default: '${contract_version}`," Returns contract address for"," user-defined file system"," deployment instead of the system"," one.",` Default: '${user_defined}`," -d, --deployments-dir <dir> Specify contract deployments"," directory path.",` Default: '${deployments_dir}`,""," -h --help This message."," -v --verbose Enable verbose output.",""];for(t of n)console.log(t);l(e)}app_name="evm-contract-deployments-address.js",app_opts=[],runtime_environment="",resolve_date="",user_level="",target_networks=[],network_ids=[],networks_all="",target_app="",target_contract="",contract_version="",user_defined="",deployments_dir="",quiet="",verbose="",a("evm-contract-deployment-address.js")||a("evm-contract-deployment-address")?async function(){let e,t;const n=i({booleans:["A","networks-all","u","user-defined","h","help","v","verbose"]}),r=n._;quiet="y",runtime_environment="node",n.h&&(e=!0),n.help&&(e=!0),(r.indexOf("--help")>-1||r.indexOf("-h")>-1)&&(e=!0),e&&(quiet="n",await d(),h(0)),(void 0===n||n._.length<1)&&(t="Target contract argument required.",f("Target contract argument required.",0),h(1)),target_contract=n._[0],"u"in n&&(user_level=n.u),"user_level"in n&&(user_level=n.user_level),(n.v||n.verbose)&&(quiet="n")}():(runtime_environment="browser",target_networks=o("network"),target_ids=o("chain_id"),networks_all=o("networks_all")[0],target_app=o("target_app")[0],target_contract=o("target_contract")[0],contract_version=o("contract_version")[0],user_defined=o("user_defined")[0],deployments_dir=o("deployments_dir")[0],quiet=o("quiet"),0===quiet.length&&(quiet="n")),async function(){await d(),function(){let e;const t=[`${app_name} configuration:`,` Resolve date: ${resolve_date}`,` Runtime environment: ${runtime_environment}`,` Target networks: ${target_networks}`,` Network ID (chain ID): ${network_ids}`,` All networks: ${networks_all}`,` Target application: ${target_app}`,` User-defined address: ${user_defined}`,` Deployments path: ${deployments_dir}`];for(e of t)u(e)}();const e=[target_networks,network_ids,networks_all,target_app,target_contract,contract_version,user_defined,deployments_dir];await c.apply(null,e)}()})();
|